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

# Add to a Brand Library

> Add an image, video, or audio file from an upload, existing media, or a URL. Identical file contents return the existing item. Images are up to 10 MiB; video and audio (beta) up to 100 MiB.



## OpenAPI

````yaml https://www.trybloom.ai/api/v1/spec.json post /brands/{id}/library
openapi: 3.1.1
info:
  title: Bloom API
  version: 1.0.0
servers:
  - url: https://www.trybloom.ai/api/v1
security:
  - apiKey: []
  - bearer: []
tags:
  - name: Uploads
    description: >-
      Stage private local files for brand sources, the Library, and other
      supported operations.
  - name: Account
    description: >-
      Inspect the authenticated account — profile, credit balance, and
      accessible workspaces.
  - name: Brands
    description: Manage brands and brand identity.
  - name: Library
    description: Add, list, and remove a brand's images, video, and audio.
  - name: Images
    description: Retrieve and manage images.
  - name: Videos
    description: Retrieve and manage video files.
  - name: Audio
    description: Retrieve and manage audio files.
  - name: Briefs
    description: Get brand guidance and selected assets for a specific task.
  - name: Models
    description: Find available models and check their inputs.
  - name: Generations
    description: Create and retrieve model generations.
  - name: Reviews
    description: >-
      Check an asset against a brand's color, typography, logo, and copy
      guidance.
paths:
  /brands/{id}/library:
    post:
      tags:
        - Library
      summary: Add to a Brand Library
      description: >-
        Add an image, video, or audio file from an upload, existing media, or a
        URL. Identical file contents return the existing item. Images are up to
        10 MiB; video and audio (beta) up to 100 MiB.
      operationId: library.add
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Brand ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                source:
                  anyOf:
                    - type: object
                      properties:
                        type:
                          const: upload
                        uploadId:
                          type: string
                          format: uuid
                          description: Completed temporary upload from `POST /uploads`.
                      required:
                        - type
                        - uploadId
                      title: Upload
                    - type: object
                      properties:
                        type:
                          const: media
                        mediaId:
                          type: string
                          format: uuid
                          description: >-
                            Image, video, or audio ID, such as a generation
                            output. Media from another brand is copied into this
                            one.
                      required:
                        - type
                        - mediaId
                      title: Existing media
                    - type: object
                      properties:
                        type:
                          const: url
                        url:
                          type: string
                          format: uri
                          description: Public HTTPS URL of the file. Bloom stores a copy.
                      required:
                        - type
                        - url
                      title: URL
                  description: Where the file comes from.
              required:
                - source
              examples:
                - source:
                    type: upload
                    uploadId: 3f2b8c1e-9a4d-4e7b-8c2f-1d5e6a7b8c9d
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: Media ID.
                      type:
                        type: string
                        description: >-
                          Media family: image, video, or audio. More values may
                          be added.
                      source:
                        type: string
                        description: >-
                          How the file entered Bloom: uploaded, scraped
                          (collected from a brand source), or generated. More
                          values may be added.
                      brandSessionId:
                        type: string
                        format: uuid
                        description: Brand that owns the file.
                      workspaceId:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          Workspace that owns the brand. Null for a personal
                          workspace.
                      mimeType:
                        type: string
                        description: The file's MIME type.
                      url:
                        type: string
                        format: uri
                        description: >-
                          Stable link to the file. Stops working when the file
                          is deleted.
                      fileSize:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                        description: Size in bytes.
                      durationMs:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                        description: Duration in milliseconds, when known.
                      width:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                        description: Width in pixels, when known.
                      height:
                        anyOf:
                          - type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          - type: 'null'
                        description: Height in pixels, when known.
                      description:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          Description of the file's contents, when Bloom has
                          one.
                      inLibrary:
                        type: boolean
                        description: Whether the file is in its brand's Library.
                      addedToLibraryAt:
                        anyOf:
                          - type: string
                            format: date-time
                          - type: 'null'
                        description: When the file was added to the Library, or null.
                      generationId:
                        anyOf:
                          - type: string
                            format: uuid
                          - type: 'null'
                        description: Generation that produced the file, or null.
                      createdAt:
                        type: string
                        format: date-time
                        description: When the file was stored.
                      existing:
                        type: boolean
                        description: >-
                          True when the brand already held this file; no new
                          copy was stored.
                    required:
                      - id
                      - type
                      - source
                      - brandSessionId
                      - workspaceId
                      - mimeType
                      - url
                      - fileSize
                      - durationMs
                      - width
                      - height
                      - description
                      - inLibrary
                      - addedToLibraryAt
                      - generationId
                      - createdAt
                      - existing
                required:
                  - data
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryAdd400ErrorResponse'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryAdd401ErrorResponse'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryAdd403ErrorResponse'
        '404':
          description: '404'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryAdd404ErrorResponse'
        '429':
          description: '429'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryAdd429ErrorResponse'
          headers:
            Retry-After:
              description: >-
                Seconds until the API-key request limit resets. Present only
                when the request-rate limiter can calculate the delay.
              schema:
                type: integer
                minimum: 0
        '503':
          description: '503'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LibraryAdd503ErrorResponse'
components:
  schemas:
    LibraryAdd400ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: UPLOAD_UNAVAILABLE
                    status:
                      const: 400
                    message:
                      type: string
                      default: Temporary upload is unavailable
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: INVALID_URL
                    status:
                      const: 400
                    message:
                      type: string
                      default: Please provide a valid, publicly reachable URL.
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: DOWNLOAD_FAILED
                    status:
                      const: 400
                    message:
                      type: string
                      default: Failed to download the file
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: UNSUPPORTED_FORMAT
                    status:
                      const: 400
                    message:
                      type: string
                      default: Unsupported file type
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: FILE_TOO_LARGE
                    status:
                      const: 400
                    message:
                      type: string
                      default: File is too large
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    LibraryAdd401ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: UNAUTHORIZED
                    status:
                      const: 401
                    message:
                      type: string
                      default: Invalid or missing API credentials
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    LibraryAdd403ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: ACCOUNT_BANNED
                    status:
                      const: 403
                    message:
                      type: string
                      default: This account has been suspended.
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: FORBIDDEN
                    status:
                      const: 403
                    message:
                      type: string
                      default: Plan upgrade required
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: BETA_ACCESS_REQUIRED
                    status:
                      const: 403
                    message:
                      type: string
                      default: Video and audio in the Library are in beta
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    LibraryAdd404ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: BRAND_NOT_FOUND
                    status:
                      const: 404
                    message:
                      type: string
                      default: Brand not found
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: MEDIA_NOT_FOUND
                    status:
                      const: 404
                    message:
                      type: string
                      default: Media not found
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: UPLOAD_NOT_FOUND
                    status:
                      const: 404
                    message:
                      type: string
                      default: Upload not found
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    LibraryAdd429ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: TOO_MANY_REQUESTS
                    status:
                      const: 429
                    message:
                      type: string
                      default: Rate limit exceeded
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    LibraryAdd503ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: LIBRARY_UNAVAILABLE
                    status:
                      const: 503
                    message:
                      type: string
                      default: The Library cannot be changed right now
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ApiError:
      type: object
      properties:
        code:
          type: string
        status:
          type: integer
        message:
          type: string
        data: {}
      required:
        - code
        - status
        - message
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Bloom API key, for example `x-api-key: bloom_sk_...`.'
    bearer:
      type: http
      scheme: bearer
      description: Bloom API key (`Bearer bloom_sk_...`) or Bloom OAuth access token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.