Skip to main content

Getting Started

To get started, make sure you are using the correct client_id and client_secret for the environment you are using.

Staging Environment

For testing and development purposes, please use the staging API at https://api-staging.speccheckrx.com.

Production Environment

For live deployments, access the production API at https://api.speccheckrx.com.

Idempotent Requests

The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. When creating or updating an object, send an idempotency key. If a connection error occurs, you can repeat the request without creating a duplicate object or applying the same update twice. To perform an idempotent request, include an Idempotency-Key header. The API saves the status code and body of the first request for each idempotency key. Subsequent requests with the same key return the same result. Generate a unique idempotency key for each distinct operation. V4 UUIDs work well. Keys may be up to 255 characters. Do not use sensitive data (for example, email addresses or patient identifiers) as idempotency keys. The idempotency layer compares incoming parameters to those of the original request and returns an error if they differ, to prevent accidental misuse. All POST requests accept idempotency keys. Do not send idempotency keys on GET requests; they have no effect because those requests are idempotent by definition.

Error Handling

Errors return a JSON response with an error object describing what went wrong. Failed requests return HTTP 4xx or 5xx status codes. The error object always includes type and message. When present, code is a stable, machine-readable string (for example, invalid_request), and param identifies the related input field or header.
code and param are omitted when not applicable.

Error Types

Error messages and status codes may vary by endpoint. Always use the error object together with the HTTP status when handling failures.