Skip to content
Go to Micro
Using the API

Errors

Error codes and how to handle them

The Micro API uses standard HTTP status codes. Every /v2 error returns the same JSON envelope, with the details nested under an error key.

{
"error": {
"code": "invalid_request",
"message": "Invalid filter: unknown property slug 'emial'",
"request_id": "eeaac41f-c240-4c12-9ee8-7d3a30d59413"
}
}

code is a stable machine-readable string — prefer it over string-matching message. request_id is also returned as an x-request-id response header; quote it when contacting support. Validation failures add an errors array with per-field entries (message, field, code).

:::caution API key validation and rate limiting happen at the gateway, before a request reaches the API. Those rejections return a bare { "message": "Forbidden" } instead of the envelope above, so read error?.code defensively rather than assuming error is always present. :::

StatuscodeWhen it happens
400invalid_requestMalformed request body, invalid filter operator, unknown property slug, missing required field
401unauthenticatedMissing x-api-key header
403permission_deniedAPI key is invalid, revoked, or doesn’t have access to the requested team
404not_foundObject ID doesn’t exist or isn’t accessible
405method_not_allowedWrong HTTP method for the route
409conflictWrite conflicts with current state — see Idempotency
412precondition_failedIf-Match ETag no longer matches the record
415unsupported_media_typeMissing or non-JSON Content-Type
422unprocessable_entityWell-formed request that fails a semantic check
429rate_limitedRate limit exceeded — see Rate Limits
500internal_errorSomething went wrong on our end
503service_unavailableTemporary outage — retry with backoff
504timeoutRequest exceeded the server time budget
const res = await fetch(`https://developers.micro.so/v2/prism/${teamId}/contact/query`, {
method: 'POST',
headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json' },
body: JSON.stringify({ query: { select: ['full_name'] } }),
});
if (!res.ok) {
const body = await res.json().catch(() => ({}));
const code = body.error?.code ?? 'error';
const message = body.error?.message ?? body.message ?? res.statusText;
throw new Error(`Micro API ${code} (${res.status}): ${message}`);
}
  • Unknown property slug — check the slug against the Objects reference
  • Invalid operator — filter operators are case-sensitive (= not ==)
  • Missing select — every query requires at least one property in select
  • Invalid objectType — must be one of contact, organization, identity, deal, action, event, document