Skip to content

Upload a link's image

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
Authorization
AuthorizationBearer token (OAuth access token or teakapi_ API key) · headerrequired

Bearer token. Accepts either an OAuth 2.0 access token (obtained via browser sign-in; expires after 1 hour and is refreshable) or a teakapi_ API key.

Path parameters
cardIdstringrequired
Request body
application/json
fileSizenumberrequired

Bytes; at most 20971520 (20 MB).

mimeTypestringrequired

JPEG, PNG, WebP, GIF (its first frame) or AVIF. SVG and HEIC are refused.

Allowed:image/jpegimage/pngimage/webpimage/gifimage/avif
Responses
200

A signed URL. PUT the bytes to uploadUrl with the same Content-Type, then pass fileKey to PUT /v1/cards/{cardId}/thumbnail

expiresInnumberrequired
fileKeystringrequired
maxFileSizenumberrequired
methodstringrequired
Allowed:PUT
uploadUrlstring<uri>required
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

codestringrequired
errorstringrequired
retryAtnumber | null
404

The card, or the upload for it, was not found

codestringrequired
errorstringrequired
retryAtnumber | null
409

The card is in Trash

codestringrequired
errorstringrequired
retryAtnumber | null
413

FILE_TOO_LARGE: images must be under 20 MB

codestringrequired
errorstringrequired
retryAtnumber | null
429

RATE_LIMITED: 20 image changes a minute; retryAt and Retry-After say when to try again

codestringrequired
errorstringrequired
retryAtnumber | null
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://teakvault.com/api/v1/cards/string/thumbnail/upload' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "fileSize": 0,
  "mimeType": "image/jpeg"
}'
Response
{
  "expiresIn": 0,
  "fileKey": "string",
  "maxFileSize": 0,
  "method": "PUT",
  "uploadUrl": "http://example.com"
}

Was this page helpful?