---
title: Manage automations with the API | Lightfield
description: Create, update, pause, resume and delete automations through the REST API with an owner or admin API key.
---

The Automations API is in beta and isn’t available to every workspace yet. Endpoints, parameters, and response schemas may change, including breaking changes.

Use the Automations API to create and change automations from your own code, and to pause, resume or delete them. An automation runs its steps whenever one of its triggers fires. For what each trigger, step and permission does, and who a run acts as, see [Build an automation](/help/automations/build-an-automation/index.md).

## Before you start

Only an API key can call these endpoints, and the key’s creator must be a workspace owner or admin who still has that role. A workspace key’s creator must also have been an owner or admin when they created it. Otherwise the request returns `403`.

Each operation needs one scope. See [Scopes](/using-the-api/scopes/index.md).

| Operation                                                                                                                                                                                           | Scope                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
| [List automations](/api/resources/automation/methods/list/index.md), [retrieve one](/api/resources/automation/methods/retrieve/index.md)                                                            | `automations:read`   |
| [Create an automation](/api/resources/automation/methods/create/index.md)                                                                                                                           | `automations:create` |
| [Update](/api/resources/automation/methods/update/index.md), [pause](/api/resources/automation/methods/pause/index.md) or [resume](/api/resources/automation/methods/resume/index.md) an automation | `automations:update` |
| [Delete an automation](/api/resources/automation/methods/delete/index.md)                                                                                                                           | `automations:delete` |

## Create an automation

An automation you create through the API is live as soon as the request returns, and its triggers can start runs right away. The permissions on its steps are granted by your request: nobody approves them in the app the way they do for an automation built in chat. Check the steps and permissions before you send the request. To try an automation before it runs on its own, give it only a `MANUAL` trigger, which runs only when started by hand, and add its real triggers with an update once you’re satisfied.

[Create an automation](/api/resources/automation/methods/create/index.md) needs a `name`, at least one trigger and at least one step:

Terminal window

```
curl https://api.lightfield.app/v1/automations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LIGHTFIELD_API_KEY" \
  -H "Lightfield-Version: 2026-03-01" \
  -d '{
    "name": "Research new accounts",
    "description": "Adds a short company summary to each new account",
    "triggers": [{ "type": "RECORD_CREATED", "objectType": "$account" }],
    "steps": [
      {
        "type": "AGENT",
        "name": "Research",
        "prompt": "Research the company behind the new account and add a note with a two-sentence summary.",
        "permissions": [
          { "type": "TOOL", "name": "web_search", "reason": "Looks up the company" },
          { "type": "API", "scopes": ["accounts:read", "notes:create"], "reason": "Reads the account and adds the note" }
        ]
      }
    ],
    "runAs": { "type": "WORKSPACE" }
  }'
```

The response is the automation, with `status: "ACTIVE"`. This excerpt leaves out some properties:

```
{
  "id": "aut_cmv1b7k2p0004",
  "objectType": "automation",
  "status": "ACTIVE",
  "name": "Research new accounts",
  "model": "auto",
  "runAs": { "type": "WORKSPACE" },
  "triggers": [{ "type": "RECORD_CREATED", "objectType": "$account" }],
  "lastRunAt": null,
  "lastFailureAt": null
}
```

