Skip to main content
The captures resource on the Figranium Kotlin SDK gives you access to recordings, screenshots, and browser cookies produced during task executions. You can list captures for a specific run, delete individual files, inspect stored cookies, and bulk-clear screenshots or cookies when you need to reclaim space or reset state.
main.kt

Methods

Returns all captures, including recordings and screenshots. Optionally filter by runId.
  • HTTP endpoint: GET /api/data/captures (with runId query parameter when set)
  • Signature: captures.list(runId: String? = null, options: RequestOptions = RequestOptions()): List<Capture>
list_captures.kt
Each capture entry contains name, url, size, modified, and type ("recording" or "screenshot").
Returns only screenshot captures, omitting recordings.
  • HTTP endpoint: GET /api/data/screenshots
  • Signature: captures.screenshots(options: RequestOptions = RequestOptions()): List<Capture>
list_screenshots.kt
Delete a single capture by its name.
  • HTTP endpoint: DELETE /api/data/captures/{name}
  • Signature: captures.delete(name: String, options: RequestOptions = RequestOptions()): JsonObject
delete_capture.kt
List stored browser cookies and their origins.
  • HTTP endpoint: GET /api/data/cookies
  • Signature: captures.cookies(options: RequestOptions = RequestOptions()): JsonObject
list_cookies.kt
Remove a specific cookie by name, optionally scoped to a domain and path.
  • HTTP endpoint: POST /api/data/cookies/delete
  • Signature: captures.deleteCookie(name: String, domain: String? = null, path: String? = null, options: RequestOptions = RequestOptions()): JsonObject
delete_cookie.kt
Delete all screenshots at once.
  • HTTP endpoint: POST /api/data/clear-screenshots
  • Signature: captures.clear(options: RequestOptions = RequestOptions()): JsonObject
clear_screenshots.kt
Delete all stored cookies.
  • HTTP endpoint: POST /api/data/clear-cookies
  • Signature: captures.clearCookies(options: RequestOptions = RequestOptions()): JsonObject
clear_cookies.kt

Working example: list captures for a run and delete cookies

This example combines list and deleteCookie to clean up after a run: it lists captures for a specific run, then removes a session cookie for the target domain.
cleanup_after_run.kt

Model

Capture

Request options

Pass custom headers and per-request timeouts.

Errors

Handle FigraniumException responses.

Executions

Start runs that produce captures.

Captures and storage

Learn how Figranium stores recordings and screenshots.

Session state

Understand how cookies and session state work in Figranium.