Back

    Buyamia Directory API

    v1.1.0

    Errors & Status Codes

    Every failure returns JSON of the form { "error": "message" } with an appropriate HTTP status. There is no error code enum — match on the status, and log the message.

    StatusMeaningTypical cause
    200OKSuccessful read or update
    201CreatedRFQ, quote, business, product or webhook created
    400Bad RequestMissing required field, or a path that does not start with /v1/
    401UnauthorizedMissing header, unknown/inactive key, or expired key
    403ForbiddenKey lacks the named scope
    404Not FoundUnknown resource, unknown route, or a record hidden by visibility rules
    405Method Not AllowedWrong method on a search endpoint
    429Too Many RequestsPer-key rate limit tripped — back off
    500Internal Server ErrorUnhandled error or a database error surfaced verbatim
    503Service UnavailableSemantic search called without embeddings configured

    A 404 does not always mean "does not exist". Non-public businesses and non-active products are hidden as 404 for keys without the matching internal scope.

    Best practices

    • Check the status before parsing — error bodies do not contain data.
    • Exponential backoff with jitter on 429 and 5xx; no retry on other 4xx.
    • Validate payloads client-side; most 400s are a missing title, buyer_name, items, supplier_id, or q.
    • Alert only after repeated 5xx — single failures are usually transient.
    Current as of API 1.1.0 — released 7 September 2026