Problem Details
Lucca Apis implements the “Problem Details” standard to describe errors (see RFC 7807). The Problem Details standard is a way to respond with machine-readable error messages. So make sure to read them, as they will definitely help your figure out the cause for errors you may encounter.Common HTTP Status Codes
Note: The Lucca API strives to stick to the intended semantics of the HTTP status codes.Code | Name | Description | Retry? |
---|---|---|---|
400 | Bad Syntax | Common validation problem. You may want to double check the request body complies with the spec, and the query parameters as well. You may find further details in the response body. | ❌ No |
401 | Unauthorized | Server could not authenticate you. Make sure your access token is valid and has not expired. | ❌ No |
403 | Forbidden | Your HTTP requests was forbidden by the server. Double check what you’re attempting to achieve is allowed by the API Reference and/or your level of access. | ❌ No |
404 | Not Found | The requested resource does not exist, was deleted, or you do not have access to it (access rights). | ❌ No |
405 | Method Not Allowed | The HTTP method you invoked is not supported on the corresponding API path. Please refer to the API Reference. | ❌ No |
429 | Too Many Requests | You exceeded the API rate-limit. | ✅ Yes (later) |
500 | Internal Server Error | Something unexpected happened. We were notified and will be investigating the problem. Please refer to our status page to know more. | ✅ Yes (maybe) |
503 | Service Unavailable | The Lucca API is down. We’re on it to make sure it will be back up as soon as possible. Please refer to our status page to know more. | ✅ Yes |
Errors due to limits being reached
Learn more about the limits of the Lucca API usage.
Error Handling
Depending on the kind of error, you may use one or all of the following strategies in order to handle it:Strategy | Purpose | When needed |
---|---|---|
Handling errors (below) | Recover whenever an API request fails. | Always |
Monitor webhooks | React to failed event deliveries. | Often |
Browse logs (below) | Investigate past problems. | Sometimes |
Handling 4xx Errors
When receiving 4xx errors, first refer to the response content, as it should be a Problem object that gives clear pointers about the reasons for the error. Most often, 4xx errors are caused by:- lack of authentication (401), in which case your access_token is certainly invalid or has expired ;
- a poorly formatted payload infringed validation rules on the payload (400) or query parameters typing and/or requirements, in which case you should double check the API Reference ;
- insufficient access rights (403 on write requests and 404 on read requests), in which case you should make sure your access_token has the required oAuth scopes.
Other 4xx error types may be due to our API limits
Handling Deprecation Warnings
Whenever a version of the Lucca API is marked as deprecated, all server responses will have both:- a
Deprecation
HTTP header which indicates the date from which the version was marked as deprecated ; - a
Sunset
HTTP header which indicates the date from which the version will no longer respond.
Therefore, you should definitely monitor these headers in all of your requests in order to be notified
whenever a script uses a deprecated API version.