Skip to content

Create a new task

POST
/api/v1/tasks

Create a new task.

Args: body: Task creation parameters.

Returns: Created task data.

Raises: 400: Neither projects nor workspace provided.

CreateTaskRequest

Request body for creating a task.

Per FR-API-TASK-003: Create task endpoint.

Attributes: name: Task name (required). notes: Task description (optional). assignee: Assignee user GID (optional). projects: List of project GIDs to add task to (optional). due_on: Due date in YYYY-MM-DD format (optional). workspace: Workspace GID (required if no projects specified).

object
name
required
Name

Task name

string
>= 1 characters
notes
Any of:
string
assignee
Any of:
string
projects
Any of:
Array<string>
due_on
Any of:
string
/^\d{4}-\d{2}-\d{2}$/
workspace
Any of:
string

Successful Response

SuccessResponse[AsanaResource]
object
data
required
AsanaResource

Response data payload

object
gid
required
Gid

Globally unique Asana resource identifier

string
resource_type
Any of:
string
name
Any of:
string
key
additional properties
any
meta
required
ResponseMeta

Response metadata

object
request_id
required
Request Id

Request correlation ID

string
>= 1 characters
timestamp
Timestamp

Response timestamp (UTC)

string format: date-time
pagination
Any of:
PaginationMeta

Pagination metadata for list responses.

Per ADR-ASANA-008: Cursor-based pagination with opaque offset.

Attributes: limit: Number of items requested per page. has_more: Whether more items exist after this page. next_offset: Opaque cursor for next page (None if no more pages).

object
limit
required
Limit

Number of items per page

integer
>= 1
has_more
required
Has More

Whether more items exist

boolean
next_offset
Any of:
string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string