# POST /api/v2/automations/{automation}/actions/activate

Switch an automation on

- MCP id: automations.actions.activate
- Scope: api:write:automations
- Scope: api:write:project_automations
- Scope: api:write:customer_automations
- Permission: automations::update
- Needs the automations feature on your organisation
- Rate cost: 1 unit, write bucket. A write costs the same whatever `view` you ask for.
- Cache-Control: private, no-store

Switches the automation on, so its trigger starts runs from now on; a paused automation carries on again.

Runs use the permissions of its owner. Three states refuse with `409` `state-conflict`: no saved flow with a trigger (`no_trigger`), a step whose secret the automation does not keep, as in a copy (`secret_missing`, with `conflict.node_key`), and an owner that must be replaced first (`owner_required`). Switching on one that is already on succeeds with an `already_in_target_state` warning. Over MCP the user must agree first (`confirm: true`). The declared permission is `automations::update`; for a project or customer automation, the `project_automations` or `customer_automations` permission of the same action applies instead.

## Parameters
- automation (integer, path): The Automation's numeric id. Accepts a soft-deleted record.
- view (string, optional): Which field set to render.
- X-Request-Id (header, optional): A correlation id of your own. It is recorded in our logs next to the server's request id but never returned: the response header always carries the server's id. A value that does not match the pattern is discarded silently, never rejected.
- If-Match (header, optional): The ETag a write is conditional on. A stale validator is 412 precondition-failed.
- Idempotency-Key (header, optional): A caller-chosen key that makes this POST safe to retry. Replaying it returns the original response with Idempotency-Replayed: true.

## Response 200
- id (integer, required): Unique identifier.
- name (string ≤ 255, required): Name as shown in the automations list.
- description (string or null, required, multiline): What the automation is for, in its makers' words.
- context_type (string or null, required): What the automation belongs to. `null` is the whole organisation. With a type, `context_id` names the one project or customer, or is `null` for every one of them. The scope decides which permissions apply: `automations`, `project_automations` or `customer_automations`.
- context_id (integer or null, required): The one project or customer the automation belongs to. `null` with a `context_type` means every project or every customer.
- owner_id (integer or null, required): The person who made the automation. Its runs use their permissions, so a step they may not do is refused when the flow is saved. `null` once that user is gone. It is whoever creates the automation and never changes, except for plnnrly support's own account, which must name a real person here when it creates or changes one.
- owner_requires_replacement (boolean, required): Whether the owner is plnnrly support's own account. Such an automation cannot be saved or switched on until a real person is named as its owner.
- is_active (boolean, required, server-assigned): Whether the automation is switched on. A new automation is always off.
- is_runnable (boolean, required): Whether triggers start runs right now: switched on, not paused and not deleted.
- paused_reason (string or null, required): Why plnnrly paused the automation, such as a step that kept failing. `null` while it is not paused. Switching it on again clears it. Never names record data.
- current_version_id (integer or null, required): The version whose flow runs. `null` until a flow is first saved.
- trigger_type (string or null ≤ 255, required, server-assigned): The step type of the flow's trigger, such as `trigger.record_created`, taken from the current version. See `GET /api/v2/automation-node-types`.
- trigger_record_type (string or null ≤ 255, required, server-assigned): The record type the trigger starts on, such as `work_item`, or `null` for a trigger without a record, such as a schedule.
- trigger_events (array of string, required): The record events the trigger starts on. Empty for a trigger that does not start on record events, such as a schedule or a date being reached.
- next_run_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): When a schedule trigger next starts a run. `null` for other triggers.
- last_run_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): When the automation last started a run.
- runs_count (integer, required): How many live runs the automation has started, as counted for the organisation's usage. Test runs and runs that were skipped are not counted.
- template_key (string or null ≤ 100, required): The template the automation was made from, `null` when it was built from scratch. See `GET /api/v2/automation-templates`. Send it on create to start from that template: its flow is saved as version 1, with the answers in `template_answers` in their places.
- manual_inputs (array of object, required, detail only): What a person fills in when they start the automation by hand, as its trigger declares it. Empty for an automation that is not started by hand.
- webhook_url (string or null, required): The address other systems send requests to, for an automation whose trigger receives webhooks; `null` otherwise. Requests must also prove they know the automation's secret, which this API never returns.
- updated_by_id (integer or null, required): Who last saved the automation's flow or settings.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync.
- deleted_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): Soft-delete timestamp, `null` while live. A deleted automation starts no runs.
- owner (Ref or UserSummary or null, required): The person who made the automation.
- updated_by (Ref or UserSummary or null, required): Who last saved the automation.
- current_version (Ref or AutomationVersionSummary or null, required): The version whose flow runs.
- versions_count (integer ≥ 0, required): Number of saved versions of the flow.
- links (AutomationLinks, required)
  - self (url, required): The canonical URI of this record.
  - versions (url, required): Every saved version of the flow, newest first.
  - runs (url, required): The automation's runs, newest first.

## Errors
- 403 forbidden-by-policy | insufficient-permission | insufficient-token-scope: Forbidden.
- 409 idempotency-key-in-flight | idempotency-key-reused | state-conflict: Conflict.
- 412 precondition-failed: Precondition failed.
- 400 idempotency-key-required | invalid-cursor | invalid-query-parameter | malformed-request | unsupported-parameter: Bad request.
- 401 token-expired | unauthenticated: Unauthenticated.
- 404 endpoint-not-found | resource-not-found: Not found.
- 406 not-acceptable: Not acceptable.
- 429 rate-limit-exceeded: Too many requests.
- 500 internal-error: Server error.
- 503 tenant-unavailable: Service unavailable.

## Example
```bash
curl -X POST \
  'https://<your-url>/api/v2/automations/1/actions/activate' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: <key>' \
  -d '{}'
```
