Skip to main content

Error handling

Endpoint error response

In the case of non-2xx HTTP status responses, endpoints return details of errors using the following schema (the errors array is relevant to POST endpoints which receive JSON in the request body).

{
"status": <int>,
"errors": [
{
"property": <string>,
"messages": [
<string>
]
}, ...
],
"message": <string>
}

An example HTTP 400 response would look like this:

{
"status": 400,
"errors": [
{
"property": "amountRequested",
"messages": [
"key missing from body",
"must be greater than zero",
"value must be a number"
]
},
{
"property": "investorReferenceType",
"messages": [
"must be one of nino, lei, concat"
]
}
],
"message": "Bad Request"
}

HTTP response codes

An overview of response messages that the PrimaryBid Connect API can throw following a request.

CodeNameDescription
20xOKIndicates that the request has succeeded.
201CreatedIndicates that the request has succeeded and a new resource has been created as a result.
204No contentResponse to a successful event will not return a body (e.g. a DELETE op).
400Bad requestThe request was unacceptable, often due to a missing required parameter or field, or that parameter or field was of an incorrect type.
401UnauthorisedNo valid API key/secret was supplied (authentication failure).
403ForbiddenThe request is valid, but the server is refusing to respond to it (authorisation failure).
404Not foundThe server can't find the requested resource.
405Method not allowedInvalid HTTP method on the requested resource.
409ConflictThe request could not be processed due to a conflict in the current state of the resource e.g. edit conflict between multiple simultaneous updates.
422Unprocessable entityThe parameters had the correct type but one or more were not valid.
429Too many requestsThe request is rejected because you made too many API calls within a short period of time. Check out the Rate Limits.
5xxServer errors