Back

    Buyamia Directory API

    v1.0

    Error Codes Reference

    The API uses standard HTTP status codes. Error responses include a descriptive message in the error field.

    Error Response Format

    {
      "data": null,
      "error": "Descriptive error message here"
    }

    HTTP Status Codes

    CodeMeaningCommon Causes
    200OKRequest succeeded
    201CreatedResource successfully created (POST)
    400Bad RequestInvalid parameters, missing required fields, malformed JSON
    401UnauthorizedMissing or invalid API key
    403ForbiddenAPI key lacks required permission scope
    404Not FoundResource does not exist
    406Not AcceptableMissing required Accept header (MCP server)
    409ConflictDuplicate resource (e.g., duplicate external_rfq_id)
    429Too Many RequestsRate limit exceeded
    500Internal Server ErrorUnexpected server error — contact support
    503Service UnavailableSemantic search unavailable (OpenAI key not configured)

    Error Handling Best Practices

    • Always check the HTTP status code before parsing the response body
    • Implement exponential backoff for 429 (rate limit) responses
    • Log the full error response for debugging — the error message is human-readable
    • For 5xx errors, retry with backoff up to 3 times before alerting
    • Validate request payloads client-side before sending to reduce 400 errors
    Last updated on February 23, 2026