No custom OAuth app setup required. Sign in or provide your credentials to connect.
Authentication: API key. Enter your Spacelift account host, API key ID, and secret. Create a Secret API key under Organization settings > API keys. Give it Read access for read-only tools or Write or Admin access for changes. Use the full account host for US accounts, such as acme.app.us.spacelift.io. See Spacelift API authentication.
Sample use cases
- Find stacks and inspect their runs, logs, and planned changes
- Manage contexts, policies, spaces, and stack dependencies
- Trigger runs and review infrastructure changes
Available tools
Pass an upstream stack output to the downstream stack as a variable on a dependency.
Attach a context to a stack or module with a priority.
Attach a policy to a stack or module (LOGIN and ACCESS policies cannot be attached).
Cancel a run that has not started yet (QUEUED/READY/PENDING).
Confirm an UNCONFIRMED tracked run so it applies its plan.
Create a blueprint (DRAFT, or PUBLISHED with a template).
Create a context. Call search_spaces first for a space ID; add variables with set_context_config and attach it with attach_context.
Turn on drift detection for a stack on a cron schedule.
Create a module tracking a repository branch.
Publish a new module version from a commit (default: tracked branch head) with an explicit semantic version or an automatic patch bump.
Create a Rego policy of a given type. Destructive: an ‘autoattach:’ label attaches it to matching stacks at once, where TRIGGER/APPROVAL policies can start or approve runs.
Post a comment on a run. Use list_stack_runs or search_runs to find run IDs.
Schedule deletion of a stack (cron or one-off Unix time).
Schedule tracked runs on a stack by cron expression or a one-off Unix time (exactly one), with optional env vars.
Schedule a command (task) on a stack by cron expression or a one-off Unix time (exactly one).
Create a space under a parent space. Call search_spaces first for the parent ID. Returns the new space ID.
Create a stack tracking a repository branch.
Make stack_id depend on depends_on_stack_id.
Create stack(s) from a PUBLISHED blueprint with template input values.
Create a task: run a one-off shell command (e.g. ‘tofu state list’) in a stack’s workspace.
Create a named webhook that posts Spacelift events to an HTTPS endpoint, optionally signed with a secret (never echoed back).
Cycle a worker pool: tell every worker to finish its current run and restart (e.g. after rotating config).
Delete a blueprint. Stacks already created from it are kept. Use search_blueprints to find IDs.
Delete a context. Fails while it is attached to stacks unless force=true, which detaches it everywhere first.
Delete an environment variable or mounted file from a context. Use get_context to list config element IDs.
Remove an output-to-input reference from a dependency.
Turn off drift detection for a stack. Inverse of create_drift_detection. Use search_stacks to find stack IDs.
Permanently delete a module and its versions. Fails if deletion protection is on. Use search_modules to find module IDs.
Delete a module version that no stack uses (yank_module_version hides a used one instead).
Delete a policy. Fails while it is attached to stacks unless force=true, which detaches it everywhere first.
Cancel a scheduled stack deletion. Inverse of create_scheduled_delete. Use list_scheduled_deletes to find IDs.
Delete a scheduled run. Inverse of create_scheduled_run. Use list_scheduled_runs to find schedule IDs.
Delete a scheduled task. Inverse of create_scheduled_task. Use list_scheduled_tasks to find schedule IDs.
Delete an empty space. Fails while it still has child spaces, stacks, contexts, policies, modules or worker pools.
Permanently delete a stack. DANGER: destroy_resources=true first destroys every cloud resource it manages.
Delete an environment variable or mounted file from a stack. Use list_stack_config to list config element IDs.
Remove a stack dependency and its references.
Delete a named webhook. Inverse of create_webhook. Use search_webhooks to find IDs.
Delete a worker pool. Fails while stacks or modules still use it. Use search_worker_pools to find IDs.
Detach a context from a stack by attachment ID.
Detach a policy from a stack by attachment ID.
Disable a module so no new versions can be created. Inverse of enable_module. Use search_modules to find module IDs.
Disable a stack so no runs can be created on it. Inverse of enable_stack. Use search_stacks to find stack IDs.
Discard an UNCONFIRMED tracked run so its plan is never applied.
Enable a disabled module so new versions can be created.
Enable a disabled stack so it can create runs again. Inverse of disable_stack. Use search_stacks to find stack IDs.
Get one API key’s details and space access rules (the secret is never returned). Use list_api_keys to find IDs.
Get one blueprint with its YAML template and the inputs it asks for. Use search_blueprints to find blueprint IDs.
Get one context with its config elements (secret values and file mount contents are null) and the stacks it is attached to, including attachment IDs for detach_context.
Get the identity this API key authenticates as (ID, name, admin flag, teams, token expiry).
Get one module with its source string and current and latest versions. Use search_modules to find module IDs.
Get one module version with its state, yank status, consumers count and commit.
Get one policy with its Rego body and the stacks it is attached to (with attachment IDs for detach_policy).
Get a sampled policy evaluation: the input document, policy body, results and outcome.
Get one RBAC role with the actions it grants and its binding count. Use list_roles to find role IDs.
Get one run (tracked, proposed or task) by ID with its state history, which lists the states that have logs for get_run_logs.
List a run’s planned or applied resource changes (address, change type, result), filtered by phase and change type, capped at max_resources.
Read a run’s logs (ANSI-sanitized). With state null, returns every state that has logs; output is capped at max_lines.
Get one space with its parent, inheritance and this API key’s access level. Use search_spaces to find space IDs.
Get one stack by ID with its tracked commit, blocking run, attached contexts, policies and cloud integrations (with attachment IDs for detach tools) and drift detection.
Get one user with role, status, groups and space access rules. Use list_users to find user IDs.
Get one named webhook (endpoint, enabled, space, labels; the secret is never returned). Use search_webhooks to find IDs.
Get one worker pool with its workers (IDs, status, drained flag) and queue counts. Use search_worker_pools to find IDs.
List the account’s API keys with type, admin flag, space access rules and last use (secrets are never returned).
List the branches of a repository. Use list_repositories for provider, namespace and repository first; pass a branch to create_stack.
List a module’s versions, newest first, filterable by state and text, with cursor pagination.
List OpenTofu versions Spacelift supports. Use for the OPENTOFU vendor version on create_stack/update_stack.
List a policy’s recorded evaluations (key, outcome, time), newest first, filterable by outcome, with cursor pagination.
List policy inputs captured in a space for a policy type, newest first (login inputs live under root).
List repositories Spacelift can see through a VCS integration, optionally filtered by substring.
List RBAC roles (built-in and custom) with the actions each grants. Use get_role for one role.
List a stack’s scheduled deletions (when the stack itself will be deleted). Use search_stacks to find stack IDs.
List a stack’s scheduled tracked runs (cron or one-off). Use search_stacks to find stack IDs.
List a stack’s scheduled tasks (commands on a cron or one-off schedule). Use search_stacks to find stack IDs.
List a stack’s own environment variables and mounted files (not those from attached contexts).
List the stacks a stack depends on, with dependency IDs and their output-to-input references.
List a stack’s outputs (name, value, sensitive flag).
List a stack’s proposed (PR / plan-only) runs, newest first, 10 per page (pass page_info.cursor for older ones).
List a stack’s tracked runs, newest first, 10 per page (pass page_info.cursor for older runs).
List a stack’s tasks (one-off commands from create_task), newest first, 10 per page (pass page_info.cursor for older ones).
List Terraform versions Spacelift supports. Use for terraform_version on create_stack/update_stack.
List identity-provider user groups mapped to space access, with members and access rules. Admin only.
List the account’s users with role, status, login method and space access rules. Admin only. Use get_user for one user.
Lock a stack for exclusive use by this API key, with an optional note.
Promote a finished proposed run to a tracked run on the same commit.
Re-plan an UNCONFIRMED run limited to specific resource addresses (targeted replan).
Retry a FAILED or STOPPED run as a new run on the same commit.
Add an APPROVE or REJECT review to a run (used by approval policies).
Search the account audit trail, newest first, by action (wildcards), a created_at window (Unix seconds) and free text, with cursor pagination.
Search blueprints (templated stack definitions) by state, labels and free text, with cursor pagination.
Search contexts (reusable env vars, files and hooks) by space, labels and free text, with cursor pagination.
Search modules in the private registry by provider, space, labels, public flag and free text, with cursor pagination.
Search policies by type, space, labels and free text, with cursor pagination.
Search the policy template library by type and free text, with cursor pagination.
Search resources managed by stacks across the account, filtered by stack ID and free text (e.g. a resource type), with cursor pagination.
Search runs across all stacks, newest first, with filters for state, run type, triggering user and a created_at window (Unix seconds), full-text search, ordering, and cursor or offset paging.
Search spaces (the access-control tree holding stacks, contexts and policies) by parent, labels and free text, with cursor pagination.
Search stacks with server-side filters (space, labels, repository, branch, project root, state), full-text search and cursor pagination.
Search VCS integrations by provider and free text, with cursor pagination.
Search named webhook integrations by labels and free text, with cursor pagination.
Search private worker pools by space, labels and free text, with cursor pagination.
Add or overwrite an environment variable or mounted file on a context.
Set the queue priority (high, normal, low) of a run that has not finished.
Set the commit a stack tracks to a specific SHA (the next tracked run uses it).
Add or overwrite an environment variable or mounted file on a stack.
Star (star=true) or unstar (star=false) a stack. Use search_stacks to find stack IDs.
Drain (drain=true) a worker so it takes no new runs, or undrain it (drain=false).
Evaluate a Rego policy body against a JSON input without saving anything, returning the result JSON.
Stop a run that is in progress (planning, applying, performing).
Move a stack’s tracked commit to the current head of its tracked branch.
Trigger a run on a stack: TRACKED (plan, then apply after confirm_run; applies immediately with autodeploy) or PROPOSED (plan only).
Release a stack lock held by this API key.
Update a blueprint’s name, space, state (DRAFT to PUBLISHED only), template, description or labels; unset fields keep their current values.
Update a context’s name, description, labels, space or hooks; unset fields keep their current values and config elements are never touched (use set_context_config).
Change a stack’s drift detection schedule or settings; unset fields keep their current values.
Update a module’s source, branch, labels, space and settings; unset fields keep their current values.
Update a policy’s name, body, labels, space, description or engine; unset fields keep their current values.
Replace a scheduled stack deletion’s timing and resource-destruction flag. Use list_scheduled_deletes to find IDs.
Replace a scheduled run’s name and timing; env vars and runtime settings are kept unless environment is set.
Replace a scheduled task’s command and timing. Use list_scheduled_tasks to find schedule IDs.
Update a space’s name, description, parent (moves it), inheritance or labels; unset fields keep their current values.
Update a stack’s settings; unset fields keep their current values (the tool reads the stack first because the API replaces the whole input).
Update a named webhook’s name, endpoint, space, enabled flag, labels, retry or secret; unset fields keep their current values.
Update a worker pool’s name, description, labels, space and limits; unset fields keep their current values.
Yank a module version (mark it bad so consumers stop using it), with a note.