7shifts uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, a charge failed, etc.), and codes in the 5xx range indicate an error with 7shifts' servers.

Code / statusDescription
200 OKEverything worked
400 Bad RequestOften missing a required parameter.
401 UnauthorizedNo valid API key provided.
402 Request failedParameters were valid but request failed.
404 Not foundOften missing a required parameter.
500, 502, 503, 504 Server errorsSomething went wrong on 7shifts' end.

The error object

Parameter

Type

Description

status

String

Always returns 'error' when an error occurs.

message

String

A human-friendly message about what type of error occurred.

error

String

The type of error that occurred. One of the following:

missing_parameter
unauthorized
invalid_id
invalid_json
save_error
delete_error
access_denied
validation_error
missing_header
unknown

Example response

{
  "status": "error",
  "message": "location_id is required",
  "error": "missing_parameter"
}