Skip to main content

Tasks API

The Tasks API lets you trigger, monitor, and retrieve results from any deployed agent.

Base URL

https://api.ariftly.io/v1

Create a task

POST /tasks

Triggers a new task on a deployed agent. Returns immediately with a task_id — the agent runs asynchronously.

Request body:

{
"agent": "ai-readiness",
"task_type": "questionnaire.respond",
"input": {
"document_url": "https://example.com/questionnaire.pdf"
},
"priority": "normal"
}
FieldTypeRequiredDescription
agentstringAgent slug (e.g., ai-readiness, sales)
task_typestringTask type declared in the agent's manifest
inputobjectInput payload validated against the agent's input schema
prioritystringlow, normal, high. Default: normal
session_idstringAttach this task to an existing session

Response 202 Accepted:

{
"task_id": "task_01j9x8k...",
"agent": "ai-readiness",
"task_type": "questionnaire.respond",
"status": "queued",
"created_at": "2026-04-21T10:00:00Z"
}

Get a task

GET /tasks/{task_id}

Response 200 OK:

{
"task_id": "task_01j9x8k...",
"agent": "ai-readiness",
"task_type": "questionnaire.respond",
"status": "complete",
"created_at": "2026-04-21T10:00:00Z",
"completed_at": "2026-04-21T10:03:42Z",
"artifacts": [
{
"artifact_id": "art_01j9x8m...",
"type": "ai_readiness.questionnaire_response",
"created_at": "2026-04-21T10:03:41Z"
}
]
}

Task statuses:

StatusMeaning
queuedWaiting to be dispatched to the agent
runningAgent is actively working
awaiting_approvalAgent is waiting for human approval before proceeding
completeAgent finished and emitted all artifacts
failedAgent encountered an unrecoverable error
cancelledTask was manually cancelled

List tasks

GET /tasks

Query parameters:

ParameterTypeDescription
agentstringFilter by agent slug
statusstringFilter by status
limitintegerMax results. Default: 20, max: 100
cursorstringPagination cursor from previous response

Response 200 OK:

{
"tasks": [...],
"next_cursor": "cursor_abc..."
}

Cancel a task

DELETE /tasks/{task_id}

Cancels a running task. The agent will receive a cancellation signal and stop work.

Response 200 OK:

{ "cancelled": true }

Get task artifacts

GET /tasks/{task_id}/artifacts

Returns all artifacts emitted by a completed task.

Response 200 OK:

{
"artifacts": [
{
"artifact_id": "art_01j9x8m...",
"type": "ai_readiness.questionnaire_response",
"data": {
"answers": [...],
"confidence_scores": {...}
},
"created_at": "2026-04-21T10:03:41Z"
}
]
}