createCapture
# createCapture
POST
/captures
const url = 'http://localhost:8080/api/v1/captures';const options = { method: 'POST', headers: {cookie: 'hs_session=<hs_session>', 'Content-Type': 'application/json'}, body: '{"platform":"instagram","accountId":"per_01j9x3k8m2q4r5s6t7v8w9y0z1","pageUrl":"https://example.com","title":"example","mode":"passive","runId":"per_01j9x3k8m2q4r5s6t7v8w9y0z1","capturedAt":"2026-04-15T12:00:00Z","extensionVersion":"example","assets":[{"url":"https://example.com","kind":"image","order":1,"width":1,"height":1,"inViewport":true}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/captures \ --header 'Content-Type: application/json' \ --cookie hs_session=<hs_session> \ --data '{ "platform": "instagram", "accountId": "per_01j9x3k8m2q4r5s6t7v8w9y0z1", "pageUrl": "https://example.com", "title": "example", "mode": "passive", "runId": "per_01j9x3k8m2q4r5s6t7v8w9y0z1", "capturedAt": "2026-04-15T12:00:00Z", "extensionVersion": "example", "assets": [ { "url": "https://example.com", "kind": "image", "order": 1, "width": 1, "height": 1, "inViewport": true } ] }'Step 1 of a capture. Registers the page and its asset list. Returns an upload token for this capture and the asset keys the server does not already have.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
platform
required
string
accountId
required
string
pageUrl
required
string format: uri
title
string
mode
required
string
runId
string
capturedAt
required
string format: date-time
extensionVersion
required
string
assets
required
Array<object>
object
url
required
string format: uri
kind
required
string
order
required
Position in DOM order.
integer
width
integer
height
integer
inViewport
boolean
Responses
Section titled “Responses”Capture created.
Media typeapplication/json
object
captureId
required
string
uploadToken
required
Hsu_… token for the helper; this capture only.
string
uploadExpiresAt
required
string format: date-time
assets
required
Array<object>
object
key
required
SHA-1 hex of the URL.
string
url
required
string format: uri
needed
required
False when the server already has these bytes.
boolean
Examples
Exampleseed
Derived from fixtures/seed.json.
{ "assets": [ { "key": "a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4", "needed": true, "url": "https://scontent.example.com/v/t51/asset-a.jpg" }, { "key": "b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5", "needed": false, "url": "https://scontent.example.com/v/t51/asset-b.jpg" }, { "key": "c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6", "needed": true, "url": "https://scontent.example.com/v/t51/asset-c.jpg" } ], "captureId": "cap_01j9a1b2c3d4e5f6g7h8j9k026", "uploadExpiresAt": "2026-10-17T09:10:00.000Z", "uploadToken": "hsu_demoUploadToken0123456789abcdef"}Invalid request.
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "i18nKey": "example", "detail": "example", "fields": [ { "path": "example", "code": "example", "i18nKey": "example" } ]}Role or scope does not allow this.
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "i18nKey": "example", "detail": "example", "fields": [ { "path": "example", "code": "example", "i18nKey": "example" } ]}Not found.
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "i18nKey": "example", "detail": "example", "fields": [ { "path": "example", "code": "example", "i18nKey": "example" } ]}Too many requests. See Retry-After.
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "i18nKey": "example", "detail": "example", "fields": [ { "path": "example", "code": "example", "i18nKey": "example" } ]}Headers
Section titled “Headers”Retry-After
integer