Skip to Content
API ReferenceAutomations

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

ParameterTypeDescription
workspace_iduuidRequired. Filter by workspace
typestringFilter 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

FieldTypeRequiredDescription
workspace_iduuidYesThe workspace this automation belongs to
typestringYesOne of: write_social, write_blog, rss_social, rss_blog, rss_digest_blog
namestringNoDisplay name for the automation
topicstringConditionalRequired for write_social and write_blog types
promptstringNoCustom AI prompt for content generation
schedulestringNoRRULE recurrence rule string
auto_publishbooleanNoWhether 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