HTTP Response Codes

Status CodeErrorDescription
400Bad RequestUsually sent when there's a domain level error, for example, attempting to update a job that has already finished.
401UnauthorizedWe could not verify your identity from the API key contained in the request.
403ForbiddenThe 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.
404Not FoundShows that either the endpoint or the resource trying to be accessed does not exist.
422Unprocessable EntityThere was an error in the data sent to the server, most likely the validation of part of the request has failed.
500Server ErrorThere 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:

{
    "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:

{
    "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:

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

The following response would be returned:

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

Codes

Error CodeDescription
ERROR_CONFIGURATIONAPI configuration issue on Gophr's side.
ERROR_JOB_STATUSCannot perform this action because of current job status.
ERROR_JOB_FINISHEDCannot perform this action on a job, because it is finished or cancelled.
INVALID_JOB_OPERATIONGeneral 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_FAILEDA field or query param sent to the server does comply with our validation rules.
UNAUTHORIZEDThe request did not contain a valid API Key header or the operation is forbidden.