---
title: "Set the image that stands for a site you own."
method: PUT
path: "/sites/{idOrSlug}/cover"
tags: ["Sites"]
---

# Set the image that stands for a site you own.

`PUT /sites/{idOrSlug}/cover`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/sites/{idOrSlug}/cover`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.stacktr.ee/oauth/authorize`, token URL `https://api.stacktr.ee/oauth/token`, scopes: `sites:write`)

The picture shown as the page's thumbnail on a client portal and as its link preview, in place of a screenshot of the page. PNG, JPEG or WebP up to 2 MB, as the raw body or a multipart `file` field. A gated page still shows only the lock to anyone who has not opened it. Kept through updates to the page. Owner-authed.

## Response `200`

Set. `cover_at` is when.

- object
  - `id` string
  - `cover_at` integer

## Other responses

- `401`: Missing or invalid credentials.
- `404`: No such site.
- `413`: Larger than 2 MB (cover_too_large).
- `415`: Not a PNG, JPEG or WebP (cover_type_not_supported).

---

[API](https://skmtc.dev/stacktr/apis/stacktree-api.md) · [All operations](https://skmtc.dev/stacktr/apis/stacktree-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stacktr/apis/stacktree-api/revisions/5878cce46977?raw)
