Get a widget embed and its widget key
Read one widget deployment with its widget key, to recover the embed snippet at any time. The key is public; the origin allowlist protects it.
GET
/
widget-deployments
/
{deployment_id}
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/widget-deployments/8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
deployment_id = "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e"
response = requests.get(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/widget-deployments/{deployment_id}",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
const deploymentId = '8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/widget-deployments/${deploymentId}`,
{ headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` } },
)
console.log(await response.json())
{
"id": "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e",
"name": "Docs site widget",
"widget_key": "mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e",
"assistant_id": "5b1e9c2a-7d4f-4e3b-9a61-0c8f2d7e4a13",
"status": "active",
"allowed_origins": ["https://docs.example.com", "https://www.example.com"],
"created_at": "2026-09-20T14:03:11.482190+00:00",
"created_by": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"expires_at": null,
"revoked_at": null,
"last_used_at": "2026-09-24T07:58:30.021455+00:00"
}
{ "code": "authentication_error", "message": "Authentication is required." }
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
{ "code": "not_found", "message": "The requested resource was not found." }
The response includes
widget_key, so you can recover the snippet for an embed at any time. The key is public and is not a secret.
A deployment that does not exist, a deployment in another organization and a malformed ID all return the same 404.
You need the assistant.read permission, which the owner, admin, editor and member (normal) roles hold. Authenticate with an mithunai_sk_ API key or a signed-in console session.
string
required
The deployment’s ID (UUID), as returned in
id.Response
string
required
The deployment’s ID (UUID).
string
required
The embed’s label.
string
required
The public widget key,
mithunai_wk_ followed by the deployment ID. Send it in the
X-MITHUNAI-Widget-Key header.string
required
The embedded assistant’s ID.
string
required
active, revoked or expired. expired means the current time is past expires_at; an
expired embed answers nothing. A revoked embed reads revoked even after its expiry.string[]
required
Origins allowed to host the widget, sorted.
string
required
When the deployment was created, ISO 8601 in UTC.
string | null
required
ID of the user who created it, or
null when it was created with an API key.string | null
required
When the embed expires, or
null if it does not.string | null
required
When the embed was revoked, or
null.string | null
required
When the widget key last authenticated a request, or
null if never.string | null
required
How the widget appears on a page whose snippet has no
data-mode: chat, sidebar, search or
deflector, or null (the snippet decides). Always null while stored presentations are off on
your deployment. See Setting the default for an
embed.curl --request GET "$MITHUNAI_URL/mithunai/api/v1/widget-deployments/8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
deployment_id = "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e"
response = requests.get(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/widget-deployments/{deployment_id}",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
const deploymentId = '8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/widget-deployments/${deploymentId}`,
{ headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` } },
)
console.log(await response.json())
{
"id": "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e",
"name": "Docs site widget",
"widget_key": "mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e",
"assistant_id": "5b1e9c2a-7d4f-4e3b-9a61-0c8f2d7e4a13",
"status": "active",
"allowed_origins": ["https://docs.example.com", "https://www.example.com"],
"created_at": "2026-09-20T14:03:11.482190+00:00",
"created_by": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"expires_at": null,
"revoked_at": null,
"last_used_at": "2026-09-24T07:58:30.021455+00:00"
}
{ "code": "authentication_error", "message": "Authentication is required." }
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
{ "code": "not_found", "message": "The requested resource was not found." }
Last modified on November 11, 2026
curl --request GET "$MITHUNAI_URL/mithunai/api/v1/widget-deployments/8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e" \
--header "Authorization: Bearer $MITHUNAI_API_KEY"
import os, requests
deployment_id = "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e"
response = requests.get(
f"{os.environ['MITHUNAI_URL']}/mithunai/api/v1/widget-deployments/{deployment_id}",
headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
const deploymentId = '8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e'
const response = await fetch(
`${process.env.MITHUNAI_URL}/mithunai/api/v1/widget-deployments/${deploymentId}`,
{ headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` } },
)
console.log(await response.json())
{
"id": "8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e",
"name": "Docs site widget",
"widget_key": "mithunai_wk_8d0f5a2e-3c41-4b7a-9e6d-1f2a3b4c5d6e",
"assistant_id": "5b1e9c2a-7d4f-4e3b-9a61-0c8f2d7e4a13",
"status": "active",
"allowed_origins": ["https://docs.example.com", "https://www.example.com"],
"created_at": "2026-09-20T14:03:11.482190+00:00",
"created_by": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"expires_at": null,
"revoked_at": null,
"last_used_at": "2026-09-24T07:58:30.021455+00:00"
}
{ "code": "authentication_error", "message": "Authentication is required." }
{ "code": "authorization_error", "message": "You do not have permission to perform this action." }
{ "code": "not_found", "message": "The requested resource was not found." }