API Error Codes and Messages
If an API call is unsuccessful, it returns an HTTP error code. If the error is known, you receive a message in the response body.
Known errors are returned in the response body in this format.
HTTP Code | HTTP Message | API Message | Resource | Possible Causes |
---|---|---|---|---|
401 | Unauthorized | Invalid access token | Any | The access token is expired. |
401 | Unauthorized | Invalid authentication scheme | Any | An Authorization header was provided, but the token isn't properly formatted. |
5XX |
| None | Any | Our systems encountered and logged an unexpected error. Please contact us if you continue to see the error. |
Error codes that can occur when you access datasets, labels, or examples.
| HTTP Code | HTTP Message | API Message | Resource | Possible Causes |
| --------- | ------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- |
| 400 | Bad Request | None | Any dataset, label, or example resources. | The request couldn’t be fulfilled because the HTTP request was malformed, the Content Type was incorrect, there were missing parameters, or a parameter was provided with an invalid value. |
| 400 | Bad Request | The name
parameter is required to create a dataset. | POST
/language/datasets
| The name
parameter was passed in, but no value was provided. |
| 400 | Bad Request | Uploading a dataset requires either the data
field. | POST
/language/datasets/upload
| The path to the local .zip file or the URL to the .zip file in the cloud wasn’t specified. |
| 400 | Bad Request | The data
parameter cannot be duplicated | POST
/language/datasets/upload
| The data
parameter cannot be duplicated |
| 400 | Bad Request | The dataset is not yet available for update, try again once the dataset is ready. | PUT
/language/datasets/<DATASET_ID>/upload
| You’re adding examples to a dataset that’s currently being created. You must wait for dataset to become available before you can add examples to it. |
| 400 | Bad Request | Failed to download the dataset from the public URL. | POST
/language/datasets/upload/
language/datasets/upload/sync
| The API can't access the dataset file via the URL provided.
When specifying the URL for a .zip file in a cloud drive service like Dropbox, be sure it's a link to the file and not a link to the interactive download page. For example, the URL should look like https://www.dropbox.com/s/abcdxyz/mountainvsbeach.zip?dl=1.
|
| 400 | Bad Request | Supported dataset types: [image, image-detection, image-multi-label] | POST
/language/datasets/upload
| The type
request parameter contains a value that isn't a valid dataset type. |
| 400 | Bad Request | Example max size supported is 1024000. | POST
/language/datasets/<DATASET_ID>/examples
| The image file being added as an example exceeds the maximum file size of 1 MB. |
| 404 | Not Found | None | Any dataset, label, or example resources. | The requested REST resource doesn’t exist or you don't have permission to access the resource. |
| 404 | Not Found | Unable to find dataset. | GET
/language/datasets/<DATASET_ID>
|
- You don't have access to the dataset.
- The dataset was deleted.
/language/datasets/<DATASET_ID>
| - You don't have access to the dataset.
- The dataset was deleted.
/language/datasets
| The call is trying to create a label with a name that exists in the dataset. Label names must be unique within a dataset. |
| 503 | Service Unavailable | Operation timed out! | GET /language/datasets
| The call has timed out due to large data size. By default, this call returns 25 datasets. If the datasets contain a lot of examples, this call may time out. Use the offset
and count
parameters to limit and page through the data. |
Error codes that can occur when you train a dataset to create a model or access a model.
HTTP Code | HTTP Message | API Message | Resource | Possible Causes |
---|---|---|---|---|
400 | Bad Request |
| POST /language/train | The name or datasetId parameter was passed in, but no parameter value was provided. |
400 | Bad Request | The name or datasedId parameters are required to train. | POST /language/train | The name or datasetId parameter is missing. |
400 | Bad Request | Invalid id <MODEL_ID> | GET /language/train/<MODEL_ID> | There’s no model with an ID that matches the modelId parameter. |
400 | Bad Request | Invalid id <MODEL_ID> | GET /language/train/<MODEL_ID>/lc | There’s no model with an ID that matches the modelId parameter. |
400 | Bad Request |
| GET /language/models/<MODEL_ID> | The model for which you are getting metrics hasn’t completed training. |
404 | Not Found | None | GET /language/models/<MODEL_ID> | The modelId parameter is missing. |
405 | Method Not Allowed | None | GET /language/train/<MODEL_ID> | The modelId parameter is missing. |
Error codes that can occur when you make a prediction.
HTTP Code | HTTP Message | API Message | Resource | Possible Causes |
---|---|---|---|---|
400 | Bad Request | None | POST /language/intent | The prediction request couldn’t be fulfilled because the HTTP request was malformed, the Content Type was incorrect, there were missing parameters, or a parameter was provided with an invalid value. |
400 | Bad Request | Bad Request: Bad sampleLocation | POST /language/intent | The URL passed in the sampleLocation parameter is invalid. The URL could be incorrect, contain the wrong file name, or the file may have been moved. |
400 | Bad Request | The modelId parameter is required. | POST /language/intent | The modelId parameter is missing. |
400 | Bad Request | File size limit exceeded | POST /language/intent | The file you passed in for prediction exceeds the maximum file size limit of 5 MB. |
400 | Bad Request | Bad Request: Unsupported sample file format | POST /language/intent | The file you passed in for prediction isn’t one of the supported file types. |
403 | Forbidden | Forbidden! | POST /language/intent |
|
429 | Too Many Requests | You've reached the maximum number of predictions. | POST /language/intent | You have exceeded the number of prediction requests for your current plan. Contact your AE to update your plan. See Rate Limits. |