> ## 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.

# Batch assign tasks to user



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/sgp/openapi.yml patch /v4/evaluations/{evaluation_id}/tasks/batch-assign
openapi: 3.1.0
info:
  title: EGP API V4
  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: []
tags:
  - name: Models
    description: Model API.
paths:
  /v4/evaluations/{evaluation_id}/tasks/batch-assign:
    patch:
      tags:
        - Evaluations
      summary: Batch assign tasks to user
      operationId: PATCH-V4-/tasks/batch-assign
      parameters:
        - name: evaluation_id
          in: path
          required: true
          schema:
            type: string
            title: Evaluation Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchAssignTaskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/TaskResponse'
                  - type: 'null'
                title: Response Patch-V4-/Tasks/Batch-Assign
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BatchAssignTaskRequest:
      properties:
        task_ids:
          items:
            type: string
          type: array
          title: Task Ids
          description: Tasks to be assigned
        assigned_to:
          title: Assigned To
          description: The ID of the user that the task is assigned to.
          type: string
      type: object
      required:
        - task_ids
      title: BatchAssignTaskRequest
    TaskResponse:
      properties:
        id:
          type: string
          title: Id
        task_type:
          $ref: '#/components/schemas/TaskORMTaskTypeEnum'
        task_entity_parent_id:
          type: string
          title: Task Entity Parent Id
        task_entity_id:
          type: string
          title: Task Entity Id
        account_id:
          title: Account Id
          description: The ID of the account that owns the given entity.
          type: string
        assigned_to:
          title: Assigned To
          description: The ID of the user that the task is assigned to.
          type: string
        assignment_expires_at:
          title: Assignment Expires At
          description: The date and time when the task assignment expires in ISO format.
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/TaskORMStatusEnum'
        priority:
          type: integer
          title: Priority
        task_entity:
          $ref: '#/components/schemas/TestCaseResultResponse'
          description: The entity that the task is associated with.
      type: object
      required:
        - id
        - task_type
        - task_entity_parent_id
        - task_entity_id
        - account_id
        - status
        - priority
      title: TaskResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    TestCaseResultResponse:
      oneOf:
        - $ref: '#/components/schemas/GenerationTestCaseResultResponse'
        - $ref: '#/components/schemas/FlexibleTestCaseResultResponse'
      title: TestCaseResultResponse
      discriminator:
        propertyName: test_case_evaluation_data_schema
        mapping:
          FLEXIBLE:
            $ref: '#/components/schemas/FlexibleTestCaseResultResponse'
          GENERATION:
            $ref: '#/components/schemas/GenerationTestCaseResultResponse'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    GenerationTestCaseResultResponse:
      properties:
        label_status:
          $ref: '#/components/schemas/EvaluationORMStatusEnum'
          description: >-
            The status of the test case result. This should not be explictly set
            when creating a test case result. When patching a test case result,
            this field can be set to 'PENDING' to prevent the test case result
            from being marked 'COMPLETED'.
          optional_in_request: true
        audit_status:
          $ref: '#/components/schemas/AuditORMStatusEnum'
        audit_required:
          title: Audit Required
          type: boolean
        audit_comment:
          title: Audit Comment
          type: string
        application_spec_id:
          type: string
          title: Application Spec Id
        evaluation_id:
          type: string
          title: Evaluation Id
        evaluation_dataset_id:
          type: string
          title: Evaluation Dataset Id
        evaluation_dataset_version_num:
          type: string
          title: Evaluation Dataset Version Num
        test_case_id:
          type: string
          title: Test Case Id
        test_case_evaluation_data:
          $ref: '#/components/schemas/ResultSchemaGeneration'
        test_case_evaluation_data_schema:
          type: string
          const: GENERATION
          title: Test Case Evaluation Data Schema
          default: GENERATION
        result:
          title: Result
          description: >-
            The result of the test case evaluation, in JSON form where the key
            is the question ID and the value is the result.
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: number
              - items:
                  anyOf:
                    - type: string
                    - type: integer
                    - type: number
                    - type: boolean
                type: array
          type: object
        completed_at:
          title: Completed At
          type: string
          format: date-time
        time_spent_labeling_s:
          title: Time Spent Labeling S
          description: The time spent labeling in seconds.
          type: integer
        application_test_case_output_id:
          title: Application Test Case Output Id
          type: string
        invalidated_at:
          title: Invalidated At
          description: >-
            The date and time when the entity was overwritten or deleted in ISO
            format.
          type: string
          format: date-time
        id:
          type: string
          title: Id
          description: The unique identifier of the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the entity was created in ISO format.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The date and time when the entity was last updated in ISO format.
        account_id:
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
          optional_in_request: true
          type: string
        created_by_user_id:
          type: string
          title: Created By User Id
          description: The user who originally created the entity.
        created_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that created the entity.
        annotated_by_user_id:
          title: Annotated By User Id
          description: The user who annotated the task.
          type: string
        annotated_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that annotated the entity.
        edited_by_user_id:
          title: Edited By User Id
          description: The user who edited the task.
          type: string
        edited_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that edited the entity.
        archived_at:
          title: Archived At
          description: The date and time when the entity was archived in ISO format.
          type: string
          format: date-time
        edited_by:
          $ref: '#/components/schemas/UserV2Details'
      type: object
      required:
        - label_status
        - application_spec_id
        - evaluation_id
        - evaluation_dataset_id
        - evaluation_dataset_version_num
        - test_case_id
        - test_case_evaluation_data
        - id
        - created_at
        - updated_at
        - account_id
        - created_by_user_id
        - created_by_identity_type
      title: GenerationTestCaseResultResponse
    FlexibleTestCaseResultResponse:
      properties:
        label_status:
          $ref: '#/components/schemas/EvaluationORMStatusEnum'
          description: >-
            The status of the test case result. This should not be explictly set
            when creating a test case result. When patching a test case result,
            this field can be set to 'PENDING' to prevent the test case result
            from being marked 'COMPLETED'.
          optional_in_request: true
        audit_status:
          $ref: '#/components/schemas/AuditORMStatusEnum'
        audit_required:
          title: Audit Required
          type: boolean
        audit_comment:
          title: Audit Comment
          type: string
        application_spec_id:
          type: string
          title: Application Spec Id
        evaluation_id:
          type: string
          title: Evaluation Id
        evaluation_dataset_id:
          type: string
          title: Evaluation Dataset Id
        evaluation_dataset_version_num:
          type: string
          title: Evaluation Dataset Version Num
        test_case_id:
          type: string
          title: Test Case Id
        test_case_evaluation_data:
          $ref: '#/components/schemas/ResultSchemaFlexible'
        test_case_evaluation_data_schema:
          type: string
          const: FLEXIBLE
          title: Test Case Evaluation Data Schema
          default: FLEXIBLE
        result:
          title: Result
          description: >-
            The result of the test case evaluation, in JSON form where the key
            is the question ID and the value is the result.
          additionalProperties:
            anyOf:
              - type: string
              - type: integer
              - type: boolean
              - type: number
              - items:
                  anyOf:
                    - type: string
                    - type: integer
                    - type: number
                    - type: boolean
                type: array
          type: object
        completed_at:
          title: Completed At
          type: string
          format: date-time
        time_spent_labeling_s:
          title: Time Spent Labeling S
          description: The time spent labeling in seconds.
          type: integer
        application_test_case_output_id:
          title: Application Test Case Output Id
          type: string
        invalidated_at:
          title: Invalidated At
          description: >-
            The date and time when the entity was overwritten or deleted in ISO
            format.
          type: string
          format: date-time
        id:
          type: string
          title: Id
          description: The unique identifier of the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The date and time when the entity was created in ISO format.
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The date and time when the entity was last updated in ISO format.
        account_id:
          title: Account Id
          description: The ID of the account that owns the given entity.
          can_patch: false
          optional_in_request: true
          type: string
        created_by_user_id:
          type: string
          title: Created By User Id
          description: The user who originally created the entity.
        created_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that created the entity.
        annotated_by_user_id:
          title: Annotated By User Id
          description: The user who annotated the task.
          type: string
        annotated_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that annotated the entity.
        edited_by_user_id:
          title: Edited By User Id
          description: The user who edited the task.
          type: string
        edited_by_identity_type:
          $ref: '#/components/schemas/IdentifierTypeEnum'
          description: The type of identity that edited the entity.
        archived_at:
          title: Archived At
          description: The date and time when the entity was archived in ISO format.
          type: string
          format: date-time
        edited_by:
          $ref: '#/components/schemas/UserV2Details'
      type: object
      required:
        - label_status
        - application_spec_id
        - evaluation_id
        - evaluation_dataset_id
        - evaluation_dataset_version_num
        - test_case_id
        - test_case_evaluation_data
        - id
        - created_at
        - updated_at
        - account_id
        - created_by_user_id
        - created_by_identity_type
      title: FlexibleTestCaseResultResponse
    EvaluationORMStatusEnum:
      type: string
      enum:
        - PENDING
        - COMPLETED
        - FAILED
      title: EvaluationORMStatusEnum
    AuditORMStatusEnum:
      type: string
      enum:
        - UNAUDITED
        - FIXED
        - APPROVED
      title: AuditORMStatusEnum
    ResultSchemaGeneration:
      properties:
        generation_output:
          type: string
          title: Generation Output
        generation_extra_info:
          $ref: '#/components/schemas/ExtraInfoSchema'
      type: object
      required:
        - generation_output
      title: ResultSchemaGeneration
    IdentifierTypeEnum:
      type: string
      enum:
        - user
        - service_account
      title: IdentifierTypeEnum
    UserV2Details:
      properties:
        id:
          type: string
          title: Id
        first_name:
          title: First Name
          type: string
        last_name:
          title: Last Name
          type: string
        email:
          type: string
          title: Email
        preferences:
          title: Preferences
          additionalProperties: true
          type: object
      type: object
      required:
        - id
        - email
      title: UserV2Details
    ResultSchemaFlexible:
      properties:
        generation_output:
          anyOf:
            - type: string
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: integer
                  - type: number
                  - items:
                      $ref: '#/components/schemas/FlexibleIOChunk'
                    type: array
                  - items:
                      $ref: '#/components/schemas/ChatMessageV2'
                    type: array
                  - items: {}
                    type: array
                  - additionalProperties: true
                    type: object
                  - $ref: '#/components/schemas/FileIODataType'
                  - type: 'null'
              type: object
          title: Generation Output
        generation_extra_info:
          $ref: '#/components/schemas/ExtraInfoSchema'
      type: object
      required:
        - generation_output
      title: ResultSchemaFlexible
    ExtraInfoSchema:
      oneOf:
        - $ref: '#/components/schemas/ChunkExtraInfoSchema'
        - $ref: '#/components/schemas/StringExtraInfoSchema'
      title: ExtraInfoSchema
      discriminator:
        propertyName: schema_type
        mapping:
          CHUNKS:
            $ref: '#/components/schemas/ChunkExtraInfoSchema'
          STRING:
            $ref: '#/components/schemas/StringExtraInfoSchema'
    FlexibleIOChunk:
      properties:
        text:
          type: string
          title: Text
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
      type: object
      required:
        - text
      title: FlexibleIOChunk
    ChatMessageV2:
      oneOf:
        - $ref: '#/components/schemas/UserMessage'
        - $ref: '#/components/schemas/AssistantMessage'
        - $ref: '#/components/schemas/SystemMessage'
      title: ChatMessageV2
      discriminator:
        propertyName: role
        mapping:
          assistant:
            $ref: '#/components/schemas/AssistantMessage'
          system:
            $ref: '#/components/schemas/SystemMessage'
          user:
            $ref: '#/components/schemas/UserMessage'
    FileIODataType:
      anyOf:
        - $ref: '#/components/schemas/ExternalFile'
        - $ref: '#/components/schemas/InternalFile'
      title: FileIODataType
    ChunkExtraInfoSchema:
      properties:
        schema_type:
          type: string
          const: CHUNKS
          title: Schema Type
          default: CHUNKS
        chunks:
          items:
            $ref: '#/components/schemas/ChunkData'
          type: array
          title: Chunks
      type: object
      required:
        - chunks
      title: ChunkExtraInfoSchema
    StringExtraInfoSchema:
      properties:
        schema_type:
          type: string
          const: STRING
          title: Schema Type
          default: STRING
        info:
          type: string
          title: Info
      type: object
      required:
        - info
      title: StringExtraInfoSchema
    UserMessage:
      properties:
        role:
          type: string
          const: user
          title: Role
          description: >-
            The role of the message. Must be set to 'user'.


            A user message is a message from the user to the AI. This should be
            the message used to send end user input to the AI.
          default: user
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/UserMessageContentParts'
              type: array
          title: Content
          description: >-
            Input from the user. Can either be text or a list of content parts.
            Not all models support image content parts, or multiple parts.
      type: object
      required:
        - content
      title: User Message
    AssistantMessage:
      properties:
        role:
          type: string
          const: assistant
          title: Role
          description: >-
            The role of the message. Must be set to 'assistant'.


            An assistant message is a message from the AI to the client. It is
            different from an agent message in that it cannot contain a tool
            request. It is simply a direct response from the AI to the client.
          default: assistant
        content:
          type: string
          title: Content
          description: Text response from the assistant
      type: object
      required:
        - content
      title: Assistant Message
    SystemMessage:
      properties:
        role:
          type: string
          const: system
          title: Role
          description: >-
            The role of the message. Must be set to 'system'.


            A system message is different from other messages in that it does
            not originate from a party engaged in a user/AI conversation.
            Instead, it is a message that is injected by either the application
            or system to guide the conversation. For example, a system message
            may be used as initial instructions for an AI entity or to tell the
            AI that it did not do something correctly.
          default: system
        content:
          type: string
          title: Content
          description: Text input from the system.
      type: object
      required:
        - content
      title: System Message
    ExternalFile:
      properties:
        uri:
          type: string
          title: Uri
        file_type:
          type: string
          enum:
            - image
            - pdf
          title: File Type
      type: object
      required:
        - uri
        - file_type
      title: ExternalFile
    InternalFile:
      properties:
        file_id:
          type: string
          title: File Id
        file_type:
          type: string
          enum:
            - image
            - pdf
          title: File Type
      type: object
      required:
        - file_id
        - file_type
      title: InternalFile
    ChunkData:
      properties:
        text:
          type: string
          title: Text
        metadata:
          title: Metadata
          additionalProperties: true
          type: object
      type: object
      required:
        - text
      title: ChunkData
    UserMessageContentParts:
      oneOf:
        - $ref: '#/components/schemas/TextUserMessageContentParts'
        - $ref: '#/components/schemas/ImageUrlUserMessageContentParts'
        - $ref: '#/components/schemas/ImageDataUserMessageContentParts'
      title: UserMessageContentParts
      discriminator:
        propertyName: type
        mapping:
          image_data:
            $ref: '#/components/schemas/ImageDataUserMessageContentParts'
          image_url:
            $ref: '#/components/schemas/ImageUrlUserMessageContentParts'
          text:
            $ref: '#/components/schemas/TextUserMessageContentParts'
    TextUserMessageContentParts:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
        text:
          type: string
          title: Text
      type: object
      required:
        - text
      title: TextUserMessageContentParts
    ImageUrlUserMessageContentParts:
      properties:
        type:
          type: string
          const: image_url
          title: Type
          default: image_url
        image_url:
          $ref: '#/components/schemas/ImageUrlSubPart'
          description: >-
            Specifies the image URL and level of detail. Only supported by
            OpenAI models
      type: object
      required:
        - image_url
      title: ImageUrlUserMessageContentParts
    ImageDataUserMessageContentParts:
      properties:
        type:
          type: string
          const: image_data
          title: Type
          default: image_data
        image_data:
          $ref: '#/components/schemas/ImageDataSubPart'
          description: Specifies inline image data
      type: object
      required:
        - image_data
      title: ImageDataUserMessageContentParts
    ImageUrlSubPart:
      properties:
        url:
          type: string
          title: Url
          description: 'The URL of the image. Note: only OpenAI supports this.'
        detail:
          title: Detail
          description: >-
            Only used for OpenAI. Corresponds to OpenAI's image detail
            parameter.
          type: string
          enum:
            - low
            - high
            - auto
      type: object
      required:
        - url
      title: ImageUrlSubPart
    ImageDataSubPart:
      properties:
        type:
          type: string
          const: base64
          title: Type
          description: The type of the image data. Only base64 is supported.
          default: base64
        media_type:
          type: string
          title: Media Type
          description: >-
            The media/mime type of the image data. For example, 'image/png'.
            Check providers' documentation for supported media types.
        data:
          type: string
          title: Data
          description: The base64-encoded image data.
        detail:
          title: Detail
          description: >-
            Only used for OpenAI. Corresponds to OpenAI's image detail
            parameter.
          type: string
          enum:
            - low
            - high
            - auto
      type: object
      required:
        - media_type
        - data
      title: ImageDataSubPart

````