Skip to main content

Patient Add Form to Case

Submits a dynamic customer case form for a specific case and customer.

HTTP Request

POST <BASE_URL>/api/v1/customer-dynamic-case-form

Headers

NameTypeRequiredDescription
cv-api-keystringYesSecret API key for authentication

Request Body (JSON)

NameTypeRequiredDescription
keystringNoAPI key (if not provided in header)
caseIdstringYesThe ID of the case to update
formTitlestringYesTitle of the form
formDescriptionstringNoDescription of the form
questionsarrayYesArray of question objects (see below)

Question Object

NameTypeRequiredDescription
questionIdstringYesThe ID of the question
questionstringYesThe question text
typestringYesThe type of the question (e.g., text, file, multiselect)
requiredbooleanNoWhether the question is required
answeranyYesThe answer to the question
phibooleanNoWhether the question contains PHI
hintstringNoHint text for the question
placeholderstringNoPlaceholder text for the question
optionsarrayNoOptions for select/multiselect questions

Responses

200 OK

{
"status": 200,
"success": true,
"data": {
"caseId": "string",
"formResponseId": "string"
}
}

Error Responses

  • If any required parameter (key, caseId, formTitle, or questions) is missing:
{
"status": 400,
"success": false,
"error": "The '<param>' param is required"
}
  • If a required field in a question is missing:
{
"status": 400,
"success": false,
"error": "The 'questions[<index>].<field>' field is required"
}
  • If the secret key is not provided:
{
"status": 400,
"success": false,
"error": "Secret key not provided!"
}
  • If the partner organization is disabled:
{
"status": 400,
"success": false,
"error": "Partner organization is disabled"
}
  • If the provided case is not valid for the organization:
{
"status": 400,
"success": false,
"error": "Provided case is not valid"
}
  • If the form cannot be submitted (no question responses):
{
"status": 400,
"success": false,
"error": "Case Form can't be Submitted."
}

Example Request

curl -X POST "<BASE_URL>/api/v1/customer-dynamic-case-form" \
-H "cv-api-key: your-secret-key" \
-H "Content-Type: application/json" \
-d '{
"caseId": "abc123",
"formTitle": "Health Survey",
"formDescription": "Initial intake",
"questions": [
{ "questionId": "q1", "answer": "Yes" },
{ "questionId": "q2", "answer": 42 }
]
}'

Notes

  • The cv-api-key can be provided either as a header or in the key field of the request body.
  • The questions array must contain at least one question object.
  • The response includes the caseId and the generated formResponseId for the submission.