Skip to main content

Render - Screenshot Create

Endpoint

/o/render

Overview

Renders a dashboard view and returns the saved screenshot path.

Authentication

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Requires dashboard read access.
  • app_id is required for non-global-admin users by read-access validation.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringConditionallyRequired for non-global-admin read validation.
viewStringNoView route prefix used to build render target (view#route). For dashboard screenshots, use /dashboard?ssr=true so the server-side rendering path is enabled.
routeStringNoRoute fragment appended after #. Dashboard routes should use the same hash path as the UI, for example /analytics/sessions/overview.
idStringNoElement ID to capture. When provided, target selector becomes #id.

Response

Success Response

{
"path": "/images/screenshots/screenshot_55f16fc8ae8458f30ffd1ad9fbc4032a.png"
}

Response Fields

FieldTypeDescription
pathStringRelative path of generated screenshot image.

Error Responses

Status Code: 400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

Status Code: 401 Unauthorized

{
"result": "No app_id provided"
}

Status Code: 400 Bad Request

{
"result": "Error creating token: failed_to_create_token"
}

Status Code: 400 Bad Request

{
"result": "Error creating screenshot: Browser context closed"
}

Status Code: 400 Bad Request

{
"result": "Error creating screenshot. Please check logs for more information."
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Full-view captureid omittedRenders view#route and captures full view screenshot.Raw object with path.
Element captureid providedRenders view#route and captures specific #id element.Raw object with path.

Render Target Construction

The endpoint concatenates view and route into the browser navigation target. A dashboard screenshot request should therefore pass:

  • view=/dashboard?ssr=true
  • route=/analytics/sessions/overview

This produces a target equivalent to /dashboard?ssr=true#/analytics/sessions/overview.

Impact on Other Data

  • Creates short-lived login token for render flow.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuthentication sourceResolves requesting member.
countly.appsRead-access validation sourceValidates app access where required.
countly.auth_tokensTemporary render token storageInserts LoginAuthToken used for headless view rendering.

Examples

Example 1: Capture full view

/o/render?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&view=%2Fdashboard%3Fssr%3Dtrue&route=%2Fanalytics%2Fsessions%2Foverview

Example 2: Capture specific element

/o/render?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&view=%2Fdashboard%3Fssr%3Dtrue&route=%2Fanalytics%2Fsessions%2Foverview&id=d-chart-time

Operational Considerations

  • Requires working server-side headless browser runtime.
  • Requires the render process to reach the configured Countly dashboard host from inside the API container.
  • If Puppeteer/Chrome or the internal dashboard route is unavailable, the route returns a generic screenshot creation error and the server logs contain the concrete browser error.
  • Rendering is synchronous for request lifecycle and can take longer for heavy pages.

Limitations

  • Output is an image path reference; file storage retention depends on server operations.
  • The route is configuration-dependent and may fail on instances where server-side rendering is not installed or not allowed to access the dashboard URL.

Last Updated

2026-04-13