---
title: "Create a task"
method: POST
path: "/api/v1/agent/{agentId}/task"
tags: ["agent"]
---

# Create a task

`POST /api/v1/agent/{agentId}/task`

Creates a new task and submits it to the agent for processing

## Path parameters

- `agentId` string, required

## Headers

- `authorization` string — This is your JWT tolen
- `x-api-key` string — A valid API key

## Request body

- object
  - `cancelUrl` string
  - `successUrl` string
  - `email` string, email
  - `test` boolean
  - `data` object, required

## Response `200`

200

- object
  - `success` boolean, required
  - `task` object, required
    - `id` string, required
    - `title` string, nullable, required
    - `status` string, required
    - `cost` string, required
    - `userId` string, nullable, required
    - `agentId` string, nullable, required
    - `data` unknown, required
    - `test` boolean, required
    - `paymentComplete` boolean, nullable, required
    - `paymentDetails` unknown, required
    - `createdAt` string, required
    - `updatedAt` string, required
  - `paymentRequired` boolean, required
  - `redirectTo` string

## Changes

- **2024-08-20** `74bdfb8101cc` — 8 breaking, 1 warning, 14 info
  - added the new required request property `data`
  - the `task/id` response's property type/format changed from `string`/`uuid` to `string`/`` for status `200`
  - removed the required property `proposal` from the response with the `200` status
  - removed the required property `task/mode` from the response with the `200` status
  - …19 more
- **2024-08-03** `3b82b46ab1d2` — 1 info
  - added the required property `task/paymentState` to the response with the `200` status

[Change history](https://skmtc.dev/artilla-ai/apis/artilla-api-documentation/changes/api/v1/agent/:agentId/task/post.md)

---

[API](https://skmtc.dev/artilla-ai/apis/artilla-api-documentation.md) · [All operations](https://skmtc.dev/artilla-ai/apis/artilla-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/artilla-ai/artilla-api-documentation/revisions/db7d7d4115f0/schema)
