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

# POST Execute Automation

> Manually trigger an automation execution.

## Execute automation

`POST /api/automations/:automationId/execute`

Manually trigger an automation to run for a specific conversation or contact.

### Headers

**Cookie** `string` *required*

Session cookie (login via POST /api/auth/login)

### Path parameters

**automationId** `integer` *required*

Automation ID.

### Body parameters

**conversationId** `integer`

Target conversation.

**contactPhone** `string`

Target contact phone.

**variables** `object`

Variables for template substitution.

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/automations/1/execute \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{ "conversationId": 5 }'
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "executionId": "exec_abc123",
    "automationId": 1,
    "status": "running",
    "startedAt": "2026-01-15T14:00:00Z"
  }
}
```

***

## Test automation

`POST /api/automations/:id/test`

Test an automation with sample data without sending real messages.

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/automations/1/test \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "contactPhone": "919876543210",
    "message": "Hello"
  }'
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "executionId": "test_exec_123",
    "nodes": [
      { "id": "node_1", "status": "completed", "output": "Matched trigger" },
      { "id": "node_2", "status": "completed", "output": "Would send: Welcome!" }
    ]
  }
}
```

***

## Trigger events

`POST /api/automations/triggers/new-conversation`

Manually trigger the `new_conversation` event for automations listening on it.

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/automations/triggers/new-conversation \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{ "conversationId": 5, "contactPhone": "919876543210" }'
```

### Trigger: message received

`POST /api/automations/triggers/message-received`

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/automations/triggers/message-received \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "channelId": "647015955153740",
    "conversationId": 5,
    "contactPhone": "919876543210",
    "message": "Hello, I need help"
  }'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.