Skip to content

Takosumi API

The Takosumi API exposes the control plane that runs OpenTofu / Terraform modules from Git. Terms like Workspace, Capsule, and Run are in the glossary.

Discovering endpoints

Every endpoint exposes the following discovery surfaces.

http
GET /.well-known/takosumi
GET /v1/capabilities

CLI, dashboard, and other clients refer to capabilities, not edition names.

json
{
  "product": "takosumi",
  "apiBaseUrl": "https://takosumi.example.com/api/v1",
  "api_versions": ["takosumi.dev/v1alpha1"],
  "features": {
    "stacks": true,
    "opentofu_runner": true,
    "oidc": true
  },
  "endpoints": {
    "api": "https://takosumi.example.com/api",
    "capabilities": "https://takosumi.example.com/v1/capabilities",
    "oidc_issuer": "https://takosumi.example.com"
  }
}

Field names are snake_case. product is always takosumi; clients check it first. endpoints.api is <origin>/api, not the origin itself.

Authentication

Clients use a session cookie or a bearer token, depending on the endpoint.

http
Authorization: Bearer <token>

Every endpoint publishes the auth methods its operator enabled as capabilities. A Takosumi Cloud API key is a personal access token. When the protocol itself defines a signature (such as an S3-compatible endpoint), use that signature.

OpenTofu Stack API

The Stack API runs OpenTofu / Terraform modules from Git. Existing providers are used as-is, and every run goes plan → apply. All Stack API endpoints live under /api/v1.

The Cloudflare-specific import/deploy compatibility profile is retired.

Workspace

MethodPathDescription
GET/api/v1/workspacesList the workspaces you belong to
POST/api/v1/workspacesCreate a workspace
GET/api/v1/workspaces/{workspaceId}Read a workspace
PATCH/api/v1/workspaces/{workspaceId}Update a workspace
GET/api/v1/workspaces/{workspaceId}/membersList members
POST/api/v1/workspaces/{workspaceId}/membersAdd a member
PATCH/api/v1/workspaces/{workspaceId}/members/{subject}Change a member's role
DELETE/api/v1/workspaces/{workspaceId}/members/{subject}Remove a member
GET/api/v1/workspaces/{workspaceId}/graphRead the Capsule dependency graph
GET/api/v1/workspaces/{workspaceId}/activityList activity
GET/api/v1/workspaces/{workspaceId}/usageList usage
GET/api/v1/workspaces/{workspaceId}/billingRead billing state
GET/api/v1/workspaces/{workspaceId}/backupsList control-plane exports
POST/api/v1/workspaces/{workspaceId}/backupsExport control-plane data
POST/api/v1/workspaces/{workspaceId}/plan-updateCreate a workspace-wide update Run
POST/api/v1/workspaces/{workspaceId}/drift-checkCreate a workspace-wide drift-check Run

Create a Workspace

POST /api/v1/workspaces

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/workspaces" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN" \
  -H 'content-type: application/json' \
  -d '{
    "name": "production",
    "handle": "prod"
  }'
FieldTypeDescription
namestringdisplay name
handlestringunique identifier

On success it returns 201 with the Workspace (including workspaceId).

Read a Workspace

GET /api/v1/workspaces/{workspaceId}

bash
curl -s "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/workspaces/ws_example" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

Project and Capsule

MethodPathDescription
GET/api/v1/workspaces/{workspaceId}/projectsList projects
POST/api/v1/workspaces/{workspaceId}/projectsCreate a project
GET/api/v1/projects/{projectId}Read a project
GET/api/v1/workspaces/{workspaceId}/capsulesList capsules
POST/api/v1/workspaces/{workspaceId}/capsulesCreate a capsule
GET/api/v1/capsules/{capsuleId}Read a capsule
PATCH/api/v1/capsules/{capsuleId}Update a capsule
DELETE/api/v1/capsules/{capsuleId}Create a destroy plan
GET/api/v1/capsules/{capsuleId}/outputsRead public outputs
GET/api/v1/capsules/{capsuleId}/usage-summaryRead the usage summary
GET/api/v1/capsules/{capsuleId}/state-versionsList state versions
GET/api/v1/capsules/{capsuleId}/dependenciesList dependencies
POST/api/v1/capsules/{capsuleId}/dependenciesCreate a dependency
DELETE/api/v1/dependencies/{dependencyId}Delete a dependency
GET/api/v1/capsules/{capsuleId}/provider-bindingsRead the ProviderBinding selection
PUT/api/v1/capsules/{capsuleId}/provider-bindingsReplace the ProviderBinding selection
GET/api/v1/workspaces/{workspaceId}/current-state-versionsRead all current state versions
GET/api/v1/capsule-configsList Capsule creation settings
GET/api/v1/capsule-configs/{capsuleConfigId}Read a Capsule creation setting
PATCH/api/v1/capsule-configs/{capsuleConfigId}Update a Capsule creation setting

