Skip to main content

Per request options

Every SDK method accepts request options.

Authentication behavior

  • If you set token, the SDK adds authorization: Bearer <token>.
  • If you pass an explicit Authorization header, the SDK keeps your header.
  • You can override token per request.

Tenant scoping behavior

  • Tenant header key is tenant-id.
  • If you set tenantId on the client, it applies to every request.
  • If you set tenantId on a request, it overrides the client value.

Expand behavior

For resources that support expand, you can pass one value or an array.
The SDK serializes array values as comma-separated strings.

Direct request helper

Use sdk.request when you need a low-level call.

Validation errors

For methods that validate request bodies, invalid payloads fail before any HTTP call.

API errors

Non-2xx responses throw ApiClientError.

Response shape

Each successful call returns:
  • status
  • ok (always true for resolved calls)
  • headers
  • body (raw parsed body)
  • data (unwrapped from { data: ... } when present)