Skip to content

One artist's upcoming events, each with the full bill

GET
/api/v2/artist/{key}/gigs
curl --request GET \
--url https://crate.hosaka.fm/api/v2/artist/example/gigs \
--header 'X-API-Key: <X-API-Key>'

Cycle-114 — upcoming events for one artist, with the support-act lane. A SUB-ROUTE rather than a dossier facet on purpose: at 0.07% coverage, folding it into the default-rich dossier would tax every /artist call for something empty 99.93% of the time (the same opt-in precedent as /similar and /bandcamp). {key} = 64-hex cluster_id (canonical) or a name slug; CLUSTER-KEYED, so a subject resolving without a cluster anchor returns an honest empty with a /resolve pointer, never a guess. An artist with no forward-dated event is 200 with gigs:[] — never 404, and never a claim that the artist is not touring. Cluster identity is keyed on the NORMALISED ARTIST NAME (pe-norm-v1), so an alias or legal name is a DIFFERENT cluster and may carry its own gigs. Keyed (X-API-Key); ONE crate_reader checkout; every hop index-served (measured 69.7 ms). FRESHNESS IS NOW READ LIVE (sprint-bug-148): surface carries the producer’s own refreshed_at, event_count and orphan_artist_rate from mirror.mb_events_meta, and the import-cadence note is DERIVED from that stamp rather than frozen into copy. v2 2.53.0 shipped a probe observation hardcoded at ship time because that twin was not granted to crate_reader; a live pg_class.relacl diff found the gap on 2026-08-19 and mirror granted it the same day. The read is deliberately NOT memoized — it is a genuine singleton measured at 1.980 ms, unlike the journalism freshness read which needed a TTL cache at 315 ms. If the read fails the note is dropped rather than invented. COVERAGE IS NARROW AND SAID SO ON THE WIRE: 1,772 artist clusters of ~2,564,895 (0.07%) carry a forward-dated event, so an empty result means this surface has no event for the subject — NOT that nobody is playing. The source is mirror.mb_events (MusicBrainz volunteer editing): strong for touring and festival acts with active editors, absent for the long tail, and NOT a market feed — there is no on-sale, price, or ticketing state, and the import cadence (imported_at 2026-08-01 when probed) is right for ‘upcoming’ and wrong for ‘on sale now’. begin_date is a MusicBrainz PARTIAL date held as text, so only full YYYY-MM-DD rows are served: 1,092 year-only and 584 year-month events are EXCLUDED and 18 malformed rows (which sort AFTER valid 2026 dates lexicographically) are filtered by a format guard. lineup[] is the reason this lane exists — mb_event_artists carries 46,331 support act and 713 supporting DJ links, making this the ONLY surface in the fleet that answers ‘who is opening’ (seen’s festival_lineup_entries is headliners-only with zero forward-dated rows). link_type is served VERBATIM and NO billing order is implied, because MusicBrainz does not record one; lineup order is link_type, then name, then mbid. roles[] carries EVERY role the addressed cluster holds on a bill (MusicBrainz can credit one cluster under several link_types on one event, and a cluster can bind several mbids), and it is sourced from the same join that selected the event so it is never cut by the lineup bound; it is always empty on the city direction, which has no subject. A lineup longer than 30 sets lineupTruncated instead of silently dropping members. event_type is null on 17 forward-dated rows; venue is null when the event carries no place link (~4.3%). MusicBrainz can link an event to SEVERAL venues (404 events carry 2, 83 carry 3, up to 22 — genuinely multi-site festivals): venue carries one of them deterministically and venueCount says how many exist, so a multi-venue event is disclosed rather than presented as if it had one venue.

key
required
string
>= 1 characters <= 200 characters
X-On-Behalf-Of
string
<= 128 characters /^[A-Za-z0-9._:@-]{1,128}$/

Optional. A partner fronting many end users with one key names the end user this call is made for (an opaque, stable id of YOUR choosing: 1–128 chars of [A-Za-z0-9._:@-]). The key stays the customer; the profile becomes a metering dimension — usage rolls up per profile (GET /api/v2/me/usage?profile=), per-profile caps apply UNDER the key tier limits (429 rate_limited with reason “profile_cap”; defaults 60/min and 2,000/UTC-day), and DELETE /api/v2/me/profiles/{profile_id} forgets a profile. crate stores only a salted, customer-scoped hash of the id — never the id. A malformed value is 400 invalid_on_behalf_of. The frozen v1 contract ignores the header.

The artist’s forward-dated events with their bills, or an honest empty