A Capsule starts with a plan. Create it, then run plan → apply.

MethodPathDescription
POST/api/v1/capsules/{capsuleId}/planCreate a plan Run
POST/api/v1/capsules/{capsuleId}/destroy-planCreate a destroy plan Run
POST/api/v1/capsules/{capsuleId}/drift-checkCreate a drift-check Run
POST/api/v1/capsules/{capsuleId}/backupsCreate a Capsule backup

Create a Capsule

POST /api/v1/workspaces/{workspaceId}/capsules

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/workspaces/ws_example/capsules" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN" \
  -H 'content-type: application/json' \
  -d '{
    "name": "example-app",
    "environment": "production",
    "sourceId": "src_example",
    "installConfigId": "capcfg_example"
  }'
FieldTypeDescription
namestringCapsule name, a DNS-style slug ([a-z0-9-]+)
environmentstringenvironment name (e.g. production)
sourceIdstringthe registered Source
installConfigIdstringthe Capsule creation settings (variables, bindings)
projectIdstring?a non-default Project
autoUpdateboolean?create a plan per new snapshot. Defaults to false

Create a plan

POST /api/v1/capsules/{capsuleId}/plan

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/capsules/cap_example/plan" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

A Run always starts as a plan. Use the returned Run's id next.

Read a Run

GET /api/v1/runs/{runId}

bash
curl -s "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/runs/run_example" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

takosumi status run_example
takosumi logs run_example

Approve and apply

Approve first when the configuration requires approval.

POST /api/v1/runs/{runId}/approve

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/runs/run_example/approve" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

POST /api/v1/runs/{runId}/apply

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/runs/run_example/apply" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

Cancel

POST /api/v1/runs/{runId}/cancel

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/runs/run_example/cancel" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

The cancellation is recorded too.

Destroy

DELETE /api/v1/capsules/{capsuleId}

bash
curl -X DELETE "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/capsules/cap_example" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

Delete creates a destroy plan. Review it, then apply.

Source

MethodPathDescription
GET/api/v1/sourcesList sources
POST/api/v1/sourcesCreate a source
GET/api/v1/sources/{sourceId}Read a source
PATCH/api/v1/sources/{sourceId}Update source metadata
POST/api/v1/sources/{sourceId}/syncCreate a sync Run
GET/api/v1/sources/{sourceId}/snapshotsList source snapshots
POST/api/v1/sources/{sourceId}/compatibility-checkCreate a compatibility report
GET/api/v1/compatibility-reports/{reportId}Read a compatibility report

Create a Source

POST /api/v1/sources

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/sources" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN" \
  -H 'content-type: application/json' \
  -d '{
    "workspaceId": "ws_example",
    "name": "example-app",
    "url": "https://github.com/example/example-app.git",
    "defaultRef": "v1.2.0",
    "defaultPath": "deploy/opentofu"
  }'
FieldTypeDescription
workspaceIdstringthe Workspace it belongs to
namestringname
urlstringthe Git repository URL
defaultRefstring?branch / tag / commit to track. Defaults to HEAD
defaultPathstring?the module directory. Defaults to .
authConnectionIdstring?a Connection for private repositories
autoSyncboolean?periodic ref checks. Defaults to false

On success it returns 201 with the Source. The hookSecret in the response is only visible this once — save it now if you set a webhook.

Sync a Source

POST /api/v1/sources/{sourceId}/sync

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/sources/src_example/sync" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN" \
  -H 'content-type: application/json' \
  -d '{ "intent": "manual_plan" }'

intent is observe (default) or manual_plan. Wait until the sync Run is succeeded and sourceSnapshotId appears under /api/v1/sources/{sourceId}/snapshots before planning.

List SourceSnapshots

GET /api/v1/sources/{sourceId}/snapshots

bash
curl -s "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/sources/src_example/snapshots" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

Run and StateVersion

