---
title: "Create Task Definition"
method: POST
path: "/v1/workspaces/{workspace}/task-definitions/"
tags: ["v1", "protected", "task-definitions"]
---

# Create Task Definition

`POST /v1/workspaces/{workspace}/task-definitions/`

## Request

- The document declares no server URL.
- Auth: HTTP bearer

Save a task: the agent, what to ask it, and the parameters.

## Path parameters

- `workspace` string, required: Slug of the workspace the request acts in

## Request body

- TaskDefinitionCreate: A saved task: the agent, what to ask it, and the parameters to ask with.
  - `agent_id` string, uuid, required: UUID of the agent that runs the task.
  - `description` string, required: What the agent is asked to do each time the task runs.
  - `name` string, required: What the saved task is called.
  - `parameters` object: Task parameters every run of it starts with, as on a run.

## Response `201`

Successful Response

- TaskDefinitionResponse
  - `agent_id` string, uuid, required
  - `created_at` string, date-time, required
  - `created_by` string, required
  - `description` string, required
  - `id` string, uuid, required
  - `name` string, required
  - `parameters` object, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-20** `1868622eed6d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentarea/apis/agentarea-api/changes/v1/workspaces/:workspace/task-definitions/post.md)

---

[API](https://skmtc.dev/agentarea/apis/agentarea-api.md) - [All operations](https://skmtc.dev/agentarea/apis/agentarea-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentarea/apis/agentarea-api/revisions/5b651833a114?raw)
