Error codes

Sometimes requests to the API aren't successful. Failures can occur for many reasons. In all cases, the API returns an HTTP status code that indicates the nature of the failure, with a response body in JSON format containing additional information.

For server errors, the response body contains an error phrase.

CodeMeaningDescription
200SuccessIf data was requested, it's available in the data field at the top level of the response body.
400Bad RequestThis usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again.
401UnauthorizedA valid authentication token was not provided with the request, so the API couldn't associate a user with the request. This could mean no token was provided, or the provided token was incorrect or disabled.
403ForbiddenThe authentication and request syntax was valid but the server is refusing to complete the request. This can happen if you try to read or write to objects or properties that the user doesn't have access to.
404Not foundEither the request method and path supplied don't specify a known action in the API, or the object specified by the request doesn't exist.
409ConflictYou're trying to create an object that already exists.
415Unsupported media typeYou're providing a payload in an unexpected format, or you haven't set the Content-Type header correctly. Perk uses application/json in all requests.
429Too Many RequestsYou've exceeded one of the enforced rate limits in the API.
See Rate limits for more information.
500Internal ErrorPerk's servers have experienced a problem. Although this is rare, please contact support to report this error.