Media type application/json
object
object
required
string
Allowed values: artist.gigs
subject
required
object
clusterId
required
string | null
name
required
string | null
discogsArtistId
number | null
state
required
string
Allowed values: ok
gigs
required
Array<object>
object
eventMbid
required
string
name
required
string | null
date
required
string
time
required
string | null
eventType
required
string | null
venue
required
object
name
required
string | null
city
required
string | null
countryCode
required
string | null
venueCount
required
number
roles
required
Array<string>
lineup
required
Array<object>
object
clusterId
required
string | null
name
required
string | null
role
required
string
lineupTruncated
required
boolean
surface
required
object
refreshedAt
required
string | null
eventCount
required
number | null
orphanArtistRate
required
number | null
notes
required
Array<string>
Example
{
"object": "artist.gigs",
"state": "ok"
}
X-RateLimit-Limit
integer

Requests allowed in the current window.

X-RateLimit-Remaining
integer

Requests remaining in the current window.

X-RateLimit-Reset
integer

Unix epoch (seconds) when the current window resets.

X-Quota-Limit
integer

The tier’s included monthly 2xx allowance.

X-Quota-Remaining
integer

Included allowance minus the requests gated this month — an UPPER BOUND on billable 2xx (errors are counted at the gate but never billed; /api/v2/me/usage is the billable truth). 0 once the included bucket is spent (overage, where enabled, is flagged by X-Overage).

X-Quota-Reset
integer

Unix epoch (seconds) of the next UTC month start, when the monthly counter resets.

Validation failure (invalid query, malformed body, bad facet name)

Media type application/json

The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".

codeHTTPwhen thrownfix
invalid_artist_key400/artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid>resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id}
use_resolve_for_locator400/artist/{key} given a discogs:/mbid: locator (not a canonical address)GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL)
invalid_label_key400/label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet)address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp)
invalid_fields400/artist/{key}?fields= lists a facet that is not a valid top-level dossier fielduse only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field)
missing_locator400/resolve called with none of q/cluster/discogs/mbidpass exactly one locator
invalid_locator400a /resolve locator is malformed for its typefix the format, or fall back to ?q=<name>
invalid_query400/search ?q= missing/empty, or any Zod validation failure (details[] attached)pass ?q=<text>; fix each details entry
invalid_facet400an unknown facet filter name was suppliedGET /api/v2/facets for valid names + values
invalid_range400/me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 daysomit both for the current month to date, or page one calendar month per call (the hint names the exact fix)
invalid_on_behalf_of400X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-]fix the id, or omit the header to meter the key as one principal
invalid_cursor400/search ?after= is malformed, tampered, or was minted for a different query (q/filters changed)pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart
rate_limited429an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset)back off retry_after_seconds (or until X-RateLimit-Reset), then retry
pool_exhausted503the database pool could not hand out a connection within the acquire timeout (Retry-After: 5)retry after 5 s
query_timeout503a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recursretry after 30 s; narrow a broad ?q= with filters
request_aborted504the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout)retry later; on the artist dossier, request fewer ?fields=
internal500an unexpected error (logged server-side)retry once; report if it persists
object
error
required

Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.

string
message

One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).

string
hint

Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with ). The human counterpart to the machine-actionable next.

string
doc_url

Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.

string
param

The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.

string
next

A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.

string
details

Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.

Array
retry_after_seconds

On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.

number
master_id

Echoed on master_not_found (404) — the master id that did not resolve.

number
Example
{
"error": "invalid_query"
}

Authentication failure

Media type application/json

The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".

codeHTTPwhen thrownfix
invalid_artist_key400/artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid>resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id}
use_resolve_for_locator400/artist/{key} given a discogs:/mbid: locator (not a canonical address)GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL)
invalid_label_key400/label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet)address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp)
invalid_fields400/artist/{key}?fields= lists a facet that is not a valid top-level dossier fielduse only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field)
missing_locator400/resolve called with none of q/cluster/discogs/mbidpass exactly one locator
invalid_locator400a /resolve locator is malformed for its typefix the format, or fall back to ?q=<name>
invalid_query400/search ?q= missing/empty, or any Zod validation failure (details[] attached)pass ?q=<text>; fix each details entry
invalid_facet400an unknown facet filter name was suppliedGET /api/v2/facets for valid names + values
invalid_range400/me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 daysomit both for the current month to date, or page one calendar month per call (the hint names the exact fix)
invalid_on_behalf_of400X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-]fix the id, or omit the header to meter the key as one principal
invalid_cursor400/search ?after= is malformed, tampered, or was minted for a different query (q/filters changed)pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart
rate_limited429an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset)back off retry_after_seconds (or until X-RateLimit-Reset), then retry
pool_exhausted503the database pool could not hand out a connection within the acquire timeout (Retry-After: 5)retry after 5 s
query_timeout503a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recursretry after 30 s; narrow a broad ?q= with filters
request_aborted504the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout)retry later; on the artist dossier, request fewer ?fields=
internal500an unexpected error (logged server-side)retry once; report if it persists
object
error
required

Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.

