# 3pm-backend route `viewBlob`

Paths are relative to the backend's origin (https://fleet.edgecr4ft.net, or your own 3pm-backend), not to this site. Index: https://3pm.edgecr4ft.net/docs/backend/api.md

---

tokens:
  claude: 436
  o200k: 293
# POST /api/buckets/{clusterId}/blobs/{blobId}/view (viewBlob)

Mint the one credential a browser tag can carry: a `getBlob` URL with `?k=` on it, good for sixty seconds, for this blob, for reading — `{as: "mjpeg"}` adds the rendering an `<img>` needs.

- auth: an account — Authorization: Bearer 3pmu_<token>, or the dashboard's session cookie
- body: ViewBlobBody (JSON)
- answer: ViewBlobUrl (JSON)

## Types

```ts
/** `viewBlob`'s body: how the tag will read the blob. */
interface ViewBlobBody {
  /** `"mjpeg"` for an `<img>` over a stream of JPEG messages; absent for the raw bytes. */
  as?: "mjpeg";
}

/** The URL a browser tag can carry, and when it stops working. */
interface ViewBlobUrl {
  /** A `getBlob` URL on this origin, with `?k=` (and `&as=` when one was asked for). */
  url: string;
  /** Epoch ms; sixty seconds after it was minted, and never renewed. */
  expires_at: EpochMs;
}

/** Milliseconds since the Unix epoch. */
type EpochMs = number;
```
