Reference

Errors and recovery

A refused request returns one envelope. Read error_code, follow docs_url, and correct the request before retrying. A refused request costs no API Credits.

Error shape

{
  "code": 400,
  "msg": "A salary comparison needs salary.currency, with eq or a non-empty in, in an all that contains the comparison. A currency inside any or not does not count. Figures are annualized inside one currency, not converted across currencies.",
  "data": null,
  "error_code": "query_spec",
  "docs_url": "https://platform.metix.ai/docs/reference/errors#query-refusals",
  "trace_id": "mira-api-54ff49e0"
}

error_code is the stable identifier a client should switch on, and every error response carries one. msg can change and is written as the next step, not as a stack trace. docs_url is the page that explains the failure, and its fragment names the section. Follow the URL the response carries rather than building one. Quote trace_id when you contact support.

Reading docs_url as an agent

Add .md to the path of docs_url, before the #, and fetch it: /docs/reference/errors#query-refusals becomes /docs/reference/errors.md#query-refusals. The fragment names the section to read. GET /docs is the catalog for browsing every page; it does not replace docs_url.

The Playground prints error_code on the status badge and links docs_url as "Why this failed". The same envelope is what curl and MCP receive.

error_code catalog

These are the codes the public envelope writes. Group on the string, not on msg.

error_code
missing_api_key
HTTP
401
What to do
Send Authorization: Bearer $METIX_KEY. Create a key under API Keys if you do not have one. A browser CORS preflight lands here too, because a preflight carries no Authorization header: this API is called from a server, and a key must not ship in a browser.
Docs
run
error_code
invalid_api_key
HTTP
401
What to do
The header was present but the key is not a live Metix key. Check the value, and that the shell expanded $METIX_KEY.
Docs
run
error_code
auth_error
HTTP
401
What to do
Authentication failed for a reason that is not the two cases above. Recreate the header from the quickstart.
Docs
run
error_code
forbidden
HTTP
403
What to do
The key is disabled, has expired, or lacks the scope this route needs. Check it on /auth/key/status, then use an active key.
Docs
This page, HTTP status
error_code
insufficient_quota
HTTP
402
What to do
The key is valid and the balance is empty. Buy API Credits or wait for the next plan grant.
Docs
usage
error_code
quota_period_changed
HTTP
409
What to do
The billing period changed while this request was being settled. Retry the request.
Docs
usage
error_code
quota_settlement_unconfirmed
HTTP
503
What to do
API Credits for this request could not be settled. Retry with bounded backoff.
Docs
usage
error_code
rate_limited
HTTP
429
What to do
Back off before retrying. The response carries Retry-After, in seconds, and data.retry_after_seconds repeats it. /auth/key/status reports the limit on the key.
Docs
This page, HTTP status
error_code
invalid_request
HTTP
400
What to do
A parameter outside the where tree is wrong, for example size out of range or an empty or malformed _source. msg names the parameter.
Docs
This page, HTTP status
error_code
validation_error
HTTP
422
What to do
The JSON body or a parameter failed schema checks, or the body carries a key the route does not take. msg names the first failure and where it is, for example Validation Error at body.after: Extra inputs are not permitted, and data.errors lists every one.
Docs
This page, HTTP status
error_code
not_found
HTTP
404
What to do
No such route or documentation page. Check the method and path against GET /contract, or the page against GET /docs. A detail ID that matches no record is not a 404: it comes back in not_found.
Docs
This page, HTTP status
error_code
method_not_allowed
HTTP
405
What to do
The path exists but not with this method. Search and detail routes are POST; /version, /contract, /docs and /auth/key/status are GET.
Docs
This page, HTTP status
error_code
query_spec
HTTP
400
What to do
The where tree was refused before it ran: its shape, an operator the field does not take, a value of the wrong type, or a salary comparison without its currency. msg is one of the refusals listed below.
error_code
unsupported_query_field
HTTP
400
What to do
The field name is not in this dataset's list. People, jobs, and companies do not share a vocabulary. Job created_at is not public.
Docs
fields
error_code
unavailable_field
HTTP
400
What to do
The field is listed but cannot be compared right now. exists still works on it, and unavailableFields in GET /contract lists every field in that state.
error_code
unsupported_source_field
HTTP
400
What to do
_source named a path the record does not have. Omit _source, or use a path from the record page. A name shaped like an ID gets this record's ID path in msg: profile_id on people, id on jobs and companies.
error_code
renamed_source_field
HTTP
400
What to do
_source named a field this API published before 2026-09-15. msg names the path that replaced each old name in the request, or says it is no longer returned. Send the new paths; the changelog lists every rename.
error_code
invalid_id
HTTP
400
What to do
An ID in a detail request is not one this API issued for that dataset. msg names its position. Send IDs exactly as a search returned them.
error_code
invalid_cursor
HTTP
400
What to do
after is not a next value from this search, or it came from a search with a different where. Send next back unchanged with the same where, or omit after to start again from the first page.
Docs
paging
error_code
internal_error
HTTP
500
What to do
Retry only with bounded backoff. Do not change the query to work around a 500.
Docs
This page, HTTP status
error_code
service_unavailable
HTTP
503
What to do
A capability is temporarily unavailable. Retry with bounded backoff; msg says which one.
Docs
This page, HTTP status

