Skip to content

Create a magic link for a patient

POST
/businesses/{businessId}/patients/{patientId}/magic-links
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.

businessId
required
string format: uuid

Business ID

patientId
required
string format: uuid

Patient ID

Media type application/json
object
redirectUrl
required

URL to redirect the patient to after authentication. Must be a valid Upvio domain.

string format: uri
autoSubmit

When true (default), the patient portal submits the one-time code automatically. When false, the patient must confirm before the code is submitted.

boolean
default: true

Magic link created

Media type application/json
object
data
object
id
required

The magic link ID.

string
url
required

The magic link URL that authenticates the patient.

string format: uri
redirectUrl
required

The URL the patient is redirected to after authentication.

string format: uri
createdAt
required

Time when the resource was created (ISO 8601 format).

string format: date-time
expiresAt
required

When the magic link expires.

string format: date-time
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