Each step comes back with an `id` that Lightfield assigns. A `WEBHOOK` trigger comes back with the `url` that starts a run; [Webhook](/help/automations/build-an-automation/index.md#webhook) explains how to call it.

When you build the request:

- **Triggers:** record triggers take `objectType` as `$account`, `$contact`, `$opportunity`, `$meeting`, `$task` or `$note`, or a custom object’s slug. `RECORD_CREATED` also accepts `$email`. A `RECORD_UPDATED` trigger runs on any change unless you list `watchedFields`, such as `["$name"]` or a custom field’s key.
- **API permissions:** a step can be granted only API scopes your key holds, and only a full-access key can grant `*`. Later updates need a key that still holds every scope the automation grants, even to rename it.
- **Model:** leave `model` out or send `auto` unless your workspace can choose automation models.
- **Runs as:** `runAs` takes `WORKSPACE` or a `MEMBER` with a `memberId` from [List members](/api/resources/member/methods/list/index.md). An admin can name themselves, `WORKSPACE` or a member who isn’t an owner or admin. Only an owner can name another admin or an owner. See [Runs as](/help/automations/build-an-automation/index.md#runs-as) for what each choice can read.

## Read automations

[List automations](/api/resources/automation/methods/list/index.md) returns a preview of each automation, newest first: its `status`, `triggerTypes`, `stepCount`, `lastRunAt` and `lastFailureAt`. Page through it with `limit` and `offset`, as described in [Pagination](/using-the-api/list-endpoints/index.md#pagination). [Retrieve an automation](/api/resources/automation/methods/retrieve/index.md) for its steps and trigger details.

Terminal window

```
curl https://api.lightfield.app/v1/automations/aut_cmv1b7k2p0004 \
  -H "Authorization: Bearer $LIGHTFIELD_API_KEY" \
  -H "Lightfield-Version: 2026-03-01"
```

Both return only published automations: one that has never been published from the app isn’t listed and returns `404`. Retrieve shows the published version; inputs, skills and files set in the app aren’t part of the response. An automation that takes its member from a run’s input shows `runAs` as `FROM_INPUT`, which only the app can set.

## Update an automation

[Update an automation](/api/resources/automation/methods/update/index.md) replaces the fields you send and leaves the others as they are. The result becomes the published version at once. A paused automation stays paused, and a request that changes nothing returns the automation unchanged.

Each field is replaced whole. Sending `steps` replaces every step, and sending `triggers` replaces every trigger, including relationship watches set in the app. To change one step, retrieve the automation, edit its `steps`, and send the full list back. Remove each step’s `id`, and the `url` on a `WEBHOOK` trigger, before you send them: they’re assigned by Lightfield and aren’t accepted in a request.

Terminal window

```
curl https://api.lightfield.app/v1/automations/aut_cmv1b7k2p0004 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LIGHTFIELD_API_KEY" \
  -H "Lightfield-Version: 2026-03-01" \
  -d '{
    "triggers": [
      { "type": "RECORD_CREATED", "objectType": "$account" },
      { "type": "SCHEDULED", "schedule": { "cron": "0 9 * * 1-5", "timezone": "America/New_York" } }
    ]
  }'
```

An update keeps inputs set in the app, and keeps a `FROM_INPUT` member unless you send `runAs`. If someone changes the automation while your request runs, the update returns `409`; retrieve it again and resend your change.

## Pause, resume or delete

[Pause an automation](/api/resources/automation/methods/pause/index.md) to stop its triggers from starting runs. [Resume it](/api/resources/automation/methods/resume/index.md) to let them start runs again. Both return the automation; one that’s already in the requested state comes back unchanged.

Terminal window

```
curl https://api.lightfield.app/v1/automations/aut_cmv1b7k2p0004/pause \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LIGHTFIELD_API_KEY" \
  -H "Lightfield-Version: 2026-03-01" \
  -d '{}'
```

Check that `status` is `PAUSED`, or `ACTIVE` after a resume. What pausing does to runs already in progress is described in [Pause, resume or delete an automation](/help/automations/index.md#pause-resume-or-delete-an-automation).

[Delete an automation](/api/resources/automation/methods/delete/index.md) turns off its triggers and dismisses the runs it has waiting for review. It can’t be undone, so pause the automation instead if you might want it back.

Terminal window

```
curl -X DELETE https://api.lightfield.app/v1/automations/aut_cmv1b7k2p0004 \
  -H "Authorization: Bearer $LIGHTFIELD_API_KEY" \
  -H "Lightfield-Version: 2026-03-01"
```

```
{ "id": "aut_cmv1b7k2p0004", "objectType": "automation", "deleted": true }
```

Deleting it again returns `404`.

## When a request is refused

A refused create or update changes nothing. `message` says what to fix.

| Status | When it happens                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | `code` is `invalid_configuration`: a record trigger names an object type the workspace doesn’t have, or a step or trigger is invalid. The message lists each problem with its location, such as `steps[1]`. An unsupported `model` also returns `400`.                                                                                                                                                                                                                                         |
| `403`  | The request didn’t use an API key, the key lacks the scope, its creator isn’t an owner or admin, or the workspace’s plan doesn’t include automations. Also when a step grants an API scope the key doesn’t hold, which the message names, or when `runAs` names someone your role can’t pick.                                                                                                                                                                                                  |
| `404`  | No published automation has that ID in this workspace.                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `409`  | The automation changed while the update ran. Retrieve it and retry.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `422`  | The request is valid JSON but can’t be saved: `triggers` is empty, the workspace can’t choose the requested `model`, `description` or a permission `reason` is blank, an API scope can’t be granted to automation steps, a tool isn’t available in the workspace, an `MCP` connector isn’t trimmed and lowercase or its tool names aren’t trimmed and unique, a `NETWORK` domain has a scheme, query, fragment, uppercase host or surrounding spaces, or a watched relationship doesn’t apply. |

The error format is described in [Errors](/using-the-api/errors/index.md#error-response-format).
