BoldSales

API Documentation

Responses and status codes

All API responses are returned in JSON format and follow a consistent structure to indicate the outcome of each request. This section outlines how to interpret success and error responses, including HTTP status codes and response body formats.

Common HTTP Status Codes

The following table shows the HTTP status codes used in the BoldSales API.

Status CodeMessage
200OK
201Created
400Client or Validation Error
401Authentication Failure
403Access Denied
404API or Item Not Found
405Method Not Allowed
415Unsupported Media Type
429Rate Limit Exceeded
500Unexpected Server Error

Success Responses

When a request is successful, the API returns a data object containing relevant information. For write operations such as POST, PUT, PATCH, and DELETE, a message field may also be included to provide a human-readable description of the outcome.

Example

{
  "message": "Contact created successfully.",
  "data": {
    "id": 202730
  }
}

Error Responses

When a request fails, the API returns an error response with details about what went wrong. This includes a general message, a list of errors, and a statusCode.

Client or Validation error

This error indicates that the server cannot process the request because of a client error, such as invalid request message framing or deceptive request routing.

Error TypeDescription
DuplicateValueThe requested update in the field or entry already exists
FieldRequiredOne or more required fields are missing from the request.
InvalidValueThe value provided for the field is not valid
LengthExceededThe value provided for the field exceeds the prescribed limit
NotFoundThe requested details for updating/fetching a metric/log/entry/detail are not found
APICallQuotaExceededThe request has been restricted due to the subscription limit of the organization
MethodNotAllowedThe request or value for the field is not allowed due to client validation or authorization restrictions
{
  "errors": [
    {
      "field": "EmailAddress",
      "errorMessage": "[email protected] already exists.",
      "errorType": "DuplicateValue"
    }
  ],
  "message": "Validation failed.",
  "statusCode": 400
}

Authentication failure

As indicated by the status code, either the Authorization header is missing or incorrect.

{
  "errors": [
    {
      "field": "userId",
      "errorMessage": "Current user does not have permission to perform this action.",
      "errorType": "Unauthorized"
    }
  ],
  "message": "Unauthorized",
  "statusCode": 401
}

Access denied

This error indicates that the server received the request but denied it because the user does not have the required permissions.

{
  "errors": [
    {
      "field": "userId",
      "errorMessage": "Current user does not have permission to perform this action.",
      "errorType": "AccessDenied"
    }
  ],
  "message": "Access Denied",
  "statusCode": 403
}

API or Item not found

Either the API URL or the object ID in the request is invalid.

{
  "errors": [
    {
      "field": "fieldId",
      "errorMessage": "Field does not exist.",
      "errorType": "NotFound"
    }
  ],
  "message": "Not found",
  "statusCode": 404
}

Method not allowed

This error indicates that the HTTP method used in the request is not allowed for this endpoint.

{
    "errors": [
        {
            "field": "", 
            "errorMessage": "Method not allowed", 
            "errorType": "MethodNotAllowed" 
        }
    ],
    "message": "Method not allowed", 
    "statusCode": 405 
}

Unsupported media type

This errorCode value appears if the server refuses the request as a result of receiving the input in an unsupported format.

{ 
    "errors": [ 
        { 
            "field": "", 
            "errorMessage": "Unsupported Media Type", 
            "errorType": "UnsupportedMediaType" 
        } 
    ], 
    "message": "Unsupported Media Type", 
    "statusCode": 415 
}

Rate limit exceeded

It indicates that the maximum number of requests has been reached. A rate limit is established based on the organization's plan.

{
  "errors": [
    {
      "field": "",
      "errorMessage": "Rate limit exceeded! Maximum allowed token cost is 10000 per hour.",
      "errorType": "APICallQuotaExceeded"
    }
  ],
  "message": "Rate limit exceeded! Maximum allowed token cost is 10000 per hour.",
  "statusCode": 429
}