Leonardo.AI Media API

The Media API from Leonardo.AI — 2 operation(s) for media.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

leonardo-ai-media-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Leonardo.AI 3D Model Assets Media API
  description: Upload, retrieve, and delete 3D model assets for use with Rodin and other 3D-capable workflows.
  version: v1.0.0
  contact:
    name: Leonardo.AI Support
    url: https://docs.leonardo.ai/docs/need-more-support
  license:
    name: Leonardo.AI Terms of Service
    url: https://leonardo.ai/terms-of-service/
servers:
- url: https://cloud.leonardo.ai/api/rest/v1
  description: Leonardo.AI Production API
security:
- bearerAuth: []
tags:
- name: Media
paths:
  /media:
    post:
      tags:
      - Media
      summary: Upload media
      description: This endpoint returns presigned details to upload a media file to S3
      operationId: uploadMedia
      requestBody:
        content:
          application/json:
            schema:
              properties:
                extension:
                  nullable: false
                  title: String
                  type: string
                  description: 'The file extension of the media file to upload. Supported extensions: mp4, mov.'
              required:
              - extension
              type: object
        description: Query parameters provided in the request body as a JSON object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  uploadMedia:
                    nullable: true
                    properties:
                      uploadId:
                        nullable: true
                        title: String
                        type: string
                      url:
                        nullable: true
                        title: String
                        type: string
                      fields:
                        nullable: true
                        title: String
                        type: string
                    title: MediaUploadOutput
                    type: object
          description: Responses for POST /media
  /media/{id}:
    get:
      tags:
      - Media
      summary: Get uploaded media
      description: This endpoint returns details of an uploaded media record
      operationId: getUploadedMediaById
      parameters:
      - required: true
        description: _"id" is required_
        in: path
        name: id
        schema:
          pattern: '[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}'
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  uploaded_media_by_pk:
                    nullable: true
                    properties:
                      id:
                        nullable: true
                        title: uuid
                        type: string
                      createdAt:
                        nullable: true
                        title: timestamp
                        type: string
                      url:
                        nullable: true
                        title: String
                        type: string
                      thumbnailUrl:
                        nullable: true
                        title: String
                        type: string
                      status:
                        nullable: true
                        title: String
                        type: string
                      statusReason:
                        nullable: true
                        title: String
                        type: string
                      mediaType:
                        nullable: true
                        title: String
                        type: string
                      duration:
                        nullable: true
                        title: Float
                        type: number
                      width:
                        nullable: true
                        title: Int
                        type: integer
                      height:
                        nullable: true
                        title: Int
                        type: integer
                      video_fps:
                        nullable: true
                        title: Float
                        type: number
                    title: uploaded_media
                    type: object
          description: Responses for GET /media/{id}
    delete:
      tags:
      - Media
      summary: Delete uploaded media
      description: This endpoint deletes an uploaded media record and removes the associated file from S3
      operationId: deleteUploadedMediaById
      parameters:
      - required: true
        description: _"id" is required_
        in: path
        name: id
        schema:
          pattern: '[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}'
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  delete_uploaded_media_by_pk:
                    nullable: true
                    properties:
                      id:
                        nullable: true
                        title: uuid
                        type: string
                    title: uploaded_media
                    type: object
          description: Responses for DELETE /media/{id}
components:
  securitySchemes:
    bearerAuth:
      type: http
      bearerFormat: auth-scheme
      description: 'Bearer HTTP authentication. Allowed headers `Authorization: Bearer <api_key>`'
      scheme: bearer