Skip to content

Errors

beginner

HTTP error codes, error response format, validation errors, and retry strategies for the Engramma API.

Error response format

The Engramma API uses FastAPI's standard error format.

Validation errors (422):

{
  "detail": [
    {
      "loc": ["body", "text"],
      "msg": "field required",
      "type": "value_error.missing"
    }
  ]
}

Simple errors (401, 403, 404, etc.):

{
  "detail": "Not authenticated"
}

Validation error fields

FieldTypeDescription
locarray[string|integer]Path to the field that failed (e.g. ["body", "text"])
msgstringHuman-readable error message
typestringError type identifier
inputanyThe value that caused the error (when available)
ctxobjectAdditional context (when available)

HTTP status codes

400 Bad Request

The request body is malformed or cannot be parsed.

SituationFix
Invalid JSON bodyCheck JSON syntax, ensure Content-Type is application/json
Missing required Content-TypeAdd -H "Content-Type: application/json"

401 Unauthorized

Authentication failed or was not provided.

Detail messageFix
Not authenticatedAdd X-API-Key header or Authorization: Bearer header
Invalid API keyVerify the API key is correct and active
Token expiredRefresh using POST /v1/auth/refresh
Token revokedCreate a new API key or re-login

403 Forbidden

Authentication succeeded but the action is not allowed.

SituationFix
Insufficient scopeCreate a key with broader scopes
Not an organization adminAsk an org admin to perform the action
Account suspendedContact support

404 Not Found

The resource or endpoint doesn't exist.

SituationFix
Wrong URL pathCheck the API docs for correct paths
Resource deletedThe pattern/org/user may have been removed

405 Method Not Allowed

Wrong HTTP method for the endpoint.

SituationFix
GET on a POST-only endpointUse the correct HTTP method (e.g. POST /v1/memory/text/retrieve, not GET)

409 Conflict

The request conflicts with current state.

SituationFix
Email already registeredUse login instead, or use a different email
Consolidation already runningWait for the current cycle to complete

422 Unprocessable Entity

The request is well-formed JSON but fails validation.

Common validationsConstraint
text field missingRequired on store/retrieve/recall
text too longMax 10,000 characters (store), 5,000 (query)
top_k out of rangeMust be 1-50 (text endpoints)
threshold out of rangeMust be 0.5-1.0 (forget endpoint)
items too largeMax 50 items (batch-store)
password too shortMinimum 12 characters

429 Too Many Requests

You've exceeded your plan's quota.

SituationFix
Daily query limit reachedUpgrade plan or wait until tomorrow
Pattern storage fullUpgrade plan or delete unused patterns

Rate limit headers:

HTTP/1.1 429 Too Many Requests
Retry-After: 60

500 Internal Server Error

Something went wrong on our side.

SituationFix
Unexpected errorRetry the request with exponential backoff
Persistent failuresContact support

Retry strategy

Recommended retry behavior:

AttemptDelayRetries on
1st retry1s429, 500, 502, 503
2nd retry2s429, 500, 502, 503
3rd retry4s429, 500, 502, 503
Give upReturn the error

Never retry:

  • 400 (bad request — fix the input)
  • 401 (auth failed — fix credentials)
  • 403 (forbidden — fix permissions)
  • 404 (not found — resource doesn't exist)
  • 405 (wrong method — use correct HTTP verb)
  • 409 (conflict — resolve the conflict)
  • 422 (validation — fix the data)

Next steps