---
search:
  tags:
    - Operations
    - POST
seo:
  description: >-
    Starts replacing a link card's image. Works at the free plan's card…
    Reference for the POST /v1/cards/{cardId}/thumbnail/upload endpoint in the
    Teak API.
sidebar:
  label: Upload a link's image
  badge: POST
title: Upload a link's image
type: openapi-operation
---
Starts replacing a link card's image. Works at the free plan's card limit: no card is created.

`POST /v1/cards/{cardId}/thumbnail/upload`

**Request body** (`application/json`)

- `fileSize` (number, required) — Bytes; at most 20971520 (20 MB).
- `mimeType` (string, required) — JPEG, PNG, WebP, GIF (its first frame) or AVIF. SVG and HEIC are refused.

Request body example:

```json
{
  "fileSize": 0,
  "mimeType": "image/jpeg"
}
```

**Responses**

- `200` — A signed URL. PUT the bytes to uploadUrl with the same Content-Type, then pass fileKey to PUT /v1/cards/{cardId}/thumbnail
- `400` — TYPE\_MISMATCH: not a link card. UNSUPPORTED\_TYPE: not an accepted image type (JPEG, PNG, WebP, GIF (its first frame) or AVIF. SVG and HEIC are refused.). INVALID\_INPUT: the image couldn't be read, or is over 10,000 pixels on a side
- `404` — The card, or the upload for it, was not found
- `409` — The card is in Trash
- `413` — FILE\_TOO\_LARGE: images must be under 20 MB
- `429` — RATE\_LIMITED: 20 image changes a minute; \`retryAt\` and Retry-After say when to try again

Response example, 200:

```json
{
  "expiresIn": 0,
  "fileKey": "string",
  "maxFileSize": 0,
  "method": "PUT",
  "uploadUrl": "http://example.com"
}
```
