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

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

# Task

One task: the list's fields except the name and timestamps, the requirement set and contract assignment behind it, and its slots and answers.

## 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
components:
  schemas:
    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
    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
    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
    RequirementSetId:
      type: string
      description: A requirement set's ID, a TypeID with the prefix requirementset.
      pattern: ^requirementset_[0-7][0-9a-hjkmnp-tv-z]{25}$
      example: requirementset_01h455vb4pex5vsknk084sn02q
    TaskSlot:
      type: object
      description: One position a task asks to be answered. A single slot is answered
        as a whole; a section slot is answered per member field, listed in
        fields.
      required:
        - key
        - kind
        - required
        - locked
        - sensitive
      properties:
        key:
          type: string
          description: The slot's key, which submissions name as slotKey.
          example: residentState
        kind:
          type: string
          description: single or section.
          enum:
            - single
            - section
          example: single
        required:
          type: boolean
          description: Whether the slot must be answered.
          example: true
        locked:
          type: boolean
          description: Whether the slot was locked after it was filled in from the
            producer's record.
          example: false
        sensitive:
          type: boolean
          description: Whether the slot's answers are sensitive. A sensitive answer is
            always masked.
          example: false
        jurisdiction:
          type: string
          description: The two-letter code of the state asking the question, or ADJUSTER.
            Absent unless the task asks state-specific questions.
          example: CO
        fields:
          type: array
          description: A section slot's member fields. Absent on a single slot.
          items:
            type: object
            description: One member field of a section slot.
            required:
              - fieldKey
              - required
              - sensitive
            properties:
              fieldKey:
                type: string
                description: The field's key, which submissions name as fieldKey.
                example: addressLine1
              required:
                type: boolean
                description: Whether the field must be answered.
                example: true
              sensitive:
                type: boolean
                description: Whether the field's answers are sensitive. A sensitive answer is
                  always masked.
                example: false
        entries:
          type: array
          description: A repeatable section's entries, in the order they were added, which
            submissions name as entryId. Absent on any other slot.
          items:
            $ref: "#/components/schemas/SectionEntryId"
      example:
        key: residentState
        kind: single
        required: true
        locked: false
        sensitive: false
    TaskSubmission:
      type: object
      description: "The latest answer at one position: slotKey, with fieldKey for a
        section slot's field and entryId for a repeatable section's entry."
      required:
        - slotKey
        - performer
        - value
      properties:
        slotKey:
          type: string
          description: The key of the slot answered.
          example: residentState
        fieldKey:
          type: string
          description: The member field answered. Absent unless the slot is a section.
          example: addressLine1
        entryId:
          $ref: "#/components/schemas/SectionEntryId"
        performer:
          type: object
          description: Who gave the answer. personId names the person who answered; it is
            absent for system, and for a person the requirement set's rules hide
            from your organization.
          required:
            - kind
          properties:
            kind:
              type: string
              description: person for an answer a person gave; system for one filled in from
                the producer's record.
              enum:
                - person
                - system
              example: person
            personId:
              $ref: "#/components/schemas/PersonId"
        value:
          type: object
          description: "The answer. kind says which field carries it: inline the answer
            itself, file a description of an uploaded file. prefilled and masked
            carry neither: a prefilled answer stays in the producer's record,
            and a sensitive answer is never returned."
          required:
            - kind
          properties:
            kind:
              type: string
              description: inline, file, prefilled or masked.
              enum:
                - inline
                - file
                - prefilled
                - masked
              example: inline
            inline:
              description: The answer as given, any JSON value. Present only for inline.
              example: CO
            file:
              $ref: "#/components/schemas/TaskFile"
              description: The uploaded file. Present only for file; the bytes are not
                returned. GET /v1/tasks/{id}/files/{slot} returns a link to
                them.
      example:
        slotKey: ssn
        performer:
          kind: person
          personId: person_01h455vb4pex5vsknk084sn02q
        value:
          kind: masked
    SectionEntryId:
      type: string
      description: The ID of one entry of a task's repeatable section, a TypeID with
        the prefix sectionentry.
      pattern: ^sectionentry_[0-7][0-9a-hjkmnp-tv-z]{25}$
      example: sectionentry_01h455vb4pex5vsknk084sn02q
    TaskFile:
      type: object
      description: A file uploaded to answer a slot of a task. The bytes are not part of it.
      required:
        - name
        - contentType
        - sizeBytes
        - sha256
      properties:
        name:
          type: string
          description: The file's name as uploaded.
          example: license.pdf
        contentType:
          type: string
          description: The file's media type.
          example: application/pdf
        sizeBytes:
          type: integer
          format: int64
          description: The file's size in bytes.
          example: 48213
        sha256:
          type: string
          description: The hex SHA-256 of the file's bytes.
          example: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
      example:
        name: license.pdf
        contentType: application/pdf
        sizeBytes: 48213
        sha256: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
    Task:
      type: object
      description: "One task: the list's fields except the name and timestamps, the
        requirement set and contract assignment behind it, and its slots and
        answers."
      required:
        - id
        - taskType
        - state
        - required
        - locked
        - requirementSet
        - contractAssignmentId
        - contractAssignmentRelation
        - dependsOn
        - slots
        - submissions
      properties:
        id:
          $ref: "#/components/schemas/TaskId"
        taskType:
          type: string
          description: The kind of task, as on the list.
          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.
          example: true
        locked:
          type: boolean
          description: Whether the task waits on others before it can be completed.
          example: false
        owner:
          $ref: "#/components/schemas/TaskOwner"
        requirementSet:
          type:
            - object
            - "null"
          description: The requirement set, at the revision, that raised the task. Null on
            a task raised on its own rather than by a set, and on one raised by
            a set another organization imposed.
          required:
            - id
            - revision
          properties:
            id:
              $ref: "#/components/schemas/RequirementSetId"
            revision:
              type: integer
              description: The revision of the set that raised the task.
              example: 3
          example:
            id: requirementset_01h455vb4pex5vsknk084sn02q
            revision: 3
        contractAssignmentId:
          type:
            - string
            - "null"
          description: The contract assignment the change request that raised the task
            created, modified, or terminated; contractAssignmentRelation says
            which. It is the same link GET /v1/tasks?contract_assignment_id=
            follows, so a task naming an assignment here is one that filter
            returns. Null on a task raised on its own, one raised without a
            change request, one raised by a change request that terminates a
            whole contract, one raised by a set another organization imposed,
            and one whose change request has not been applied yet.
          pattern: ^contractassignment_[0-7][0-9a-hjkmnp-tv-z]{25}$
          example: contractassignment_01h455vb4pex5vsknk084sn02q
        contractAssignmentRelation:
          type:
            - string
            - "null"
          description: "How the change request that raised the task touched
            contractAssignmentId: created (it added the assignment), modified
            (it changed the assignment's upline, commission level,
            annualization, states or writing number) or terminated (it ended the
            assignment). Null exactly when contractAssignmentId is. More values
            may be added; treat an unknown value as another relation to the same
            assignment."
          example: created
        dependsOn:
          type: array
          description: The tasks this one waits on, empty when none.
          items:
            $ref: "#/components/schemas/TaskId"
        slots:
          type: array
          description: The positions the task asks to be answered, empty when it asks
            nothing.
          items:
            $ref: "#/components/schemas/TaskSlot"
        submissions:
          type: array
          description: The latest answer at each slot that has one.
          items:
            $ref: "#/components/schemas/TaskSubmission"
      example:
        id: task_01h455vb4pex5vsknk084sn02q
        taskType: work
        state: in_progress
        subjectPersonId: person_01h455vb4pex5vsknk084sn02q
        required: true
        locked: false
        requirementSet:
          id: requirementset_01h455vb4pex5vsknk084sn02q
          revision: 3
        contractAssignmentId: contractassignment_01h455vb4pex5vsknk084sn02q
        contractAssignmentRelation: created
        dependsOn: []
        slots:
          - key: residentState
            kind: single
            required: true
            locked: false
            sensitive: false
        submissions:
          - slotKey: residentState
            performer:
              kind: person
              personId: person_01h455vb4pex5vsknk084sn02q
            value:
              kind: inline
              inline: CO
```
