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

# Get Image

> An image of your library and how its background removal or expansion went

## Overview

Returns an image of your library with the state of the edits started on it: the image itself (`status` is `PROCESSING` while an expansion paints it) and its background removal (`backgroundRemoval.status`). Poll it after [Remove Image Background](https://docs.hooked.so/api-reference/image/remove-background.md) or [Expand Image](https://docs.hooked.so/api-reference/image/expand.md) until the state you wait for is `COMPLETED` or `FAILED`. This call is free and safe to retry.

```bash cURL theme={null}
curl "https://api.hooked.so/v1/image/cm1a2b3c4d5e6f7g8h9i0j1k2" \
  -H "x-api-key: your_api_key_here"
```

```javascript Node.js theme={null}
const response = await fetch('https://api.hooked.so/v1/image/cm1a2b3c4d5e6f7g8h9i0j1k2', {
  headers: { 'x-api-key': 'your_api_key_here' }
});
const { data } = await response.json();
if (data.backgroundRemoval.status === 'COMPLETED') console.log(data.backgroundRemoval.url);
```

```python Python theme={null}
import requests

response = requests.get(
    'https://api.hooked.so/v1/image/cm1a2b3c4d5e6f7g8h9i0j1k2',
    headers={'x-api-key': 'your_api_key_here'}
)
data = response.json()['data']
print(data['status'], data['backgroundRemoval']['status'])
```

```json Response theme={null}
{
  "success": true,
  "message": "Image details fetched successfully",
  "data": {
    "id": "cm1a2b3c4d5e6f7g8h9i0j1k2",
    "name": "portrait.jpg",
    "status": "COMPLETED",
    "url": "https://.../portrait.jpg",
    "aspectRatio": null,
    "backgroundRemoval": {
      "status": "COMPLETED",
      "url": "https://.../cm1a2b3c4d5e6f7g8h9i0j1k2-1726560000000.png"
    },
    "usedCredits": 4,
    "createdAt": "2026-09-17T10:00:00.000Z",
    "updatedAt": "2026-09-17T10:00:12.000Z"
  }
}
```

```json 404 theme={null}
{
  "success": false,
  "message": "Image not found"
}
```

## Errors

| Status | When |
| - | - |
| 401 | Missing or invalid API key (`code: "not_authenticated"`) |
| 403 | The team does not have the Hooked app product (`code: "entitlement_required"`) |
| 404 | No such image in your library. Another team's image, or a media that is not an image, answers the same `Image not found` |


## OpenAPI

````yaml GET /v1/image/{mediaId}
openapi: 3.0.0
info:
  title: Hooked API
  version: 1.0.0
  description: AI Video Generation API
servers:
  - url: https://api.hooked.so
security:
  - ApiKeyAuth: []
tags:
  - name: Videos
    description: Create projects, follow them and render videos
  - name: Account Analysis
    description: Analyze TikTok and YouTube accounts
  - name: Channels
    description: Connected social accounts you publish to
  - name: Publish
    description: Schedule videos to your connected accounts
  - name: Images
    description: 'Image editing: background removal and expansion'
  - name: Media
    description: 'Your media library: list, import from a URL, upload a file'
  - name: Avatars
    description: Your team's own avatars (Actors) and their Hook + Demo reactions
paths:
  /v1/image/{mediaId}:
    get:
      tags:
        - Images
      summary: Get Image
      description: >-
        An image of your library and the state of the edits started on it: the
        image itself (`status` is `PROCESSING` while an expansion paints it) and
        its background removal (`backgroundRemoval.status`). Poll it until the
        state you wait for is `COMPLETED` or `FAILED`. Free and safe to retry.
      operationId: getImageDetails
      parameters:
        - name: mediaId
          in: path
          required: true
          schema:
            type: string
          description: >-
            The library image, as returned by the endpoint that started the
            edit.
      responses:
        '200':
          description: Image found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The image id
                      name:
                        type: string
                        description: The image name in your library
                      status:
                        type: string
                        enum:
                          - PROCESSING
                          - COMPLETED
                          - FAILED
                        description: >-
                          The image itself: `PROCESSING` while an expansion is
                          being painted, then `COMPLETED` or `FAILED`
                      url:
                        type: string
                        nullable: true
                        description: >-
                          Signed URL of the image; `null` while it is still
                          being made
                      aspectRatio:
                        type: string
                        nullable: true
                        description: >-
                          `ratio_9_16`, `ratio_1_1`, `ratio_16_9`, ... when
                          known (always set on an expanded image), otherwise
                          `null`
                      backgroundRemoval:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - NONE
                              - PROCESSING
                              - COMPLETED
                              - FAILED
                            description: '`NONE` when none was ever started'
                          url:
                            type: string
                            nullable: true
                            description: >-
                              Signed URL of the PNG with transparency when
                              `status` is `COMPLETED`, otherwise `null`
                        description: State of the background removal of this image
                      usedCredits:
                        type: number
                        description: Credits recorded on this image (0 for a BYOK team)
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
              example:
                success: true
                message: Image details fetched successfully
                data:
                  id: media_abc123
                  name: portrait.jpg
                  status: COMPLETED
                  url: https://.../portrait.jpg
                  aspectRatio: null
                  backgroundRemoval:
                    status: COMPLETED
                    url: https://.../media_abc123-1726560000000.png
                  usedCredits: 4
                  createdAt: '2026-09-17T10:00:00.000Z'
                  updatedAt: '2026-09-17T10:00:12.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/EntitlementRequired'
        '404':
          description: >-
            No such image in your library. Another team's image, or a media that
            is not an image, answers the same
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFound404'
              example:
                success: false
                message: Image not found
        '429':
          $ref: '#/components/responses/RateLimited429'
      security:
        - ApiKeyAuth: []
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error401'
    EntitlementRequired:
      description: The team does not have the product this endpoint needs
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/EntitlementRequired403'
    RateLimited429:
      description: >-
        Your team is over a rate limit: 30 POST requests per minute, 120 other
        requests per minute, or 3 downloads of your URLs running at once.
        Nothing ran and nothing was charged: wait `Retry-After` seconds and send
        the request again. See [Rate
        limits](/guides/error-handling#rate-limits-429).
      headers:
        Retry-After:
          description: Seconds to wait before sending again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: The limit of the bucket you hit (not sent for the download cap).
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: 'Requests left in this window: 0 (not sent for the download cap).'
          schema:
            type: integer
        X-RateLimit-Reset:
          description: >-
            When the window ends, in Unix seconds (not sent for the download
            cap).
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                enum:
                  - false
              errorCode:
                type: string
                enum:
                  - RATE_LIMITED
              message:
                type: string
              retryAfterSeconds:
                type: integer
            required:
              - success
              - errorCode
              - message
              - retryAfterSeconds
          example:
            success: false
            errorCode: RATE_LIMITED
            message: >-
              Rate limit exceeded: 30 POST requests per minute per team. Retry
              after 12 s.
            retryAfterSeconds: 12
  schemas:
    NotFound404:
      type: object
      description: >-
        Not found. Another team's resource answers the same way as a missing
        one.
      properties:
        success:
          type: boolean
          enum:
            - false
        message:
          type: string
      required:
        - success
        - message
      example:
        success: false
        message: Project not found
    Error401:
      type: object
      description: Missing or invalid `x-api-key`.
      properties:
        code:
          type: string
          enum:
            - not_authenticated
        message:
          type: string
          example: Not authenticated
        errorCode:
          type: string
          enum:
            - NOT_AUTHENTICATED
        details:
          type: object
          additionalProperties:
            type: string
      example:
        code: not_authenticated
        message: Not authenticated
        errorCode: NOT_AUTHENTICATED
        details:
          x-api-key: Header not provided or API Key invalid
    EntitlementRequired403:
      type: object
      description: >-
        Valid key, but the team does not have the product this endpoint belongs
        to.
      properties:
        code:
          type: string
          enum:
            - entitlement_required
        error:
          type: string
          enum:
            - entitlement_required
        message:
          type: string
        product:
          type: string
          example: app
      required:
        - code
        - error
        - message
        - product
      example:
        code: entitlement_required
        error: entitlement_required
        message: This endpoint requires the "app" product.
        product: app
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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