Argil Videos API

Create, render, retrieve, list, and delete avatar videos. A video is defined as a set of moments (transcript or audio) mapped to an avatar and voice, with subtitles, aspect ratio, auto B-rolls, and background music, then rendered asynchronously into an MP4.

OpenAPI Specification

argil-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Argil API
  version: '1.0'
  description: >-
    The Argil API programmatically generates AI avatar videos. Create a video
    from moments (transcript or audio) mapped to an avatar and voice, render it
    asynchronously, clone avatars and voices, manage B-roll assets, and receive
    render events via webhooks. All requests authenticate with an `x-api-key`
    header.
  contact:
    name: Argil
    url: https://www.argil.ai
  termsOfService: https://www.argil.ai/terms
servers:
- url: https://api.argil.ai/v1
  description: Argil production API
security:
- ApiKeyAuth: []
tags:
- name: Videos
  description: Create, render, and manage avatar videos.
- name: Avatars
  description: Create and list avatars and digital twins.
- name: Voices
  description: Clone, list, and sync voices.
- name: Assets
  description: Upload and manage B-roll and media assets.
- name: Webhooks
  description: Register and manage render-event webhooks.
paths:
  /videos:
    post:
      tags:
      - Videos
      operationId: createVideo
      summary: Create a new video
      description: >-
        Creates a video from an array of moments. Each moment binds a transcript
        or audio URL to an avatar and voice. The video is created in an IDLE
        state and must be rendered to produce an MP4.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVideoRequest'
      responses:
        '201':
          description: Video created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
    get:
      tags:
      - Videos
      operationId: listVideos
      summary: List videos
      description: Returns a paginated list of videos for the authenticated account.
      parameters:
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: A paginated list of videos.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Video'
                  page:
                    type: integer
                  pageSize:
                    type: integer
                  total:
                    type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
  /videos/{id}:
    parameters:
    - $ref: '#/components/parameters/VideoId'
    get:
      tags:
      - Videos
      operationId: getVideo
      summary: Get a video
      description: Retrieves a single video by its ID, including status and output URLs.
      responses:
        '200':
          description: The requested video.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      tags:
      - Videos
      operationId: deleteVideo
      summary: Delete a video
      description: Permanently deletes a video by its ID.
      responses:
        '204':
          description: Video deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /videos/{id}/render:
    parameters:
    - $ref: '#/components/parameters/VideoId'
    post:
      tags:
      - Videos
      operationId: renderVideo
      summary: Render a video
      description: >-
        Triggers asynchronous rendering of a video. Optionally accepts a
        one-shot `callbackUrl` (HTTPS) that receives a webhook when this
        specific render completes.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                callbackUrl:
                  type: string
                  format: uri
                  description: >-
                    Optional HTTPS URL to receive a one-shot notification when
                    this render completes.
      responses:
        '200':
          description: Render started; returns the updated video with status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /avatars:
    post:
      tags:
      - Avatars
      operationId: createAvatar
      summary: Create an avatar
      description: >-
        Creates a new avatar from training media. See also the video-based
        avatar creation flow.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAvatarRequest'
      responses:
        '201':
          description: Avatar created (training may be asynchronous).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Avatar'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
    get:
      tags:
      - Avatars
      operationId: listAvatars
      summary: List avatars
      description: Returns all avatars available to the account, including stock avatars.
      responses:
        '200':
          description: A list of avatars.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Avatar'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /avatars/{id}:
    parameters:
    - $ref: '#/components/parameters/AvatarId'
    get:
      tags:
      - Avatars
      operationId: getAvatar
      summary: Get an avatar
      description: Retrieves a single avatar by its ID.
      responses:
        '200':
          description: The requested avatar.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Avatar'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /voices:
    post:
      tags:
      - Voices
      operationId: createVoice
      summary: Clone a voice
      description: Clones a custom voice from an audio sample.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVoiceRequest'
      responses:
        '201':
          description: Voice created (cloning may be asynchronous).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
    get:
      tags:
      - Voices
      operationId: listVoices
      summary: List voices
      description: Returns all voices available to the account.
      responses:
        '200':
          description: A list of voices.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Voice'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /voices/{id}:
    parameters:
    - $ref: '#/components/parameters/VoiceId'
    get:
      tags:
      - Voices
      operationId: getVoice
      summary: Get a voice
      description: Retrieves a single voice by its ID.
      responses:
        '200':
          description: The requested voice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /voices/sync:
    post:
      tags:
      - Voices
      operationId: syncVoices
      summary: Sync voices
      description: >-
        Re-syncs voices from underlying providers (ElevenLabs, Minimax) into the
        account's voice library.
      responses:
        '200':
          description: Voices synced.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Voice'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /assets:
    post:
      tags:
      - Assets
      operationId: uploadAsset
      summary: Upload an asset
      description: Creates a new asset from a URL for use as B-roll or background music.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - url
              properties:
                url:
                  type: string
                  format: uri
                  description: Public URL of the media to import.
                name:
                  type: string
      responses:
        '201':
          description: Asset created (processing may be asynchronous).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
    get:
      tags:
      - Assets
      operationId: listAssets
      summary: List assets
      description: Returns all assets in the account's library.
      responses:
        '200':
          description: A list of assets.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Asset'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /assets/{id}:
    parameters:
    - $ref: '#/components/parameters/AssetId'
    get:
      tags:
      - Assets
      operationId: getAsset
      summary: Get an asset
      description: Retrieves an asset and its processing status by ID.
      responses:
        '200':
          description: The requested asset.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      tags:
      - Assets
      operationId: deleteAsset
      summary: Delete an asset
      description: Removes an uploaded asset by ID.
      responses:
        '204':
          description: Asset deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /webhooks:
    post:
      tags:
      - Webhooks
      operationId: createWebhook
      summary: Create a webhook
      description: >-
        Registers a webhook that fires on the specified render events. Argil
        POSTs the event payload to `callbackUrl`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '201':
          description: Webhook created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
    get:
      tags:
      - Webhooks
      operationId: listWebhooks
      summary: List webhooks
      description: Retrieves all webhooks registered for the account.
      responses:
        '200':
          description: A list of webhooks.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /webhooks/{id}:
    parameters:
    - $ref: '#/components/parameters/WebhookId'
    put:
      tags:
      - Webhooks
      operationId: updateWebhook
      summary: Update a webhook
      description: Modifies an existing webhook's configuration.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookRequest'
      responses:
        '200':
          description: Webhook updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      tags:
      - Webhooks
      operationId: deleteWebhook
      summary: Delete a webhook
      description: Removes a webhook by ID.
      responses:
        '204':
          description: Webhook deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key issued in the Argil dashboard.
  parameters:
    VideoId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    AvatarId:
      name: id
      in: path
      required: true
      schema:
        type: string
    VoiceId:
      name: id
      in: path
      required: true
      schema:
        type: string
    AssetId:
      name: id
      in: path
      required: true
      schema:
        type: string
    WebhookId:
      name: id
      in: path
      required: true
      schema:
        type: string
    Page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        default: 1
    PageSize:
      name: pageSize
      in: query
      required: false
      schema:
        type: integer
        default: 20
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Request validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Moment:
      type: object
      description: A segment of a video pairing a script or audio with an avatar and voice.
      properties:
        transcript:
          type: string
          maxLength: 500
          description: Text the avatar speaks. Mutually exclusive with audioUrl.
        audioUrl:
          type: string
          format: uri
          description: URL of pre-recorded audio (up to ~40s). Mutually exclusive with transcript.
        avatarId:
          type: string
          description: Avatar that presents this moment.
        voiceId:
          type: string
          description: Voice used to synthesize the transcript.
        gestureSlug:
          type: string
          description: Optional gesture applied during the moment.
        zoom:
          type: number
          description: Optional zoom level for the moment.
      required:
      - avatarId
    Subtitles:
      type: object
      properties:
        enabled:
          type: boolean
        style:
          type: string
        position:
          type: string
        size:
          type: integer
    CreateVideoRequest:
      type: object
      required:
      - name
      - moments
      properties:
        name:
          type: string
          description: Video title.
        moments:
          type: array
          items:
            $ref: '#/components/schemas/Moment'
        subtitles:
          $ref: '#/components/schemas/Subtitles'
        aspectRatio:
          type: string
          enum:
          - '16:9'
          - '9:16'
        enableAutoBrolls:
          type: boolean
        model:
          type: string
          enum:
          - ARGIL_V1
          - ARGIL_ATOM
        extras:
          type: object
          additionalProperties:
            type: string
          description: Up to 10 custom key-value pairs (max 256 chars each).
    Video:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          enum:
          - IDLE
          - GENERATING_AUDIO
          - GENERATING_VIDEO
          - DONE
          - FAILED
        duration:
          type: number
          nullable: true
        aspectRatio:
          type: string
        moments:
          type: array
          items:
            $ref: '#/components/schemas/Moment'
        videoUrl:
          type: string
          format: uri
          nullable: true
        videoUrlSubtitled:
          type: string
          format: uri
          nullable: true
        previewUrl:
          type: string
          format: uri
          nullable: true
        extras:
          type: object
          additionalProperties:
            type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CreateAvatarRequest:
      type: object
      required:
      - name
      properties:
        name:
          type: string
        videoUrl:
          type: string
          format: uri
          description: Source video used for video-based avatar cloning.
        imageUrl:
          type: string
          format: uri
    Avatar:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        status:
          type: string
          enum:
          - TRAINING
          - READY
          - FAILED
        thumbnailUrl:
          type: string
          format: uri
          nullable: true
        createdAt:
          type: string
          format: date-time
    CreateVoiceRequest:
      type: object
      required:
      - name
      - sampleUrl
      properties:
        name:
          type: string
        sampleUrl:
          type: string
          format: uri
          description: URL of an audio sample used to clone the voice.
    Voice:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        provider:
          type: string
          enum:
          - ELEVENLABS
          - MINIMAX
          - ARGIL
        status:
          type: string
          enum:
          - PROCESSING
          - READY
          - FAILED
        createdAt:
          type: string
          format: date-time
    Asset:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        url:
          type: string
          format: uri
        status:
          type: string
          enum:
          - PROCESSING
          - READY
          - FAILED
        createdAt:
          type: string
          format: date-time
    CreateWebhookRequest:
      type: object
      required:
      - callbackUrl
      - events
      properties:
        callbackUrl:
          type: string
          format: uri
          description: HTTPS URL that receives event payloads.
        events:
          type: array
          items:
            type: string
            enum:
            - VIDEO_GENERATION_SUCCESS
            - VIDEO_GENERATION_FAILED
    Webhook:
      type: object
      properties:
        id:
          type: string
        callbackUrl:
          type: string
          format: uri
        events:
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
        statusCode:
          type: integer