Skip to main content
Use these recipes when you need from a language that does not use the official SDK. They all use the same HTTPS API. Pick the language your application already uses. The only official SDK is @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 in Authorization 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 includes fetch, 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 uses net/http from the Go standard library.
Use 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 includes java.net.http.HttpClient.
Parse the JSON response with the JSON library your application already uses. On a failed response, read error.code, error.message, and requestId before deciding whether a retry is safe.

C#

Use HttpClient from the .NET runtime and keep one instance for your application lifetime.
Keep the same Idempotency-Key when your code retries CreateProject with the unchanged JSON body.

Ruby

Ruby includes Net::HTTP, so this recipe has no gem dependency.

PHP

This example uses the cURL extension included with common PHP installations.
Encode an idempotency key as a UUID or another printable request ID before sending it in an HTTP header.

Handle responses safely

All examples read the data 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, and 404 before making another request.
  • Refresh state after 409.
  • Retry only 429, 500, or 503 with bounded exponential backoff and jitter.
  • For a retried write, preserve the original idempotency key and exactly the same request body.
Never log the token, plaintext record fields, or one-time credential values. For record decryption and encrypted writes, use the SDK, CLI, or MCP on a trusted machine instead of reimplementing cryptography in a REST client.