> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update or assign annotation tasks in bulk

> Update many annotation tasks in one request, operating in one of two mutually exclusive modes.

In ids mode, provide a list of task IDs together with an `assigned_to` and/or a `status`
(limited to `pending_redo` or `completed`) to apply those field changes to each listed task;
only tasks that currently exist are affected and IDs that do not resolve are silently skipped.
In audit_assignment mode, provide an evaluation ID, queue ID, and evaluation item IDs to assign
Level 1 and/or Level 2 auditors for those items, creating the underlying audit tasks when they do
not yet exist; a Level 2 auditor cannot be assigned unless a Level 1 auditor is already present.
Exactly one of `ids` or `audit_assignment` must be supplied, and `assigned_to`/`status` are only
valid in ids mode. Access and state checks run before any write, so the request is rejected as a
whole with nothing persisted if any task is inaccessible, if a status change is attempted without
a modification role, or if an already-completed task would be reassigned; audit assignment also
requires a modification role. Reassigning a task to a new user emits a task-start lineage event,
and the response returns the affected annotation tasks.



## OpenAPI

````yaml https://api.sgp.scale.com/openapi-versions/v5/openapi.json patch /v5/annotation-tasks/batch
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/annotation-tasks/batch:
    patch:
      tags:
        - Annotation Tasks
      summary: Update or assign annotation tasks in bulk
      description: >-
        Update many annotation tasks in one request, operating in one of two
        mutually exclusive modes.


        In ids mode, provide a list of task IDs together with an `assigned_to`
        and/or a `status`

        (limited to `pending_redo` or `completed`) to apply those field changes
        to each listed task;

        only tasks that currently exist are affected and IDs that do not resolve
        are silently skipped.

        In audit_assignment mode, provide an evaluation ID, queue ID, and
        evaluation item IDs to assign

        Level 1 and/or Level 2 auditors for those items, creating the underlying
        audit tasks when they do

        not yet exist; a Level 2 auditor cannot be assigned unless a Level 1
        auditor is already present.

        Exactly one of `ids` or `audit_assignment` must be supplied, and
        `assigned_to`/`status` are only

        valid in ids mode. Access and state checks run before any write, so the
        request is rejected as a

        whole with nothing persisted if any task is inaccessible, if a status
        change is attempted without

        a modification role, or if an already-completed task would be
        reassigned; audit assignment also

        requires a modification role. Reassigning a task to a new user emits a
        task-start lineage event,

        and the response returns the affected annotation tasks.
      operationId: PATCH-V5-/v5/annotation-tasks/batch
      parameters:
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnnotationTaskBatchUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIList_AnnotationTask_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AnnotationTaskBatchUpdateRequest:
      properties:
        ids:
          title: Ids
          items:
            type: string
          type: array
        audit_assignment:
          $ref: '#/components/schemas/AnnotationTaskAuditAssignmentRequest'
        assigned_to:
          title: Assigned To
          type: string
        status:
          title: Status
          type: string
          enum:
            - PENDING_REDO
            - COMPLETED
      type: object
      title: AnnotationTaskBatchUpdateRequest
    APIList_AnnotationTask_:
      properties:
        object:
          type: string
          const: list
          title: Object
          default: list
        items:
          items:
            $ref: '#/components/schemas/AnnotationTask'
          type: array
          title: Items
      type: object
      required:
        - items
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AnnotationTaskAuditAssignmentRequest:
      properties:
        evaluation_id:
          type: string
          title: Evaluation Id
        queue_id:
          type: string
          title: Queue Id
        evaluation_item_ids:
          items:
            type: string
          type: array
          title: Evaluation Item Ids
        level_1_assigned_to:
          title: Level 1 Assigned To
          type: string
        level_2_assigned_to:
          title: Level 2 Assigned To
          type: string
      type: object
      required:
        - evaluation_id
        - queue_id
        - evaluation_item_ids
      title: AnnotationTaskAuditAssignmentRequest
    AnnotationTask:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: annotation_task
          title: Object
          default: annotation_task
        queue_id:
          type: string
          title: Queue Id
        evaluation_id:
          type: string
          title: Evaluation Id
        evaluation_item_id:
          type: string
          title: Evaluation Item Id
        task_type:
          $ref: '#/components/schemas/TaskORMTaskTypeEnum'
        assigned_to:
          title: Assigned To
          type: string
        assignment_expires_at:
          title: Assignment Expires At
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/TaskORMStatusEnum'
        priority:
          type: integer
          title: Priority
        updated_at:
          type: string
          format: date-time
          title: Updated At
        duration_seconds:
          title: Duration Seconds
          type: integer
        flagged_for_review:
          title: Flagged For Review
          type: boolean
        review_comment:
          title: Review Comment
          type: string
      type: object
      required:
        - id
        - queue_id
        - evaluation_id
        - evaluation_item_id
        - task_type
        - status
        - priority
        - updated_at
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TaskORMTaskTypeEnum:
      type: string
      enum:
        - EVALUATION_ANNOTATION
        - EVALUATION_AUDIT
        - CONTRIBUTOR_ANNOTATION
        - CONTRIBUTOR_AUDIT
      title: TaskORMTaskTypeEnum
    TaskORMStatusEnum:
      type: string
      enum:
        - NOT_READY
        - PENDING
        - PENDING_REDO
        - COMPLETED
        - FIXED
      title: TaskORMStatusEnum
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````