Field lists: people, jobs, companies. Grammar: query spec. The live vocabulary, with the operators each field takes, is also in GET /contract under querySpecByEntity.

HTTP status reference

HTTP
400
Meaning
The request was refused before it ran: a query tree, a parameter, an ID, or a cursor
Client action
Correct the request before retrying. Nothing was charged
HTTP
401
Meaning
Missing or invalid API key
Client action
Provide a valid Bearer key from $METIX_KEY
HTTP
402
Meaning
API Credits exhausted
Client action
Review quota on /auth/key/status, then buy or wait
HTTP
403
Meaning
Key disabled, expired, or missing scope
Client action
Use an active key with the required scope
HTTP
404
Meaning
No such route or documentation page
Client action
Check the method and the path
HTTP
405
Meaning
The route does not take this method
Client action
Use the method GET /contract lists
HTTP
409
Meaning
The billing period changed during settlement
Client action
Retry the request
HTTP
422
Meaning
Invalid parameter format or value
Client action
Fix the named field
HTTP
429
Meaning
Rate limit exceeded
Client action
Wait the seconds Retry-After names, then retry
HTTP
500
Meaning
Internal server error
Client action
Retry only with bounded backoff
HTTP
503
Meaning
Capability temporarily unavailable
Client action
Retry with bounded backoff

Query Spec refusals

A query tree is translated before anything runs, so these all arrive as a 400 and none of them cost an API Credit. The query spec page explains the grammar. This table is the recovery list: the message you received, what wrote it, and the change that makes the next request run.

Message
At least one search condition is required.
What triggered it
An empty where tree
Fix
Add a condition. An unfiltered sweep of the corpus is not available
Message
all takes a non-empty array of conditions. An empty all is not an unfiltered search. Add at least one condition; the field list is in GET /contract (querySpecByEntity).
What triggered it
An empty all array, usually after clearing the playground sample
Fix
Add at least one condition. The field list is in GET /contract (querySpecByEntity) and on each dataset page
Message
any takes a non-empty array of conditions. Add at least one condition; the field list is in GET /contract (querySpecByEntity).
What triggered it
An empty any array
Fix
Add at least one condition
Message
not takes one condition, or a non-empty array of conditions.
What triggered it
An empty not
Fix
Negate one condition, or an array of them
Message
This field cannot be filtered on. Use the other conditions, or see GET /contract and the dataset field table.
What triggered it
A field that is listed but cannot be compared right now. unavailableFields in GET /contract lists them
Fix
Use exists on that field, or pick another condition. Do not retry the same comparison expecting empty to mean no matches
Message
Unsupported query field '<name>'. Did you mean: <names>? The full list of queryable fields is in GET /contract (querySpecByEntity), or the metix_get_contract tool over MCP.
What triggered it
A field name that is not in this dataset's list, including Job created_at. It arrives as unsupported_query_field
Fix
Use a suggested name, or check the dataset's field table. On jobs, use posted_date for recency
Message
Unsupported query field '<name>'. It is returned on a <dataset> record but cannot be filtered on. The full list of queryable fields is in GET /contract (querySpecByEntity), or the metix_get_contract tool over MCP.
What triggered it
A record path that is not a query field, such as a job's url. It arrives as unsupported_query_field
Fix
Filter on another field, then read this one from the detail record
Message
Query field '<name>' was withdrawn and has no replacement. The full list of queryable fields is in GET /contract (querySpecByEntity), or the metix_get_contract tool over MCP.
What triggered it
A query field published before 2026-09-15 that nothing replaced; the changelog names them. It arrives as unsupported_query_field
Fix
Remove the condition. GET /contract lists what can be filtered on
Message
Each field condition takes exactly one operator. Write a bounded range as an all of two conditions.
What triggered it
Two or more operators in one leaf, such as gte and lte together
Fix
Split a bounded range into an all of two leaves
Message
Unsupported operator. Operators are eq, in, match, gte, gt, lte, lt and exists; GET /contract lists the ones each field takes (querySpecByEntity, fieldOperators).
What triggered it
A leaf with no operator, or with a key that is not one, such as startswith
Fix
Use one of the operators the field takes
Message
Field '<field>' is matched exactly, against the whole stored value, including case. It takes eq, in or exists. match does not search inside these values: use eq or in with a value from the dataset page or from a record.
What triggered it
match or a range operator on a field compared whole: a category, a name, a code, or a yes or no
Fix
Use eq or in with the whole value. Each dataset page lists the values of its category fields
Message
Field '<field>' is free text. It takes match, eq, in or exists. gte, gt, lte and lt compare numbers and dates only.
What triggered it
gte, gt, lte or lt on a free-text field
Fix
Use match or eq, or compare a numeric or date field instead
Message
Field '<field>' is a number or a date. It takes eq, in, gte, gt, lte, lt or exists.
What triggered it
match on a number or a date
Fix
Compare with eq, in, or a range operator
Message
Field '<field>' takes a value from a fixed, ordered list. It takes eq, in, gte, gt, lte, lt or exists; gte, gt, lte and lt compare positions in the list. The list is in GET /contract (closedValues).
What triggered it
match on a field that takes a value from an ordered list: education.degree, languages.proficiency, experience.company.size, or a company's size
Fix
Use eq or in with a listed value, or compare positions with gte, gt, lte or lt
Message
gte, lte, gt, lt, eq and in on a numeric field take a number, not a string.
What triggered it
A number sent as a string, such as "50"
Fix
Send the number without quotes
Message
in takes a non-empty array of values.
What triggered it
in with an empty array, or with one value that is not in an array
Fix
Send a non-empty array
Message
This field is a yes or a no. Use true or false.
What triggered it
A yes or no field compared with something other than true or false
Fix
Use true or false
Message
Unsupported languages.proficiency value. Allowed, lowest first: elementary, limited_working, professional_working, full_professional, native. The five LinkedIn labels, such as Native or bilingual proficiency, are accepted too.
What triggered it
A languages.proficiency value outside the five levels
Fix
Use one of the values the message lists, or a LinkedIn label
Message
Unsupported education.degree value. Allowed, lowest first: Associate or below, Bachelor, Master, Doctorate.
What triggered it
An education.degree value outside its four labels, such as a number or PhD
Fix
Use a label the message lists
Message
Unsupported company size value. Allowed, smallest first: Myself Only, 1-10, 11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001-10,000, 10,001+.
What triggered it
An experience.company.size or company size value outside the nine bands
Fix
Use a band the message lists, such as 51-200
Message
Each query node must be one of: all, any, not, a scope, or a field condition.
What triggered it
A node shape the grammar does not have, or an extra key on a leaf
Fix
Remove the extra key, or wrap the conditions in a composer
Message
Unsupported date value. Use YYYY-MM-DD or a documented relative value such as now-6m.
What triggered it
A date form outside the documented set, or an offset past the maximum
Fix
Use YYYY-MM-DD, or now-<n>d, now-<n>m, now-<n>y inside the published limits
Message
Field is not available inside <scope>.
What triggered it
A field used inside a scope that does not group it
Fix
Move the condition outside the scope, or use a field the scope covers
Message
Nested scopes cannot be nested inside one another.
What triggered it
has_experience inside has_education, or similar
Fix
Keep scopes at the same level and combine them with all or any
Message
Query nesting exceeds the maximum depth of 6.
What triggered it
A tree nested deeper than six levels
Fix
Flatten the tree. Most queries need two or three levels
Message
Query exceeds the maximum of 64 conditions.
What triggered it
More than 64 leaves in one tree
Fix
Split the work across several queries, or use in with a list instead of many any branches
Message
A salary comparison needs salary.currency, with eq or a non-empty in, in an all that contains the comparison. A currency inside any or not does not count. Figures are annualized inside one currency, not converted across currencies.
What triggered it
salary.annual_min or salary.annual_max compared without salary.currency pinned in an all around the comparison
Fix
Add salary.currency with eq to that all. exists on salary.annual_min or salary.annual_max does not need a currency
Message
Unsupported _source field. See the documented field list in GET /contract (returnableFields).
What triggered it
A detail _source path that is not in the record. It arrives as unsupported_source_field
Fix
Use a path from the record page for that dataset
Message
Unsupported _source field. The ID of this record is '<id path>'. See the documented field list in GET /contract (returnableFields).
What triggered it
A detail _source name shaped like an ID that is not this record's ID path, usually the ID name of another dataset. It arrives as unsupported_source_field
Fix
Send the ID path the message names: profile_id on people, id on jobs and companies
Message
_source field '<name>' was renamed to '<new path>'. Every rename is in GET /contract (renamedReturnFields).
What triggered it
A detail _source name published before 2026-09-15. It arrives as renamed_source_field
Fix
Send the path the message names
Message
_source field '<name>' is no longer returned. The current record is in GET /contract (returnableFields).
What triggered it
A detail _source name for a field that is no longer returned. It arrives as renamed_source_field
Fix
Remove it from _source. The record page lists what is returned
Message
_source must name at least one field, or be omitted for the default set.
What triggered it
An empty _source array, or an includes or excludes that leaves nothing. It arrives as invalid_request
Fix
Name at least one field, or omit _source for the default record

