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

# Upload KB Images

> Upload images to Bunny CDN, auto-caption with vision, and write a markdown gallery KB doc.

## Request

```json theme={null}
{
  "images": [
    { "sourceUrl": "https://example.com/room.jpg" },
    { "data": "<base64>", "mimeType": "image/jpeg" }
  ],
  "autoCaption": true,
  "tags": ["eltahrir", "rooms"],
  "targetDocName": "STEIGENBERGER EL TAHRIR CAIRO (ROOMS)"
}
```

## Response

```json theme={null}
{
  "success": true,
  "docId": "kb_doc_id",
  "assets": [
    {
      "assetId": "asset_id",
      "cdnUrl": "https://vg-bunny-cdn.b-cdn.net/kb-images/…",
      "caption": "Spacious deluxe room with Nile view…"
    }
  ]
}
```

## Behavior

1. Uploads each image to Bunny CDN under `kb-images/{agentId}/{docId}/…`
2. When `autoCaption` is true, runs the same vision captioning pipeline as dashboard KB uploads
3. Writes `kb_image_assets/{assetId}` rows
4. Creates or updates a `kb` doc named `targetDocName` with markdown image blocks — the shape runtime KB search already expects

<Tip>
  Match existing card-search naming conventions in `targetDocName` so retrieval stays consistent with hand-authored galleries.
</Tip>


## OpenAPI

````yaml POST /agents/{agentId}/kb/images
openapi: 3.0.3
info:
  title: Convocore OpenAPI
  description: Full API reference for Convocore
  version: 1.0.4
servers:
  - url: https://eu-gcp-api.vg-stuff.com/v3
security: []
paths:
  /agents/{agentId}/kb/images:
    post:
      tags:
        - KB
      summary: Upload KB images with optional auto-caption
      operationId: kbRouter-uploadKbImages
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                images:
                  type: array
                  items:
                    type: object
                    properties:
                      sourceUrl:
                        type: string
                        format: uri
                      data:
                        type: string
                      mimeType:
                        type: string
                    additionalProperties: false
                  minItems: 1
                  maxItems: 30
                autoCaption:
                  type: boolean
                  default: true
                tags:
                  type: array
                  items:
                    type: string
                targetDocName:
                  type: string
                  minLength: 1
              required:
                - images
                - targetDocName
              additionalProperties: false
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  docId:
                    type: string
                  assets:
                    type: array
                    items:
                      type: object
                      properties:
                        url:
                          type: string
                        sourceUrl:
                          type: string
                        caption:
                          type: string
                        error:
                          type: string
                      additionalProperties: true
                required:
                  - success
                  - docId
                  - assets
                additionalProperties: false
        default:
          $ref: '#/components/responses/error'
      security:
        - Authorization: []
components:
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  $ref: '#/components/schemas/message_11569e'
            required:
              - message
              - code
            additionalProperties: false
  schemas:
    message_11569e:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````