string
message

One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).

string
hint

Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with ). The human counterpart to the machine-actionable next.

string
doc_url

Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.

string
param

The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.

string
next

A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.

string
details

Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.

Array
retry_after_seconds

On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.

number
master_id

Echoed on master_not_found (404) — the master id that did not resolve.

number
Example
{
"error": "invalid_query"
}

Rate limit exceeded — see Retry-After + X-RateLimit-* headers

Media type application/json
object
error
required
string
Allowed values: rate_limited
retry_after_seconds
required
number
Example
{
"error": "rate_limited"
}

Internal server error

Media type application/json

The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".

codeHTTPwhen thrownfix
invalid_artist_key400/artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid>resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id}
use_resolve_for_locator400/artist/{key} given a discogs:/mbid: locator (not a canonical address)GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL)
invalid_label_key400/label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet)address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp)
invalid_fields400/artist/{key}?fields= lists a facet that is not a valid top-level dossier fielduse only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field)
missing_locator400/resolve called with none of q/cluster/discogs/mbidpass exactly one locator
invalid_locator400a /resolve locator is malformed for its typefix the format, or fall back to ?q=<name>
invalid_query400/search ?q= missing/empty, or any Zod validation failure (details[] attached)pass ?q=<text>; fix each details entry
invalid_facet400an unknown facet filter name was suppliedGET /api/v2/facets for valid names + values
invalid_range400/me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 daysomit both for the current month to date, or page one calendar month per call (the hint names the exact fix)
invalid_on_behalf_of400X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-]fix the id, or omit the header to meter the key as one principal
invalid_cursor400/search ?after= is malformed, tampered, or was minted for a different query (q/filters changed)pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart
rate_limited429an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset)back off retry_after_seconds (or until X-RateLimit-Reset), then retry
pool_exhausted503the database pool could not hand out a connection within the acquire timeout (Retry-After: 5)retry after 5 s
query_timeout503a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recursretry after 30 s; narrow a broad ?q= with filters
request_aborted504the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout)retry later; on the artist dossier, request fewer ?fields=
internal500an unexpected error (logged server-side)retry once; report if it persists
object
error
required

Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.

string
message

One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).

string
hint

Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with ). The human counterpart to the machine-actionable next.

string
doc_url

Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.

string
param

The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.

string
next

A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.

string
details

Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.

Array
retry_after_seconds

On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.

number
master_id

Echoed on master_not_found (404) — the master id that did not resolve.

number
Example
{
"error": "invalid_query"
}

Capacity — pool_exhausted (no connection within the acquire timeout; Retry-After: 5) or query_timeout (the statement was cancelled by crate’s own statement budget; Retry-After: 30); honour Retry-After

Media type application/json

The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".

codeHTTPwhen thrownfix
invalid_artist_key400/artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid>resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id}
use_resolve_for_locator400/artist/{key} given a discogs:/mbid: locator (not a canonical address)GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL)
invalid_label_key400/label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet)address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp)
invalid_fields400/artist/{key}?fields= lists a facet that is not a valid top-level dossier fielduse only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field)
missing_locator400/resolve called with none of q/cluster/discogs/mbidpass exactly one locator
invalid_locator400a /resolve locator is malformed for its typefix the format, or fall back to ?q=<name>
invalid_query400/search ?q= missing/empty, or any Zod validation failure (details[] attached)pass ?q=<text>; fix each details entry
invalid_facet400an unknown facet filter name was suppliedGET /api/v2/facets for valid names + values
invalid_range400/me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 daysomit both for the current month to date, or page one calendar month per call (the hint names the exact fix)
invalid_on_behalf_of400X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-]fix the id, or omit the header to meter the key as one principal
invalid_cursor400/search ?after= is malformed, tampered, or was minted for a different query (q/filters changed)pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart
rate_limited429an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset)back off retry_after_seconds (or until X-RateLimit-Reset), then retry
pool_exhausted503the database pool could not hand out a connection within the acquire timeout (Retry-After: 5)retry after 5 s
query_timeout503a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recursretry after 30 s; narrow a broad ?q= with filters
request_aborted504the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout)retry later; on the artist dossier, request fewer ?fields=
internal500an unexpected error (logged server-side)retry once; report if it persists
object
error
required

Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.

string
message

One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).

string
hint

Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with ). The human counterpart to the machine-actionable next.

string
doc_url

Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.

string
param

The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.

string
next

A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.

string
details

Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.

Array
retry_after_seconds

On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.

number
master_id

Echoed on master_not_found (404) — the master id that did not resolve.

number
Example
{
"error": "invalid_query"
}

