Skip to main content
All methods below belong to AirctrlClient. Method names are the stable developer bindings verified against the public API. For a runnable TypeScript example of every method, continue to SDK examples.

Identity availability

A human PAT may call every method on this page when RBAC permits it. A Service Account may call only:
  • listRecords() and listProjectRecords().
  • getSecret(), readRecord() and getAll().
  • listProviders().
  • getGateway(), listGatewayTokens(), listGatewayLogs(), getGatewayLogDetail() and listGatewayKeyAccess().
Every other method is human-only. The SDK does not turn a human-only API operation into a Service Account operation. RBAC and record key access can further reduce what either identity may do.

Context and projects

Record reading and creation

Record lifecycle and sharing

Record history and audit

Providers and gateways

Gateway tokens

Gateway observability

listGatewayLogs and listUsageLogs return pagination.next_cursor. Continue by passing it as cursor with the same scope and filters. Cursor and legacy offset are mutually exclusive.

Service Account metadata

These metadata methods require a human PAT. The table above is the supported developer binding layer. The package separately exports advanced first-party primitives used by the Web app and CLI for Service Account credential lifecycle and identity rotation. Their presence does not create equivalent lifecycle commands or tools in the public CLI or MCP server; consult the installed TypeScript declarations before deliberately integrating those lower-level exports.

Groups and access material

These methods require a human PAT. Team+ enables collaboration; RBAC and PAT scope still apply. Revocation does not need a vault unlock. See effective access and pending material. Membership, deletion and project-grant results include changed, wrappersDeleted, projectWrappersDeleted and per-resource changes. These are server snapshots, not proof of completed client encryption. Inspect material_pending, rekey_queued and remaining sources. Reconciliation returns attemptedProjectIds; missing holder material can remain pending. Optional projectIds restrict projects, not pending direct group-record repairs in the account. Reconciliation does not grant permissions.

Exact method signatures

Optional values end with ?. Input types are exported by @airctrl/sdk, so your editor can show every field and accepted value. For readRecord, scope accepts record sections only: fields, meta, owner, access, or full. fields decrypts and returns the complete field map; it does not select individual field names. Omit environment for General, or pass development, staging, or production to select that value. A missing value never falls back to another scope; the PAT or Service Account token must permit the selection.
Context and projects
Groups
GroupInput has required name: string and optional description: string. Keep the passphrase local; vaultPassword is the existing SDK parameter name.
Records
Providers and gateways
Service Account metadata

Input and result rules

  • IDs are UUID strings. Keep account, project, record, gateway, token and credential IDs separate.
  • Methods with accountId select the active account. The value never grants access.
  • List methods return arrays or paginated objects. Empty access returns an empty result, not broader data.
  • getProject() and getServiceAccount() can return null when the resource is unavailable.
  • Write methods that create a resource return its new identifier or resource metadata.
  • Methods that return no resource resolve successfully without a value.
  • Record plaintext is accepted or returned only by client-side crypto methods. Raw HTTP methods work with encrypted material.
  • Provider secrets and newly created gateway tokens are one-time values. Do not log their result.

End-to-end examples

Create a project, then create an encrypted record inside it:
Read only metadata first, then decrypt only when the process needs the value:
Create a gateway token and display the one-time value only to the custody step:
Read project-wide usage without requesting stored request bodies:

Failure behavior

Every API failure throws AirctrlError. Inspect its fields instead of parsing prose.
Do not retry 400, 403, or 404 unchanged. Retry temporary 429, 500, or 503 failures with bounded exponential backoff. Reuse the same idempotency key only for the same intended write.

OAuth partner backend

OAuth partner methods run only in a confidential backend. Keep the client secret and every returned token in a secret manager; never send them to browser storage or logs. Use createPkce() for each authorization transaction. It returns a fresh 43-character verifier and its SHA-256 base64url challenge; persist the verifier only in the short-lived server transaction. Every OAuth App remains owned and managed by the organization that registered it. A private App can be installed only there. A public App presents an organization selector containing only active organizations where the approving user holds oauth-installations:connect; each resulting installation and token remains bound to the selected customer organization. Active subscription, trial, and payment-retry (past_due) states qualify. The SDK flow and its protection, logs, and spend methods are otherwise identical for private and public Apps; the installation binding enforces the organization boundary. Use Discover the authorization server to select Production or QA and read the current authorization, token, and revocation endpoints. Local development values are in Environments. implements OAuth 2.0 authorization, not OpenID Connect login: it intentionally does not issue ID Tokens or expose a UserInfo endpoint.
Every protected external key returns its own protectionId. Store that ID next to the partner’s stable external key ID. Lifecycle calls never accept the parent OAuth connection ID.
The preflight performs no writes and receives no provider key. On the first successful protection, creates one internal Service Account and one dedicated project for the connection. Each protection then creates one encrypted provider credential, one independently configured gateway, its model bindings and one runtime gateway token. The provider key is validated and encrypted at rest; it is never returned. The same idempotency key may only replay the same request. Serialize refreshes per installation; concurrent reuse revokes the refresh-token family. If a newer runtime-token operation supersedes an older idempotency key, returns idempotency_operation_superseded. Omit otel.headers in updateProtection() to preserve current headers; send null or {} to clear them. Disconnecting revokes OAuth/runtime access and disables the internal Service Account. It never deletes the project, credentials, gateways, settings, logs or audit history. OAuthPartnerClient failures throw AirctrlOAuthError, not AirctrlError. Inspect status, error, and optional description; do not parse the message string.
SDK helper: createPkce()SDK types: OAuthScope, OAuthTokenSet, OAuthGatewaySettings, OAuthProtection, OAuthGatewayPreflight, OAuthProvider, OAuthProviderModel, OAuthProviderModelCapability, OAuthProviderModelPricing, OAuthProviderModelsDiscovery, OAuthProtectionProvisionInput, OAuthProtectionUpdateInput, OAuthProtectionLog, OAuthProtectionLogs, and OAuthProtectionSpendSDK method: authorizationUrl()SDK method: exchangeCode()SDK method: refresh()SDK method: revoke()SDK method: listProvisioningProviders()SDK method: discoverProvisioningProviderModels()SDK method: preflightProtection()SDK method: provisionProtection()SDK method: listProtections()SDK method: getProtection()SDK method: updateProtection()SDK method: listProtectionLogs()SDK method: getProtectionSpend()SDK method: revokeProtection()SDK method: rotateProtectionProviderKey()SDK method: rotateProtectionRuntimeToken()SDK method: reactivateProtection()