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

# List insta swaps for a sample

> Retrieve insta swaps for a digital sample. Pass `accountToken` to scope results to a creator or brand (embed widgets require a token).



## OpenAPI

````yaml /openapi.yaml get /digital-samples/{id}/insta-swaps
openapi: 3.1.0
info:
  title: YPH Public API
  version: 1.0.0
  description: |
    Programmatic access to Digital Samples, Actors, Insta Swaps, and webhooks.

    Authenticate with `Authorization: Bearer yph_sk_live_…`.
servers:
  - url: https://api.yourproducthere.ai/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: System
  - name: Account
  - name: Actors
  - name: Digital Samples
  - name: Insta Swaps
  - name: Webhooks
paths:
  /digital-samples/{id}/insta-swaps:
    get:
      tags:
        - Insta Swaps
      summary: List insta swaps for a sample
      description: >-
        Retrieve insta swaps for a digital sample. Pass `accountToken` to scope
        results to a creator or brand (embed widgets require a token).
      parameters:
        - $ref: '#/components/parameters/SampleId'
        - $ref: '#/components/parameters/AccountTokenQuery'
      responses:
        '200':
          description: Swap list retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  instaSwaps:
                    type: array
                    items:
                      $ref: '#/components/schemas/InstaSwap'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    SampleId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    AccountTokenQuery:
      name: accountToken
      in: query
      required: false
      schema:
        type: string
        maxLength: 128
      description: >
        Filter results to resources whose `accountToken` equals this opaque
        integrator id.

        On digital samples this is the **brand** token; on actors and
        insta-swaps it is the **creator** (or brand in self-service mode).

        Embed widgets should always pass this — without it, UIs show no rows.
  schemas:
    InstaSwap:
      type: object
      description: >
        Insta swap render job. `accountToken` on the swap is the integrator id
        for whoever initiated it (creator or brand).

        `sampleAccountToken` and `productToken` are read from the parent digital
        sample.

        When `isBrandSelfService` is true, `accountToken` equals
        `sampleAccountToken` (brand-owned production, not a creator
        application).
      properties:
        id:
          type: string
          format: uuid
        orgId:
          type: string
        digitalSampleId:
          type: string
          format: uuid
        digitalSampleVariationId:
          type: string
          format: uuid
          nullable: true
          description: >-
            Variation seed used for this render; null when original seed was
            used.
        actorId:
          type: string
          format: uuid
        accountToken:
          type: string
          nullable: true
          maxLength: 128
        sampleAccountToken:
          type: string
          nullable: true
          maxLength: 128
          readOnly: true
          description: Brand token from the parent digital sample.
        productToken:
          type: string
          nullable: true
          maxLength: 128
          readOnly: true
          description: Catalog product token from the parent digital sample.
        isBrandSelfService:
          type: boolean
          readOnly: true
          description: >-
            True when swap `accountToken` equals the parent sample's
            `accountToken`.
        status:
          type: string
          enum:
            - QUEUED
            - ASSIGNED
            - RENDERING
            - PENDING_APPROVAL
            - COMPLETED
            - FAILED
            - EXPIRED
            - CANCELLED
          description: Render pipeline status. Treat unknown values as in-progress.
        triggerSource:
          type: string
          enum:
            - app
            - api
        renderingMs:
          type: integer
          nullable: true
        startedAt:
          type: string
          nullable: true
          format: date-time
        finishedAt:
          type: string
          nullable: true
          format: date-time
        signedResultVideoUrl:
          type: string
          nullable: true
          format: uri
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      example:
        id: e4e18374-f119-4b11-a8a1-d6a2bc38e41a
        orgId: org_123abc
        digitalSampleId: d3b07384-d113-4956-a5e2-416b2a41bc3c
        actorId: a1c02874-e339-4d11-8fa1-e6a2bc38c41d
        accountToken: creator_42
        sampleAccountToken: brand_nike
        productToken: sku_air_max_90
        isBrandSelfService: false
        status: COMPLETED
        triggerSource: api
        renderingMs: 4500
        startedAt: '2026-06-20T12:10:00Z'
        finishedAt: '2026-06-20T12:10:04.500Z'
        signedResultVideoUrl: https://r2.yourproducthere.ai/results/completed_video.mp4?token=sig
        createdAt: '2026-06-20T12:09:59Z'
        updatedAt: '2026-06-20T12:10:05Z'
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            A machine-readable, uppercase error code (e.g.
            `REQUIRED_FIELD_MISSING`, `INVALID_PARAMETER`, `RESOURCE_NOT_FOUND`,
            `UNAUTHORIZED`, `CONFLICT`).
        error:
          type: string
          description: A human-readable error message explaining why the request failed.
        parameter:
          type: string
          nullable: true
          description: >-
            The name of the specific input parameter or body field that caused
            the error (e.g. `seedVideoUrl`, `title`, etc.).
        details:
          type: object
          nullable: true
          description: >-
            Additional key-value pairs providing context or structured details
            about the failure.
      example:
        code: REQUIRED_FIELD_MISSING
        error: title is required
        parameter: title
        details: null
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthorized:
              summary: Invalid API Key
              value:
                code: UNAUTHORIZED
                error: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your organization API key starting with yph_sk_live_…

````