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

# Send an upload chunk

> Sends one chunk of raw bytes for a resumable upload session. Send the `Upload-Offset` header set to the number of bytes already sent (0 for the first chunk), and the chunk itself as the raw request body with `Content-Type: application/offset+octet-stream`.

This call is idempotent at the current offset: resending the offset you already sent returns the session's current offset unchanged, without writing the chunk twice. Sending an offset ahead of what the session has recorded means a chunk was lost in transit; the call fails with a 409 so you can resend from the session's real offset instead of leaving a gap in the assembled file.

Requires a token with the `videos:write` scope.



## OpenAPI

````yaml /api-reference/openapi.json patch /uploads/{upload}
openapi: 3.1.0
info:
  title: TrackPlay API
  description: >-
    Send conversions and events to TrackPlay, and read them back. Authenticated
    with scoped tokens you mint in the dashboard.
  version: 1.0.0
servers:
  - url: https://app.trackplay.io/api/v1
    description: App API. Conversions, videos, webhooks.
  - url: https://e.trackplay.io
    description: Events API. High-volume event ingest.
security:
  - bearerAuth: []
tags:
  - name: Videos
    description: Create, read, update, and delete videos, and read workspace metadata.
  - name: Video settings
    description: Save a settings draft, publish it live, and read or restore past deploys.
  - name: Uploads
    description: >-
      Upload a source video file in one request or in resumable chunks, and poll
      its processing status.
  - name: Captions and chapters
    description: >-
      Manage caption tracks, chapter markers, AI-generated segments, and CTA
      cards on a video.
  - name: Playlists
    description: Group videos into a playlist or course, and manage the videos inside it.
  - name: Webhooks
    description: Subscribe a URL to TrackPlay lifecycle events and test deliveries.
  - name: Zapier
    description: >-
      The REST-hook endpoints Zapier calls to connect a workspace and manage
      triggers.
  - name: Analytics
    description: Read play, retention, event, and conversion analytics for a video.
  - name: Exports
    description: Queue and download bulk analytics exports.
  - name: Conversions
    description: Report a sale or a lead, from your own server or from a browser fallback.
  - name: Events
    description: Send a custom event tied to a viewer's session.
  - name: Identity
    description: Resolve a viewer's identity from the page, with no token required.
paths:
  /uploads/{upload}:
    patch:
      tags:
        - Uploads
      summary: Send an upload chunk
      description: >-
        Sends one chunk of raw bytes for a resumable upload session. Send the
        `Upload-Offset` header set to the number of bytes already sent (0 for
        the first chunk), and the chunk itself as the raw request body with
        `Content-Type: application/offset+octet-stream`.


        This call is idempotent at the current offset: resending the offset you
        already sent returns the session's current offset unchanged, without
        writing the chunk twice. Sending an offset ahead of what the session has
        recorded means a chunk was lost in transit; the call fails with a 409 so
        you can resend from the session's real offset instead of leaving a gap
        in the assembled file.


        Requires a token with the `videos:write` scope.
      operationId: uploadVideoChunk
      parameters:
        - name: upload
          in: path
          required: true
          schema:
            type: string
          description: The `upload_id` from `POST /videos/{video}/upload/init`.
        - name: Upload-Offset
          in: header
          required: true
          schema:
            type: integer
          description: The number of bytes already sent for this upload, before this chunk.
      requestBody:
        required: true
        content:
          application/offset+octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: >-
            The chunk was written, or this offset was already written and the
            chunk was not repeated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadChunkResponse'
        '400':
          description: >-
            `OFFSET_REQUIRED`: no `Upload-Offset` header. `EMPTY_CHUNK`: zero
            bytes. `SIZE_EXCEEDED`: the chunk goes past the size declared at
            init. The body carries the server's real `offset`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: >-
            `AUTH_REQUIRED`: no token sent. `INVALID_TOKEN`: the token is
            invalid, expired, or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: '`INSUFFICIENT_SCOPE`: the token does not carry `videos:write`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: '`UPLOAD_NOT_FOUND`: no upload session with that ID, or it expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: >-
            `OFFSET_MISMATCH`: your `Upload-Offset` is ahead of the server's, so
            a chunk was lost. Resend from the `offset` in the body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limited. 60 requests per minute per token.
components:
  schemas:
    UploadChunkResponse:
      type: object
      properties:
        offset:
          type: integer
          description: >-
            The total bytes received so far. Send your next chunk's
            `Upload-Offset` header as this value.
        size:
          type: integer
          description: The size declared at init.
    ApiError:
      type: object
      description: The error shape the app API returns on a failed read or export.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                A stable error code, e.g. `INSUFFICIENT_SCOPE`,
                `VIDEO_NOT_FOUND`, `EXPORT_NOT_FOUND`.
            message:
              type: string
              description: What went wrong, in plain English.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A scoped token minted in **Settings → API tokens**. Send it as
        `Authorization: Bearer tplt_…` or `X-API-Key: tplt_…`.

````

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