Skip to main content
POST
/
tasks
Create a task
curl --request POST \
  --url https://api.deck.co/v2/tasks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "agent_id": "<string>",
  "id": "<string>",
  "input_schema": "<unknown>",
  "output_schema": "<unknown>",
  "prompt": "<string>",
  "storage": "<unknown>",
  "extraction": false
}
'
{
  "id": "<string>",
  "object": "<string>",
  "name": "<string>",
  "prompt": "<string>",
  "status": "<string>",
  "agent_id": "<string>",
  "input_schema": "<unknown>",
  "output_schema": "<unknown>",
  "storage": "<unknown>",
  "extraction": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "request_id": "<string>"
}

Authorizations

Authorization
string
header
required

Secret key (sk_live_...)

Body

Request body for creating a new task.

name
string
required

Display name for the task.

agent_id
string
required

The agent this task belongs to. Prefixed with agt_.

id
null | string

Optional client-specified ID for the task. If not provided, Deck generates one.

input_schema
any

JSON Schema defining the expected input for task runs.

output_schema
any

JSON Schema defining the expected output for task runs.

prompt
null | string

Instructions for the agent describing what this task should do.

storage
any

Storage configuration for file capture. Set enabled to true to capture files. Supports enabled, extraction, extraction_schema, and deduplication fields.

extraction
boolean
default:false

Enable document extraction on captured files. When true, Deck parses supported files and returns structured JSON.

Response

Created

A task object. Tasks are defined actions an agent can perform.

id
string
required

Unique identifier for the task, prefixed with task_.

object
string
required

Always task.

name
string
required

Display name for the task.

prompt
null | string
required

Instructions for the agent describing what this task should do.

status
string
required

Task status: learning, test, or live.

agent_id
string
required

The agent this task belongs to. Prefixed with agt_.

input_schema
null | any
required

JSON Schema defining the expected input for task runs.

output_schema
null | any
required

JSON Schema defining the expected output for task runs.

storage
null | any
required

Storage configuration for file capture during task execution.

extraction
boolean
required

Whether document extraction is enabled for captured files.

created_at
string<date-time>
required

ISO 8601 timestamp of when the resource was created.

updated_at
string<date-time>
required

ISO 8601 timestamp of when the resource was last updated.

request_id
string
required

Unique identifier for the API request. Include this when contacting support.