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

# Analyze image for focal point, faces, and palette

> Runs focal-point detection, face boxes, and palette extraction on a stored file or one-off upload. Results can be persisted in file metadata when analyzing by `fileId`. Use output to seed CDN `fp=x,y` params. Requires a standard API key or dashboard session â€” not a CDN signing key.



## OpenAPI

````yaml /openapi.json post /api/images/analyze
openapi: 3.1.0
info:
  title: Convertly API
  version: 1.0.0
  description: >-
    Convertly provides production API endpoints for media conversion,
    compression, Image CDN delivery, Forma AI, HLS/DASH video streaming, media
    tools, async jobs, workflows, webhooks, and Convertly Storage.
  license:
    name: Proprietary
    url: https://convertly.sh/terms
servers:
  - url: https://convertly.sh
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /api/images/analyze:
    post:
      tags:
        - Image CDN
      summary: Analyze image for focal point, faces, and palette
      description: >-
        Runs focal-point detection, face boxes, and palette extraction on a
        stored file or one-off upload. Results can be persisted in file metadata
        when analyzing by `fileId`. Use output to seed CDN `fp=x,y` params.
        Requires a standard API key or dashboard session â€” not a CDN signing
        key.
      operationId: analyzeImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - fileId
              properties:
                fileId:
                  type: string
                  format: uuid
                  description: Convertly Storage file ID to analyze.
                refresh:
                  type: boolean
                  default: false
                  description: When true, re-run analysis even if cached metadata exists.
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Image file to analyze (max 25 MiB).
      responses:
        '200':
          description: Analysis result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageAnalysisResult'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '500':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ImageAnalysisResult:
      type: object
      properties:
        version:
          type: integer
          example: 1
        width:
          type: integer
        height:
          type: integer
        focal:
          type: object
          properties:
            suggested:
              type: object
              properties:
                x:
                  type: number
                'y':
                  type: number
                confidence:
                  type: number
                source:
                  type: string
                  enum:
                    - face
                    - smart-crop
                    - center
            crop:
              type:
                - object
                - 'null'
              properties:
                left:
                  type: integer
                top:
                  type: integer
                width:
                  type: integer
                height:
                  type: integer
        faces:
          type: array
          items:
            type: object
            properties:
              x:
                type: number
              'y':
                type: number
              width:
                type: number
              height:
                type: number
              confidence:
                type: number
        palette:
          type: object
          description: Dominant and population-sorted colour swatches.
        analyzedAt:
          type: string
          format: date-time
        cached:
          type: boolean
          description: True when returned from stored file metadata without re-analysis.
      required:
        - version
        - width
        - height
        - focal
        - faces
        - palette
        - analyzedAt
    Error:
      type: object
      properties:
        error:
          type: string
        upgradeUrl:
          type: string
      required:
        - error
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Dashboard-generated Convertly API key. Keys currently begin with
        `cvly_`.
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternative API key header for server-side clients.

````