> ## 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.

# GET Automation Nodes & Edges

> Manage the visual flow builder nodes and edges for automations.

## Save automation nodes

`POST /api/automations/:automationId/nodes`

Automations use a visual flow builder backed by nodes and edges. Nodes represent actions, and edges define the flow between them.

### Headers

**Cookie** `string` *required*

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

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/automations/1/nodes \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "nodes": [
      {
        "id": "node_1",
        "type": "trigger",
        "position": { "x": 100, "y": 100 },
        "data": {
          "triggerType": "new_conversation"
        }
      },
      {
        "id": "node_2",
        "type": "sendMessage",
        "position": { "x": 300, "y": 100 },
        "data": {
          "messageType": "text",
          "content": { "text": "How can we help you?" }
        }
      }
    ]
  }'
```

### Node types

| Type | Description | Data |
| - | - | - |
| `trigger` | Flow trigger point | `triggerType`, conditions |
| `sendMessage` | Send a WhatsApp message | `messageType`, `content` or `templateName` |
| `condition` | Branch based on conditions | `conditions` array |
| `delay` | Wait before continuing | `duration` (seconds) |
| `assignAgent` | Assign to team member | `agentId` |
| `updateContact` | Update contact fields | `fields` |
| `addTag` | Add tags to contact | `tags` |
| `httpRequest` | Make HTTP request | `url`, `method`, `headers`, `body` |
| `aiResponse` | Generate AI response | `prompt`, `model` |

```json theme={null}
{
  "nodes": [
    {
      "id": "node_1",
      "type": "trigger",
      "position": { "x": 100, "y": 100 },
      "data": {
        "triggerType": "new_conversation"
      }
    },
    {
      "id": "node_2",
      "type": "condition",
      "position": { "x": 300, "y": 100 },
      "data": {
        "conditions": [
          { "field": "message", "operator": "contains", "value": "help" }
        ]
      }
    },
    {
      "id": "node_3",
      "type": "sendMessage",
      "position": { "x": 500, "y": 50 },
      "data": {
        "messageType": "text",
        "content": { "text": "How can we help you?" }
      }
    },
    {
      "id": "node_4",
      "type": "sendMessage",
      "position": { "x": 500, "y": 200 },
      "data": {
        "messageType": "template",
        "templateName": "welcome_message"
      }
    },
    {
      "id": "node_5",
      "type": "delay",
      "position": { "x": 700, "y": 50 },
      "data": {
        "duration": 300
      }
    }
  ]
}
```

***

## Save automation edges

`POST /api/automations/:automationId/edges`

```bash cURL theme={null}
curl -X POST https://zeplo.ai/api/automations/1/edges \
  -H "Cookie: connect.sid=s%3A7HImZ-T2BxWSbUsf9dtWdOlBW4rVuORO.5J0Do0NyvBu%2BkTvu1aHvtNs00BKhkpUKTwiokLS0cpw" \
  -H "Content-Type: application/json" \
  -d '{
    "edges": [
      {
        "id": "edge_1",
        "source": "node_1",
        "target": "node_2"
      }
    ]
  }'
```

### Edge properties

| Field | Description |
| - | - |
| `id` | Unique edge identifier |
| `source` | Source node ID |
| `target` | Target node ID |
| `sourceHandle` | Output handle (`true`/`false` for condition nodes) |

```json theme={null}
{
  "edges": [
    {
      "id": "edge_1",
      "source": "node_1",
      "target": "node_2"
    },
    {
      "id": "edge_2",
      "source": "node_2",
      "target": "node_3",
      "sourceHandle": "true"
    },
    {
      "id": "edge_3",
      "source": "node_2",
      "target": "node_4",
      "sourceHandle": "false"
    }
  ]
}
```


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