Detail IDs

Detail routes take the IDs a search returned, unchanged. An ID this API did not issue for that dataset, including a placeholder copied from an example, refuses the whole request with invalid_id, and msg names its position, for example job_ids[1] is not a job ID from this API. Nothing is charged.

An ID that is valid but matches no record is a different case. The request succeeds and the ID comes back in not_found, which is free. That happens when a record has left the index, most often a job posting that has closed.

Dataset
People
Detail route
POST /entity/v1/profiles/detail-by-id
Where its IDs come from
POST /v1/people/query, POST /v1/people-search
Dataset
Jobs
Detail route
POST /entity/v1/jobs/detail-by-id
Where its IDs come from
POST /v1/jobs/query
Dataset
Companies
Detail route
POST /entity/v1/companies/detail-by-id
Where its IDs come from
POST /v1/companies/query, company.id on a job record, experience.company.id on a profile record

Paging with next

A search response carries next while more results remain. Send it back as after, with the same where on the same route, to read the following page. The value is opaque and only means something to the search that issued it, so an edited cursor, one written by hand or copied from an example, or one issued before cursors were sealed (see changelog) is refused with invalid_cursor, and so is a cursor sent with a different where from the one it came from. Nothing is charged for the refusal.

Message
Invalid cursor. Send back the next value from the previous response of the same search, unchanged.
What triggered it
after that is not a next value from this search
Fix
Send next back unchanged, or omit after to start from the first page
Message
This cursor belongs to a different search. Send it with the same where it came from, or omit after to start again from the first page.
What triggered it
A next value sent with a different where from the search that issued it
Fix
Send the where the cursor came from, or omit after to start the new search from its first page

Salary comparisons

Job salary.annual_min and salary.annual_max are same-currency annual pay, and they are what a salary filter compares. The default record carries the posting's own figures instead, in salary.min and salary.max per salary.period, which may be a month or an hour; name salary.annual_min and salary.annual_max in _source to read the yearly figures. A comparison is refused unless salary.currency is pinned, with eq or a non-empty in, in an all that contains the comparison: directly in it, or in an all nested inside it. A currency inside any or not does not count, because it may not hold. That is what keeps USD years apart from BRL months.

// Refused. The range has no currency.
{"where": {"field": "salary.annual_min", "gte": 100000}}

// Runs. Annual USD at or above 100000.
{"where": {"all": [
  {"field": "salary.currency", "eq": "USD"},
  {"field": "salary.annual_min", "gte": 100000}
]}}

// Also runs. exists does not compare figures.
{"where": {"field": "salary.annual_min", "exists": true}}

salary.period is optional on a range. Values are hour, day, week, month, or year. YEAR and yr fold to year. There is no FX conversion: USD and EUR stay separate. The jobs field table has the worked example used on that page.