API Reference
API Reference
Section titled “API Reference”This is a reference document demonstrating the API documentation format.
Endpoints
Section titled “Endpoints”GET /api/users
Section titled “GET /api/users”Returns a list of users.
Response:
{ "users": [ { "id": 1, "name": "John" }, { "id": 2, "name": "Jane" } ]}POST /api/users
Section titled “POST /api/users”Creates a new user.
Request Body:
{ "name": "string", "email": "string"}Response:
{ "id": 3, "name": "New User", "email": "user@example.com"}Authentication
Section titled “Authentication”All API requests require authentication via Bearer token.
curl -H "Authorization: Bearer <token>" https://api.example.com/usersError Codes
Section titled “Error Codes”| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 500 | Internal Server Error |