API Documentation

RESTful API Reference & Interactive Playground

POST
/api/auth/login

Authenticate user and receive JWT token

Request Examples

curl -X POST https://api.example.com/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "secure_password"
  }'

Response Example

{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "user": {
      "id": "123",
      "email": "user@example.com",
      "name": "John Doe"
    }
  },
  "timestamp": "2024-01-15T10:30:00Z"
}

Authentication

All API requests require authentication using Bearer tokens in the Authorization header.

Header Format:

Authorization: Bearer YOUR_ACCESS_TOKEN

API Key

Long-lived tokens for server-to-server communication

JWT Token

Short-lived tokens for user authentication (expires in 1 hour)

Rate Limiting

API requests are limited based on your subscription tier. Rate limit headers are included in all responses.

100

Requests/min

Free Tier

1,000

Requests/min

Pro Tier

10,000

Requests/min

Enterprise

Response Headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1642435200

Status Codes

200
OK
Request succeeded
201
Created
Resource created successfully
204
No Content
Request succeeded with no response body
400
Bad Request
Invalid request parameters
401
Unauthorized
Authentication required
403
Forbidden
Insufficient permissions
404
Not Found
Resource not found
429
Too Many Requests
Rate limit exceeded
500
Internal Server Error
Server error occurred

API Playground