Skip to main content

Tasks API

A task is a unit of work given to an agent, or to a person. It can run once when you ask, on a schedule, or when an event happens. Every run is kept with its output, cost and duration, so you can see what was done and what it cost.

Base path: /api/v1/tasks. Permissions: tasks:read to read, tasks:write to create, change, run and decide.

List tasks​

GET /api/v1/tasks
ParameterTypeDescription
page, limitintegerPaging (default limit 50)
appId, teamIdstringOnly this workspace or team
assignedAgentIdstringOnly tasks assigned to this agent
statusstringpending, in_progress, completed, failed, cancelled or paused
typestringmanual, scheduled or triggered
prioritystringlow, medium, high or urgent
inboxstringself returns the tasks assigned to you, the caller

Create a task​

POST /api/v1/tasks
FieldTypeRequiredDescription
namestringYes2-200 characters
descriptionstringNoWhat should be done, up to 1,000 characters
assignedAgentIdstringNoThe agent that does the work
assignedAgentsstring[]NoSeveral agents
assignedUserIdstringNoA person, for human work
appId, teamIdstringNoWorkspace and team
projectId, milestoneIdstringNoAttach the task to a project milestone
typestringNomanual (default), scheduled or triggered
schedulestringNoCron expression, for scheduled tasks
timezonestringNoTimezone of the schedule, for example Europe/Paris
prioritystringNolow, medium, high or urgent
deadlinestringNoISO 8601 date-time
dependenciesstring[]NoTasks that must finish first
inputobjectNoExtra context for the agent
settingsobjectNomaxRetries, timeoutMs, retryDelayMs, enableMemory
curl -X POST https://api.meetloyd.com/api/v1/tasks \
-H "Authorization: Bearer $MEETLOYD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily pipeline briefing",
"description": "Summarise new leads, deal changes and today'\''s meetings.",
"assignedAgentId": "agent_sales_lead",
"type": "scheduled",
"schedule": "0 8 * * 1-5",
"timezone": "Europe/Paris",
"priority": "high"
}'

Read, change, delete​

GET    /api/v1/tasks/:id
PATCH /api/v1/tasks/:id
DELETE /api/v1/tasks/:id

PATCH changes only the fields you send, including status.

Run, cancel, retry​

POST /api/v1/tasks/:id/run
POST /api/v1/tasks/:id/cancel
POST /api/v1/tasks/:id/retry

run queues the task for its agent and answers 202 with { "queued": true, "taskId" }. Follow progress through the task's status and its runs. A task with no agent assigned answers 400. retry runs a failed task again with the same configuration.

Runs​

GET /api/v1/tasks/:id/runs?page=1&limit=50
GET /api/v1/tasks/runs/:runId

Each run has its status, output, tool calls, token usage, cost and start and end times. GET /api/v1/tasks/runs lists recent runs across tasks.

Approvals and human work​

GET  /api/v1/tasks/pending-approval?appId=&teamId=
POST /api/v1/tasks/:id/approve { "autoExecute"?: boolean }
POST /api/v1/tasks/:id/reject { "reason"?: string }
POST /api/v1/tasks/:id/claim

Tasks that need a person's approval before they run are listed by pending-approval. Only the person the decision belongs to can approve or reject it; anyone else gets 403 with "code": "assigned_to_someone_else". claim records that you have picked up a task assigned to people.

Common schedules​

CronRuns
0 9 * * 1-5Weekdays at 9:00
0 */2 * * *Every 2 hours
0 8 * * 1Mondays at 8:00
0 0 1 * *First day of each month at midnight
*/30 * * * *Every 30 minutes

Just ask Loyd​

In the dashboard you can ask Loyd to "create a task for the research agent to summarise competitor news every Monday at 8". Loyd creates the same task the API would.