Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getmaito.com/llms.txt

Use this file to discover all available pages before exploring further.

Responses And Errors

REST responses use a small JSON envelope.

Success Envelope

{
  "ok": true,
  "data": {
    "id": "draft_123"
  }
}

Error Envelope

{
  "ok": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "scheduledFor is required.",
    "details": []
  }
}
details is optional and usually contains validation issues or structured domain context.

Common Status Codes

StatusMeaning
400Bad request shape or unreadable request body.
401Missing, invalid, or expired authentication.
402Billing or entitlement restriction.
403Authenticated user cannot access the requested resource or capability.
404Resource was not found.
409Request conflicts with current state.
422Request was valid JSON but failed validation or domain rules.
500Server error or server misconfiguration.

SDK Error Behavior

The TypeScript SDK parses the response envelope. For ok: false, it throws an Error with the code and message combined:
VALIDATION_ERROR: scheduledFor is required.
When the server returns a non-API response shape, the SDK throws a generic request or invalid-response error.