Key Concepts

Response Status Codes

The Sayari API uses conventional HTTP response codes to indicate the success or failure of an API request.

Success

All successful requests will be indicated with 2xx status codes.

CodeResponseDescription
200OkSuccessful GET request. Everything worked as expected.
201CreatedSuccessful POST request. Everything worked as expected.

Errors

4xx range codes indicate errors based on provided information. 5xx range codes indicate server-side errors.

Error codes in the 4xx range often include an error code for clarity.

CodeResponseDescription
400Bad RequestIncorrectly formatted request.
401UnauthorizedRequest made without valid token.
404Not FoundResource not found or does not exist.
405Method Not AllowedRequest made with an unsupported HTTP method. Currently only GET and POST are supported.
406Not AcceptableRequest made in an unacceptable state. This is most commonly due to parameter validation errors.
415Unsupported Media TypeAccept header on request set to an unsupported media type. Currently only application/json and text/csv are supported for indicated resources.
429Rate LimitedToo many requests within too short of a period. The reply will contain a retry-after header that indicates when the client can safely retry.
500Internal Server ErrorInternal server error occurred.

Error format:

1{
2 "status": 500,
3 "success": false,
4 "messages": ["Internal Server Error"]
5}

Validation messages on request parameters will also be displayed in the messages field to give more information on the failed request.