mosoodocs

Errors and limits

Handle Mosoo API errors, retries, idempotency, and public API limits.

All non-2xx JSON errors use the same envelope:

{
  "error": {
    "code": "invalid_request",
    "message": "Request body must be an object."
  }
}

Branch on error.code, not error.message. The message is for developers and should not be shown directly to end users.

Error codes

HTTPerror.codeCaller action
400invalid_requestFix request shape, field value, body size, or unsupported field. Do not retry unchanged.
400invalid_jsonFix serialization or Content-Type.
401unauthenticatedCheck Authorization; rotate or recreate the API token.
403forbiddenCheck that the API token can access this Agent, Thread, or file.
404not_foundCheck that the ID exists and is visible to this API token.
409agent_not_publishedPublish the Agent and enable API access.
409service_inactiveRepublish or repair the Agent in Mosoo.
409readiness_blockedFix Agent readiness or configuration in Mosoo.
409idempotency_conflictWait for Retry-After if in-flight, or use a new key when the body differs.
429rate_limitedBack off and retry after Retry-After.
500internal_errorRetry briefly with backoff; persist failure details if it repeats.

Idempotency

Idempotency-Key is supported on:

  • POST /agents/{agentId}/threads
  • POST /threads/{threadId}/events

Rules:

  • The key is scoped to the API token, method, route, and request body.
  • Reusing the same key with the same request replays the stored response.
  • Reusing the same key with a different request returns 409 idempotency_conflict.
  • Reusing the key while the first request is still processing returns 409 idempotency_conflict.
  • Keys must be non-empty and 128 characters or fewer.
  • Conflict responses can include Retry-After.

Public limits

LimitValue
Create Thread input text32000 characters
client_external_ref255 characters
File ID26 characters
File upload67108864 bytes
Event list default100 events
Event list maximum1000 events
Thread list maximum100 Threads

On this page