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

# Edit an image

> Edit a previously generated or uploaded image. Use the prompt to describe what to change. The aspect ratio remains the same as the original image. Optionally include `referenceImageIds` for additional context. The endpoint returns a new image ID immediately; poll `GET /images/{id}` to check the status and retrieve the result.



## OpenAPI

````yaml https://www.trybloom.ai/api/v1/spec.json post /images/{id}/edit
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/{id}/edit:
    post:
      tags:
        - Images
      summary: Edit an image
      description: >-
        Edit a previously generated or uploaded image. Use the prompt to
        describe what to change. The aspect ratio remains the same as the
        original image. Optionally include `referenceImageIds` for additional
        context. The endpoint returns a new image ID immediately; poll `GET
        /images/{id}` to check the status and retrieve the result.
      operationId: images.edit
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: ID of a completed or uploaded image to edit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 2000
                  description: >-
                    What to change — describe the edit (e.g. "make the
                    background blue"). Aspect ratio is locked to the original
                    image's ratio.
                brandSessionId:
                  type: string
                  format: uuid
                  description: Brand ID (from GET /brands)
                imageSize:
                  enum:
                    - 2K
                    - 4K
                  type: string
                  default: 2K
                  description: '"2K" (default, 1 credit) or "4K" (2 credits)'
                model:
                  enum:
                    - fast
                    - standard
                    - pro
                  type: string
                  description: >-
                    Model tier. "fast" is quickest, "standard" is balanced, and
                    "pro" is the default and offers the highest quality.
                referenceImageIds:
                  type: array
                  maxItems: 9
                  items:
                    type: string
                    format: uuid
                  description: >-
                    IDs of uploaded or generated images for additional context
                    (max 9)
              required:
                - prompt
                - brandSessionId
      responses:
        '202':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      status:
                        const: pending
                    required:
                      - id
                      - status
                required:
                  - data
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit400ErrorResponse'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit401ErrorResponse'
        '402':
          description: '402'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit402ErrorResponse'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit403ErrorResponse'
        '404':
          description: '404'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit404ErrorResponse'
        '409':
          description: '409'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit409ErrorResponse'
        '422':
          description: '422'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit422ErrorResponse'
        '429':
          description: '429'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEdit429ErrorResponse'
          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:
    ImagesEdit400ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: EDIT_SUBJECT_NOT_COMPLETED
                    status:
                      const: 400
                    message:
                      type: string
                      default: Image must be completed before editing
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: EDIT_SUBJECT_NO_STORAGE_PATH
                    status:
                      const: 400
                    message:
                      type: string
                      default: Image has no stored file
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: SESSION_MISSING_BRAND_IMAGE
                    status:
                      const: 400
                    message:
                      type: string
                      default: Brand session is not fully onboarded
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: REFERENCE_LIMIT_EXCEEDED
                    status:
                      const: 400
                    message:
                      type: string
                      default: Too many reference images
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesEdit401ErrorResponse:
      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
    ImagesEdit402ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: INSUFFICIENT_CREDITS
                    status:
                      const: 402
                    message:
                      type: string
                      default: Not enough credits to edit
                    data:
                      type: object
                      properties:
                        action_url:
                          type: string
                          format: uri
                          description: >-
                            Deep link to /pricing for the caller to top up
                            credits
                      required:
                        - action_url
                  required:
                    - code
                    - status
                    - message
                    - data
                - type: object
                  properties:
                    code:
                      const: PAYMENT_REQUIRED
                    status:
                      const: 402
                    message:
                      type: string
                      default: Subscription paused — complete payment to resume
                    data:
                      type: object
                      properties:
                        action_url:
                          type: string
                          format: uri
                          description: >-
                            Deep link to /pricing to complete the pending
                            payment
                      required:
                        - action_url
                  required:
                    - code
                    - status
                    - message
                    - data
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesEdit403ErrorResponse:
      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: FEATURE_NOT_ENTITLED
                    status:
                      const: 403
                    message:
                      type: string
                      default: 4K generation isn't included with your current plan
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesEdit404ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: EDIT_SUBJECT_NOT_FOUND
                    status:
                      const: 404
                    message:
                      type: string
                      default: Image not found
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      const: REFERENCE_IMAGE_NOT_FOUND
                    status:
                      const: 404
                    message:
                      type: string
                      default: Reference image 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
    ImagesEdit409ErrorResponse:
      type: object
      properties:
        error:
          allOf:
            - $ref: '#/components/schemas/ApiError'
            - anyOf:
                - type: object
                  properties:
                    code:
                      const: BRAND_NOT_READY
                    status:
                      const: 409
                    message:
                      type: string
                      default: Brand is not ready for image generation
                    data: {}
                  required:
                    - code
                    - status
                    - message
                - type: object
                  properties:
                    code:
                      type: string
                    status:
                      type: integer
                    message:
                      type: string
                    data: {}
                  required:
                    - code
                    - status
                    - message
      required:
        - error
    ImagesEdit422ErrorResponse:
      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
    ImagesEdit429ErrorResponse:
      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.

````