Skip to main content

Doximity Ask embedded

The full Ask experience, embedded in your product

Overview

The Ask embedded integration embeds the full Doximity Ask experience — multi-turn chat, file attachments, enterprise templates, and more — directly inside your product's pages. Your application embeds a Doximity-hosted Ask session in an iframe; Doximity hosts, runs, and improves the entire experience.

This is the fastest path to giving your clinicians Doximity Ask: there is no chat UX to build, no API responses to render, and no streaming protocol to handle. When we improve Ask, your product improves with it.

The trade-off: you give up control over the product experience. If you need to build a custom experience on top of the Ask engine — your own interface, your own rendering of answers and artifacts — use the Ask API instead.

For a full working example of how to embed Ask into your product see Ask embedded on Github.

How it works

The integration has two moving parts, one on your backend and one in your UI:

  1. Your backend mints a launch. When a clinician opens the Ask view in your product, your backend calls the Doximity Partner Login API. The call identifies the practitioner (creating their Doximity account on first use, linked to your organization) and returns a short-lived magic sign-in URL that lands them in an Ask chat — either a chat Doximity created at launch time or the composer to start one (see Three ways to launch).
  2. Your frontend embeds the launch URL in an iframe. The magic link signs the clinician in and lands them directly in the Ask chat — no Doximity credentials, no login screen. From there they are conversing with Doximity Ask.

The clinician's session persists (the sign-in is remembered), so returning to the iframe later does not re-mint or re-prompt. Each new launch context — a new patient, a new encounter — mints a fresh launch and opens a fresh chat.

Step 1: Mint the launch

Mint a launch from your backend by calling the Partner Login API with your OAuth bearer token:

POST https://ehr-connect.doximity.com/api/v1/partners/login
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{
  "practitioner_id": "your-internal-practitioner-id",
  "first_name": "Dana",
  "last_name": "Kim",
  "npi": "1234567890",
  "destination": "ask",
  "embedded": true,
  "ask": "I need help titrating metformin for this patient"
}

The response returns the launch URL:

{
  "url": "https://auth.doximity.com/magic_link?..."
}

The URL is a

single-use magic sign-in link that expires after five minutes. Mint it server-side, just-in-time, and hand it to your frontend immediately — do not store it, email it, or reuse it.

Your OAuth application authenticates this call the same way as the Ask API's client-credentials flow — fetch the token endpoint from the discovery document (see

"Ask API, Step 1") and exchange your client credentials. Your application must be provisioned for partner launches; contact your Doximity representative through the Get started page.

Step 2: Embed the iframe

Follow the launch URL in an iframe in your product. The magic link signs the clinician in and redirects them into the embedded Ask chat:

<iframe
  src="LAUNCH_URL"
  title="Doximity Ask"
  width="100%"
  height="800"
  frameborder="0">
</iframe>

Launch lifecycle

  • Mint just-in-time. The magic link expires in five minutes and is single-use. Mint it when (or immediately before) the iframe renders — typically in your page's server-side render or an authenticated endpoint of your own that the page calls.
  • Expired or used links. If the clinician refreshes a stale page, the iframe will fail to authenticate. Detect this in your parent page and re-mint the launch.
  • Sessions persist. The sign-in is remembered by the browser, so subsequent iframes for the same clinician do not need a fresh magic link to keep them signed in — but each new launch (new patient or encounter) should still mint a fresh one so the chat lands in the right context.
  • Domain allowlisting. Browsers only allow your page to frame Doximity if your product's domain is on the allowlist for embedded Ask. Your domains are registered with Doximity when your integration is provisioned — see Security and privacy.

Launch parameters

The Partner Login API accepts:

ParameterRequiredDescription
practitioner_idyesThe practitioner's identifier in YOUR system. Doximity creates a linked account for them on first launch.
first_name, last_nameyesThe practitioner's name, used when creating their account.
emailnoThe practitioner's email, if you want it recorded on the account.
npinoThe practitioner's NPI, used for usage attribution.
embeddednoSet to em true | to receive an iframe-embeddable launch URL (the embedded Ask experience) instead of the full-page one.
asknoAn opening message for the chat — the prompt the chat starts from.
patient_contextnoClinical context for the patient, passed through as an attachment to the chat.
partner_patient_idnoThe patient's identifier in YOUR system. Relaunches for the same patient anchor to the same record.
patient_name, patient_age, patient_gender, patient_mrnnoPatient demographics shown as the chat's patient banner.

Send JSON or form-encoded parameters. Unrecognized parameters are ignored; identify your integration's required set with your Doximity representative during onboarding.

Three ways to launch

Every launch uses the same two steps — mint, embed. What differs is what the mint call includes. Three shapes cover most integrations; they can be mixed freely as your product's contexts demand.

Blank chat

The clinician lands on the Ask homepage, and their first message starts the chat. Use this when the question isn't known at launch time and you have no patient context to provide for the chat — a general-purpose Ask widget in your product.

Patient context

Anchor the chat to a patient: include the demographics for the banner (patient_name, patient_age, patient_gender, patient_mrn) and the clinical history as patient_context — it rides along as the chat's patient-context. No ask parameter: the clinician lands in a quiet, patient-anchored chat and drives the questions themselves. Use this when your product knows the encounter but the clinician owns the workflow.

Chat with prompt

Include ask with an opening question. The chat is created and the question is answered right away — the clinician lands with the answer already streaming. Use this when your product formulates the question at launch time (a chart-review button, an encounter summary action). The shapes combine: a prompt launch can carry patient context too.

What your users get

The embedded experience is the full Doximity Ask product, not a stripped-down view:

  • Multi-turn chat — clinicians converse with Ask, ask follow-ups, and steer the conversation; conversation history persists.
  • Attachments — clinicians upload files (photos, documents) into the chat themselves.
  • Enterprise templates — your organization's configured templates and prompts are available in the embedded session.
  • Patient context — the context your launch passes (patient demographics, clinical context) anchors the chat, with the patient banner rendered in the session.
  • Clinical references — answers cite their sources, with the full citation rendering Doximity's product provides.
  • Continuous improvement — model, tools, and UX updates ship to the embedded experience without any work on your side.

Security and privacy

  • Single-use, five-minute magic links. Launch URLs authenticate a specific Doximity account and cannot be reused, shared, or replayed after consumption. They are secrets while they live — treat them like session credentials.
  • Domain allowlisting. Embedded Ask is only served inside frames from your registered production domains. Local development and staging domains are registered separately.
  • PHI. Patient context sent in the launch is handled under Doximity's HIPAA program. Send patient data only for launches where your agreement with Doximity covers it, and never log or persist launch URLs alongside patient data.
  • Your practitioner identifiers. Your practitioner_id values are your system's identities, namespaced by your organization — they never collide with other partners' identifiers.

Ask API or Ask embedded?

Ask embeddedAsk API
You buildNothing — embed and goThe entire chat experience: UI, streaming, rendering, state
Product experienceThe full Doximity Ask product, improved continuously by DoximityFully custom — your design, your workflow
Multi-turn, attachments, templatesIncludedYou build them on the conversation endpoints
Best forFastest time to market; standard Ask workflows inside your EHR or productDeeply custom integrations and programmatic workflows
RequiresDomain allowlisting, server-side launch mintingOAuth client credentials, your own client implementation

You can adopt the embedded integration first and add Ask API workflows later — both use the same Doximity accounts and the same attribution.

Questions about Ask embedded?

bd@doximity.com