Automations API
Create, read, update, and manage automations programmatically.
List Automations
Retrieve all automations in a workspace.
GET /rest/v1/automations?workspace_id=eq.<workspace-id>&select=*Query Parameters
| Parameter | Type | Description |
|---|---|---|
workspace_id | uuid | Required. Filter by workspace |
type | string | Filter by automation type (e.g., write_social, rss_blog) |
Response
[
{
"id": 1,
"workspace_id": "uuid",
"type": "write_social",
"name": "Daily Marketing Tips",
"topic": "Digital marketing strategies",
"prompt": "Write in a casual, engaging tone",
"schedule": "RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0",
"auto_publish": true,
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
]Get Automation
Retrieve a single automation with its outputs (channel assignments).
GET /rest/v1/automations?id=eq.<id>&select=*,outputs(*,channels(*,connections(*)))Create Automation
POST /rest/v1/automations
Content-Type: application/json
{
"workspace_id": "uuid",
"type": "write_social",
"name": "Daily Marketing Tips",
"topic": "Digital marketing strategies",
"prompt": "Write in a casual, engaging tone",
"schedule": "RRULE:FREQ=DAILY;BYHOUR=9;BYMINUTE=0",
"auto_publish": false
}Fields
| Field | Type | Required | Description |
|---|---|---|---|
workspace_id | uuid | Yes | The workspace this automation belongs to |
type | string | Yes | One of: write_social, write_blog, rss_social, rss_blog, rss_digest_blog |
name | string | No | Display name for the automation |
topic | string | Conditional | Required for write_social and write_blog types |
prompt | string | No | Custom AI prompt for content generation |
schedule | string | No | RRULE recurrence rule string |
auto_publish | boolean | No | Whether to auto-publish generated posts (default: false) |
Update Automation
PATCH /rest/v1/automations?id=eq.<id>
Content-Type: application/json
{
"name": "Updated Name",
"topic": "New topic",
"auto_publish": true
}Delete Automation
DELETE /rest/v1/automations?id=eq.<id>Trigger Generation
Manually trigger content generation for an automation using the Edge Function:
POST /functions/v1/generate-content
Content-Type: application/json
{
"automation_id": 1
}This creates a new run, generates content for all output channels, and creates posts based on the automation’s settings.
Last updated on