Skip to main content

Getting Started

The SpecCheck API is available at the following base URL: https://api.speccheckrx.com

Request API Access

To request API access, contact support@speccheckrx.com. An API agreement is required before credentials can be issued. Once approved, you’ll receive a client_id and client_secret to obtain an access token for authenticating API requests.

Testing Orders

To test your integration, use your existing account number with the respective lab. Before submitting test orders, coordinate with the lab to ensure they are identified as test orders and are not unintentionally processed for fulfillment.

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.