# Patient Side Integration URL: https://developers.vsee.com/guides/embed-waiting-room/patient-side **Prerequisites:** you already have a patient portal where patients sign up and log in. You want them to go on to VSee Clinic without signing up or logging in again. The examples use the staging clinic `https://vclinic.vseepreview.com/vc/next/`. Replace it with your own clinic's URL. --- ### Use case 1: Log the patient in and open the VSee Clinic patient dashboard Try it yourself in the [Patient Dashboard](https://developers.vsee.com/use-cases/patient-dashboard) use case. #### Step 1: Get a patient access token Call [POST /users/sso](https://developers.vsee.com/api/user-api/post/users/sso). The API returns the token in `data.token.token`. The examples below show it as ``. #### Step 2: Redirect the patient to your VSee Clinic page Give the patient a button or link that goes to VSee Clinic. The URL follows this pattern: ``` {portal_base_url}auth?sso_token={token}&next={next_url} ``` For example: ``` https://vclinic.vseepreview.com/vc/next/auth?sso_token=&next=/u/clinic ``` This logs the patient in, then redirects them to `https://vclinic.vseepreview.com/vc/next/u/clinic`. Additional options: - `disable_navigation=1`: disable all email communication. For example: ``` https://vclinic.vseepreview.com/vc/next/auth?sso_token=&next=/u/clinic&disable_navigation=1 ``` --- ### Use case 2: Log the patient in and start a video session Try it yourself in the [Video Session](https://developers.vsee.com/use-cases/patient-video-session) use case. #### Step 1: Get a patient access token Call [POST /users/sso](https://developers.vsee.com/api/user-api/post/users/sso). The API returns the token in `data.token.token` (written `` in these examples). The user's ID (`data.id`) is used as `member_id` in step 3. #### Step 2: Create an intake Call [POST /intakes](https://developers.vsee.com/api/visit-api/post/intakes) with the SSO token from step 1 in the `X-ApiToken` header. The response contains the intake ID in `data.id`, for example `61165a8e-d8cc-47da-bd8e-597d64457b1f`. #### Step 3: Create a walk-in visit Call [POST /visits/add_walkin](https://developers.vsee.com/api/visit-api/post/visits/add_walkin) with the SSO token from step 1 in the `X-ApiToken` header and the `intake_id` from step 2. The response contains the visit ID in `data.id`, for example `67258`. #### Step 4: Redirect the patient to the video call and chat page ``` https://vclinic.vseepreview.com/vc/next/auth?sso_token=&next=/visits/start/67258 ``` --- ### Use case 3: Log the patient in and schedule an appointment Try it yourself in the [Appointment Scheduling](https://developers.vsee.com/use-cases/appointment-scheduling) use case. #### Step 1: Get a patient access token Call [POST /users/sso](https://developers.vsee.com/api/user-api/post/users/sso). The API returns the token in `data.token.token` (written `` in these examples). The user's ID (`data.id`) is used as `member_id` in step 3. #### Step 2: Create an intake Call [POST /intakes](https://developers.vsee.com/api/visit-api/post/intakes) with the SSO token from step 1 in the `X-ApiToken` header. The response contains the intake ID in `data.id`, for example `61165a8e-d8cc-47da-bd8e-597d64457b1f`. #### Step 3: Create a scheduled appointment Call [POST /visits](https://developers.vsee.com/api/visit-api/post/visits) with the SSO token from step 1 in the `X-ApiToken` header and the `intake_id` from step 2. The response contains the visit ID in `data.id`, for example `67258`. If your clinic uses one-time appointment links, the visit also contains `data.one_time_link_token` (shown below as ``). Build a link in this format and send it to the patient: ``` https://vclinic.vseepreview.com/vc/next/members/appointment/67258?token= ``` #### Step 3b (optional): Let the patient finish scheduling in VSee Clinic You can let the patient see the intake you created in step 2, confirm it, and go on to the scheduling calendar in VSee Clinic. Send the patient to the landing page with the `intake_id` parameter: ``` https://vclinic.vseepreview.com/vc/stable/u/clinic?intake_id=61165a8e-d8cc-47da-bd8e-597d64457b1f&action=appointment#schedule-appointment ``` > **Note:** To schedule a visit, the providers' availability (slots) must be set up first. The only exception is when you use the Admin API Token: it overrides the schedule and creates the appointment even when the calendar is empty. --- ### Use case 4: Log the patient in and create an eConsult (asynchronous visit) Try it yourself in the [eConsult (Async Visit)](https://developers.vsee.com/use-cases/econsult) use case. #### Step 1: Get a patient access token Call [POST /users/sso](https://developers.vsee.com/api/user-api/post/users/sso). The API returns the token in `data.token.token` (written `` in these examples). The user's ID (`data.id`) is used as `member_id` in step 3. #### Step 2: Create an intake Call [POST /intakes](https://developers.vsee.com/api/visit-api/post/intakes) with the SSO token from step 1 in the `X-ApiToken` header. The response contains the intake ID in `data.id`, for example `61165a8e-d8cc-47da-bd8e-597d64457b1f`. #### Step 3: Create an asynchronous visit (eConsult) Call [POST /visits/add_econsult](https://developers.vsee.com/api/visit-api/post/visits/add_econsult) with the SSO token from step 1 in the `X-ApiToken` header and the `intake_id` from step 2. The response contains the visit ID in `data.id`, for example `67258`. Because this is an asynchronous visit, every provider assigned to the waiting room sees it, and one of them must accept it. --- ### Use case 5: Guest invite link Try it yourself in the [Guest Invite](https://developers.vsee.com/use-cases/guest-invite) use case. Follow steps 1 to 3 of use case 2 or use case 3 to get a visit. #### Step 4: Get the visit Call [GET /visits/:id](https://developers.vsee.com/api/visit-api/get/visits/%7Bid%7D): ```json { "id": "8888", "code": "", ... } ``` Take the `code` value and build the invite link: ``` https://vclinic.vseepreview.com/vc/next/visits/join/ ```