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

# Get a video generation

> Poll a video-generation job for status and, once completed, the produced video.

Retrieve the status of a video-generation job. While it is `pending` or
`processing`, keep polling; once `completed`, the response carries the produced
video with a presigned `url` valid for **24 hours**. Only jobs your organization
created are visible; any other id returns
[`404 not_found`](/guides/errors#not_found).

<Tip>
  Pass a `webhook_url` on the original [video request](/api-reference/videos/generate)
  to receive a signed callback instead of polling. See [Webhooks](/guides/webhooks).
</Tip>


## OpenAPI

````yaml api-reference/openapi.json GET /videos/generations/{generation_id}
openapi: 3.1.0
info:
  title: Samsa API
  description: >-
    The Samsa public REST API. Authenticate with an organization API key as a
    bearer token (`Authorization: Bearer samsa_sk_...`). Errors follow a single
    envelope shape; every response carries an `X-Request-ID`.
  version: 1.0.0
servers:
  - url: https://api.samsa.ai/public/v1
security:
  - BearerAuth: []
paths:
  /videos/generations/{generation_id}:
    get:
      tags:
        - Videos
      summary: Retrieve a video generation's status and result
      description: >-
        Returns the job status (`pending`, `processing`, `completed`, `failed`,
        `cancelled`), and — once `completed` — the produced video with a
        presigned (24h) URL. Only jobs your organization submitted through the
        public API are visible; anything else returns `404`. Requires the
        `videos.generate` scope.
      operationId: get_video_generation_videos_generations__generation_id__get
      parameters:
        - name: generation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Generation Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicVideoGenerationDetail'
        '401':
          description: Missing, invalid, expired, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: The API key lacks the required scope for this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Generation, or a referenced model/palette/image, not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: >-
            Request validation failed (engine, duration, resolution, frames,
            ...).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '429':
          description: Per-key rate limit or per-org concurrency cap exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
components:
  schemas:
    PublicVideoGenerationDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/PublicVideoStatus'
          description: '`pending`, `processing`, `completed`, `failed`, or `cancelled`.'
          examples:
            - completed
        mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Mode
          description: '`image_to_video`, `text_to_video`, or `text_to_video_styled`.'
          examples:
            - image_to_video
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the job was submitted.
        credits_used:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credits Used
          description: Credits charged for this job.
          examples:
            - 80
        video:
          anyOf:
            - $ref: '#/components/schemas/PublicVideoAsset'
            - type: 'null'
          description: The produced video (presigned URL); null until `completed`.
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: Failure detail when `status` is `failed`; otherwise null.
      type: object
      required:
        - id
        - status
        - created_at
      title: PublicVideoGenerationDetail
      description: >-
        `GET /videos/generations/{id}` body (ADR §7.2).


        `created_at` and `credits_used` come from the immutable credit-ledger
        row

        (the durable public submit record); `mode` prefers the same source
        because

        the worker's completion path rewrites `video_jobs.metadata`.
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
      type: object
      required:
        - error
      title: ErrorEnvelope
      description: The complete public error body — an ``error`` object wrapper (ADR §5).
    PublicVideoStatus:
      type: string
      enum:
        - pending
        - processing
        - completed
        - failed
        - cancelled
      title: PublicVideoStatus
      description: >-
        Public video-job status — the lower-cased internal ``VideoTaskStatus``.


        Same convention as the shipped image/models surfaces (plain lower-case,
        NOT

        the ADR §7.2 ``queued`` remap): the ticket's 202 uses ``status:
        "pending"``.
    PublicVideoAsset:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        url:
          type: string
          title: Url
          description: Presigned, time-limited (24h) HTTPS URL of the video (mp4).
          examples:
            - https://cdn.samsa.ai/user-.../videos/abc.mp4?X-Amz-Signature=...
        thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail Url
          description: Presigned (24h) thumbnail URL, when available.
        duration:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration
          description: Clip length in seconds, when known.
          examples:
            - 8
      type: object
      required:
        - id
        - url
      title: PublicVideoAsset
      description: The produced video on a completed job (ADR §7.2).
    ErrorDetail:
      properties:
        type:
          type: string
          title: Type
          examples:
            - authentication_error
        code:
          type: string
          title: Code
          examples:
            - invalid_api_key
        message:
          type: string
          title: Message
          examples:
            - The provided API key is invalid, expired, or revoked.
        request_id:
          type: string
          title: Request Id
          examples:
            - 8f14e45fceea167a5a36dedd4bea2543
        param:
          anyOf:
            - type: string
            - type: 'null'
          title: Param
          description: Present on validation errors — names the offending field.
          examples:
            - aspect_ratio
      type: object
      required:
        - type
        - code
        - message
        - request_id
      title: ErrorDetail
      description: The ``error`` object of the public envelope (ADR §5).
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Organization API key as a bearer token: `Authorization: Bearer
        samsa_sk_...`.

````