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>",
"settings": {
"timeout_seconds": 2,
"sensitive": true
}
}
'import requests
url = "https://api.deck.co/v2/tasks"
payload = {
"name": "<string>",
"agent_id": "<string>",
"id": "<string>",
"input_schema": "<unknown>",
"output_schema": "<unknown>",
"prompt": "<string>",
"storage": "<unknown>",
"settings": {
"timeout_seconds": 2,
"sensitive": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agent_id: '<string>',
id: '<string>',
input_schema: '<unknown>',
output_schema: '<unknown>',
prompt: '<string>',
storage: '<unknown>',
settings: {timeout_seconds: 2, sensitive: true}
})
};
fetch('https://api.deck.co/v2/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deck.co/v2/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'agent_id' => '<string>',
'id' => '<string>',
'input_schema' => '<unknown>',
'output_schema' => '<unknown>',
'prompt' => '<string>',
'storage' => '<unknown>',
'settings' => [
'timeout_seconds' => 2,
'sensitive' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deck.co/v2/tasks"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"id\": \"<string>\",\n \"input_schema\": \"<unknown>\",\n \"output_schema\": \"<unknown>\",\n \"prompt\": \"<string>\",\n \"storage\": \"<unknown>\",\n \"settings\": {\n \"timeout_seconds\": 2,\n \"sensitive\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deck.co/v2/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"id\": \"<string>\",\n \"input_schema\": \"<unknown>\",\n \"output_schema\": \"<unknown>\",\n \"prompt\": \"<string>\",\n \"storage\": \"<unknown>\",\n \"settings\": {\n \"timeout_seconds\": 2,\n \"sensitive\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deck.co/v2/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"id\": \"<string>\",\n \"input_schema\": \"<unknown>\",\n \"output_schema\": \"<unknown>\",\n \"prompt\": \"<string>\",\n \"storage\": \"<unknown>\",\n \"settings\": {\n \"timeout_seconds\": 2,\n \"sensitive\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "task_AbC123xYz456",
"object": "<string>",
"name": "<string>",
"prompt": "<string>",
"status": "<string>",
"agent_id": "<string>",
"input_schema": "<unknown>",
"output_schema": "<unknown>",
"storage": "<unknown>",
"settings": "<unknown>",
"created_at": "2026-08-24T12:00:00Z",
"updated_at": "2026-08-24T12:00:00Z",
"request_id": "<string>"
}{
"errors": {},
"type": "<string>",
"title": "<string>",
"status": 123,
"traceId": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}Create a task
Creates a new task on an agent. A task is a defined action an agent can perform, such as fetching data or submitting a form.
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>",
"settings": {
"timeout_seconds": 2,
"sensitive": true
}
}
'import requests
url = "https://api.deck.co/v2/tasks"
payload = {
"name": "<string>",
"agent_id": "<string>",
"id": "<string>",
"input_schema": "<unknown>",
"output_schema": "<unknown>",
"prompt": "<string>",
"storage": "<unknown>",
"settings": {
"timeout_seconds": 2,
"sensitive": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
agent_id: '<string>',
id: '<string>',
input_schema: '<unknown>',
output_schema: '<unknown>',
prompt: '<string>',
storage: '<unknown>',
settings: {timeout_seconds: 2, sensitive: true}
})
};
fetch('https://api.deck.co/v2/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.deck.co/v2/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'agent_id' => '<string>',
'id' => '<string>',
'input_schema' => '<unknown>',
'output_schema' => '<unknown>',
'prompt' => '<string>',
'storage' => '<unknown>',
'settings' => [
'timeout_seconds' => 2,
'sensitive' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.deck.co/v2/tasks"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"id\": \"<string>\",\n \"input_schema\": \"<unknown>\",\n \"output_schema\": \"<unknown>\",\n \"prompt\": \"<string>\",\n \"storage\": \"<unknown>\",\n \"settings\": {\n \"timeout_seconds\": 2,\n \"sensitive\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.deck.co/v2/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"id\": \"<string>\",\n \"input_schema\": \"<unknown>\",\n \"output_schema\": \"<unknown>\",\n \"prompt\": \"<string>\",\n \"storage\": \"<unknown>\",\n \"settings\": {\n \"timeout_seconds\": 2,\n \"sensitive\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.deck.co/v2/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"id\": \"<string>\",\n \"input_schema\": \"<unknown>\",\n \"output_schema\": \"<unknown>\",\n \"prompt\": \"<string>\",\n \"storage\": \"<unknown>\",\n \"settings\": {\n \"timeout_seconds\": 2,\n \"sensitive\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "task_AbC123xYz456",
"object": "<string>",
"name": "<string>",
"prompt": "<string>",
"status": "<string>",
"agent_id": "<string>",
"input_schema": "<unknown>",
"output_schema": "<unknown>",
"storage": "<unknown>",
"settings": "<unknown>",
"created_at": "2026-08-24T12:00:00Z",
"updated_at": "2026-08-24T12:00:00Z",
"request_id": "<string>"
}{
"errors": {},
"type": "<string>",
"title": "<string>",
"status": 123,
"traceId": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}{
"errors": [
{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"request_id": "<string>"
}Headers
Optional key that makes the request idempotent. Retrying with the same key returns the original response instead of repeating the operation; keys expire after 24 hours. Any string up to 256 characters. See Idempotency.
256"550e8400-e29b-41d4-a716-446655440000"
Body
Request body for creating a new task.
Response
Created
A task object. Tasks are defined actions an agent can perform.
Task-level settings. Supports timeout_seconds (the per-run timeout, in seconds) and sensitive (when true, the Console hides the live browser view, agent reasoning, and screenshots for this task's runs). null when no settings were set on the task, in which case runs use your plan's default timeout and the task is not sensitive.
Was this page helpful?