---
title: "List tasks"
url: "https://developer-staging.agentsync.io/apis/platform-api/versions/8177e94d-86f2-48a5-8ed6-d5fbcb69f38a/operations/listTasks"
---

> Full API specification: https://developer-staging.agentsync.io/apis/platform-api/versions/8177e94d-86f2-48a5-8ed6-d5fbcb69f38a.md

# List tasks

`GET` `/v1/tasks`

Operation ID: `listTasks`

Lists the tasks your organization reaches: those raised by a requirement set your organization imposed, and those waiting in one of its queues. Narrow the list with producer_id, contract_assignment_id and state, alone or together. Send the same filters with every page of one listing. With contract_assignment_id a page can hold fewer items than page_size, or none, and still carry a nextToken; keep reading until the page has no nextToken.

## Query parameters

- `producer_id` (string, optional) - Only tasks about this person. A value that is not a person TypeID is a 400.
- `contract_assignment_id` (string, optional) - Only tasks raised by the requirement sets your organization imposed through a change request applied to this contract assignment: the one that created it, and any that modified it or terminated it. These are exactly the tasks whose contractAssignmentId is this assignment. An assignment your organization cannot see, or one no change request applied to, returns an empty page. A value that is not a contract assignment TypeID is a 400.
- `state` (array, optional) - Only tasks in these states. Repeat the parameter or send one comma-separated value. A value outside the list is a 400.
- `page_size` (integer, optional) - Items per page. Defaults to 50; a value above 200 is clamped to 200. A non-numeric or non-positive value is a 400.
- `page_token` (string, optional) - Opaque token from a previous response's page.nextToken. Send it with the same filters as the request that returned it: it is signed for them. A token that is malformed, altered, sent with other filters, or longer than 1024 bytes is a 400.

## Responses