The 15 s request deadline passed before the response was assembled (request_aborted)

Media type application/json

The error envelope for all 4xx/5xx responses. error is the only guaranteed field — branch on it, never on HTTP status alone. An unresolved/empty lookup is NOT an error: it returns HTTP 200 with present:false / a null field / state:"honest_gap".

codeHTTPwhen thrownfix
invalid_artist_key400/artist/{key} key is not a 64-hex cluster_id, discogs:<id>, or mbid:<uuid>resolve by name first: GET /api/v2/resolve?q=<name>, then call /artist/{cluster_id}
use_resolve_for_locator400/artist/{key} given a discogs:/mbid: locator (not a canonical address)GET /api/v2/resolve?discogs=<id> (or ?mbid=), then use the returned cluster_id (the response next field is the ready-to-call URL)
invalid_label_key400/label/{key} key is not a 64-hex label_cluster_id or name-slug (e.g. a discogs:/mbid: locator — not resolvable for labels yet)address a label by its 64-hex label_cluster_id or its name-slug (e.g. /api/v2/label/warp)
invalid_fields400/artist/{key}?fields= lists a facet that is not a valid top-level dossier fielduse only the fields in the response valid set; omit ?fields= entirely for the full dossier (see the example field)
missing_locator400/resolve called with none of q/cluster/discogs/mbidpass exactly one locator
invalid_locator400a /resolve locator is malformed for its typefix the format, or fall back to ?q=<name>
invalid_query400/search ?q= missing/empty, or any Zod validation failure (details[] attached)pass ?q=<text>; fix each details entry
invalid_facet400an unknown facet filter name was suppliedGET /api/v2/facets for valid names + values
invalid_range400/me/usage ?from/?to is not an ISO day (YYYY-MM-DD), to is before from, or the span exceeds 62 daysomit both for the current month to date, or page one calendar month per call (the hint names the exact fix)
invalid_on_behalf_of400X-On-Behalf-Of (or /me/usage?profile=, /me/profiles/{profile_id}) is not 1–128 chars of [A-Za-z0-9._:@-]fix the id, or omit the header to meter the key as one principal
invalid_cursor400/search ?after= is malformed, tampered, or was minted for a different query (q/filters changed)pass pagination.next_cursor from the previous page of the SAME query unchanged; drop after to restart
rate_limited429an IP/key/tier rate, monthly quota, or concurrency cap was exceeded (retry_after_seconds + Retry-After + X-RateLimit-* set; a monthly-quota stop also carries X-Quota-Remaining: 0 + X-Quota-Reset)back off retry_after_seconds (or until X-RateLimit-Reset), then retry
pool_exhausted503the database pool could not hand out a connection within the acquire timeout (Retry-After: 5)retry after 5 s
query_timeout503a statement was cancelled by crate’s own budget (statement_timeout; Retry-After: 30) — capacity, not a gateway timeout; during the upstream database’s daily 04–07Z stall this is transient, for very broad /search ?q= (single common words) it recursretry after 30 s; narrow a broad ?q= with filters
request_aborted504the 15 s request deadline passed before the response was assembled (a statement the deadline cancelled mid-flight answers this code, not query_timeout)retry later; on the artist dossier, request fewer ?fields=
internal500an unexpected error (logged server-side)retry once; report if it persists
object
error
required

Machine-readable error code (stable lowercase snake_case). The ONLY field guaranteed on every error body — switch on it programmatically, never on HTTP status alone (several codes share a status). See the code table in this schema’s description.

string
message

One-sentence human-readable statement of WHAT is wrong (developer-facing). Present only for catalogued codes. Describes the violated rule — not a fix (see hint/next).

string
hint

Actionable remediation in human terms — what to DO next, often naming the exact endpoint (a template with ). The human counterpart to the machine-actionable next.

string
doc_url

Deep link to this code’s docs: https://crate.hosaka.fm/docs/api#error-. Auto-populated for catalogued codes.

string
param

The specific request parameter that caused the failure (e.g. “key”, “q”), so a client can point at the offending input. Present only when the code declares one.

string
next

A copy-pasteable, fully-formed corrected call (a concrete URL, NOT a template) an agent can fire verbatim to recover — the machine-actionable counterpart to hint. Present only when a handler supplies one.

string
details

Structured validation breakdown — on Zod 400s (invalid_query), an array of { path, message }, one per failed field. Present only when validation specifics are attached.

Array
retry_after_seconds

On a 429 rate_limited response, seconds to wait before retrying (mirrors the Retry-After header). Sleep at least this long, then re-issue the identical request.

number
master_id

Echoed on master_not_found (404) — the master id that did not resolve.

number
Example
{
"error": "invalid_query"
}