Skip to main content

HTTP Status Codes

Error Response

When a request fails, the API returns a structured error body alongside the HTTP status code. The error_code field identifies the specific error for programmatic handling:
Every MemoryLake API endpoint answers errors in this format, including the refusals made before your request reaches the service: a missing or invalid API key (401), a key used from an address it is not allowed from (403), a rate limit (429), a service that cannot be reached (502) and maintenance (503). The inference endpoints of Memory Router are the one exception: they keep the provider’s format. When you contact support about a request, quote its X-Trace-ID response header.
Until October 2026, the refusals listed above used a different body, {"error": {"message", "type"}}. If your code reads error.message, read message and error_code instead.

What a 403 tells you

A permission refusal carries more than the code. Alongside error_code: ACCESS_DENIED, the data object names the permission that was missing and what would have satisfied it, so you can act on the response without guessing:
array
The permissions that were checked and not held. permission is the identifier to grant, permission_level says whether it is granted once for the whole service or per resource instance.
string
Which request to make of your admin. capability — ask for the permission itself; you do not have it anywhere, so widening your access to this one resource will not help. instance — ask for access to this resource; you already hold the permission elsewhere.
array
Any one of these grants would have allowed the request. Hand this to whoever administers your team: it is the shortest answer to “what do I need”.
A refusal does not tell you whether the resource exists — a 403 means “not for you” and says nothing more. Deletes work the same way: permission is checked first. Once it passes, deleting a resource that was already removed or was never there answers 200, so a repeated delete is safe to retry. If you could delete a resource only through a grant on that resource itself, rather than through your role, the grant is removed with the resource, so deleting it again answers 403. Deleting a knowledge entry that does not exist currently answers 400.
On team, member, invitation, API key, access-control, usage, billing and IM integration endpoints, a missing permission is answered with 403, ACCESS_DENIED and the message permission denied, without a data object; the permission each endpoint needs is listed on its page.

Refusals that protect an admin

Some changes would give someone an admin role, or take access away from an admin. Only the team owner or an admin can make them; anyone else gets 403 with ACCESS_DENIED, and data.operation names the change instead of a missing permission:
operation is one of change_role, remove_member, remove_group_member, delete_group, reduce_admin_role_rules, narrow_admin_role_scope, narrow_admin_member_scope, downgrade_admin_member_tier, narrow_admin_via_group or remove_admin_member_rule. More values may be added.

Error Codes

Error Handling Best Practices

Retry Logic

Error Logging

Next Steps

Authentication

Learn about authentication

Rate Limits

Understand rate limiting