Errors¶
Each API call returns an HTTP status code that reflects the nature of the response.
Any request that succeeds will return with HTTP status 200. Any request that did not succeed will return
a 4xx or 5xx error. The 4xx range means there was a problem with the request, like a missing parameter.
The 5xx range means that something went wrong on our end.
HTTP Status Codes¶
| Status Code | Name | Description |
|---|---|---|
200 |
OK | The request succeeded. |
400 |
Bad Request | The request was invalid, for example due to a missing or malformed parameter. |
401 |
Unauthorized | The access token is missing or incorrect. |
403 |
Forbidden | You do not have permission to access this resource or perform this action. |
404 |
Not Found | The specified resource (e.g. plant) was not found. |
412 |
Precondition Failed | The action cannot be executed because a required precondition is not met. |
500 |
Internal Server Error | An unexpected error occurred on the server. |
Error Response Body¶
For 400 and 412 responses, the response body contains additional information about the cause of the problem:
{
"status": "ERROR",
"code": "INVALID_INPUT",
"message": "Invalid plant identifier (ABC)",
"data": []
}
| Field | Type | Description |
|---|---|---|
status |
string | Always "ERROR" for error responses |
code |
string | Machine-readable error code |
message |
string | Human-readable description of the error |
data |
array | Additional error details, if available |
POST / PUT Response Pattern¶
Write endpoints (POST /v1/plants/{plantId}/tasks, PUT /v1/plants/{plantId}/parts/{partId}/stock-level) return a response body with the same structure but a status field that can be one of SUCCESS or ERROR:
{
"status": "SUCCESS",
"code": "SUCCESS",
"message": null,
"data": []
}
| Status | Description |
|---|---|
SUCCESS |
The operation completed successfully. |
ERROR |
The operation failed (check the code and message for details). |
{"environments":[],"pdf-download":true}