RESTful · JSON · Sanctum Auth

Build faster with
our REST API

A clean, predictable, and well-documented API powering your applications. Full resource control with token-based authentication.

Base URL https://yourapp.test/api/v1
GET /api/v1/users/42 200 OK · 48ms
{
"status": "success",
"data": {
"id": 42,
"name": "Jane Doe",
"email": "jane@example.com",
"verified": true,
"created_at": "2025-04-30T09:21:00Z"
},
"meta": { "version": "1.0.0" }
}
24+
Endpoints
99.9%
Uptime SLA
<60ms
Avg. Response
REST
JSON · Sanctum

Everything you need

Batteries-included API with auth, pagination, rate limiting, and comprehensive error handling.

Sanctum Auth

Token-based authentication using Laravel Sanctum. Supports personal access tokens and SPA sessions.

Pagination

Cursor and offset-based pagination on all collection endpoints with configurable page sizes.

Rate Limiting

Per-token rate limits with X-RateLimit-* headers on every response.

Structured Errors

RFC 7807 problem details format. Every error includes a code, message, and field-level validation.

API Endpoints

GET /users List all users
Query Parameters
per_page integer Items per page (default: 15, max: 100)
page integer Page number (default: 1)
search string Filter by name or email
sort string Sort field: created_at, name, email
Response 200
JSON
"data": [
  {
    "id": 1,
    "name": "Jane Doe",
    "email": "jane@example.com"
  }
],
"meta": { "total": 142, "last_page": 10 }
POST /users Create a user
Request Body
name string required Full name
email string required Unique email address
password string required Min 8 characters
Response 201
JSON
"data": {
  "id": 43,
  "name": "New User",
  "email": "new@example.com",
  "created_at": "2025-04-30T..."
}
GET /users/{id} Fetch single user
Path Parameters
id integer required User's numeric ID
PUT /users/{id} Update a user

Full replacement of user record. All required fields must be included.

DELETE /users/{id} Delete a user

Permanently deletes the user and all associated records. Returns 204 No Content.

POST /auth/login Issue access token
Request Body
email string required
password string required
device_name string Label for this token
Response 200
JSON
"token": "1|aB3cD4eF5...",
"token_type": "Bearer",
"expires_at": null
POST /posts Create a post

Creates a new post owned by the authenticated user. Requires Bearer token.

PATCH /posts/{id} Partial update

Partial update — only include fields to change. Returns the updated post object.

Authentication

All endpoints (except login & register) require a Bearer token in the Authorization header.

BASH
curl -X GET \
  https://yourapp.test/api/v1/users \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
PHP
$client = new \GuzzleHttp\Client();

$response = $client->get('/api/v1/users', [
    'headers' => [
        'Authorization' => 'Bearer ' . $token,
        'Accept'        => 'application/json',
    ],
]);
JS
const response = await fetch('/api/v1/users', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Accept': 'application/json',
  }
});
Token Scopes
read GET requests only
write POST, PUT, PATCH
delete DELETE requests
* Full access

Rate Limits

Requests are counted per token per minute. Headers are included on every response.

Request Tiers
Free
60 / min
Standard
300 / min
Pro
1,000 / min
Enterprise
Unlimited
RESPONSE HEADERS
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 287
X-RateLimit-Reset: 1746016860
Retry-After: 42   # only on 429

Error Codes

All error responses follow a consistent JSON structure with machine-readable codes.

JSON
"error": {
  "code": "VALIDATION_ERROR",
  "message": "The given data was invalid.",
  "fields": {
    "email": ["The email has already been taken."]
  }
}
HTTP Code Meaning
200 OKSuccess
201 CREATEDResource created
401 UNAUTHENTICATEDMissing or invalid token
403 UNAUTHORIZEDToken lacks scope
422 VALIDATION_ERRORInvalid request data
429 RATE_LIMITToo many requests
500 SERVER_ERRORInternal server error