Skip to main content
All Octavia AI CMS endpoints return responses in a consistent, predictable JSON structure. This unified format ensures reliable parsing and standardized error handling across all SDKs and integrations.

Envelope structure

export type ApiResponse<T = any> = {
  success: boolean;
  statusCode: number;
  message: string;
  data: T | null;
};

Field descriptions

FieldTypeDescription
successbooleanIndicates whether the request succeeded. true for 2xx, false for others.
statusCodenumberHTTP status code returned by the API. Mirrors the actual HTTP response status.
messagestringHuman-readable summary of the outcome. Defaults to a standard message based on status.
dataT or nullContains the actual response payload. null when no data is returned or on errors.

Example responses

✅ Success (200 OK)

{
  "success": true,
  "statusCode": 200,
  "message": "Request successful",
  "data": {
    "id": "art_123",
    "title": "Introducing AI CMS"
  }
}

🆕 Resource created (201 Created)

{
  "success": true,
  "statusCode": 201,
  "message": "Resource created successfully",
  "data": {
    "id": "art_456"
  }
}

🚫 Validation error (422 Unprocessable Entity)

{
  "success": false,
  "statusCode": 422,
  "message": "Unprocessable entity",
  "data": {
    "field": "title",
    "error": "Title is required"
  }
}

🧱 No content (204)

{
  "success": true,
  "statusCode": 204,
  "message": "No content",
  "data": null
}

Next Steps

Status Codes

Explore all supported HTTP status codes, default messages, and their meanings.