Error Responses

Our error responses can tell you which request body fields failed and why.

Wristband APIs return errors as either a JSON serialized ApiError or ConstraintViolationsApiError object.

ApiError Response

This is the default error response for most errors.

Response Fields

NameTypeDescription
typeStringThe type of the error object.
codeStringThe API error code.
messageStringThe API error message.
ticketStringString for support and debugging purposes.

Example Response

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
  "type": "base_error",
  "code": "invalid_request",
  "message": "The count parameter must be greater than or equal to 0",
  "ticket": "v1c7nblicpvqia7fia8r5d2qeu"
}

ConstraintViolationsApiError Response

This error response is for invalid fields within an API request, with error codes specific to those fields.

Response Fields

NameTypeDescription
typeStringThe type of the error object.
codeStringThe API error code.
messageStringThe API error message.
ticketStringString for support and debugging purposes.
violationsMap<String, List>Map with field names as keys and lists of ConstraintViolationDetails as values for fields with validation errors.

ConstraintViolationDetails

NameTypeDescription
codeStringField-specific error code indicating the issue with the request value.
constraintAttributesMap<String, String>(Optional) Map describing the constraint that was violated, with attribute names as keys and values as attribute values.

Example Response

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
  "type": "constraint_violations_error",
  "code": "message_body_constraint_violations",
  "message": "Field violations detected while trying to create a user",
  "ticket": "jgqgau2nj4eobeaje6m4jhoop8",
  "violations": {
    "username": [{
      "code": "too_long",
      "constraintAttributes": {
        "maxLength": "200"
      }
    }],
    "externalId": [{
      "code": "not_unique"
    }]
  }
}