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

# Submit an egocentric batch

> Submit an egocentric batch with the Egocentric API.

Submit video URLs with one shared set of annotation options. A successful response returns `202`, a batch ID, and job IDs in input order. Media validation and annotation happen asynchronously.

Use one `Idempotency-Key` for each intended batch. Keys are scoped to your organization. Repeat the same key and request to recover an accepted batch; a changed request with that key returns `409`. See [submission and replay examples](https://docs.perceptron.inc/services/egocentric.md#submit-a-batch).

For authentication, limits, and HTTP errors, see the [workflow](https://docs.perceptron.inc/services/egocentric.md) and [error guide](https://docs.perceptron.inc/services/egocentric-limits-and-errors.md).


## OpenAPI

````yaml api-reference/openapi.json POST /v1/egocentric/batches
openapi: 3.1.0
info:
  title: Perceptron API
  contact:
    name: Perceptron API Support
    email: support@perceptron.inc
  version: 1.0.0
servers:
  - url: https://api.perceptron.inc
security: []
tags:
  - name: Chat Completions
    description: Chat completions API (OpenAI-compatible)
  - name: Detection
    description: Native Perceptron image detection API
  - name: Models
    description: Model listing and metadata API
  - name: Files
    description: File upload, listing, retrieval, and deletion API
  - name: Egocentric
    description: Video annotation batches, jobs and results
paths:
  /v1/egocentric/batches:
    post:
      tags:
        - Egocentric
      summary: Submit an egocentric batch
      description: Submit videos for annotation and return their batch and job IDs.
      operationId: submit_batch
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            A single organization-scoped key of 1 to 255 visible ASCII
            characters; reuse only with the same request.
          required: true
          schema:
            type: string
            maxLength: 255
            minLength: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitBatchRequest'
        required: true
      responses:
        '202':
          description: Batch accepted
          headers:
            Location:
              schema:
                type: string
              description: Relative URL of the accepted batch; unchanged on replay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitBatchResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '409':
          description: Idempotency conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '413':
          description: Request body exceeds 8 MiB
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '429':
          description: Capacity or credit limit
          headers:
            Retry-After:
              schema:
                type: string
              description: >-
                Seconds to wait before retrying; omitted for insufficient
                credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
        '503':
          description: Temporarily unavailable
          headers:
            Retry-After:
              schema:
                type: string
              description: >-
                Seconds to wait before retrying; omitted for insufficient
                credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerceptronErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SubmitBatchRequest:
      type: object
      description: Submit videos for annotation with shared options.
      required:
        - inputs
      properties:
        hand_activity:
          type: boolean
          description: Include hand activity annotations; defaults to true.
        hand_tracking:
          $ref: '#/components/schemas/HandTrackingInput'
          description: >-
            Hand tracking selection; omitted or true enables the default 2d
            output, and false disables it.
        inputs:
          type: array
          items:
            $ref: '#/components/schemas/VideoInput'
          description: Videos to annotate, in the order their jobs will be returned.
          maxItems: 1000
          minItems: 1
      additionalProperties: false
    SubmitBatchResponse:
      allOf:
        - $ref: '#/components/schemas/EgocentricBatch'
          description: Current batch progress, options, and timing.
        - type: object
          required:
            - jobs
          properties:
            jobs:
              type: array
              items:
                $ref: '#/components/schemas/JobReference'
              description: >-
                Accepted job identifiers in the same order as the submitted
                inputs.
      description: The current batch and its job identifiers, in the original input order.
    PerceptronErrorResponse:
      type: object
      description: Native Perceptron error response format.
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PerceptronErrorDetail'
    HandTrackingInput:
      oneOf:
        - type: boolean
          title: Enable or disable hand tracking
        - oneOf:
            - $ref: '#/components/schemas/HandTrackingSettings'
          title: Hand tracking settings
      description: Enable or disable hand tracking, or select its output format.
    VideoInput:
      type: object
      description: One video source and its optional display filename.
      required:
        - type
        - video_url
      properties:
        filename:
          type: string
          description: >-
            Optional filename: 1 to 255 characters, without path separators or
            control

            characters. The names `.` and `..` and an explicit null are
            rejected.
          maxLength: 255
          minLength: 1
        type:
          $ref: '#/components/schemas/VideoInputType'
          description: Input source type, currently video_url.
        video_url:
          $ref: '#/components/schemas/EgocentricVideoUrl'
          description: URL of the video to annotate.
      additionalProperties: false
    EgocentricBatch:
      type: object
      description: Progress, options, and timing for a batch of videos.
      required:
        - object
        - id
        - job_count
        - options
        - counts
        - done
        - created_at
        - started_at
        - execution_finished_at
        - finished_at
      properties:
        counts:
          $ref: '#/components/schemas/JobCounts'
          description: Job counts by public state, including zero counts.
        created_at:
          type: string
          format: date-time
          description: UTC time the batch was accepted.
        done:
          type: boolean
          description: True once every job has completed or failed.
        execution_finished_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Latest actual execution end once every job has a known end or is
            confirmed never to have run.

            Null if any end is unknown or no job ran.
        finished_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Time the last job finished; null until done is true.
        id:
          $ref: '#/components/schemas/BatchId'
          description: Unique batch identifier.
        job_count:
          type: integer
          format: int32
          description: Number of submitted inputs and jobs.
          maximum: 1000
          minimum: 1
        object:
          type: string
          description: Object type, always egocentric.batch.
          example: egocentric.batch
        options:
          $ref: '#/components/schemas/EgocentricOptionsV1'
          description: Options applied to every job, with defaults filled in at acceptance.
        started_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Earliest known actual execution start across its jobs; null if no
            start is known.
    JobReference:
      type: object
      description: Identifier of a job accepted in a batch.
      required:
        - id
      properties:
        id:
          $ref: '#/components/schemas/JobId'
          description: Unique job identifier.
    PerceptronErrorDetail:
      type: object
      description: Native Perceptron error detail.
      required:
        - message
      properties:
        code:
          type:
            - string
            - 'null'
        message:
          type: string
        param:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
    HandTrackingSettings:
      type: object
      description: Settings used when hand tracking is enabled.
      required:
        - output
      properties:
        output:
          $ref: '#/components/schemas/HandTrackingOutput'
          description: Select 2d keypoints or the additional 3d mesh and joints.
      additionalProperties: false
    VideoInputType:
      type: string
      description: Input source type; video_url downloads a video from its URL.
      enum:
        - video_url
    EgocentricVideoUrl:
      type: object
      description: A video source addressed by URL.
      required:
        - url
      properties:
        url:
          type: string
          description: HTTP or HTTPS URL of the video to annotate.
          maxLength: 4096
      additionalProperties: false
    JobCounts:
      type: object
      description: Number of jobs in each public state; the counts add up to job_count.
      required:
        - queued
        - submitted
        - processing
        - completed
        - failed
      properties:
        completed:
          type: integer
          format: int32
          description: Jobs that finished successfully.
          minimum: 0
        failed:
          type: integer
          format: int32
          description: Jobs that finished without a result.
          minimum: 0
        processing:
          type: integer
          format: int32
          description: Jobs whose execution has started and that are not yet finished.
          minimum: 0
        queued:
          type: integer
          format: int32
          description: Jobs preparing inputs or waiting for capacity.
          minimum: 0
        submitted:
          type: integer
          format: int32
          description: Jobs accepted for execution and waiting to run.
          minimum: 0
    BatchId:
      type: string
    EgocentricOptionsV1:
      type: object
      description: Options used for annotation, including defaults applied at acceptance.
      required:
        - hand_tracking
        - hand_activity
      properties:
        hand_activity:
          type: boolean
          description: Whether hand activity annotations are included.
        hand_tracking:
          $ref: '#/components/schemas/HandTrackingOptions'
          description: >-
            Disabled, or enabled with the output format fixed when the batch was
            accepted.
      additionalProperties: false
    JobId:
      type: string
    HandTrackingOutput:
      type: string
      description: |-
        Hand tracking format: 2d includes per-frame boxes and keypoints;
        3d also includes a mesh and 3D joints.
      enum:
        - 2d
        - 3d
    HandTrackingOptions:
      oneOf:
        - type: boolean
          title: Hand tracking disabled
          enum:
            - false
        - type: object
          title: Hand tracking settings
          required:
            - output
          properties:
            output:
              type: string
              description: |-
                Hand tracking format: 2d includes per-frame boxes and keypoints;
                3d also includes a mesh and 3D joints.
              enum:
                - 2d
                - 3d
          additionalProperties: false
      description: >-
        Disabled hand tracking, or enabled hand tracking with an explicit output
        format.
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication using your Perceptron API key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.