---
updatedAt: 2025-05-21T20:19:57.000Z
agentTools:
  projectIndex: https://developers.gophr.com/llms.txt
---

# Errors

## HTTP Response Codes

| Status Code | Error                  | Description                                                                                                                                                    |
| ----------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **400**     | `Bad Request`          | Usually sent when there's a domain level error, for example, attempting to update a job that has already finished.                                             |
| **401**     | `Unauthorized`         | We could not verify your identity from the API key contained in the request.                                                                                   |
| **403**     | `Forbidden`            | The user is not allowed to make the request, this could be due to an invalid API key or because you're attempting to access a job that does not belong to you. |
| **404**     | `Not Found`            | Shows that either the endpoint or the resource trying to be accessed does not exist.                                                                           |
| **422**     | `Unprocessable Entity` | There was an error in the data sent to the server, most likely the validation of part of the request has failed.                                               |
| **500**     | `Server Error`         | There is an issue on Gophr's side. If you see this error, please let us know.                                                                                  |

## General Format

When error descriptions are available, they will be returned to the client with an `errors` array. Each object within the array will contain the following fields:

* `object` - Shows the specific field that the error relates to if appropriate
* `code` - The error code (see **Codes** section below).
* `message` - A human readable description of the error that has occured.

For example:

```json
{
    "errors": [
        {
            "object": null,
            "code": "INVALID_JOB_OPERATION",
            "message": "Job with id 20220607-113253-0445d443cf69a505 is confirmed and so cannot be modified."
        }
    ]
}
```

# Validation Errors

## Basic Error

If validation has failed for a field not contained within a collection, the error  (and specifically the `object` field) will appear in the following format:

```json json
{
    "errors": [
        {
            "object": "pickup_postcode",
            "code": "VALIDATION_FAILED",
            "message": "Field must be a string"
        }
    ]
}
```

## Collection Validation Errors

Where validation has failed for a field contained within a collection of items, dot (`.`) notation is used to allow you to identify the field that has failed. For example, given the following request data where the `parcel_insurance_value` is of an invalid type for the first item in the `parcels` collection:

```json json
{
  "pickup": {...},
  "dropoff": {...},
  "parcels": [
    {
      "parcel_insurance_value": "This field should be a float",
      ...
    }
  ]
}
```

The following response would be returned:

```json json
{
    "errors": [
        {
            "object": "parcels.0.parcel_insurance_value",
            "code": "VALIDATION_FAILED",
            "message": "Field must be a number"
        }
    ]
}
```

# Codes

| Error Code              | Description                                                                                                                                |
| :---------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- |
| ERROR\_CONFIGURATION    | API configuration issue on Gophr's side.                                                                                                   |
| ERROR\_JOB\_STATUS      | Cannot perform this action because of current job status.                                                                                  |
| ERROR\_JOB\_FINISHED    | Cannot perform this action on a job, because it is finished or cancelled.                                                                  |
| INVALID\_JOB\_OPERATION | General error stating that the operation being attempted on the job cannot be completed. e.g. trying to add a delivery to a confirmed job. |
| VAILIDATION\_FAILED     | A field or query param sent to the server does comply with our validation rules.                                                           |
| UNAUTHORIZED            | The request did not contain a valid API Key header or the operation is forbidden.                                                          |