---
title: "Trigger Speak AI workflows with the automations API"
description: "Create, read, update, and delete Speak AI automations, and turn an automation on or off without changing the trigger and action it is built from."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.speakai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Trigger Speak AI workflows with the automations API


import EndpointIndex from "@/components/api/EndpointIndex.astro";

The Speak AI API exposes 6 automations endpoints under the base URL `https://api.speakai.co/v1`. Every request needs the `x-speakai-key` and `x-access-token` headers described in [Authentication](/api/authentication/).

Best way to automate your workflow with Automations.

## What can you do with the automations endpoints?

Speak AI groups these 6 endpoints under the automations resource. Each entry below links to the full reference for that endpoint further down this page.

| Method | Path | What it does |
| --- | --- | --- |
| `GET` | [`/automations`](#get-automations) | Get Automations |
| `POST` | [`/automations`](#post-automations) | Create Automation |
| `GET` | [`/automations/{automationId}`](#get-automations-automation-id) | Get Automation |
| `PUT` | [`/automations/{automationId}`](#put-automations-automation-id) | Update Automation |
| `DELETE` | [`/automations/{automationId}`](#delete-automations-automation-id) | Delete Automation |
| `PUT` | [`/automations/status/{automationId}`](#put-automations-status-automation-id) | Enable or Disable Automation |

<h2 id="get-automations">Get Automations</h2>

The endpoint retrieves a list of automations via an HTTP GET request to https://api.speakai.co/v1/automations.

#### Response

The response will be in the form of a JSON schema, with the following structure:

``` json
{
 "status": "",
 "data": {
 "totalCount": 0,
 "automationList": [
 {
 "trigger": {
 "folderIds": [
 {
 "name": "",
 "folderId": ""
 }
 ],
 "values": [],
 "type": ""
 },
 "action": {
 "magicPrompt": {
 "title": "",
 "assistantType": "",
 "prompt": ""
 },
 "type": ""
 },
 "name": "",
 "description": "",
 "runType": "",
 "isActive": true,
 "automationId": "",
 "actionHistory": [
 {
 "type": ""
 }
 ],
 "createdAt": "",
 "updatedAt": "",
 "history": 0
 }
 ]
 }
}

```

The response will have a status code of 200 upon successful retrieval of the automation list.

For related responses from other endpoints of this API, the data model will be largely similar, with the addition of "email", "accessToken", and "refreshToken" fields in the "data" object, and a status code of 200.

<div slot="code">

<CodePanel label="Example request">

```bash
curl -X GET 'https://api.speakai.co/v1/automations' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000'
```

</CodePanel>

<ResponsePanel id="get-automations" statuses={[{"code":"200","description":"Success"}]}>

<div slot="status-200">

**`200` Success**

The spec records this status code with no example body.

</div>

</ResponsePanel>

</div>

<h2 id="post-automations">Create Automation</h2>

The API request creates an automation by sending an HTTP POST request to the specified endpoint. The request body is in JSON format and includes the name, description, runType, trigger, and action details. The trigger type is "folders" with specific folder IDs, and the action type is "magic-prompt" with associated details like title, assistantType, prompt, and assistantTemplateId.

The last call to this request used the following payload with the raw request body type:

``` json
{
 "name": "First Automation",
 "description": "Test",
 "action": {
 "type": "magic-prompt",
 "magicPrompt": {
 "prompt": "Summarize my meetings",
 "assistantType": "general"
 }
 },
 "trigger": {
 "type": "folders",
 "folderIds": ["3711858e52a6"]
 }
}

```

The response to the last execution returned a 200 status code with the following content in JSON format:

``` json
{
 "status": "",
 "data": {
 "automationId": "",
 "message": ""
 }
}

```

Additionally, related responses from other endpoints of this API also returned 200 status codes with similar data models, including email, access token, refresh token, totalCount, automation list, and trigger details.

Please note that the specific values (such as automationId, email, accessToken, refreshToken, folderIds, etc.) have been intentionally masked for privacy.

##### 1\. **Instant Automation with AI Chat Action**

**Body (JSON):**

``` json
{
 "name": "Instant Folder Analysis",
 "description": "Automatically analyze documents in specific folders using AI assistant",
 "runType": "instant",
 "trigger": {
 "type": "folders",
 "folderIds": ["folder123", "folder456"]
 },
 "action": {
 "type": "magic-prompt",
 "magicPrompt": {
 "title": "Document Analysis",
 "assistantType": "researcher",
 "prompt": "Analyze the document content and provide key insights, main topics, and actionable recommendations.",
 "assistantTemplateId": "template123"
 }
 },
 "fieldId": "field789"
}

```

##### 2\. **Scheduled Automation with Translation Action**

**Method:** `POST`

**Body (JSON):**

``` json
{
 "name": "Weekly Document Translation",
 "description": "Translate documents in selected folders every week",
 "runType": "schedule",
 "schedule": {
 "timePeriod": "last7days",
 "repeatAt": "09:00"
 },
 "trigger": {
 "type": "folders",
 "folderIds": ["folder789", "folder101"]
 },
 "action": {
 "type": "translation",
 "translation": {
 "targetLanguage": "spanish"
 }
 }
}

```

##### 3\. **Instant Automation with Custom AI Chat**

**Method:** `POST`

**Body (JSON):**

``` json
{
 "name": "Sales Lead Analysis",
 "description": "Analyze potential leads and generate sales insights",
 "runType": "instant",
 "trigger": {
 "type": "folders",
 "folderIds": ["leads-folder"]
 },
 "action": {
 "type": "magic-prompt",
 "magicPrompt": {
 "title": "Sales Intelligence",
 "assistantType": "sales",
 "prompt": "Review the lead information and provide: 1) Lead quality score (1-10), 2) Key pain points identified, 3) Recommended follow-up strategy, 4) Potential deal size estimate",
 "assistantTemplateId": ""
 }
 }
}

```

##### 4\. **Scheduled Automation with Marketing Analysis**

**Method:** `POST`

**Body (JSON):**

``` json
{
 "name": "Daily Marketing Report",
 "description": "Generate daily marketing insights from campaign data",
 "runType": "schedule",
 "schedule": {
 "timePeriod": "yesterday",
 "repeatAt": "08:00"
 },
 "trigger": {
 "type": "folders",
 "folderIds": ["marketing-data", "campaign-reports"]
 },
 "action": {
 "type": "magic-prompt",
 "magicPrompt": {
 "title": "Marketing Daily Digest",
 "assistantType": "marketer",
 "prompt": "Analyze yesterday's marketing data and provide: 1) Top performing campaigns, 2) Key metrics summary, 3) Trends identified, 4) Recommendations for today",
 "assistantTemplateId": "marketing-template-001"
 }
 },
 "fieldId": "marketing-field-123"
}

```

#### **Available Enum Values:**

**Run Types:**

- `"instant"` - Executes immediately when triggered

- `"schedule"` - Executes based on schedule configuration

**Trigger Types:**

- `"folders"` - Triggered by folder changes

- `"tags"` - Triggered by tag changes

- `"keywords"` - Triggered by keyword matches

**Action Types:**

- `"magic-prompt"` - AI-powered content analysis

- `"translation"` - Document translation

**Assistant Types (for magic-prompt):**

- `"researcher"`, `"marketer"`, `"sales"`, `"general"`, `"recruiter"`, `"custom"`

**Schedule Time Periods:**

- `"today"`, `"yesterday"`, `"last7days"`, `"last14days"`, `"thisWeek"`

These examples cover both instant and scheduled automation types with different actions. Make sure to replace the placeholder values (folder IDs, template IDs, etc.) with actual values from your system.

**Request rules.** `schedule` is required only when `runType` is `schedule`, and then both `schedule.timePeriod` and `schedule.repeatAt` are required too. For any other `runType`, `schedule` is optional. Each step's config object has to match that step's `stepType`; a mismatched config is rejected with a 400.

### Request body

Fields marked **required** are the ones the server rejects the request without. Anything conditional, where a field becomes required only alongside another, is described under Request rules above rather than marked here.

| Field | Type | Description |
| --- | --- | --- |
| `name` | string, **required** | Name the automation. This is what you see in the automations list. required, max length 150 |
| `description` | string | Describe what the automation does. You can send an empty string. optional, max length 1000, empty string allowed |
| `isActive` | boolean | Set whether the automation runs after you create it. Leave it out and the automation is created active. optional. The schema.default(true) is not what produces this: the controller writes isActive only when you send a boolean, and the stored record defaults to true. |
| `runOnceOnly` | string | Ignore this field. The server accepts it and then never reads it, so whatever you send has no effect. optional. unconstrained.strip, so any JSON type passes validation. The.strip has no runtime effect here because RequestValidation discards the validated value; the field is simply never read by the controller, so it is never persisted. |
| `trigger` | object, **required** | Define the single event that starts the automation. required, unknown keys rejected |
| `trigger.type` | string | Pick the kind of event that starts the automation. required inside trigger; values come from the AutomationTrigger list. One of: `folders`, `tags`, `keywords`, `composio`, `webhook`. |
| `trigger.folderIds` | string[] | List the folders the trigger watches. Folder triggers need this; other trigger types do not send it. optional. The item schema is unconstrained: the code is the schema.optional with no.items, so any item type passes. |
| `trigger.values` | string[] | Send the secondary list a trigger needs, such as the field IDs for a field-updated event. The server saves it verbatim. optional, items must be strings, empty strings allowed as items |
| `trigger.provider` | string | Say which system owns the trigger. optional; the two values are written inline in the schema, not drawn from an enum. One of: `speak`, `composio`. |
| `trigger.app` | string | Name the third-party app for a Composio trigger. optional, empty string allowed, no length cap |
| `trigger.triggerSlug` | string | Give the provider's slug for the specific trigger you picked. optional, empty string allowed, no length cap |
| `trigger.webhookId` | string | Attach an inbound webhook to the trigger by its ID. optional, empty string allowed, no length cap |
| `trigger.childKey` | string | Point the trigger at a nested key inside the incoming payload. optional, empty string allowed, no length cap |
| `trigger.connectedAccountId` | string | Identify the connected account the trigger authenticates through. optional, empty string allowed. Unlike triggers[].connectedAccountId this one is not trimmed and has no max length. |
| `trigger.fieldValueMatches` | object[] | Only fire the trigger when the named fields hold the values you list. optional, max 20 entries |
| `trigger.fieldMatchLogic` | string | Choose whether every fieldValueMatches entry has to match or just one. Leaving it out behaves like OR. optional. One of: `AND`, `OR`. |
| `trigger.triggerConfig` | object | Pass provider-specific trigger settings, such as a watched folder ID. The server stores this object as sent and the provider catalog decides its shape. optional, unconstrained object |
| `triggers` | object[] | Add extra alternative triggers. The automation runs when any one of them fires. Leave it out or send an empty array for a single-trigger automation. optional, max 10 entries |
| `triggers[].type` | string | Pick the kind of event for this alternative trigger. optional here, unlike trigger.type which is required. One of: `folders`, `tags`, `keywords`, `composio`, `webhook`. |
| `triggers[].folderIds` | string[] | List the folders this alternative trigger watches. optional, item schema unconstrained (the schema with no.items) |
| `triggers[].values` | string[] | Send the secondary list this alternative trigger needs. optional, items must be strings, empty strings allowed as items |
| `triggers[].provider` | string | Say which system owns this alternative trigger. optional. One of: `speak`, `composio`. |
| `triggers[].app` | string | Name the third-party app for this alternative Composio trigger. optional, empty string allowed |
| `triggers[].triggerSlug` | string | Give the provider's slug for this alternative trigger. optional, empty string allowed |
| `triggers[].fieldValueMatches` | object[] | Only fire this alternative trigger when the named fields hold the values you list. optional, max 20 entries, same fieldId and values shape as trigger.fieldValueMatches |
| `triggers[].fieldMatchLogic` | string | Choose whether every fieldValueMatches entry has to match or just one for this alternative trigger. optional. One of: `AND`, `OR`. |
| `triggers[].triggerConfig` | object | Pass provider-specific settings for this alternative trigger. optional, unconstrained object |
| `triggers[].connectedAccountId` | string | Identify the connected account this alternative trigger authenticates through. optional, trimmed, max length 100, empty string allowed |
| `steps` | object[], **required** | List the steps the automation runs, in order. required, min 1 entry, max 20 entries |
| `steps[].stepId` | string | Give the step an ID that is unique within this automation. Other steps reference it through dependsOn. required, trimmed, min length 1, max length 100 |
| `steps[].stepType` | string | Say what kind of work the step does. This decides which config object the step must carry. required; values come from the AutomationStepType list. One of: `trigger`, `magic-prompt`, `translation`, `composio-action`, `filter`, `speak-upload`, `notify`, `outbound-webhook`, `condition`. |
| `steps[].magicPrompt` | object | Configure an AI prompt step. required when stepType is "magic-prompt", rejected for any other stepType |
| `steps[].translation` | object | Configure a translation step. required when stepType is "translation", rejected for any other stepType |
| `steps[].filter` | object | Configure a filter step that stops the run when its rules do not match. required when stepType is "filter", rejected for any other stepType. Declared inline in automationStep, not as a shared fragment. |
| `steps[].condition` | object | Configure a branching step that sends the run down a true or false path. required when stepType is "condition", rejected for any other stepType. Declared inline with the identical logic and rules shape as steps[].filter. |
| `steps[].composio` | object | Configure a step that runs a Composio app action. required when stepType is "composio-action", rejected for any other stepType |
| `steps[].speakUpload` | object | Configure a step that uploads media into Speak. required when stepType is "speak-upload", rejected for any other stepType |
| `steps[].notify` | object | Configure a notification step. required when stepType is "notify", rejected for any other stepType |
| `steps[].outboundWebhook` | object | Configure a step that calls a URL of yours. required when stepType is "outbound-webhook", rejected for any other stepType |
| `steps[].dependsOn` | string[] | List the stepId values that must finish before this step runs. optional, items must be strings, no cap |
| `steps[].branch` | string | For a step under a condition, say which branch it belongs to. optional. These are the strings "true" and "false", not booleans, so sending true instead of "true" returns a 400. One of: `true`, `false`. |
| `runType` | string | Choose whether the automation runs as soon as its trigger fires or on a schedule. optional, empty string accepted. Values come from AutomationRunType plus an explicit ''. The declared default is 'instant', and although that default is not what reaches the controller, the effect holds anyway: createAutomation writes SCHEDULE only when runType strictly equals "schedule" and writes INSTANT otherwise. One of: `instant`, `schedule`, ``. |
| `fieldId` | string | Ignore this field. The server validates it and then never reads it, so setting it has no effect. optional, no length cap. Neither createAutomation nor updateAutomation destructures a top-level fieldId from req.body, so it is never persisted. Field targeting is done per step through magicPrompt.fieldId and magicPrompt.fieldIds. |
| `isUpdated` | boolean | Ignore this field. The server always marks a newly created automation as updated for the scheduler, whatever you send. optional. The controller does not read the client value; it hardcodes isUpdated: true on the new document. |
| `schedule` | object | Set when a scheduled automation runs. required when runType is "schedule", otherwise optional |
| `schedule.timePeriod` | string | Choose the window of media the scheduled run covers. required when runType is "schedule"; otherwise optional and an empty string is also accepted. Values come from AutomationScheduleTimePeriod. One of: `today`, `yesterday`, `last7days`, `last14days`, `thisWeek`. |
| `schedule.repeatAt` | string | Set the time of day the scheduled run fires. required (trimmed, min length 1) when runType is "schedule"; otherwise optional and an empty string is accepted. No format is enforced by the schema. |

Deeper nested fields are not listed. See the example response below for the full shape.

<div slot="code">

<CodePanel label="Example request">

```bash
curl -X POST 'https://api.speakai.co/v1/automations' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Daily Marketing Report",
  "description": "Generate daily marketing insights from campaign data",
  "runType": "schedule",
  "schedule": {
"timePeriod": "yesterday",
"repeatAt": "08:00"
  },
  "trigger": {
"type": "folders",
"folderIds": [
  "marketing-data",
  "campaign-reports"
]
  },
  "fieldId": "marketing-field-123",
  "steps": [
{
  "stepId": "step-1",
  "stepType": "magic-prompt",
  "magicPrompt": {
    "promptId": "prompt-123",
    "name": "Weekly summary"
  }
}
  ]
}'
```

</CodePanel>

<ResponsePanel id="post-automations" statuses={[{"code":"200","description":"Success"}]}>

<div slot="status-200">

**`200` Success**

The spec records this status code with no example body.

</div>

</ResponsePanel>

</div>

<h2 id="get-automations-automation-id">Get Automation</h2>

The endpoint makes an HTTP GET request to retrieve a list of automations from the specified URL.

The response of this request can be documented as a JSON schema:

``` json
{
 "type": "object",
 "properties": {
 "status": {
 "type": "string"
 },
 "data": {
 "type": "object",
 "properties": {
 "totalCount": {
 "type": "integer"
 },
 "automationList": {
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "trigger": {
 "type": "object",
 "properties": {
 "type": {
 "type": "string"
 },
 "folderIds": {
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "name": {
 "type": "string"
 },
 "folderId": {
 "type": "string"
 }
 }
 }
 },
 "values": {
 "type": "array"
 }
 }
 },
 "action": {
 "type": "object",
 "properties": {
 "magicPrompt": {
 "type": "object",
 "properties": {
 "title": {
 "type": "string"
 },
 "assistantType": {
 "type": "string"
 },
 "assistantTemplateId": {
 "type": "string"
 },
 "prompt": {
 "type": "string"
 }
 }
 },
 "type": {
 "type": "string"
 }
 }
 },
 "name": {
 "type": "string"
 },
 "description": {
 "type": "string"
 },
 "runType": {
 "type": "string"
 },
 "isActive": {
 "type": "boolean"
 },
 "automationId": {
 "type": "string"
 },
 "actionHistory": {
 "type": "array",
 "items": {
 "type": "object",
 "properties": {
 "type": {
 "type": "string"
 }
 }
 }
 },
 "createdAt": {
 "type": "string"
 },
 "updatedAt": {
 "type": "string"
 },
 "history": {
 "type": "integer"
 }
 }
 }
 }
 }
 }
 }
}

```

### Parameters

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `automationId` | path | string | Yes |  |

<div slot="code">

<CodePanel label="Example request">

```bash
curl -X GET 'https://api.speakai.co/v1/automations/97c57afd7ff1' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000'
```

</CodePanel>

<ResponsePanel id="get-automations-automation-id" statuses={[{"code":"200","description":"Success"}]}>

<div slot="status-200">

**`200` Success**

The spec records this status code with no example body.

</div>

</ResponsePanel>

</div>

<h2 id="put-automations-automation-id">Update Automation</h2>

#### Update Automation

**Body (JSON):**

``` json
{
 "name": "Updated Marketing Analysis",
 "description": "Enhanced automation with schedule and new assistant type",
 "isActive": true,
 "runType": "schedule",
 "schedule": {
 "timePeriod": "last7days",
 "repeatAt": "09:30"
 },
 "trigger": {
 "type": "folders",
 "folderIds": ["folder123", "folder456"]
 },
 "action": {
 "type": "magic-prompt",
 "magicPrompt": {
 "title": "Weekly Marketing Report",
 "assistantType": "marketer",
 "prompt": "Analyze marketing data and provide insights, trends, and recommendations",
 "assistantTemplateId": "marketing-template-001"
 }
 },
 "fieldId": "marketing-field-123"
}

```

#### **Key Points:**

• **Path Parameter Required:** `automationId` must be included in the URL path
• **Partial Updates Supported:** You can update only specific fields, not all fields are required
• **Run Type Changes:** When changing to `"schedule"`, include the `schedule` object with `timePeriod` and `repeatAt`
• **Trigger & Action Required:** Both `trigger` and `action` objects appear to be required in the request body
• **Assistant Type:** The `assistantType` is for custom Assistant selected
• **Status Control:** Use `isActive: true/false` to enable or disable the automation
• **Optional Fields:** `fieldId` is optional and only used with magic-prompt actions
• **Schedule Time Periods:** Available options - `"today"`, `"yesterday"`, `"last7days"`, `"last14days"`, `"thisWeek"`
• **Action Types:** Support for `"magic-prompt"` and `"translation"` action types
• **Trigger Types:** Support for `"folders"`, `"tags"`, and `"keywords"` trigger types
• **Assistant Types:** Available options - `"researcher"`, `"marketer"`, `"sales"`, `"general"`, `"recruiter"`, `"custom"`

**Request rules.** The same rules as creating an automation. `schedule` is required only when `runType` is `schedule`, and then both `schedule.timePeriod` and `schedule.repeatAt` are required. Each step's config object has to match that step's `stepType`.

### Parameters

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `automationId` | path | string | Yes |  |

### Request body

Fields marked **required** are the ones the server rejects the request without. Anything conditional, where a field becomes required only alongside another, is described under Request rules above rather than marked here.

| Field | Type | Description |
| --- | --- | --- |
| `name` | string, **required** | Name the automation. This is what you see in the automations list. required, max length 150 |
| `description` | string | Describe what the automation does. You can send an empty string. optional, max length 1000, empty string allowed |
| `isActive` | boolean | Turn the automation on or off. Leave it out and the automation keeps whatever active state it already has. optional. The declared default is true, but that default never reaches the controller, which does if (isActive !== undefined) setter.$set.isActive = isActive. Omitting the field therefore leaves the stored value untouched; it does NOT reactivate a paused automation. |
| `runOnceOnly` | string | Ignore this field. The server accepts it and then never reads it, so whatever you send has no effect. optional. unconstrained.strip, so any JSON type passes validation. The controller reads runOnceOnly only off the existing stored record, never off your request body, so you cannot set or clear it through this endpoint. |
| `trigger` | object, **required** | Define the single event that starts the automation. required, unknown keys rejected |
| `trigger.type` | string | Pick the kind of event that starts the automation. required inside trigger; values come from the AutomationTrigger list. One of: `folders`, `tags`, `keywords`, `composio`, `webhook`. |
| `trigger.folderIds` | string[] | List the folders the trigger watches. optional, item schema is unconstrained (the schema with no.items) |
| `trigger.values` | string[] | Send the secondary list a trigger needs, such as the field IDs for a field-updated event. optional, items must be strings, empty strings allowed as items |
| `trigger.provider` | string | Say which system owns the trigger. optional. One of: `speak`, `composio`. |
| `trigger.app` | string | Name the third-party app for a Composio trigger. optional, empty string allowed |
| `trigger.triggerSlug` | string | Give the provider's slug for the specific trigger you picked. optional, empty string allowed |
| `trigger.webhookId` | string | Attach an inbound webhook to the trigger by its ID. optional, empty string allowed |
| `trigger.childKey` | string | Point the trigger at a nested key inside the incoming payload. optional, empty string allowed |
| `trigger.connectedAccountId` | string | Identify the connected account the trigger authenticates through. optional, empty string allowed, not trimmed and no max length |
| `trigger.fieldValueMatches` | object[] | Only fire the trigger when the named fields hold the values you list. optional, max 20 entries |
| `trigger.fieldMatchLogic` | string | Choose whether every fieldValueMatches entry has to match or just one. Leaving it out behaves like OR. optional. One of: `AND`, `OR`. |
| `trigger.triggerConfig` | object | Pass provider-specific trigger settings. The server stores this object as sent. optional, unconstrained object |
| `triggers` | object[] | Add extra alternative triggers. The automation runs when any one of them fires. optional, max 10 entries |
| `triggers[].type` | string | Pick the kind of event for this alternative trigger. optional here, unlike trigger.type which is required. One of: `folders`, `tags`, `keywords`, `composio`, `webhook`. |
| `triggers[].folderIds` | string[] | List the folders this alternative trigger watches. optional, item schema unconstrained |
| `triggers[].values` | string[] | Send the secondary list this alternative trigger needs. optional, items must be strings, empty strings allowed as items |
| `triggers[].provider` | string | Say which system owns this alternative trigger. optional. One of: `speak`, `composio`. |
| `triggers[].app` | string | Name the third-party app for this alternative Composio trigger. optional, empty string allowed |
| `triggers[].triggerSlug` | string | Give the provider's slug for this alternative trigger. optional, empty string allowed |
| `triggers[].fieldValueMatches` | object[] | Only fire this alternative trigger when the named fields hold the values you list. optional, max 20 entries, same fieldId and values shape as trigger.fieldValueMatches |
| `triggers[].fieldMatchLogic` | string | Choose whether every fieldValueMatches entry has to match or just one for this alternative trigger. optional. One of: `AND`, `OR`. |
| `triggers[].triggerConfig` | object | Pass provider-specific settings for this alternative trigger. optional, unconstrained object |
| `triggers[].connectedAccountId` | string | Identify the connected account this alternative trigger authenticates through. optional, trimmed, max length 100, empty string allowed |
| `steps` | object[], **required** | List the steps the automation runs, in order. This replaces the existing steps rather than merging with them. required, min 1 entry, max 20 entries |
| `steps[].stepId` | string | Give the step an ID that is unique within this automation. Other steps reference it through dependsOn. required, trimmed, min length 1, max length 100 |
| `steps[].stepType` | string | Say what kind of work the step does. This decides which config object the step must carry. required; values come from the AutomationStepType list. One of: `trigger`, `magic-prompt`, `translation`, `composio-action`, `filter`, `speak-upload`, `notify`, `outbound-webhook`, `condition`. |
| `steps[].magicPrompt` | object | Configure an AI prompt step. required when stepType is "magic-prompt", rejected for any other stepType |
| `steps[].translation` | object | Configure a translation step. required when stepType is "translation", rejected for any other stepType |
| `steps[].filter` | object | Configure a filter step that stops the run when its rules do not match. required when stepType is "filter", rejected for any other stepType |
| `steps[].condition` | object | Configure a branching step that sends the run down a true or false path. required when stepType is "condition", rejected for any other stepType; identical shape to steps[].filter |
| `steps[].composio` | object | Configure a step that runs a Composio app action. required when stepType is "composio-action", rejected for any other stepType |
| `steps[].speakUpload` | object | Configure a step that uploads media into Speak. required when stepType is "speak-upload", rejected for any other stepType |
| `steps[].notify` | object | Configure a notification step. required when stepType is "notify", rejected for any other stepType |
| `steps[].outboundWebhook` | object | Configure a step that calls a URL of yours. required when stepType is "outbound-webhook", rejected for any other stepType |
| `steps[].dependsOn` | string[] | List the stepId values that must finish before this step runs. optional, items must be strings |
| `steps[].branch` | string | For a step under a condition, say which branch it belongs to. optional. These are the strings "true" and "false", not booleans. One of: `true`, `false`. |
| `runType` | string | Choose whether the automation runs as soon as its trigger fires or on a schedule. optional, empty string accepted. The controller writes SCHEDULE only when runType strictly equals "schedule" and writes INSTANT otherwise, so omitting it on a scheduled automation converts it back to instant and unsets its schedule. One of: `instant`, `schedule`, ``. |
| `fieldId` | string | Ignore this field. The server validates it and then never reads it, so setting it has no effect. optional. updateAutomation does not destructure a top-level fieldId from req.body. |
| `isUpdated` | boolean | Ignore this field. The server always flags the automation as updated for the scheduler on every update, whatever you send. optional. The controller hardcodes isUpdated: true in its $set and never reads the client value. |
| `schedule` | object | Set when a scheduled automation runs. required when runType is "schedule", otherwise optional. When runType is not "schedule" the controller unsets any stored schedule. |
| `schedule.timePeriod` | string | Choose the window of media the scheduled run covers. required when runType is "schedule"; otherwise optional and an empty string is also accepted. Values come from AutomationScheduleTimePeriod. One of: `today`, `yesterday`, `last7days`, `last14days`, `thisWeek`. |
| `schedule.repeatAt` | string | Set the time of day the scheduled run fires. required (trimmed, min length 1) when runType is "schedule"; otherwise optional and an empty string is accepted. No format is enforced. |

Deeper nested fields are not listed. See the example response below for the full shape.

<div slot="code">

<CodePanel label="Example request">

```bash
curl -X PUT 'https://api.speakai.co/v1/automations/AUTOMATION_ID' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Updated Marketing Analysis",
  "description": "Enhanced automation with schedule and new assistant type",
  "isActive": true,
  "runType": "schedule",
  "schedule": {
"timePeriod": "last7days",
"repeatAt": "09:30"
  },
  "trigger": {
"type": "folders",
"folderIds": [
  "folder123",
  "folder456"
]
  },
  "fieldId": "marketing-field-123",
  "steps": [
{
  "stepId": "step-1",
  "stepType": "magic-prompt",
  "magicPrompt": {
    "promptId": "prompt-123",
    "name": "Weekly summary"
  }
}
  ]
}'
```

</CodePanel>

<ResponsePanel id="put-automations-automation-id" statuses={[{"code":"200","description":"Success"}]}>

<div slot="status-200">

**`200` Success**

The spec records this status code with no example body.

</div>

</ResponsePanel>

</div>

<h2 id="delete-automations-automation-id">Delete Automation</h2>

#### DELETE Automation

This endpoint is used to delete a specific automation identified by its unique `automationId`. By sending a DELETE request to this endpoint, you can remove an automation from the system.

##### Request Format

- **Method**: DELETE

- **Endpoint**: `https://api.speakai.co/v1/automations/{automationId}`

- **Path Parameter**:

 - `automationId` (string): The unique identifier of the automation that you wish to delete. This parameter is required and should be included in the URL.

##### Response Structure

Upon successful deletion of the automation, the server will respond with a confirmation message. The expected response is typically structured as follows:

- **Status Code**: `204 No Content`

 - Indicates that the request was successful and there is no additional content to send in the response body.

In case of an error, the server may return a different status code along with an error message detailing the issue encountered.

Ensure to handle responses appropriately based on the status code received.

### Parameters

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `automationId` | path | string | Yes |  |

<div slot="code">

<CodePanel label="Example request">

```bash
curl -X DELETE 'https://api.speakai.co/v1/automations/null' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000'
```

</CodePanel>

<ResponsePanel id="delete-automations-automation-id" statuses={[{"code":"200","description":"Success"}]}>

<div slot="status-200">

**`200` Success**

The spec records this status code with no example body.

</div>

</ResponsePanel>

</div>

<h2 id="put-automations-status-automation-id">Enable or Disable Automation</h2>

#### Update Automation Status

This endpoint allows you to update the status of a specific automation to enable or disable by providing the automation ID in the URL path.

##### Request Body

The request body should contain the following parameters:

- `status`: (string) The new status for the automation.

- `message`: (string) An optional message related to the status update.

##### Response

The response will have a status code of 200 and a JSON body with the following structure:

- `status`: (string) Indicates the status of the request.

- `message`: (string) Provides additional information about the status.

##### Sample Response

``` json
{
 "status": "",
 "message": ""
}

```

### Parameters

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `automationId` | path | string | Yes |  |

<div slot="code">

<CodePanel label="Example request">

```bash
curl -X PUT 'https://api.speakai.co/v1/automations/status/97c57afd7ff1' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000'
```

</CodePanel>

<ResponsePanel id="put-automations-status-automation-id" statuses={[{"code":"200","description":"Success"}]}>

<div slot="status-200">

**`200` Success**

The spec records this status code with no example body.

</div>

</ResponsePanel>

</div>

## Related pages

- [API reference](/api/) for the base URL, authentication, and the error format.
- [Authenticate with the Speak AI API using access tokens](/api/authentication/)
- [Upload audio and video to Speak AI and read insights](/api/media/)
- [Create and update live transcription sessions in Speak AI](/api/live-transcription/)
- [Analyze text notes with the Speak AI text endpoints](/api/text/)

Get an API key on the [Speak AI developer page](https://app.speakai.co/developers?utm_source=docs&utm_medium=referral&utm_campaign=api-reference&utm_content=api-automations).

Source: https://docs.speakai.co/api/automations/index.mdx