- `200` - One page of the tasks your organization reaches.
- `400` - A parameter is missing, malformed or out of range (code parameter_invalid).
- `401` - The request has no bearer token, or the token is malformed, expired or wrongly signed (code token_invalid). Every /v1 path answers this without a valid token, including paths no route serves. The response carries WWW-Authenticate: Bearer.
- `403` - The token is valid but the API will not serve it. The code says why: caller_not_service_account (the token identifies a person; only service account tokens are accepted), caller_claims_missing (the token lacks a usable org_id or service_account_id claim), scope_missing (the token lacks the route's product scope, named in the details entry whose param is "scope"), or role_missing (the service account no longer holds a role at its organization that may call the route).
- `500` - The service failed in a way the caller cannot fix (code internal_error). A 500 written when the platform recovers from a panic has an empty body, and one written when a response cannot be encoded has a message and no details.
- `503` - A platform service this API depends on is unavailable (code service_unavailable).

## OpenAPI definition

```yaml
openapi: 3.1.1
info:
  title: AgentSync Platform API
  version: 0.0.1
servers:
  - url: https://api.{environment}.agentsync.io/platform
    description: AgentSync API gateway
    variables:
      environment:
        default: sandbox
        enum:
          - sandbox
paths:
  /v1/tasks:
    get:
      operationId: listTasks
      summary: List tasks
      description: "Lists the tasks your organization reaches: those raised by a
        requirement set your organization imposed, and those waiting in one of
        its queues. Narrow the list with producer_id, contract_assignment_id and
        state, alone or together. Send the same filters with every page of one
        listing. With contract_assignment_id a page can hold fewer items than
        page_size, or none, and still carry a nextToken; keep reading until the
        page has no nextToken."
      security:
        - oauth2:
            - platform.tasks.read
      parameters:
        - name: producer_id
          in: query
          description: Only tasks about this person. A value that is not a person TypeID
            is a 400.
          required: false
          schema:
            $ref: "#/components/schemas/PersonId"
          example: person_01h455vb4pex5vsknk084sn02q
        - name: contract_assignment_id
          in: query
          description: "Only tasks raised by the requirement sets your organization
            imposed through a change request applied to this contract
            assignment: the one that created it, and any that modified it or
            terminated it. These are exactly the tasks whose
            contractAssignmentId is this assignment. An assignment your
            organization cannot see, or one no change request applied to,
            returns an empty page. A value that is not a contract assignment
            TypeID is a 400."
          required: false
          schema:
            $ref: "#/components/schemas/ContractAssignmentId"
          example: contractassignment_01h455vb4pex5vsknk084sn02q
        - name: state
          in: query
          description: Only tasks in these states. Repeat the parameter or send one
            comma-separated value. A value outside the list is a 400.
          required: false
          style: form
          explode: true
          schema:
            type: array
            description: The states to include.
            items:
              type: string
              description: A task state.
              enum:
                - not_started
                - in_progress
                - returned
                - completed
                - approved
                - rejected
                - skipped
                - closed
              example: in_progress
          example:
            - not_started
            - in_progress
        - $ref: "#/components/parameters/PageSize"
        - $ref: "#/components/parameters/PageToken"
      responses:
        "200":
          description: One page of the tasks your organization reaches.
          content:
            application/json:
              schema:
                type: object
                description: A page of tasks.
                required:
                  - items
                  - page
                properties:
                  items:
                    type: array
                    description: The tasks on this page, empty when there are none.
                    items:
                      $ref: "#/components/schemas/TaskSummary"
                  page:
                    $ref: "#/components/schemas/Page"
              example:
                items:
                  - id: task_01h455vb4pex5vsknk084sn02q
                    name: Background questions
                    taskType: work
                    state: in_progress
                    subjectPersonId: person_01h455vb4pex5vsknk084sn02q
                    required: true
                    locked: false
                    owner:
                      kind: person
                      personId: person_01h455vb4pex5vsknk084sn02q
                    createdAt: 2026-03-02T09:30:00Z
                    updatedAt: 2026-03-03T14:00:00Z
                page:
                  nextToken: eyJrIjoiZXhhbXBsZSJ9
        "400":
          $ref: "#/components/responses/BadRequest"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "500":
          $ref: "#/components/responses/InternalError"
        "503":
          $ref: "#/components/responses/ServiceUnavailable"
security:
  - oauth2:
      - platform.tasks.read
components:
  schemas:
    PersonId:
      type: string
      description: A person's ID, a TypeID with the prefix person.
      pattern: ^person_[0-7][0-9a-hjkmnp-tv-z]{25}$
      example: person_01h455vb4pex5vsknk084sn02q
    ContractAssignmentId:
      type: string
      description: A contract assignment's ID, a TypeID with the prefix contractassignment.
      pattern: ^contractassignment_[0-7][0-9a-hjkmnp-tv-z]{25}$
      example: contractassignment_01h455vb4pex5vsknk084sn02q
    TaskSummary:
      type: object
      description: "A task your organization reaches: one raised by a requirement set
        your organization imposed, or one waiting in one of its queues. Who the
        work is about is subjectPersonId for a person, or subjectOrganizationId
        for an organization such as a firm; one of the two is present."
      required:
        - id
        - name
        - taskType
        - state
        - required
        - locked
        - createdAt
        - updatedAt
      properties:
        id:
          $ref: "#/components/schemas/TaskId"
        name:
          type: string
          description: The task's display name.
          example: Background questions
        taskType:
          type: string
          description: work asks the producer for answers; approval asks a reviewer to
            decide; review_submit asks the producer to review and submit their
            answers; forms_signature asks for a signature on forms.
          enum:
            - work
            - approval
            - review_submit
            - forms_signature
          example: work
        state:
          type: string
          description: Where the task sits in its lifecycle.
          enum:
            - not_started
            - in_progress
            - returned
            - completed
            - approved
            - rejected
            - skipped
            - closed
          example: in_progress
        subjectPersonId:
          $ref: "#/components/schemas/PersonId"
        subjectOrganizationId:
          $ref: "#/components/schemas/OrganizationId"
        required:
          type: boolean
          description: Whether the task is a required member of its requirement set, which
            means it cannot be skipped.
          example: true
        locked:
          type: boolean
          description: Whether the task waits on others first. A locked task can take
            answers but cannot be completed.
          example: false
        owner:
          $ref: "#/components/schemas/TaskOwner"
        createdAt:
          type: string
          format: date-time
          description: When the task was raised.
          example: 2026-03-02T09:30:00Z
        updatedAt:
          type: string
          format: date-time
          description: When the task last changed.
          example: 2026-03-03T14:00:00Z
        completedAt:
          type: string
          format: date-time
          description: When the task was completed or approved. Absent until it is.
          example: 2026-03-04T16:45:00Z
      example:
        id: task_01h455vb4pex5vsknk084sn02q
        name: Background questions
        taskType: work
        state: in_progress
        subjectPersonId: person_01h455vb4pex5vsknk084sn02q
        required: true
        locked: false
        owner:
          kind: person
          personId: person_01h455vb4pex5vsknk084sn02q
        createdAt: 2026-03-02T09:30:00Z
        updatedAt: 2026-03-03T14:00:00Z
    Page:
      type: object
      description: Pagination metadata of a collection response. nextToken is absent
        on the last page; pass it back as the page_token query parameter to
        continue.
      properties:
        nextToken:
          type: string
          description: Opaque token for the next page.
          example: eyJrIjoiZXhhbXBsZSJ9
      example:
        nextToken: eyJrIjoiZXhhbXBsZSJ9
    TaskId:
      type: string
      description: A task's ID, a TypeID with the prefix task.
      pattern: ^task_[0-7][0-9a-hjkmnp-tv-z]{25}$
      example: task_01h455vb4pex5vsknk084sn02q
    OrganizationId:
      type: string
      description: "An organization's ID: a TypeID with the prefix org. It never
        changes, and is the same ID for the organization across the AgentSync
        API."
      pattern: ^org_[0-7][0-9a-hjkmnp-tv-z]{25}$
      example: org_01h455vb4pex5vsknk084sn02q
    TaskOwner:
      type: object
      description: "Who owns a task: a named person, or a queue that a role at an
        organization works from. A person whom the requirement set's rules hide
        from your organization is shown as the queue the task was written for
        instead; any other named owner is shown by personId. Absent when the
        task has no owner."
      required:
        - kind
      properties:
        kind:
          type: string
          description: person when personId names the owner; queue when queue does.
          enum:
            - person
            - queue
          example: person
        personId:
          $ref: "#/components/schemas/PersonId"
        queue:
          type: object
          description: The queue that owns the task. Absent unless kind is queue.
          required:
            - organizationId
            - persona
          properties:
            organizationId:
              $ref: "#/components/schemas/OrganizationId"
            persona:
              type: string
              description: The role whose holders work the queue.
              example: compliance_reviewer
      example:
        kind: queue
        queue:
          organizationId: org_01h455vb4pex5vsknk084sn02q
          persona: compliance_reviewer
    Error:
      type: object
      description: "The canonical error envelope. Every error the API writes carries a
        machine-readable code as the first details entry, the one whose param is
        \"code\"; branch on that, not on the message. There are two exceptions,
        both 500s the service could not build a normal error for: the platform's
        panic recovery writes an empty body, and a failure to encode a response
        writes {\"message\": \"internal server error\"} with no details. Treat a
        500 without a code as internal_error. A 429 from the API gateway, in
        front of the API, carries a message only; treat any 429 as a signal to
        slow down."
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable summary of why the request failed.
          example: invalid page_size
        details:
          type: array
          description: 'The code entry {"param": "code", "message": "<code>"} first, then
            entries that name the offending request parameter. Present on every
            error the service writes except the two code-less 500s described
            above, so it is not marked required.'
          items:
            $ref: "#/components/schemas/ErrorDetail"
      example:
        message: invalid page_size
        details:
          - param: code
            message: parameter_invalid
          - param: page_size
            message: must be a positive integer
    ErrorDetail:
      type: object
      description: "One entry of an error's details: the error code, or a request
        parameter and what is wrong with it."
      required:
        - param
        - message
      properties:
        param:
          type: string
          description: The parameter the entry is about, or "code" for the error code.
          example: code
        message:
          type: string
          description: For param "code", the error code; otherwise what is wrong with the
            parameter.
          example: parameter_invalid
      example:
        param: code
        message: parameter_invalid
  parameters:
    PageSize:
      name: page_size
      in: query
      description: Items per page. Defaults to 50; a value above 200 is clamped to
        200. A non-numeric or non-positive value is a 400.
      required: false
      schema:
        type: integer
        minimum: 1
        default: 50
      example: 100
    PageToken:
      name: page_token
      in: query
      description: "Opaque token from a previous response's page.nextToken. Send it
        with the same filters as the request that returned it: it is signed for
        them. A token that is malformed, altered, sent with other filters, or
        longer than 1024 bytes is a 400."
      required: false
      schema:
        type: string
      example: eyJrIjoiZXhhbXBsZSJ9
  responses:
    BadRequest:
      description: A parameter is missing, malformed or out of range (code
        parameter_invalid).
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: invalid page_size
            details:
              - param: code
                message: parameter_invalid
              - param: page_size
                message: must be a positive integer
    Unauthorized:
      description: "The request has no bearer token, or the token is malformed,
        expired or wrongly signed (code token_invalid). Every /v1 path answers
        this without a valid token, including paths no route serves. The
        response carries WWW-Authenticate: Bearer."
      headers:
        WWW-Authenticate:
          description: The authentication scheme the API expects.
          schema:
            type: string
          example: Bearer
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: invalid or missing bearer token
            details:
              - param: code
                message: token_invalid
    Forbidden:
      description: "The token is valid but the API will not serve it. The code says
        why: caller_not_service_account (the token identifies a person; only
        service account tokens are accepted), caller_claims_missing (the token
        lacks a usable org_id or service_account_id claim), scope_missing (the
        token lacks the route's product scope, named in the details entry whose
        param is \"scope\"), or role_missing (the service account no longer
        holds a role at its organization that may call the route)."
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: token lacks the required scope
            details:
              - param: code
                message: scope_missing
              - param: scope
                message: platform.contracts.read
    InternalError:
      description: The service failed in a way the caller cannot fix (code
        internal_error). A 500 written when the platform recovers from a panic
        has an empty body, and one written when a response cannot be encoded has
        a message and no details.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: internal server error
            details:
              - param: code
                message: internal_error
    ServiceUnavailable:
      description: A platform service this API depends on is unavailable (code
        service_unavailable).
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            message: service unavailable
            details:
              - param: code
                message: service_unavailable
  securitySchemes:
    oauth2:
      type: oauth2
      description: "How to get the access token: the client-credentials flow, with the
        client ID and secret AgentSync issued for your organization. The token
        host follows the environment, auth.<environment>.agentsync.io. Request
        only the scopes your integration needs."
      flows:
        clientCredentials:
          tokenUrl: https://auth.sandbox.agentsync.io/oauth2/token
          scopes:
            platform.organizations.read: Read organizations.
            platform.contracts.read: Read contracts.
            platform.contract-assignments.read: Read contract assignments.
            platform.producers.read: Read producers.
            platform.tasks.read: Read tasks.
            platform.requirement-sets.read: Read requirement sets.
```
