Early access
The Command API is in early access, and its interface is subject to change. During early access, we may change or remove endpoints, fields, and behaviors without following our standard deprecation process. Every Command API reference page carries an early access banner as a reminder.
We’d love for you to build with it and share your feelings with us – your feedback will directly shape the API before general availability. See Questions and feedback below.
Summary
We’re opening early access to the Command API, a dedicated set of endpoints for Command teamspaces, tickets, to-dos, releases, and coding agent sessions.
Until now, the only way to work with Command objects was through the generic /projects and /tasks endpoints. That meant locating Command custom fields yourself and re-implementing Command’s rules in your integrations. Actions the web app does in one step, such as creating a ticket or linking a release to a teamspace, took several calls, and some, such as creating a to-do, weren’t possible at all.
The Command API models Command objects directly and applies Command’s rules on the server, so your integration gets the same behavior as the web app.
Key highlights:
- Dedicated resources: Teamspaces, tickets, to-dos, releases, labels, coding agents, and coding agent sessions, all under
/command/ - One-step writes: Creating a teamspace sets up its board, Command fields, and Insights dashboard; creating a ticket returns a fully set-up ticket
- Server-side rules: Work stage and completion status are kept consistent for you, and invalid combinations return descriptive errors
- To-dos via API: Create, update, complete, and delete to-dos on tickets for the first time
- Coding agent delegation: Start a coding agent session on a ticket or to-do and follow its progress
- Granular OAuth scopes: New Command-specific granular scopes
Who is affected
This is a purely additive release. No action is required for existing integrations.
- Existing endpoints don’t change.
/projectsand/taskskeep returning teamspaces, releases, tickets, and to-dos as projects and tasks. If you work with Command objects through those endpoints today (including via theinclude_asana_created_custom_typeschange described in this changelog post), your integration will continue to work as is. - Developers building on Command can use the Command API instead of mapping Command concepts onto generic endpoints.
- A full Command license is required. Every Command endpoint, for reads and writes, requires the authenticated user to have full Command access. Users with a limited Command license receive a
400 command_license_required. Standard Asana permissions on the underlying project or task still apply on top of that.
Timeline
| Phase | Target date | Description |
|---|---|---|
| Early access | Available now! | Command API endpoints available and documented in the API reference. The interface may change without the standard deprecation process. |
| General availability | To be announced | We’ll post an update in this thread before general availability. |
Conventions
These conventions apply to every Command endpoint:
- Base path: All routes live under
https://app.asana.com/api/1.0/command/, for example/command/teamspaces. Paths below omit/api/1.0. - Resource types:
resource_typevalues are prefixed withcommand_(command_teamspace,command_ticket,command_todo,command_release,command_coding_agent,command_coding_agent_session,command_work_stage,command_code_change,command_label). - Same gids: A teamspace or release has the same gid as the project behind it; a ticket or to-do has the same gid as the task behind it.
- Workspace: Every Command object has a compact
workspacefield. - Representations: Responses use the standard compact and full representations.
opt_fieldsandopt_prettywork as on other endpoints. Some fields that are expensive to compute (for example, a teamspace’swork_stagesand a ticket’scode_changes) are only returned when requested inopt_fields. - Pagination: List endpoints accept
limit(1–100) andoffset, and returnnext_page. - Create responses:
POSTendpoints that create an object return201with the full object and aLocationheader. - Deletes: Deleting a teamspace, ticket, to-do, label, or release removes it and returns an empty data object.
Key concepts
- Teamspace: Where a software team plans and tracks its work. Holds the team’s tickets, work stages, ticket ID prefix (
ticket_prefix) and cycle settings (cycle_length_weeks,cycle_start_on,current_cycle). Changingticket_prefixchanges the prefix of every existing ticket ID in the teamspace (the numbers stay the same), so don’t treat ticket IDs as permanent identifiers – use GIDs. - Ticket: A feature, bug, or chore. A ticket belongs to a teamspace, a release, or both. Its human-readable ID (
short_id, e.g.,CODE-42) combines the teamspace’s prefix and a number. - To-do: A checklist item on a ticket, with its own assignee and a writable
is_completed. A ticket can have up to 45 to-dos, returned in order in the ticket’stodosfield. - Release: Groups tickets that ship together and can be linked to several teamspaces. Adding a ticket to a release links the release to the ticket’s teamspace if it isn’t linked yet. Link or unlink teamspaces with
/teamspaces/addand/teamspaces/remove, which need edit access to each teamspace. Unlinking a teamspace also removes that teamspace’s tickets from the release; the tickets stay in their teamspace. - Coding agent session: A run of a third-party coding agent on a ticket or to-do. The agent works in the repositories configured for the ticket’s teamspace and links its pull requests back to the ticket. Sessions start asynchronously.
- Label: A teamspace-level object that can be applied to a ticket.
New endpoints
For the full list of available Command API endpoints, please refer to our API Reference.
New OAuth scopes
| Resource | Scopes |
|---|---|
| Teamspaces | command_teamspaces:read, command_teamspaces:write, command_teamspaces:delete |
| Tickets | command_tickets:read, command_tickets:write, command_tickets:delete |
| Releases | command_releases:read, command_releases:write, command_releases:delete |
| Coding agents | command_coding_agents:read |
| Coding agent sessions | command_coding_agent_sessions:read, command_coding_agent_sessions:write |
| Labels | command_labels:write, command_labels:delete |
Every Command endpoint also accepts the full-access default scope. Existing scopes such as tasks:* and projects:* don’t grant access to Command endpoints.
Usage
Create a teamspace
Creating a teamspace sets up its board view, Command fields and Insights dashboard, as the web app does. The Insights dashboard may finish setting up shortly after the response returns.
// POST /command/teamspaces
{
"data": {
"workspace": "11111",
"name": "Platform",
"ticket_prefix": "PLAT",
"cycle_length_weeks": 2,
"cycle_start_on": "2027-01-04"
}
}
ticket_prefix must be 1–20 letters or digits and unused in the workspace; if omitted, it’s derived from the name. cycle_length_weeks must be 1–12 (default 1), and cycle_start_on defaults to the Monday of the current week (UTC).
Get a teamspace’s work stages
To set a ticket’s work stage, you need the gid of one of its teamspace’s work stages. Request them with opt_fields:
// GET /command/teamspaces/{teamspace_gid}?opt_fields=name,work_stages
{
"data": {
"gid": "22222",
"resource_type": "command_teamspace",
"name": "Platform",
"work_stages": [
{
"gid": "30001",
"name": "Not started",
"category": "not_started"
},
{
"gid": "30002",
"name": "In progress",
"category": "in_progress"
},
{
"gid": "30003",
"name": "Done",
"category": "completed"
},
{
"gid": "30004",
"name": "Won't do",
"category": "canceled"
}
]
}
}
Work stage category is one of not_started, in_progress, unplanned, completed, or canceled. Work stages are read-only in the API.
Create a ticket
Send teamspace, releases, or both. If a release isn’t linked to the ticket’s teamspace yet, it gets linked. The ticket is fully set up when the response returns.
// POST /command/tickets
{
"data": {
"teamspace": "22222",
"name": "Fix login redirect loop",
"type": "bug",
"assignee": "me",
"releases": [
"44444"
]
}
}
// Response (abbreviated)
{
"data": {
"gid": "33333",
"resource_type": "command_ticket",
"name": "Fix login redirect loop",
"short_id": "PLAT-42",
"type": "bug",
"teamspace": {
"gid": "22222",
"resource_type": "command_teamspace",
"name": "Platform"
},
"work_stage": {
"gid": "30001",
"name": "Not started",
"category": "not_started"
},
"is_completed": false,
"completed_at": null,
"assignee": {
"gid": "12345",
"resource_type": "user",
"name": "Jamie Smith"
},
"releases": [
{
"gid": "44444",
"resource_type": "command_release",
"name": "January release"
}
],
"todos": [],
"permalink_url": "Log in - Asana",
"workspace": {
"gid": "11111",
"resource_type": "workspace",
"name": "Acme Corp"
}
}
}
Move a ticket through its work stages
Update work_stage to move a ticket forward.
// PUT /command/tickets/{ticket_gid}
{
"data": {
"work_stage": "30003"
}
}
List a teamspace’s open bugs
Filters combine with AND:
GET /command/teamspaces/{teamspace_gid}/tickets?type=bug&is_completed=false&assignee=me&limit=50
When filters are applied, a page may contain fewer than limit tickets — or none — while next_page is still set. Keep following next_page until it’s null.
Add a to-do to a ticket
// POST /command/tickets/{ticket_gid}/todos
{
"data": {
"name": "Add regression test",
"assignee": "me"
}
}
Without insert_before or insert_after, the to-do is added at the end. Complete it later with PUT /command/todos/{todo_gid} and "is_completed": true.
Add tickets to a release
// POST /command/releases/{release_gid}/tickets/add
{
"data": {
"tickets": [
"33333",
"33334"
]
}
}
Tickets already in the release are ignored. The same pattern applies to /tickets/remove, /teamspaces/add and /teamspaces/remove.
Find a release by name
GET /command/releases returns the releases in a workspace. Pass name to return only releases whose name contains that text, ignoring case:
GET /command/releases?workspace={workspace_gid}&name=january&limit=50
// Response (abbreviated)
{
"data": [
{
"gid": "44444",
"resource_type": "command_release",
"name": "January release"
},
{
"gid": "44445",
"resource_type": "command_release",
"name": "Hotfixes for January"
}
],
"next_page": null
}
To narrow the results further, add teamspace={teamspace_gid} to return only releases linked to that teamspace.
Start a coding agent session
First, find the coding agents turned on in the workspace with GET /command/coding_agents?workspace={workspace_gid}. Then start a session on a ticket or to-do:
// POST /command/coding_agent_sessions
{
"data": {
"target": "33333",
"coding_agent": "55555"
}
}
By default, the agent works in the repositories configured for the teamspace and the user. The session starts in the background, so the response returns with status: launching. Poll GET /command/coding_agent_sessions/{session_gid} to follow it as status moves from launching to active, then to completed or failed:
// GET /command/coding_agent_sessions/{session_gid}
{
"data": {
"gid": "66666",
"resource_type": "command_coding_agent_session",
"status": "failed",
"fail_reason": "missing_settings",
"external_url": null,
"coding_agent": {
"gid": "55555",
"resource_type": "command_coding_agent",
"name": "Cursor"
},
"target": {
"gid": "33333",
"resource_type": "command_ticket",
"name": "Fix login redirect loop"
},
"created_by": {
"gid": "12345",
"resource_type": "user",
"name": "Jamie Smith"
},
"created_at": "2027-01-12T10:15:00.000Z"
}
}
The POST request already checks the Coding Agent’s readiness, and if the session cannot be started, errors are returned directly in the POST response with the coding_agent_not_ready error and specific details about the cause (e.g., missing repository settings). However, problems found after the session starts show up as status: failed with a fail_reason.
Manage a teamspace’s labels
Labels belong to a teamspace and categorize its tickets. To create one, send the teamspace’s gid with a name and an optional color, which defaults to none:
// POST /command/labels
{
"data": {
"teamspace": "22222",
"name": "Bug bash",
"color": "blue"
}
}
The response returns 201 with the new label:
{
"data": {
"gid": "77777",
"resource_type": "command_label",
"name": "Bug bash",
"color": "blue"
}
}
To list a teamspace’s labels, request them with opt_fields:
// GET /command/teamspaces/{teamspace_gid}?opt_fields=name,labels
{
"data": {
"gid": "22222",
"resource_type": "command_teamspace",
"name": "Platform",
"labels": [
{
"gid": "77777",
"resource_type": "command_label",
"name": "Bug bash",
"color": "blue"
}
]
}
}
To delete a label, pass the teamspace it belongs to. Tickets that have the label stop showing it:
DELETE /command/labels/{label_gid}?teamspace={teamspace_gid}
Creating and deleting labels needs edit access to the teamspace’s labels. Use a label’s gid in labels when you create a ticket, or with POST /command/tickets/{ticket_gid}/labels/add and /labels/remove.
Command-specific errors
Most Command errors explain themselves (for example, an invalid ticket_prefix or cycle_length_weeks). A few come from Command’s rules and are worth handling explicitly:
400 todo_limit_reached: a ticket can have at most 45 to-dos.403 duplicate_ticket_prefix: another teamspace in the workspace already uses this prefix.403 coding_agent_not_ready: coding agent not available.
Not yet available in early access
The following aren’t part of the Command API yet. Where possible, use the existing endpoints in the meantime.
- Managing members, privacy and sharing for teamspaces, and releases
- Reordering tickets
- Configuring work stages, forecast settings and repository/GitHub settings
- Linking or unlinking code changes (a ticket’s linked pull and merge requests are readable via
opt_fields=code_changes) - Messaging, stopping or archiving coding agent sessions
- Command-specific webhooks and events
Resources
- What is Command by Asana?
- API Reference
- OAuth scopes
- Input/output options (
opt_fields) - Pagination
- Deprecations
- [ Upcoming ] Enhanced custom type support for projects and portfolios, plus new custom_type filtering
Questions and feedback
Since this is an early access release, your feedback will directly shape the Command API. We’re especially interested in:
- Which missing capabilities block your integration (see Not yet available in early access)
- How you’d like to find teamspaces (for example, a name filter on
GET /command/teamspaces) - Your experience starting and following coding agent sessions, including how failures surface
Please reply in this thread with questions or feedback.