Invite Patient to Complete Questionnaire

Send an invitation to a patient to complete a specific questionnaire. The invitation can be sent via email or SMS and generates a secure token-based link that allows the patient to access and complete the questionnaire without requiring full authentication.

Sample Use Case: Re-invite Patients to Complete ID/Signature

A common scenario is when patients complete the main intake form but fail to complete the ID verification/signature portion. This endpoint allows you to send them directly to complete only that part.

How It Works

  • Use the identification questionnaire ID: identification-questionnaire
  • If the patient already has an incomplete ID questionnaire, the existing instance is reused
  • The patient picks up where they left off—they do NOT need to redo the intake

Example

POST /ias/patients/patient_xyz789/inviteCompleteQuestionnaire
Content-Type: application/json
Authorization: Bearer <affiliate_token>

{
  "questionnaire": "identification-questionnaire",
  "orderId": "order_def456"
}

Using External SMS Services

If you prefer to use your own SMS provider instead of the built-in SMS:

  1. Call the endpoint without inviteType or with "email" to avoid triggering internal SMS
  2. The response contains the questionnaire instance
  3. Use the link pattern with your external SMS service

Alternative: Use the Get Order Link endpoint to get a link for the entire order:

GET /ias/orders/{orderId}/actions/getOrderLink
Authorization: Bearer <affiliate_token>

This returns a shortened link that takes the patient to complete all pending items on their order, including ID verification

Endpoint

URL: /ias/patients/:id/inviteCompleteQuestionnaire
Method: POST
Authentication: Required (Affiliate Token)
Content-Type: application/json

Authentication

Required Roles:

  • AFFILIATE_SUPER_ADMIN
  • AFFILIATE_ADMIN
  • AFFILIATE_AGENT

Request Parameters

URL Parameters

ParameterTypeRequiredDescription
idStringYesThe patient ID

Request Body

FieldTypeRequiredDescription
questionnaireStringYesThe ID of the questionnaire to complete
orderIdStringNoOptional order ID to attach the questionnaire instance to
expiryWeeksNumberNoNumber of weeks until the invitation expires (default: 52 weeks)
inviteTypeStringNoHow to send the invitation: "email" (default) or "sms"

Request Examples

Send Email Invitation

POST /ias/patients/patient_xyz789/inviteCompleteQuestionnaire
Content-Type: application/json
Authorization: Bearer <affiliate_token>

{
  "questionnaire": "questionnaire_abc123",
  "inviteType": "email"
}

Send SMS Invitation

POST /ias/patients/patient_xyz789/inviteCompleteQuestionnaire
Content-Type: application/json
Authorization: Bearer <affiliate_token>

{
  "questionnaire": "questionnaire_abc123",
  "expiryWeeks": 2,
  "inviteType": "sms"
}

Attach Questionnaire to Order

POST /ias/patients/patient_xyz789/inviteCompleteQuestionnaire
Content-Type: application/json
Authorization: Bearer <affiliate_token>

{
  "questionnaire": "questionnaire_abc123",
  "orderId": "order_def456",
  "inviteType": "email"
}

Response

Success Response

Status Code: 200 OK

{
  "id": "qi_abc123",
  "patient": "patient_xyz789",
  "questionnaire": {
    "id": "questionnaire_abc123",
    "title": "Health Assessment",
    "description": "Initial health screening questionnaire"
  },
  "valid": false,
  "expiresAt": "2025-12-19T00:00:00.000Z",
  "createdAt": "2024-12-19T10:30:00.000Z"
}

Response Fields

FieldTypeDescription
idStringUnique identifier for the questionnaire instance
patientStringThe patient ID
questionnaireObjectThe questionnaire details
questionnaire.titleStringTitle of the questionnaire
validBooleanWhether the questionnaire has been completed
expiresAtString (ISO 8601)Expiration date
createdAtString (ISO 8601)Creation timestamp

Error Responses

StatusMessage
404Patient not found
404Questionnaire not found
401Authentication required
500Internal server error


Notes

  • Idempotent: Calling multiple times resends the invitation but doesn't create duplicate instances
  • Expiration: Default is 52 weeks; customize with expiryWeeks
  • White Labeling: Links automatically use your custom domain if configured

Related Endpoints

EndpointMethodDescription
/ias/patients/actions/verifyInviteCompleteQuestionnaireTokenGETVerify invite token
/ias/orders/:id/actions/getOrderLinkGETGet order completion link
/ias/orders/:id/actions/sendOrderLinkPOSTSend order link via email/SMS