> For the complete documentation index, see [llms.txt](https://docs.thryve.health/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thryve.health/embed-visualization-widget-beta.md).

# Embed Visualization Widget (Beta)

Embed predefined visualizations of your users' data in your web app with the Thryve Visualization Widget. Request a visualization by specifying the *template ID* and optional parameters in a REST API call. Then embed the returned URL in an iframe.

The API request creates a `visualizationSessionToken` that the widget uses to authorize and identify the user. For security, the token expires after 15 minutes. Your web app must handle expiration and create a new session.

{% hint style="info" %}
Visualization widgets are in **beta**. We plan to add more templates over time. If you want a new template or have feedback on an existing one, contact our product team through the support center.
{% endhint %}

### Templates

| templateId | Name                                                                        |
| ---------- | --------------------------------------------------------------------------- |
| `100`      | [Daily Totals](/thryve-product-overview/visualize-beta.md#daily-totals)     |
| `101`      | [Social Jet Lag](/thryve-product-overview/visualize-beta.md#social-jet-lag) |

## Create a visualization session

> Creates a new visualization session for the given end user and template. Returns a short-lived URL to be embedded in an iframe or WebView.<br>

```json
{"openapi":"3.0.3","info":{"title":"Thryve Visualization Widget API","version":"6.0.0"},"servers":[{"url":"https://api.thryve.de","description":"Thryve public API"}],"paths":{"/widget/v6/visualization":{"post":{"summary":"Create a visualization session","description":"Creates a new visualization session for the given end user and template. Returns a short-lived URL to be embedded in an iframe or WebView.\n","parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Basic Auth credentials for the customer account. Format: `Basic <base64(username:password)>`.\n"},{"in":"header","name":"AppAuthorization","required":true,"schema":{"type":"string"},"description":"Basic Auth credentials for the app. Format: `Basic <base64(authId:authSecret)>`.\n"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisualizationWidgetRequest"}}}},"responses":{"200":{"description":"Session created. Embed the returned `url` in an iframe or WebView.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisualizationWidgetResponse"}}}},"400":{"description":"Request validation failed. Typically caused by an invalid `endUserId` format, a missing required field, an unrecognised `config` property, or an invalid field value.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Authentication failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The specified `templateId` does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"VisualizationWidgetRequest":{"type":"object","required":["endUserId","templateId"],"properties":{"endUserId":{"type":"string","description":"Thryve end user identifier. This is the same identifier returned when the user was created.\n"},"templateId":{"type":"integer","enum":[100,101],"description":"Visualization template to render."},"locale":{"type":"string","description":"ISO 639-1 locale code. Controls the widget's display language. Defaults to `en`. Available languages: `ar`,`bg,`cs`,`da`,`de`,`el`,`en`,`es`,`et`,`fi`,`fr`,`hu`,`id`,`it`,`ja`,`ko`,`lt`,`lv`,`nl`,`pl`,`pt`,`ro` ,`ru`, `sk`, `sl`, `sv`, `tr`, `uk`"},"config":{"type":"object","description":"Template-specific configuration. All fields are optional and fall back to server-side defaults when omitted. Shape depends on `templateId` — see Templates section.\n"}},"title":"VisualizationWidgetRequest"},"VisualizationWidgetResponse":{"type":"object","required":["url","visualizationSessionToken","locale"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri"},"visualizationSessionToken":{"type":"string"},"locale":{"type":"string"}},"title":"VisualizationWidgetResponse"},"ErrorResponse":{"type":"object","required":["error"],"additionalProperties":false,"properties":{"error":{"type":"object","required":["code","message"],"additionalProperties":false,"properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","APP_AUTH_FAILED","END_USER_INVALID","NOT_FOUND","INTERNAL_ERROR","HDA_API_ERROR"],"description":"Stable error code for programmatic handling."},"message":{"type":"string","description":"Human-readable error summary."},"details":{"type":"array","description":"Field-level detail. Present on 400 and 401 responses.","items":{"type":"object","required":["field","issue"],"additionalProperties":false,"properties":{"field":{"type":"string"},"issue":{"type":"string"}}}}}}},"title":"ErrorResponse"}}}}
```

###


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.thryve.health/embed-visualization-widget-beta.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
