API model
- Source of truth: OpenAPI 3.1 specification — download
openapi.json. - Transport: HTTPS with JSON request and response bodies.
- URL shape: Resource paths under
/v1/…, plus:batch-getcollection actions (e.g.POST /v1/orgs:batch-get). - Authentication: PAT bearer token — see Authentication.
- Errors: Stable JSON envelope across every endpoint — see Errors.
OpenAPI spec
The canonical machine-readable contract is the OpenAPI document. Use it to:- Browse endpoints, parameters, and response models in the API Reference section of these docs.
- Generate a typed client in your language with any OpenAPI-compatible tool, for example:
- openapi-typescript or @hey-api/openapi-ts for TypeScript.
- oapi-codegen for Go.
- openapi-generator for Java, Python, C#, Ruby, and more.
Calling the API directly
Every endpoint accepts and returns JSON. A minimalcurl against the Lab environment:
What to configure in every client
- Environment base URL: Lab, Sandbox, or Production (see Introduction).
- Authorization header:
Authorization: Bearer pat_<your_token>. Accept: application/json(andContent-Type: application/jsonfor requests with a body).- Timeouts and retries: configure client defaults for network resiliency. Retry on
5xxand429with backoff; do not retry on4xxother than429. - Error handling: parse the JSON error envelope and branch on its
code— see Errors.