Create a magic link for a patient
const url = 'https://api.upvio.com/v1/businesses/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/patients/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/magic-links';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"redirectUrl":"https://example.com","autoSubmit":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.upvio.com/v1/businesses/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/patients/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/magic-links \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "redirectUrl": "https://example.com", "autoSubmit": true }'Create a magic link for a patient. The returned URL authenticates the patient and redirects them to the specified URL. By default the patient portal submits the one-time code automatically; set autoSubmit to false to require the patient to confirm before the code is submitted.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Business ID
Patient ID
Request Body required
Section titled “Request Body required ”object
URL to redirect the patient to after authentication. Must be a valid Upvio domain.
When true (default), the patient portal submits the one-time code automatically. When false, the patient must confirm before the code is submitted.
Responses
Section titled “ Responses ”Magic link created
object
object
The magic link ID.
The magic link URL that authenticates the patient.
The URL the patient is redirected to after authentication.
Time when the resource was created (ISO 8601 format).
When the magic link expires.
Example generated
{ "data": { "id": "example", "url": "https://example.com", "redirectUrl": "https://example.com", "expiresAt": "2026-04-15T12:00:00Z" }}Bad Request
Unauthorized
Patient not found