API Reference
OpenTaco exposes multiple HTTP API surfaces for different use cases:Management API (prefix /v1)
Auth- All endpoints under
/v1
requireAuthorization: Bearer <access>
unless the service is started with-auth-disable
. - Acquire tokens via the
taco login
CLI and see identity viaGET /v1/auth/me
.
POST /v1/units
— createGET /v1/units?prefix=<string>
— listGET /v1/units/{id}
— get metadataDELETE /v1/units/{id}
— deleteGET /v1/units/{id}/download
— download tfstatePOST /v1/units/{id}/upload[?if_locked_by=<uuid>]
— upload tfstatePOST /v1/units/{id}/lock
— acquire lockDELETE /v1/units/{id}/unlock
— release lockGET /v1/units/{id}/status
— dependency-driven status- Response:
- Semantics:
- red: any incoming
pending
- yellow: no incoming pending, but some upstream is red
- green: neither red nor yellow
- red: any incoming
GET /v1/units/{id}/versions
— list all versions with timestamps and hashesPOST /v1/units/{id}/restore
— restore to a specific version by timestamp
- IDs use natural paths like
myapp/prod
; clients may encode asmyapp__prod
for single-segment routes. - Upload respects
if_locked_by
to avoid overwriting when held by a different lock.
GET /v1/auth/config
— Server OIDC config (issuer, client_id, optional endpoints, redirect URIs).POST /v1/auth/exchange
— Exchange OIDC ID token for OpenTaco access/refresh tokens.POST /v1/auth/token
— Refresh to new access (rotates refresh).POST /v1/auth/issue-s3-creds
— Issue stateless STS credentials (requires Bearer).GET /v1/auth/me
— Echo subject/roles/groups from Bearer.GET /oidc/jwks.json
— JWKS with current signing key.
Terraform Cloud API (prefix /tfe/api/v2)
OpenTaco implements the Terraform Cloud API v2 forterraform
cloud
backend compatibility.
Authentication & Discovery
GET /.well-known/terraform.json
— Service discovery (login endpoints, API version)GET /oauth/authorization
— OAuth2 authorization endpoint (PKCE)POST /oauth/token
— OAuth2 token exchange
Organizations & Workspaces
GET /tfe/api/v2/organizations/{org}/entitlement-set
— Organization entitlementsGET /tfe/api/v2/account/details
— User account detailsGET /tfe/api/v2/organizations/{org}/workspaces/{name}
— Get workspace by name
Workspace Operations
POST /tfe/api/v2/workspaces/{id}/actions/lock
— Lock workspacePOST /tfe/api/v2/workspaces/{id}/actions/unlock
— Unlock workspacePOST /tfe/api/v2/workspaces/{id}/actions/force-unlock
— Force unlock workspace
State Management
GET /tfe/api/v2/workspaces/{id}/current-state-version
— Get current state versionPOST /tfe/api/v2/workspaces/{id}/state-versions
— Create new state versionGET /tfe/api/v2/state-versions/{id}
— Get state version detailsGET /tfe/api/v2/state-versions/{id}/download
— Download state content
Upload Endpoints (Auth-exempt)
PUT /tfe/api/v2/state-versions/{id}/upload
— Upload state contentPUT /tfe/api/v2/state-versions/{id}/json-upload
— Upload JSON state outputs
Workspace ID Mapping
OpenTaco maps Terraform Cloud workspace IDs to unit IDs:- Workspace ID
ws-myworkspace
becomes unit IDmyworkspace
- Direct workspace names are used as-is for unit IDs
- RBAC permissions are checked against the converted unit ID