MethodPathDescription
GET/api/v1/workspaces/{workspaceId}/runsList runs
GET/api/v1/runs/{runId}Read a run
POST/api/v1/runs/{runId}/approveApprove a run
POST/api/v1/runs/{runId}/applyApply a reviewed run
POST/api/v1/runs/{runId}/cancelCancel a run
GET/api/v1/runs/{runId}/logsRead run logs
GET/api/v1/runs/{runId}/eventsRead run events
GET/api/v1/runs/{runId}/costRead the cost estimate
GET/api/v1/run-groups/{runGroupId}Read a batch of runs
POST/api/v1/run-groups/{runGroupId}/approveApprove a batch of runs
GET/api/v1/state-versions/{stateVersionId}Read a state version
POST/api/v1/state-versions/{stateVersionId}/rollback-planPlan a rollback to a past state

A Run records:

  • the source snapshot (which commit ran)
  • the OpenTofu version, provider lock digest, and ProviderBinding
  • injected env metadata (never the values)
  • plan/apply results, state version, outputs, logs, actor, and audit evidence

Connections and output sharing

MethodPathDescription
GET/api/v1/connectionsList connections
POST/api/v1/connectionsCreate a write-only connection
POST/api/v1/connections/{connectionId}/testValidate a connection
POST/api/v1/connections/{connectionId}/revokeRevoke a connection
POST/api/v1/connections/oauth/{helperId}/startStart an OAuth helper
GET/api/v1/connections/oauth/{helperId}/callbackComplete an OAuth helper
GET/api/v1/provider-connectionsList the ProviderConnections a Workspace sees
GET/api/v1/credential-recipesList credential recipes
GET/api/v1/output-sharesList output shares
POST/api/v1/output-sharesCreate an output share
POST/api/v1/output-shares/{shareId}/approveApprove an output share
POST/api/v1/output-shares/{shareId}/revokeRevoke an output share

Create a Connection

POST /api/v1/connections

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/connections" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN" \
  -H 'content-type: application/json' \
  -d '{
    "provider": "registry.opentofu.org/example/example",
    "recipe": "generic-env",
    "authMode": "env",
    "secretPartition": "provider-credentials",
    "values": { "EXAMPLE_API_KEY": "<secret>" }
  }'
FieldTypeDescription
providerstringthe fully qualified provider address
recipestringthe Credential Recipe id
authModestringenv (inject as environment variables), and others
secretPartitionstringthe secret storage partition
values / filesobjectthe secrets. Not readable after creation

The CLI is convenient too.

bash
takosumi connections create \
  --provider registry.opentofu.org/example/example \
  --recipe generic-env --auth-mode env \
  --secret-partition provider-credentials \
  --values-file ./provider-credentials.json

Test

POST /api/v1/connections/{connectionId}/test

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/connections/conn_123/test" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

takosumi connections test conn_123

Revoke

POST /api/v1/connections/{connectionId}/revoke

bash
curl -X POST "$TAKOSUMI_DEPLOY_CONTROL_URL/api/v1/connections/conn_123/revoke" \
  -H "authorization: Bearer $TAKOSUMI_DEPLOY_CONTROL_TOKEN"

takosumi connections revoke conn_123

Revocation is not deletion. Later Runs cannot use it; past records remain.

Dashboard projections

MethodPathDescription
GET/api/v1/dashboard/bootstrapRead everything the first screen needs
GET/api/v1/dashboard/overviewRead the Workspace overview

OIDC and workload identity

Takosumi Accounts exposes the standard issuer surface for registered OIDC clients.

http
GET  /.well-known/openid-configuration
GET  /oauth/jwks
GET  /oauth/authorize
POST /oauth/token

A Capsule's OIDC client can declare the scopes it needs with installExperience.oidc_client.scopes; openid is required. Access tokens issued by Accounts are bound to a single Workspace, and the token is stored encrypted in the consumer's secret store.

Error format

Failed responses return a structured error.

json
{
  "error": {
    "code": "capability_not_available",
    "message": "requested capability is not enabled for this endpoint",
    "requestId": "req_123"
  }
}

Versioning

The current API version is takosumi.dev/v1alpha1.

versionMeaning
v1alpha1Breaking changes allowed; docs and conformance update together
v1beta1Mostly fixed; upgrade/conversion guidance required
v1Backward compatible; fields are never removed

AGPL-3.0-only