put
https://{apiHost}/api/v2/public/visits//evv/tasks/
Mark a task as completed (or incomplete) and optionally record the caregiver's response.
Workflow — completing a task with a response value:
- Fetch the task list with
GET /visits/{visitId}/evv/tasks - Inspect the task's
questionTypeandoptionsarray to determine what response is expected - Submit the completion with the response value:
- For radio / scale / checkbox tasks: pass
selectedOptionIds(array of optionid
values from the task'soptionsarray). Do not passvalue— it is rejected for
these question types because it would not be displayed in the Viv UI. Use a
one-element array for radio/scale, multi-element for checkbox. - For text tasks: pass
valuewith the free-form text response. Do not pass
selectedOptionIds. - For number tasks: pass
valuewith the numeric response, optionally suffixed with
a unit from the task'sunitsarray (e.g."30 minutes"). Do not pass
selectedOptionIds. - If no response value is needed, just pass
completed: true.
- For radio / scale / checkbox tasks: pass
Side effects on completion:
- A client feed item is created (visible in the client's activity feed)
- Admin notifications are triggered
- The visit's cached task count (
queries.tasks) is updated
Marking incomplete:
Setting completed: false clears the completion timestamp. The task will need to be
re-submitted by the caregiver.
Error codes (400):
INVALID_FIELD_FOR_QUESTION_TYPE—valuewas sent on a radio/scale/checkbox task, or
selectedOptionIdswas sent on a text/number task. The Viv SVE panel and downstream
exporters render different fields per question type; sending the wrong field would
silently produce a response that does not appear in the UI.INVALID_OPTION_ID— one or more entries inselectedOptionIdsare not present on the
task'soptionsarray. Re-fetch the task to get current option ids.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…