Saltar para o conteúdo principal
POST
/
public
/
api
/
v1
/
agents
/
{agentPublicId}
/
automations
Create automation
curl --request POST \
  --url https://api.gennia.ai/public/api/v1/agents/{agentPublicId}/automations \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "description": "Runs every morning and emails the invoice digest.",
  "name": "Daily invoice summary",
  "prompt": "Summarize the invoices created in the last 24 hours and send the digest.",
  "schedule": "@daily",
  "timezone": "America/Sao_Paulo",
  "triggerConfig": {},
  "triggerSlug": "GMAIL_NEW_EMAIL",
  "triggerToolkitSlug": "gmail"
}
'
{
  "createdAt": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "lastRunAt": "2023-11-07T05:31:56Z",
  "lastRunStatus": "<string>",
  "name": "<string>",
  "nextRunAt": "2023-11-07T05:31:56Z",
  "prompt": "<string>",
  "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "schedule": "<string>",
  "timezone": "<string>",
  "triggerConfig": {},
  "triggerSlug": "<string>",
  "triggerToolkitSlug": "<string>",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Autorizações

X-Api-Key
string
header
obrigatório

Parâmetros de caminho

agentPublicId
string<uuid>
obrigatório

Corpo

application/json

Body for creating a new automation (workflow) on an agent.

triggerMode
enum<string>
obrigatório

How the automation is triggered (e.g. schedule, manual, external event).

Opções disponíveis:
manual,
schedule,
webhook,
webhook_url
description
string

Short description shown in the automation list.

Maximum string length: 500
Exemplo:

"Runs every morning and emails the invoice digest."

hitlMode
enum<string>

Human-in-the-loop approval mode for this automation.

Opções disponíveis:
auto_approve,
pause_on_approval
name
string

Display name of the automation.

Maximum string length: 150
Exemplo:

"Daily invoice summary"

prompt
string

Prompt executed by the automation when triggered.

Maximum string length: 10000
Exemplo:

"Summarize the invoices created in the last 24 hours and send the digest."

schedule
string

Cron expression for scheduled triggerMode. Ignored for non-scheduled modes.

Maximum string length: 100
Exemplo:

"@daily"

timezone
string

IANA timezone in which the schedule cron should be interpreted.

Maximum string length: 50
Exemplo:

"America/Sao_Paulo"

triggerConfig
object

Trigger-specific configuration object. Shape depends on the triggerSlug.

triggerSlug
string

Trigger slug within the toolkit (for event-based triggers).

Maximum string length: 200
Exemplo:

"GMAIL_NEW_EMAIL"

triggerToolkitSlug
string

Composio toolkit slug used to source the trigger (for event-based triggers).

Maximum string length: 100
Exemplo:

"gmail"

Resposta

Created

Scheduled / trigger-based agent automation.

createdAt
string<date-time>
description
string
hitlMode
enum<string>
Opções disponíveis:
auto_approve,
pause_on_approval
lastRunAt
string<date-time>
lastRunStatus
string
name
string
nextRunAt
string<date-time>
prompt
string
publicId
string<uuid>
schedule
string
status
enum<string>
Opções disponíveis:
active,
inactive
timezone
string
triggerConfig
object
triggerMode
enum<string>
Opções disponíveis:
manual,
schedule,
webhook,
webhook_url
triggerSlug
string
triggerToolkitSlug
string
updatedAt
string<date-time>