Smart Agent Teams
EndpointsRoutines

Trigger Routine

Run a routine now: create its task for the agent and queue a `routine` run. The task is created as `todo` with `medium` priority, assigned to the routine's agent and project. Fails with 400 `INVALID_STATE` when the agent is `paused`, `pending_approval` or `terminated`. Cron schedules are stored but not evaluated by this API yet; a scheduler calls this endpoint (or a person does, from the UI). Publishes `task.created`, `run.created` and `routine.updated`.

POST
/api/companies/{company_id}/routines/{routine_id}/trigger

Run a routine now: create its task for the agent and queue a routine run.

The task is created as todo with medium priority, assigned to the routine's agent and project. Fails with 400 INVALID_STATE when the agent is paused, pending_approval or terminated. Cron schedules are stored but not evaluated by this API yet; a scheduler calls this endpoint (or a person does, from the UI). Publishes task.created, run.created and routine.updated.

Authorization

HTTPBearer
headerAuthorizationBearer <token>

Path Parameters

routine_id*Routine Id
Formatuuid
company_id*Company Id
Formatuuid

Response Body

Successful Response

application/json
  1. response
assignee_agent_id*|null
completed_at*|null
created_at*|null
created_by_agent_id*|null
created_by_user_id*|null
description*string|null
due_date*|null
goal_id*|null
id*Id
Formatuuid
key*Key
number*Number
parent_id*|null
priority*Priority
project_id*|null
sort_order*Sort Order
started_at*|null
status*Status
title*Title
updated_at*|null
curl -X POST "https://example.com/api/companies/497f6eca-6276-4993-bfeb-53cbbbba6f08/routines/497f6eca-6276-4993-bfeb-53cbbbba6f08/trigger"
{  "assignee_agent_id": "8ff43445-51ff-4235-b9d4-d8007d4d5dc3",  "completed_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "created_by_agent_id": "acd3b99b-57bd-46a1-809a-5d915f3c2609",  "created_by_user_id": "209f54c4-4c33-43bc-9c6a-ef4c65ad7473",  "description": "string",  "due_date": "2019-08-24T14:15:22Z",  "goal_id": "3854d9ad-4bca-4a70-a63e-7c6bc2f12aee",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "key": "string",  "number": 0,  "parent_id": "1c6ca187-e61f-4301-8dcb-0e9749e89eef",  "priority": "string",  "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",  "sort_order": 0,  "started_at": "2019-08-24T14:15:22Z",  "status": "string",  "title": "string",  "updated_at": "2019-08-24T14:15:22Z"}