Attach a thumbnail or GIF to an uploaded demo
Uploads a locally generated PNG thumbnail or animated GIF for a demo created via local-upload, enabling social unfurls and the /thumb and /gif shortcut URLs. Generated demos receive these assets from the recording pipeline and reject this endpoint.
POST
/api/v1/demos/{id}/local-assets
Uploads a locally generated PNG thumbnail or animated GIF for a demo created via local-upload, enabling social unfurls and the /thumb and /gif shortcut URLs. Generated demos receive these assets from the recording pipeline and reject this endpoint.
Authentication
Bearer Token API Key (cookie: better-auth.session_token)
Path Parameters
id
string
required
path
Query Parameters
type
string
required
query
Request Body
image/pngResponses
201
Asset attached
application/jsonid
string
REQUIRED
type
string
REQUIRED
Enum:
thumbnail, gifurl
string
REQUIRED
Public shortcut URL (/thumb/:id.png or /gif/:id.gif).
400
Validation error or demo is not an uploaded demo
401
Unauthorized
403
Publishable keys cannot upload assets
404
Demo not found
411
Content-Length required
413
Asset too large (5 MB thumbnail / 25 MB GIF)
415
Wrong media type or body is not a valid PNG/GIF
429
Rate limit exceeded
curl -X POST 'https://littledemo.com/api/v1/demos/string/local-assets?type=thumbnail' \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '"string"'
const response = await fetch('https://littledemo.com/api/v1/demos/string/local-assets?type=thumbnail', { method: 'POST', headers: { "Authorization": "Bearer YOUR_API_TOKEN", "Content-Type": "application/json" }, body: JSON.stringify("string")});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://littledemo.com/api/v1/demos/string/local-assets?type=thumbnail', headers=headers, json="string")print(response.json())
201
Response
{ "id": "<string>", "type": "thumbnail", "url": "<string>"}
API Playground
Try this endpoint
POST
/api/v1/demos/{id}/local-assets