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

# Add and remove labels on many of an owner's stored tasks



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json patch /api/v1/hub/tasks/{owner}
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/hub/tasks/{owner}:
    patch:
      tags:
        - Hub
      summary: Add and remove labels on many of an owner's stored tasks
      operationId: hub_update_task_labels
      parameters:
        - name: owner
          in: path
          required: true
          schema:
            type: string
            maxLength: 255
            minLength: 1
            title: Owner
            description: Owning user or team slug
          description: Owning user or team slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskLabelsUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskLabelsResult'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Too Many Requests
      security:
        - HTTPBearer: []
components:
  schemas:
    TaskLabelsUpdate:
      properties:
        names:
          items:
            type: string
            maxLength: 400
            pattern: ^[A-Za-z0-9][A-Za-z0-9_.-]*(/[A-Za-z0-9][A-Za-z0-9_.-]*)*$
          type: array
          maxItems: 1000
          minItems: 1
          title: Names
          description: The owner's tasks to change; all must exist
        add:
          items:
            type: string
            maxLength: 200
            minLength: 1
            pattern: ^[^\x00-\x1f\x7f]+$
          type: array
          maxItems: 64
          title: Add
        remove:
          items:
            type: string
            maxLength: 200
            minLength: 1
            pattern: ^[^\x00-\x1f\x7f]+$
          type: array
          maxItems: 64
          title: Remove
        dry_run:
          type: boolean
          title: Dry Run
          description: Answer what would change; change nothing
          default: false
      additionalProperties: false
      type: object
      required:
        - names
      title: TaskLabelsUpdate
    TaskLabelsResult:
      properties:
        total:
          type: integer
          title: Total
          description: Tasks named in the request
        updated:
          type: integer
          title: Updated
          description: Tasks whose labels changed, or would
        unchanged:
          type: integer
          title: Unchanged
        dry_run:
          type: boolean
          title: Dry Run
        changes:
          items:
            $ref: '#/components/schemas/TaskLabelChange'
          type: array
          title: Changes
          description: One per updated task
      type: object
      required:
        - total
        - updated
        - unchanged
        - dry_run
        - changes
      title: TaskLabelsResult
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorEnvelope
    TaskLabelChange:
      properties:
        name:
          type: string
          title: Name
        before:
          items:
            type: string
          type: array
          title: Before
        after:
          items:
            type: string
          type: array
          title: After
      type: object
      required:
        - name
        - before
        - after
      title: TaskLabelChange
    ErrorBody:
      properties:
        code:
          type: string
          title: Code
          description: Stable, machine-readable error code
        message:
          type: string
          title: Message
        details:
          type: object
          title: Details
      type: object
      required:
        - code
        - message
      title: ErrorBody
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````