Skip to content

API Standards

This document defines the API conventions used across the autom8y platform. Following these standards ensures consistency and interoperability between services.

APIs follow REST principles where applicable:

  • Use HTTP methods semantically (GET, POST, PUT, DELETE)
  • Resources are nouns, not verbs
  • Use plural resource names (/workflows, not /workflow)

All APIs are versioned in the URL path:

https://api.autom8y.io/v1/workflows
https://api.autom8y.io/v2/workflows

Required headers for all requests:

HeaderDescriptionExample
Content-TypeRequest body formatapplication/json
AcceptResponse formatapplication/json
AuthorizationAuthenticationBearer <token>
X-Request-IDTracing identifieruuid-v4

Request bodies use JSON with snake_case keys:

{
"workflow_name": "data-sync",
"trigger_type": "schedule",
"schedule_config": {
"cron_expression": "0 */6 * * *",
"timezone": "UTC"
}
}

Successful responses wrap data in a consistent envelope:

{
"data": {
"id": "wf_abc123",
"name": "data-sync",
"status": "active",
"created_at": "2024-01-15T10:30:00Z"
},
"meta": {
"request_id": "req_xyz789",
"timestamp": "2024-01-15T10:30:00Z"
}
}

Collections include pagination metadata:

{
"data": [
{ "id": "wf_abc123", "name": "workflow-1" },
{ "id": "wf_def456", "name": "workflow-2" }
],
"meta": {
"total": 42,
"page": 1,
"per_page": 20,
"total_pages": 3
}
}

Errors follow RFC 7807 Problem Details format:

{
"type": "https://api.autom8y.io/errors/validation",
"title": "Validation Error",
"status": 400,
"detail": "The 'workflow_name' field is required",
"instance": "/v1/workflows",
"errors": [
{
"field": "workflow_name",
"code": "required",
"message": "This field is required"
}
]
}
CodeMeaningWhen to Use
200OKSuccessful GET, PUT
201CreatedSuccessful POST creating resource
204No ContentSuccessful DELETE
CodeMeaningWhen to Use
400Bad RequestInvalid request format
401UnauthorizedMissing/invalid authentication
403ForbiddenInsufficient permissions
404Not FoundResource doesn’t exist
409ConflictResource state conflict
422UnprocessableSemantic validation failure
429Too Many RequestsRate limit exceeded
CodeMeaningWhen to Use
500Internal ErrorUnexpected server failure
502Bad GatewayUpstream service failure
503Service UnavailableTemporary unavailability
504Gateway TimeoutUpstream timeout

API authentication uses Bearer tokens:

Terminal window
curl -H "Authorization: Bearer <token>" \
https://api.autom8y.io/v1/workflows

For complete authentication endpoint documentation, see the Auth API Reference. You can also test authentication flows interactively using the API Explorer.

Tokens are scoped to specific permissions:

ScopeAccess
workflows:readRead workflow definitions
workflows:writeCreate/modify workflows
workflows:executeTrigger workflow runs
analytics:readQuery analytics data

Default rate limits per authentication level:

LevelRequests/Minute
Unauthenticated60
Authenticated1000
Service Account5000

Rate limit status is returned in response headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1705312800
ParameterDescriptionDefault
pagePage number (1-indexed)1
per_pageItems per page20
sortSort fieldcreated_at
orderSort directiondesc
Terminal window
GET /v1/workflows?page=2&per_page=50&sort=name&order=asc

Use query parameters for filtering:

Terminal window
GET /v1/workflows?status=active&trigger_type=schedule

Complex filters use bracket notation:

Terminal window
GET /v1/workflows?created_at[gte]=2024-01-01&created_at[lt]=2024-02-01

For POST/PUT requests, include an idempotency key:

Terminal window
curl -X POST \
-H "Idempotency-Key: unique-request-id" \
https://api.autom8y.io/v1/workflows

The same key within 24 hours returns the cached response.