REST API
Build interactive applications using our powerful REST API with JSON endpoints, authentication, and resource management capabilities.
API Endpoints
API Overview
Our REST API follows standard HTTP methods with JSON request/response formats. Endpoints are organized by resource types with consistent naming patterns.
Base URL
https://api.dev.local
All endpoints should use this base URL for development environments.
Supported Methods
- GET Retrieve resources
- POST Create new resources
- PUT Update existing resources
- DELETE Remove resources
Authentication
All endpoints require authentication using either Bearer tokens or API keys. See Authentication Documentation for details.
Bearer Token
Authorization: Bearer
Tokens expire after 72 hours and must be refreshed. Best for web and mobile clients.
API Key
X-API-Key:
Longer-lived keys for server-to-server communication. Generated through the dashboard.
Usage Examples
fetch('https://api.dev.local/api/users', { headers: { 'Authorization': 'Bearer YOUR_TOKEN' } }) .then(response => response.json()) .then(data => console.log(data))
curl -X POST 'https://api.dev.local/api/login' \ -H 'Content-Type: application/json' \ -H 'X-API-Key: YOUR_KEY' \ -d '{ "username": "admin", "password": "secret" }'
Common Errors
401 Unauthorized
{ "error": "Missing authentication", "code": 401, "message": "No valid credentials provided" }
Ensure your API key or bearer token is correctly formatted in the headers.
404 Not Found
{ "error": "Resource not found", "code": 404, "message": "The requested resource cannot be found" }
Verify the endpoint URL path matches the documentation format.
Advanced Features
Pagination
GET /api/tasks?limit=50&offset=0
Use these query parameters to control page size and position in results.
Filtering
GET /api/users?status=active&role=admin
Filter results using query string parameters according to resource fields.
Sorting
GET /api/reports?sort=date:desc
Sort by any field using sort parameter with direction specified.