GuidesAPI ReferenceChangelogDiscussions
Back to 7shifts.comBecome a Partner
API Reference
These docs are for v2.2022.0501. Click to read the latest docs for v2.2023.0501.

Errors

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

ParameterTypeDescription
statusStringAlways returns 'error' when an error occurs.
messageStringA human-friendly message about what type of error occurred.
errorStringThe 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"
}