Skip to main content
Definite can be embedded in other web applications, allowing users to access docs directly within an iframe. This guide explains how to embed Definite in your web application.

Steps to Embed Definite

1

Obtain Your API Key

First, you need to obtain your API token from the menu in the Definite web application. See here for more.
2

Generate an Embedded UI Link

Call the endpoint to generate an embedded UI link:Endpoint: POST https://api.definite.app/v1/get_embedded_url

Parameters

ParameterTypeRequiredDescription
user_identifierstringYesA user identifier for the visiting user
doc_idstringYesThe UUID of the doc to share (found in the URL after /docs/)
embed_typestringYesMust be "doc"
required_filtersarrayNoCube filters applied to all of the user’s queries
redirect_query_paramsstringNoAdditional query params to append to redirect URL
3

Present the Iframe

Present an iframe in your web application with the generated URL. The URL authenticates the user and redirects to a copy of the shared doc.

Example

import requests

DEF_API_KEY = "your-def-api-key"

embed_options = {
    "user_identifier": "your-user-id",
    "doc_id": "doc-uuid",
    "embed_type": "doc"
}

res = requests.post(
    url="https://api.definite.app/v1/get_embedded_url",
    json=embed_options,
    headers={
        "Authorization": f"Bearer {DEF_API_KEY}"
    }
)

iframe_url = res.json()["url"]

Important Notes

  • User Identifier: The user_identifier defines a user in your team with limited access. This user cannot view other users’ content, edit integrations or cube models, or execute SQL blocks.
  • Multiple Calls: You can call get_embedded_url multiple times with different docs. The user will have a copy of each.
  • Content Updates: If you update the source doc, all downstream users will receive an updated copy on the next get_embedded_url query or page refresh.