Skip to main content

Error Handling & Types

Handling APIError

Every non-2xx response from the control plane throws an APIError. status is the HTTP status, message is the server’s error field (or the status text when there is none), and data is the parsed response body. What each status means is listed in Error Codes.

IAM Role Identifiers

Role ids appear in Session.role, OrganizationMembership.role_id, Invitation.role_id and IAM bindings. Compare them against IAM_ROLE_IDS (or the IAMRoleID type) rather than strings like "admin":

Exported Type Interfaces

The SDK exports types for the control plane’s entities, among them: