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.

Connect your agent
The test
  • task_moved

    Calls each of POST /api/1.0/projects/*/sections and POST /api/1.0/sections/*/addTask

Starting records

  • projects

    name
    Q4 launches
  • users

    email
    ancha@acme.example
    name
    Ancha Assistant

Connect your agent to the Asana mock

When ancha runs your agent, it sets:

  • ASANA_API_URL
  • ASANA_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

GET/api/1.0/projects
GET/api/1.0/projects/{project_gid}
GET/api/1.0/projects/{project_gid}/sections
POST/api/1.0/projects/{project_gid}/sections
GET/api/1.0/projects/{project_gid}/tasks
POST/api/1.0/sections/{section_gid}/addTask
GET/api/1.0/sections/{section_gid}/tasks
GET/api/1.0/tasks
POST/api/1.0/tasks
GET/api/1.0/tasks/{task_gid}
PUT/api/1.0/tasks/{task_gid}
DELETE/api/1.0/tasks/{task_gid}
POST/api/1.0/tasks/{task_gid}/addProject
POST/api/1.0/tasks/{task_gid}/removeProject
GET/api/1.0/tasks/{task_gid}/stories
POST/api/1.0/tasks/{task_gid}/stories
GET/api/1.0/tasks/{task_gid}/subtasks
POST/api/1.0/tasks/{task_gid}/subtasks
GET/api/1.0/users
GET/api/1.0/users/{user_gid}
GET/api/1.0/workspaces
GET/api/1.0/workspaces/{workspace_gid}
GET/api/1.0/workspaces/{workspace_gid}/tasks/search

Seed 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/*/addTask

More code and issues tools

All 43 tools

Asana API mock FAQ

How can I verify that an agent completed an Asana task?

In Ancha, changing a task to completed: true through PUT /api/1.0/tasks/{task_gid} 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 /api/1.0/sections/{section_gid}/addTask 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.

Book a demo

Ancha is not affiliated with Asana.