@airctrl/sdk for JavaScript and TypeScript. These recipes are direct
REST clients, not alternative SDKs.
Shared request rules
Pass your API URL, personal access token, and account ID from your application’s secure configuration. Do not put them in source code, a checked-in file, or a log. Each request sends the token inAuthorization
and selects its account with x-account-id.
Start with listProjects. It is read-only and confirms that the selected identity and account are correct.
It uses limit and offset so your application can continue with the next page when necessary.
The createProject examples show a write. Generate one idempotency key for one intended project. Reuse
the same key only when retrying the same request body.
For every endpoint, use the generated API Reference for its exact path, fields and
response schema. The API cookbook explains larger workflows, and
Errors and retries explains the error envelope and retry rules.
JavaScript
Node.js includesfetch, so this recipe needs no HTTP package.
TypeScript
TypeScript uses the same built-in HTTP client. These types make the required context explicit.Python
This example uses the Python standard library. No third-party HTTP package is required.Go
This example usesnet/http from the Go standard library.
uuid.NewString() from a UUID package your application already uses when you add a create request, and
send that value in Idempotency-Key for retries of the same body.
Java
Java 11 or later includesjava.net.http.HttpClient.
error.code, error.message, and requestId before deciding whether a retry is safe.
C#
UseHttpClient from the .NET runtime and keep one instance for your application lifetime.
Idempotency-Key when your code retries CreateProject with the unchanged JSON body.
Ruby
Ruby includesNet::HTTP, so this recipe has no gem dependency.
PHP
This example uses the cURL extension included with common PHP installations.Handle responses safely
All examples read thedata property after a successful response. On a failure, preserve requestId for
support and make a decision from the HTTP status plus error.code and error.message.
- Fix
400,403, and404before making another request. - Refresh state after
409. - Retry only
429,500, or503with bounded exponential backoff and jitter. - For a retried write, preserve the original idempotency key and exactly the same request body.