API Reference

The Terrantula API is an HTTP REST API that covers the full Terrantula control plane — entity graph, cells, actions, secrets, audit, GitHub integration, and administration. It is the same API that the SDK and CLI use under the hood.

For an interactive explorer where you can browse and try every endpoint, see Scalar explorer.

Authentication

All project-scoped endpoints require a Bearer API token in the Authorization header:

Authorization: Bearer terr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Tokens have a terr_ prefix. There are two token types:

  • Project API tokens — scoped to a specific project; issued under /projects/:projectId/tokens. Use these in CI, the CLI, and service-to-service calls.
  • Personal tokens — org-scoped; issued via the UI or the personal tokens API. Use these for interactive access.

Webhook endpoints are an exception: they authenticate via HMAC-SHA256 (X-Hub-Signature-256 header) and never accept a Bearer token.

RBAC permissions

Every project-scoped endpoint requires a specific permission in addition to a valid token. The required permission is shown inline on each endpoint in this reference. The permission strings follow the pattern resource:action:

PermissionDescription
catalog:readRead entity types, cells, relationship types, actions, environments
catalog:writeMutate catalog configuration
data:readRead entities, relationships, action runs, drift events
data:writeCreate/update/delete entities and relationships
apply:writeTrigger catalog applies (admin and above)
secrets:readList secrets (names only; values are write-only)
secrets:writeCreate and update secrets
secrets:set-valueUpdate secret values
tokens:manageIssue and revoke project API tokens

URL structure

Most endpoints are project-scoped and follow this pattern:

/{orgSlug}/{projectSlug}/...

Where {orgSlug} and {orgSlug}/{projectSlug} are the organization and project slugs, respectively. Org-scoped endpoints are under /orgs/:orgId/.

Resources

The API is organized into resource groups. Each group has a dedicated reference page generated from the live spec.

ResourceDescription
EntityTypesEntity type catalog entries — the schema for your infrastructure assets
CellsCell (pool) definitions — logical groupings of entities
RelationshipTypesRelationship type catalog
ActionsAction definitions — parameterized operations that open PRs
EnvironmentsEnvironment-scoped containers for entities and relationships
EntitiesIndividual infrastructure assets
RelationshipsTyped edges between entities
ActionRunsRecords of action invocations
CatalogRevisionsCatalog revision history
SecretsEncrypted project secrets
ApplyCatalog apply operations
WebhooksInbound GitHub webhook receiver
ProjectsProject CRUD within an org
ProjectTokensProject API token lifecycle
OrgsOrganization management
PersonalTokensPersonal API token lifecycle
ImportSourcesTerraform state import source configuration
GitHubGitHub App integration
AuditEventsAudit log entries
AuditExportAudit export configuration
DriftEventsDrift detection events
StatsProject statistics
GraphViewsSaved graph view configuration
NotificationsNotification delivery
UserPreferencesPer-user UI preferences
AdminAdministrative operations