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

# Manually upload videos

> Upload a video from your local device. If the upload is successful, a 201 Created status code is returned along with the video's ID and metadata.

> **⚠️ IMPORTANT:** The video is not yet ready for enhancement when this endpoint returns 201 Created. This is because the video is still being uploaded to the cloud storage. After uploading the video, follow these steps to ensure the video is fully uploaded and ready for enhancement:
>
> Poll for video's status:
> - Use the [`get uploaded video`](https://backend.tensorpix.ai/api/schema/redoc/#tag/videos/operation/videos_retrieve) endpoint to check the status of the video.
> - Poll this endpoint periodically to check the `file` field in the response.
>
> Checking the `file` Field:
> - If the file field is `null`, the video is still being prepared.
> - Once the file field contains a URL, the video is ready for further processing and enhancement.



## OpenAPI

````yaml https://backend.tensorpix.ai/api/schema/ post /api/videos/
openapi: 3.1.0
info:
  title: TensorPix OpenAPI Documentation
  version: 1.1.0
  termsOfService: https://tensorpix.ai/terms-conditions
  contact:
    name: TensorPix Dev Team
    email: devs@tensorpix.ai
servers:
  - url: https://backend.tensorpix.ai
security: []
externalDocs:
  url: https://docs.tensorpix.ai
  description: Check out the full TensorPix documentation.
paths:
  /api/videos/:
    post:
      tags:
        - videos
      summary: Manually upload videos
      description: >-
        Upload a video from your local device. If the upload is successful, a
        201 Created status code is returned along with the video's ID and
        metadata.


        > **⚠️ IMPORTANT:** The video is not yet ready for enhancement when this
        endpoint returns 201 Created. This is because the video is still being
        uploaded to the cloud storage. After uploading the video, follow these
        steps to ensure the video is fully uploaded and ready for enhancement:

        >

        > Poll for video's status:

        > - Use the [`get uploaded
        video`](https://backend.tensorpix.ai/api/schema/redoc/#tag/videos/operation/videos_retrieve)
        endpoint to check the status of the video.

        > - Poll this endpoint periodically to check the `file` field in the
        response.

        >

        > Checking the `file` Field:

        > - If the file field is `null`, the video is still being prepared.

        > - Once the file field contains a URL, the video is ready for further
        processing and enhancement.
      operationId: videos_create
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Video'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: ''
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedError'
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
          description: ''
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
          description: ''
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericError'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    Video:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          readOnly: true
          description: Media name
        width:
          type:
            - integer
            - 'null'
          readOnly: true
          description: Width of the video in pixels
        height:
          type:
            - integer
            - 'null'
          readOnly: true
          description: Height of the video in pixels
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Date when the media was created
        n_frames:
          type:
            - integer
            - 'null'
          readOnly: true
          description: Number of frames in the video
        framerate:
          type:
            - number
            - 'null'
          format: double
          readOnly: true
          description: Video framerate in frames per second
        size:
          type:
            - integer
            - 'null'
          readOnly: true
          description: Size of the video in bytes
        file:
          type:
            - string
            - 'null'
          format: uri
          description: >-
            Pre-signed uploaded video URL. The URL may expire after some time.
            To generate a new URL, call the endpoint again. If the field is
            `null`, it means the video hasn't been completely uploaded to our
            servers yet. The field can also be `null` if the video was enhanced
            using the /jobs/from-url endpoint. In that case the video is not
            stored on our servers and the field is `null`
        owner:
          type: string
          format: email
          title: Email address
          readOnly: true
        thumbnail:
          type:
            - string
            - 'null'
          format: uri
          readOnly: true
          description: >-
            Thumbnail of the video. `null` if the video was enhanced with the
            /jobs/from-url endpoint
        external_url:
          type:
            - string
            - 'null'
          format: uri
          readOnly: true
        bitrate:
          type:
            - integer
            - 'null'
          readOnly: true
          description: Video bitrate in bits per second
        codec_id:
          type:
            - string
            - 'null'
          readOnly: true
        bit_depth:
          type:
            - integer
            - 'null'
          readOnly: true
          description: Bit depth of the video
        chroma_subsampling:
          type:
            - string
            - 'null'
          readOnly: true
        color_space:
          type:
            - string
            - 'null'
          readOnly: true
      required:
        - bit_depth
        - bitrate
        - chroma_subsampling
        - codec_id
        - color_space
        - created_at
        - external_url
        - framerate
        - height
        - id
        - n_frames
        - name
        - owner
        - size
        - thumbnail
        - width
    ValidationError:
      type: object
      properties:
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        non_field_errors:
          type: array
          items:
            type: string
      required:
        - errors
        - non_field_errors
    UnauthenticatedError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    ForbiddenError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    RateLimitError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
    GenericError:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````