Responses
All API endpoints return a standard JSON response envelope. This page documents the HTTP status codes used by the API and the structure of the response object.
HTTP Status Codes
| Code | Title | Description |
|---|---|---|
| 200 | OK | The request was successful. |
| 400 | Bad request | Bad request |
| 401 | Unauthorized | Your authentication values are incorrect. Check the email and the token in the header. |
| 404 | Not found | The resource does not exist |
Response Object
Every response from the API follows the same structure, regardless of the endpoint called.
| Field | Type | Description |
|---|---|---|
| Type | int | 0 = Success; 1 = Error |
| Object | object | The resulting object of the request (e.g., the created document). null on error. |
| ErrorMessage | string | Short error message identifier, if an error occurred. |
| ErrorValue | object | Contains Value (error code number) and Name (error code name). null on success. See Error Codes for the full list. |
| ErrorHumanReadable | string | A human-readable text that explains the error found. null on success. |
| ValidationErrors | array | List of validation error objects with details. null when there are no validation errors. |
| IsError | boolean | true if the request failed, false otherwise. |
| IsSuccess | boolean | true if the request succeeded, false otherwise. |
Success Response
When a request is successful, Type is 0, IsSuccess is true, and Object contains the result.
{
"Type": 0,
"Object": {
"DocumentId": 123456
},
"ErrorMessage": null,
"ErrorValue": null,
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsError": false,
"IsSuccess": true
}
Error Response
When a request fails, Type is 1, IsError is true, and the error fields provide details about what went wrong.
{
"Type": 1,
"Object": null,
"ErrorMessage": null,
"ErrorValue": {
"Value": 6,
"Name": "ElementDoesNotExist"
},
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": false,
"IsError": true
}
For a complete list of error codes and their meanings, see the Error Codes page.
Validation Error Response
When the request contains invalid fields, the API returns a validation error with details in the ValidationErrors array.
{
"Type": 1,
"Object": null,
"ErrorMessage": null,
"ErrorValue": {
"Value": 2,
"Name": "ValidationError"
},
"ErrorHumanReadable": null,
"ValidationErrors": [
{
"Type": "DocumentIsADuplicate",
"Field": "DocumentDetailExternalId",
"Value": "6",
"ElementNumber": "67204",
"Detail": "Duplicate Document"
}
],
"IsSuccess": false,
"IsError": true
}
ValidationErrors Fields
| Field | Type | Description | Example |
|---|---|---|---|
| Type | string | Identifies the error with a token | "DocumentIsADuplicate" |
| Field | string | Name of the field in which validation failed | "DocumentDetailExternalId" |
| Value | string | Value which failed validation | "6" |
| ElementNumber | string | Identifies the index of the field in which validation failed | "67204" |
| Detail | string | Detailed error explanation | "Duplicate Document" |
Always check IsError or IsSuccess in your integration to determine whether the request was processed correctly before reading the Object field.