Skip to main content

Creating a Request

Requests and responses follow standard HTTP response status codes for success and failures. Request bodies should have content type application/json and be valid JSON. For instructions on creating a valid X-CB-ACCESS-SIGNATURE, see API Authentication.

Required IDs

Many API requests require either a portfolio_id or an entity_id value:

Sample Requests

The following Python and JavaScript snippets demonstrate an end-to-end Prime API request.

Python

JavaScript

Errors

Unless otherwise stated, bad requests respond with HTTP 4xx or 5xx status codes. The body also contains a message parameter indicating the cause. Your implementation language’s HTTP library should be configured to provide message bodies for non-2xx requests so that you can read the message field from the body.

Common error codes

Success

A successful response is indicated by HTTP status code 200 and may contain an optional body. If the response has a body, it will be documented under the related endpoint resource below.