Images

REST endpoints for images. Bearer-auth required.

GET /api/images

List images

List images in a workspace. Images are filtered rows from the unified file model — each row is a file with an image/* mime that has been provisioned into Cloudflare Images.

Query parameters

  • limit (optional): Max items per page (1–100, default 100).
  • after (optional): Keyset cursor — return the page after this row (next page).
  • before (optional): Keyset cursor — return the page before this row (prev page).
  • ids (optional): Comma-separated IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).
  • workspace_id (optional): Filter to images in this workspace. When omitted, returns images across every workspace the caller is a member of (admins see all).

Response

JSON
{
  "data": [
    {
      "id": "<...>",
      "fileId": "<...>",
      "workspaceId": "<...>",
      "cfImageId": "<...>",
      "width": "<...>",
      "height": "<...>",
      "size": "<...>",
      "exif": "<...>",
      "url": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}

GET /api/images/{id}

Get image

Path parameters

  • id (required): The image's prefixed ID (e.g. img_...).

Response

JSON
{
  "id": "string",
  "fileId": "string",
  "workspaceId": "string",
  "cfImageId": "string",
  "width": "number",
  "height": "number",
  "size": "number",
  "exif": {},
  "url": "string"
}

DELETE /api/images/{id}

Delete the image projection (the underlying file is unaffected).

Path parameters

  • id (required): Image to delete.

Response

JSON
{
  "success": "boolean"
}

GET /api/images/by-file/{file_id}

Get image by file id

Resolve the image (if any) bound to a given file. Used by file-detail UIs that know the file id but not the image id.

Path parameters

  • file_id (required): The underlying file's prefixed ID (e.g. fil_...).

Response

JSON
{
  "id": "string",
  "fileId": "string",
  "workspaceId": "string",
  "cfImageId": "string",
  "width": "number",
  "height": "number",
  "size": "number",
  "exif": {},
  "url": "string"
}