Overview

API Reference

The AS Starter backend exposes a versioned REST API consumed by the Angular frontend. All endpoints return JSON. Authentication uses Laravel Sanctum.

Base URL
Local
http://api.mr-seller.test
Test
https://testapi.mr-seller.de
Production
https://api.mr-seller.de
Request format
Content-Type application/json
Accept application/json
X-XSRF-TOKEN Required for state-changing requests (POST, PUT, DELETE). Obtained from /sanctum/csrf-cookie.

Overview

Authentication

The API uses Sanctum cookie-based authentication. Before any state-changing request, fetch the CSRF cookie. After login the session cookie is set automatically.

CSRF handshake
GET /sanctum/csrf-cookie

Call this before register or login. Sets the XSRF-TOKEN cookie.


Overview

Errors

Code Meaning
400 Bad request
401 Unauthenticated
403 Forbidden
404 Not found
422 Validation error
500 Server error
Validation error response
{
  "message": "The given data was invalid.",
  "errors": {
    "email": ["The email field is required."]
  }
}

Auth

Register

POST /api/auth/register

Register a new user account.

Request body
{
  "name": "string",
  "username": "string",
  "email": "string",
  "password": "string",
  "password_confirmation": "string"
}
Response 201
{
  "message": "Registration successful.",
  "user": { ... }
}

Auth

Login

POST /api/auth/login

Authenticate an existing user.

Request body
{
  "email": "string",
  "password": "string"
}
Response 200
{
  "user": { ... },
  "token": "string"
}

Site

Site Config

GET /api/site/config

Returns global site configuration — name, locales, features, active modules.


More endpoints being documented — profile, media, messaging, interactions, ads and admin routes.