An Asana API mock for organizing project tasks.
Give your agent the Q4 launches project and its tasks. It can add a section and move work into it; read the task’s memberships afterwards and check the section-creation and add-task calls.
task_movedCalls each of POST /api/1.0/projects/*/sections and POST /api/1.0/sections/*/addTask
Starting records
projects
- name
Q4 launches
users
ancha@acme.example- name
Ancha Assistant
Connect your agent to the Asana mock
When ancha runs your agent, it sets:
ASANA_API_URLASANA_ACCESS_TOKEN
Point the client you already use at them.
const headers = { Authorization: 'Bearer ' + process.env.ASANA_ACCESS_TOKEN, 'Content-Type': 'application/json' };
const me = (await (await fetch(process.env.ASANA_API_URL + '/users/me', { headers })).json()).data;
const { data: tasks } = await (await fetch(process.env.ASANA_API_URL + '/tasks?assignee=me&workspace=' + me.workspaces[0].gid + '&completed_since=now&opt_fields=name,due_on,projects.name', { headers })).json();
// Writes wrap the fields in data: fetch(url, { method: 'POST', headers, body: JSON.stringify({ data: { name, projects: [gid] } }) })Locally, ancha runs your agent as an ordinary process, so keep real Asana credentials out of its environment.
See all 23 endpoints
1
/api/1.0/projects/api/1.0/projects/{project_gid}/api/1.0/projects/{project_gid}/sections/api/1.0/projects/{project_gid}/sections/api/1.0/projects/{project_gid}/tasks/api/1.0/sections/{section_gid}/addTask/api/1.0/sections/{section_gid}/tasks/api/1.0/tasks/api/1.0/tasks/api/1.0/tasks/{task_gid}/api/1.0/tasks/{task_gid}/api/1.0/tasks/{task_gid}/api/1.0/tasks/{task_gid}/addProject/api/1.0/tasks/{task_gid}/removeProject/api/1.0/tasks/{task_gid}/stories/api/1.0/tasks/{task_gid}/stories/api/1.0/tasks/{task_gid}/subtasks/api/1.0/tasks/{task_gid}/subtasks/api/1.0/users/api/1.0/users/{user_gid}/api/1.0/workspaces/api/1.0/workspaces/{workspace_gid}/api/1.0/workspaces/{workspace_gid}/tasks/searchSeed your own data
The data the Asana mock starts with on every run, cut to a few records. ancha twins seed asana prints every field.
Full seed YAML
twins:
- asana
seed:
asana:
workspace:
name: Acme
domain: acme.example
me: ancha@acme.example
users:
- email: ancha@acme.example
name: Ancha Assistant
projects:
- name: Q4 launches
color: dark-purple
sections:
- Planned
created: -1500h
tasks:
- key: scheduled-reports
name: Scheduled reports beta
project: Q4 launches
due: 15d
created: -400h
Check what your agent did
Checks YAML
checks:
- id: task_moved
trace:
called:
- POST /api/1.0/projects/*/sections
- POST /api/1.0/sections/*/addTaskMore code and issues tools
All 43 toolsAsana API mock FAQ
How can I verify that an agent completed an Asana task?
In Ancha, changing a task to completed: true through PUT / sets its completion time and user. Read completed, completed_at and completed_by on the task, or read its stories for the marked_complete activity.
Can a task move between project sections in the Asana sandbox?
POST / moves the task into the chosen section and accepts insert_before or insert_after for ordering. The task's memberships shows its project and section after the move.
How do I page through Asana tasks and request their assignees?
For task lists in the mock, set limit from 1 to 100 and use next_page.offset for the next request. Use opt_fields to select fields such as assignee.email; the last page returns next_page: null.
Install the CLI and run your agent against the Asana mock.
Ancha is not affiliated with Asana.