API Specification — Service Name
Base URL: https://api.example.com/v1
Authentication
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer <API_TOKEN>
Endpoints
1. List Resources
GET /resources
Returns a paginated list of resources.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Results per page (default: 20, max: 100) |
cursor |
string | No | Opaque pagination cursor |
status |
string | No | Filter by status: active, archived |
Example Request
curl -X GET "https://api.example.com/v1/resources?limit=10" \
-H "Authorization: Bearer <API_TOKEN>" \
-H "Accept: application/json"
Response 200 OK
{
"object": "list",
"data": [
{
"id": "res_8f8e9a2b",
"name": "Production Database Cluster",
"status": "active",
"created_at": 1728432000
}
],
"has_more": false,
"next_cursor": null
}
2. Create Resource
POST /resources
Request Body (application/json)
{
"name": "Redis Secondary Cache",
"environment": "production",
"tags": ["cache", "infra"]
}
Response 201 Created
{
"id": "res_9a3c1b4d",
"name": "Redis Secondary Cache",
"status": "pending_provision",
"created_at": 1728435600
}
Error Handling
Standard HTTP error codes are returned:
| Code | Status | Description |
|---|---|---|
400 |
Bad Request | Validation failure or malformed JSON |
401 |
Unauthorized | Missing or expired Bearer token |
403 |
Forbidden | Insufficient permissions for resource |
404 |
Not Found | Resource does not exist |
429 |
Too Many Requests | Rate limit exceeded (100 req/min) |
500 |
Internal Error | Upstream service failure |