reference

Conventions, errors, pagination and the endpoints you'll use most.

REST API reference

Base URL: https://api.tngat.com. All requests are JSON and authenticated with Authorization: Bearer <api-key>.

Scoping

Org-scoped requests accept an optional ?orgId= override; without it the caller's active organization is used. Project- and service-scoped routes derive the org from the resource and verify the caller's role on it.

Listing and pagination

List endpoints accept ?limit=, ?cursor= and, on services, ?q= for search. The response body stays a plain array for compatibility, and the paging metadata rides in headers:

HeaderMeaning
x-page-limitThe effective page size.
x-has-moretrue when another page exists.
x-next-cursorPass as ?cursor= to fetch the next page.

Errors

Every failure carries a JSON body with a human-readable message, a stable machine-readable code, and the conventional error label:

json
{ "error": "Conflict", "message": "This project already has 20 databases…", "code": "resource_limit_exceeded" }

Branch on code, never on the message — the message is written for a person and can be reworded, the code is part of the contract.

StatuscodeMeaning
400validation_errorThe request is malformed or a referenced resource is not a valid target.
401unauthorizedMissing, invalid or revoked credentials.
403forbiddenAuthenticated, but the role lacks the permission; the message names it.
404not_foundNot found, or not visible to this organization.
409conflictA slug or hostname is already taken.
409resource_limit_exceededA published resource cap was reached (see Limits & quotas).
429rate_limitedToo many requests; a retry-after header says how long to wait.
503org_suspendedThe organization is suspended; provisioning is paused. Not a permission problem — retry once the freeze lifts.
500internal_errorAn unexpected failure. The reason is logged server-side, never returned.

A status outside the table falls back to request_failed (or internal_error for a 5xx), and a product may tag a more specific code than its status implies — resource_limit_exceeded on a 409 and org_suspended on a 503 are the two the platform distinguishes today. Treat an unfamiliar code as a refusal and show the message.

Most-used endpoints

The complete per-service list is on the REST endpoints page; these are the calls most integrations start with.

MethodPathPurpose
GET/api/projectsList projects in the active org.
POST/api/projectsCreate a project and its environments.
POST/api/v1/projects/:slug/transferMove a project to another org.
GET/api/v1/projects/:slug/environmentsEnvironments and their variables.
POST/api/v1/databasesProvision a managed database.
POST/api/v1/storageCreate a bucket.
POST/api/v1/sandboxesCreate a sandbox.
WebSocket/api/v1/sandboxes/:id/terminalA shell in a sandbox (session cookie, not an API key).
WebSocket/api/v1/apps/:projectId/:serviceName/terminalA shell in a deployed app service.
POST/api/v1/functionsDeploy an edge function.
GET/api/auditQuery the audit log.
GET/api/org/exportExport a secret-free tenant document.

Audit

Every mutating call writes an audit row naming the actor, the action, the target and the request outcome. Machine actors are recorded separately from people, so a service account's changes are distinguishable from a member's.