Skip to content

Upload the page a link was saved from

For a browser extension saving the page someone is looking at: the rendered HTML, gzipped, becomes the link’s saved copy, so pages behind a sign-in or built by scripts are kept as they were seen. Teak keeps a private copy of each link’s page either way; without a snapshot it fetches the page itself.

POST/v1/page-snapshots/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.

Request body
application/json
bytesintegerrequired

The gzipped page's exact size in bytes; at most 20971520 (20 MiB).

Responses
200

A signed URL. PUT the gzipped page to uploadUrl with Content-Type: application/gzip and exactly bytes bytes, then pass fileKey as pageSnapshotKey to POST /v1/cards

expiresInnumberrequired
fileKeystringrequired
maxFileSizenumberrequired
methodstringrequired
Allowed:PUT
uploadUrlstring<uri>required
400

INVALID_INPUT: bytes is missing or not a whole number

codestringrequired
errorstringrequired
retryAtnumber | null
413

PAGE_SNAPSHOT_TOO_LARGE: over 20 MiB gzipped

codestringrequired
errorstringrequired
retryAtnumber | null
429

RATE_LIMITED: 60 snapshots a minute; retryAt and Retry-After say when to try again

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

Was this page helpful?