Error codes

Any response can contain errors. The errors property is an array of error objects, so there can be multiple errors returned. Each object has the following:

code is an application-specific error code. This can be used by consumers to decide how to deal with certain types of errors, etc. The possible codes are listed below.

id is a reference for this exact instance of the error, which can help with debugging. If you're contacting us at api@teamork.com with a problem, please give it.

title is a short, human-readable summary of the problem.

detail is a human-readable explanation specific to this occurrence of the problem.

Sample Error code

{
  errors: [
    {
      code: “E11”,
      detail: “Hello world...”,
      id: 123131,
      title: “Hello”
    }
  ]
}

The following are the error codes used in the API responses for different scenarios. This code can be matched against programmatically to handle different scenarios, do not rely on the detail as this could be changed or translated in the future while the codes will remain the same.

At the moment Spaces echos the response codes, this could be updated in future to support custom error codes

401 - Unauthorized, invalid or no authentication given

403 - Logged in but lack the permission to perform an action

404 - Not found

400 - Bad request

500 - Internal server error

Validation errors return a slightly different format containing a map of field names and a list of errors for each validation failure.

Sample Validation error

{
    "errors": {
        "slug": [
            "value black listed"
        ]
    }
}

101 - Subscription expired

102 - Payment has failed, usually due to invalid/expired card details

103 - Trial period expired and no payment has been made

104 - Upgrade is required: number of users active has exceeded the paid users

105 - Spaces is not enabled for your account

106 - User not active and therefore cannot access Spaces

Other errors

We will be working to extend error codes as development of Spaces continues.

Feedback

If you have any feedback or suggestions, feel free to contact us at api@teamwork.com.