Criar gatilho de agenda
Cria um gatilho de agenda. Quem a chave representa responde pelos disparos (`created_by`), e a cada disparo o agente confere se essa pessoa ainda pode usá-lo. O próximo disparo (`next_run_at`) é calculado aqui. Exige o escopo triggers:write.
Authorization
chaveDeApi Chave de API da organização, criada nas configurações. Envie-a em Authorization: Bearer <sua chave>.
In: header
Path Parameters
Id ou apelido do agente.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/agents/string/triggers" \ -H "Content-Type: application/json" \ -d '{ "kind": "schedule", "message": "string" }'{ "trigger": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "name": "string", "kind": "schedule", "message": "string", "enabled": true, "schedule_days": [ "mon" ], "schedule_time": "string", "schedule_timezone": "string", "recurring_interval": 1, "recurring_unit": "minutes", "run_at": "2019-08-24T14:15:22Z", "return_channel": "web", "telegram_handle": "string", "resume_last_thread": true, "target_thread_id": "20348137-b265-4ef4-aee7-500a6c048ee0", "last_run_at": "2019-08-24T14:15:22Z", "next_run_at": "2019-08-24T14:15:22Z", "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }}