> ## 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.

# Upload an image (file)

> Upload a local image as raw bytes (`multipart/form-data`) for use as a reference or edit subject. For a remote image, use `POST /images/uploads`. Returns the canonical image ID and whether an exact match already existed in the brand session.



## OpenAPI

````yaml https://www.trybloom.ai/api/v1/spec.json post /images/uploads/file
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: Account
    description: >-
      Inspect the authenticated account — profile, credit balance, and
      accessible workspaces.
  - name: Brands
    description: Manage brands and brand identity.
  - name: Images
    description: Generate, edit, and retrieve images.
paths:
  /images/uploads/file:
    post:
      tags:
        - Images
      summary: Upload an image (file)
      description: >-
        Upload a local image as raw bytes (`multipart/form-data`) for use as a
        reference or edit subject. For a remote image, use `POST
        /images/uploads`. Returns the canonical image ID and whether an exact
        match already existed in the brand session.
      operationId: images.uploadFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  anyOf:
                    - type: string
                      contentMediaType: image/png
                    - type: string
                      contentMediaType: image/jpeg
                    - type: string
                      contentMediaType: image/webp
                    - type: string
                      contentMediaType: image/avif
                  description: >-
                    Image file (PNG, JPEG, WebP, or AVIF, max 10MB). AVIF is
                    converted to PNG server-side.
                brandSessionId:
                  type: string
                  format: uuid
                  description: Brand session to scope this upload to
              required:
                - file
                - brandSessionId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      imageUrl:
                        type: string
                        format: uri
                      width:
                        type: number
                      height:
                        type: number
                      mimeType:
                        type: string
                      existing:
                        type: boolean
                        description: >-
                          Whether Bloom reused an exact image already in this
                          brand session
                    required:
                      - id
                      - imageUrl
                      - width
                      - height
                      - mimeType
                      - existing
                required:
                  - data
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesUploadFile400ErrorResponse'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesUploadFile401ErrorResponse'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesUploadFile403ErrorResponse'
        '422':
          description: '422'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesUploadFile422ErrorResponse'
        '429':
          description: '429'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesUploadFile429ErrorResponse'
          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
components:
  schemas:
    ImagesUploadFile400ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: UNSUPPORTED_FORMAT
                    status:
                      const: 400
                    message:
                      type: string
                      default: Unsupported image format
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: FILE_TOO_LARGE
                    status:
                      const: 400
                    message:
                      type: string
                      default: Image exceeds maximum file size
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesUploadFile401ErrorResponse:
      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
    ImagesUploadFile403ErrorResponse:
      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:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesUploadFile422ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: BRAND_NOT_FOUND
                    status:
                      const: 422
                    message:
                      type: string
                      default: Brand session 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
    ImagesUploadFile429ErrorResponse:
      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
    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.

````