---
updatedAt: 2026-10-25T15:46:36.000Z
agentTools:
  projectIndex: https://docs.superwise.ai/llms.txt
---

# Get Media

Retrieve a single image from GCS by encoded image_id.

Returns one image by its encoded `image_id`, which carries the dataset routing information. Set `thumbnail_size` to `small`, `medium`, or `large` for a resized thumbnail, or leave it out for the original image.

## When to use it

Use it to fetch an image field logged to a dataset, for example to display it next to the record it belongs to.

## Required parameters

* `image_id` (body): the encoded image ID, which contains dataset routing information.

Optional body fields: `thumbnail_size`.

## Response

A successful call returns `200 OK` with the image. The response content type is not documented.

**Related:** [Log a record to a dataset](https://docs.superwise.ai/reference/log_v1_datasets__dataset_id__log_post), [Run a SQL query on datasets](https://docs.superwise.ai/reference/run_sql_query), [Get a dataset](https://docs.superwise.ai/reference/get_dataset)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "paths": {
    "/v1/datasets/get-media": {
      "post": {
        "tags": [
          "Dataset"
        ],
        "summary": "Get Media",
        "description": "Retrieve a single image from GCS by encoded image_id.",
        "operationId": "get_media",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GetMediaRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              },
              "image/*": {}
            }
          },
          "404": {
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "info": {
    "title": "Superwise Main Entities",
    "description": "API reference",
    "version": "0.1.0"
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "GetMediaRequest": {
        "properties": {
          "image_id": {
            "type": "string",
            "title": "Image Id",
            "description": "Encoded image ID (contains dataset routing information)"
          },
          "thumbnail_size": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "small",
                  "medium",
                  "large"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Thumbnail Size",
            "description": "Return a resized thumbnail at this size. None returns the original."
          }
        },
        "type": "object",
        "required": [
          "image_id"
        ],
        "title": "GetMediaRequest",
        "description": "Request body for the get-media endpoint."
      }
    },
    "securitySchemes": {
      "implicit": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://authentication.superwise.ai/identity/resources/auth/v1/api-token",
            "scopes": {}
          }
        }
      }
    }
  },
  "security": [
    {
      "implicit": []
    }
  ],
  "servers": [
    {
      "url": "api.superwise.ai",
      "description": "Superwise Api Gateway"
    }
  ]
}
```