---
title: "Download an asset, or read its metadata"
method: GET
path: "/api/v1/sites/{slug}/assets/{key}"
tags: ["Assets"]
---

# Download an asset, or read its metadata

`GET /api/v1/sites/{slug}/assets/{key}`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/assets/{key}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Returns the file itself by default, with its stored content type. `?format=json` returns the metadata plus the bytes as base64 and the stored SHA-256; `?format=meta` returns the metadata only, without reading the file. The key is the path after `/assets/` — for example `photos/hero.webp` or `style.css`. Do not prefix it with `assets/` or `/`. Keys may not contain `..` segments or start with `.dotsy/`.

## Path parameters

- `slug` string, required
- `key` string, required

## Query parameters

- `format` 'json' | 'meta'

## Response `200`

The file's bytes (default), or its JSON form when `format` is `json` or `meta`.

- union
  - AssetFile
    - `key` string, required: The asset's key: its path after `/assets/`.
    - `contentType` string, required
    - `size` integer, required: Size in bytes.
    - `uploadedAt` number, required: Upload time, Unix ms.
    - `etag` string, required: Content fingerprint (MD5 hex). Skip re-uploading a file whose MD5 already matches.
    - `originalKey` string: The key the file was uploaded as, when it is stored under this one (a JPEG or PNG kept as WebP). `etag` is the stored file's.
    - `sha256` string, required: SHA-256 of the STORED bytes. It can differ from the `bodySha256` you uploaded when a raster image was re-encoded to WebP.
    - `bodyBase64` string, required: The file's bytes, base64-encoded.
  - AssetMeta
    - `key` string, required
    - `size` integer, required: Size in bytes.
    - `uploadedAt` number, required: Upload time, Unix ms.
    - `contentType` string, required
    - `width` integer: Pixel width, for a raster image.
    - `height` integer: Pixel height, for a raster image.
    - `intent` 'hero' | 'column' | 'inline' | 'logo': The layout role the image was sized for.
    - `title` string: Display title.

## Other responses

- `400`: The key is blank (`invalid_key`).
- `401`: Missing or invalid credentials.
- `403`: The key or token cannot access this site (a key scoped to other sites).
- `404`: No such site (`site_not_found`), or no asset at that key (`asset_not_found`; `not_found` with `format=meta`).

---

[API](https://skmtc.dev/dotsy/apis/dotsy-api.md) · [All operations](https://skmtc.dev/dotsy/apis/dotsy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dotsy/apis/dotsy-api/revisions/4272ed3b85d7?raw)
