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

# Upload up to 16 small tasks in one request



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /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}:
    post:
      tags:
        - Hub
      summary: Upload up to 16 small tasks in one request
      operationId: hub_upload_tasks
      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
        description: >-
          Four bytes with the header's length (big-endian), then the header,
          then the archives back to back. The header is a UTF-8 JSON array with
          one object per task: `name`, `size` (of its `tar.gz`, in bytes),
          `archive_sha256`, `content_hash`, and optionally `task_type`,
          `description` and `labels`. At most 16 tasks and 8 MiB of archives.
        content:
          application/vnd.prime.hub-tasks.v1:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskBatchResult'
        '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:
    TaskBatchResult:
      properties:
        results:
          items:
            $ref: '#/components/schemas/TaskUploadOutcome'
          type: array
          title: Results
          description: One per task, in the order they were sent
      type: object
      required:
        - results
      title: TaskBatchResult
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorEnvelope
    TaskUploadOutcome:
      properties:
        status:
          type: string
          enum:
            - created
            - exists
            - failed
          title: Status
          description: >-
            `exists`: the task already has this content, and `version` is the
            one it has
        version:
          anyOf:
            - $ref: '#/components/schemas/TaskVersion'
            - type: 'null'
        error:
          anyOf:
            - $ref: '#/components/schemas/ErrorBody'
            - type: 'null'
      type: object
      required:
        - status
      title: TaskUploadOutcome
    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
    TaskVersion:
      properties:
        id:
          type: string
          title: Id
        owner:
          type: string
          title: Owner
        name:
          type: string
          title: Name
        version:
          type: integer
          title: Version
          description: Numbered from 1 by the Hub, per task
        task_type:
          type: string
          title: Task Type
        content_hash:
          type: string
          title: Content Hash
        archive_sha256:
          type: string
          title: Archive Sha256
        archive_size:
          type: integer
          title: Archive Size
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - owner
        - name
        - version
        - task_type
        - content_hash
        - archive_sha256
        - archive_size
        - created_at
      title: TaskVersion
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````