Skip to content

Error Handling ​

The API uses standard HTTP status codes. Every error body is JSON.

Status codes ​

CodeMeaning
200Success
201Resource created
204Success, empty body (most DELETE calls)
401Missing, invalid or expired token
403The token is missing a permission, or the action is not allowed
404Resource not found in your workspace
409Conflict with the current state (for example a duplicate)
422Validation error, or a business rule was violated
429Rate limit reached
500Server error

Error format ​

json
{
  "error": "ValidationError",
  "message": "The email field is required.",
  "errors": {
    "email": ["The email field is required."]
  },
  "code": 422
}
FieldDescription
errorMachine-readable type: ValidationError, Unauthorized, Forbidden, HttpError, TooManyRequests, InternalServerError
messageHuman-readable description
errorsValidation errors only: field → list of messages
codeHTTP status code

INFO

Responses from the authentication layer (401 and 403 for missing permissions) contain only error and message.

Validation errors (422) ​

bash
curl -X POST https://app.beeving.com/api/v1/contacts \
  -H "Authorization: Bearer TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"email": "invalid-email"}'
json
{
  "error": "ValidationError",
  "message": "The email field must be a valid email address.",
  "errors": {
    "email": ["The email field must be a valid email address."]
  },
  "code": 422
}

Business rule errors also use 422, with no errors object. For example, deleting a pipeline stage that still has deals returns:

json
{
  "error": "HttpError",
  "message": "Cannot delete a stage that has deals. Move or delete the deals first.",
  "code": 422
}

Best practices ​

  • Always send Accept: application/json.
  • Branch on the HTTP status and on error, not on message: the wording of message can change.
  • On 429, wait for the number of seconds in Retry-After before retrying. See Rate limiting.
  • Retry 5xx errors with exponential backoff.

API v1.0