Skip to content

API reference

Workflow setup

The staff app's workflow endpoints.

The staff app's endpoints for building, testing and switching on the workflows the agent runs for signed-in patients. They need a Firebase workforce token with integrations.manage; changes need MFA. Environment API keys are not accepted. Test runs call your real connections with a sample patient but never message a patient.

Responses

StatusMeaning
200Successful read or update.
201Successful POST operation.
400Invalid definition, or not ready to switch on.
401Workforce authentication required.
403Permission or MFA requirement not met, or (code BAA_REQUIRED) a test run would call a real Destination before the organization has signed its BAA.
404Not found in the selected organization and environment.
409Stale revision, duplicate key, a version that can no longer change, a workflow that has been live (archive it instead of deleting it), or an archived workflow (restore it before editing or switching it on).

List workflows

GET/organizations/{organizationId}/environments/{environmentId}/conversation-workflows

Every workflow and its versions, archived ones included (archivedAt). everLive says whether it has ever been switched on or run, which decides between Delete and Archive.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows" \
  --request GET \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Create a workflow

POST/organizations/{organizationId}/environments/{environmentId}/conversation-workflows

Its first version is a draft.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)

Request body

FieldTypeDescription
stableKeyRequiredstringMatches ^[a-z][a-z0-9_]{1,79}$.
nameRequiredstring1–120 characters.
definitionRequiredobjectSteps run in order unless one says where to go next. Anything that changes an account (a non-GET call not marked readOnly) must come after a call that checks ownership and after a Confirm step; a call using anything the patient typed must check ownership. Both are enforced again while running.
definition.schemaintegerOne of 2.
definition.categoryRequiredstringOne of support, billing, scheduling, fulfillment.
definition.descriptionRequiredstring1–300 characters.Example: Tells a patient where their order is..
definition.triggerPhrasesarray of stringsUp to 20 items.
definition.excludePhrasesarray of stringsUp to 20 items.
definition.stepsRequiredarray of objectsAt least 1 item.Up to 30 items.

definition.steps[] with type ask

FieldTypeDescription
idRequiredstringMatches ^[a-z][a-z0-9_]{0,39}$.
typeRequiredstringOne of ask.
nextstringAnother step's id, or "end".Up to 40 characters.
variableRequiredstringMatches ^[a-zA-Z][a-zA-Z0-9_]{0,39}$.
promptRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–500 characters.
formatRequiredstringphotos shows an upload button and saves how many files were added.One of text, order_number, email, number, photos.
labelstringNames the answer in the team's hand-off summary ("Medication: …"). Defaults to the variable name in words.1–40 characters.Example: Medication.

definition.steps[] with type call_api

FieldTypeDescription
idRequiredstringMatches ^[a-z][a-z0-9_]{0,39}$.
typeRequiredstringOne of call_api.
nextstringAnother step's id, or "end".Up to 40 characters.
destinationStableKeyRequiredstringMatches ^[a-z][a-z0-9_]{1,79}$.
methodRequiredstringOne of GET, POST, PUT, PATCH, DELETE.
pathRequiredstringAdded to the connection's address; values are URL-encoded.Up to 500 characters.Example: /orders/{{orderNumber}}.
bodyobjectJSON for non-GET calls, up to 8,000 characters. Credentials belong on the connection.
readOnlybooleanA non-GET call that only looks something up.
selectobject
select.listPathRequiredstringDot path into the JSON response, like shipment.tracking.Up to 160 characters.
select.matchPathRequiredstringDot path into the JSON response, like shipment.tracking.Up to 160 characters.
select.equalsRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–200 characters.
saveRequiredarray of objectsUp to 20 items.
save[].variableRequiredstringMatches ^[a-zA-Z][a-zA-Z0-9_]{0,39}$.
save[].pathRequiredstringDot path into the JSON response, like shipment.tracking.Up to 160 characters.
ownershipobjectWhere the response names its patient. A record that isn't theirs reads as not found.
ownership.emailPathstringDot path into the JSON response, like shipment.tracking.Up to 160 characters.
ownership.patientIdPathstringDot path into the JSON response, like shipment.tracking.Up to 160 characters.
contractstringHold the answer to the order lookup contract (OrderLookupResponse). An answer that breaks it is treated as a failed call; no orders is treated as not found; otherwise the patient sees their latest orders as cards, and orderCount and latestOrderStatus are saved. Can't be combined with select.One of orders_v1.
notFoundReplyRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–500 characters.
errorReplyRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–500 characters.

definition.steps[] with type condition

FieldTypeDescription
idRequiredstringMatches ^[a-z][a-z0-9_]{0,39}$.
typeRequiredstringOne of condition.
nextstringAnother step's id, or "end".Up to 40 characters.
variableRequiredstringMatches ^[a-zA-Z][a-zA-Z0-9_]{0,39}$.
operatorRequiredstringOne of equals, not_equals, contains, is_empty, is_not_empty.
valuestringUp to 200 characters.
thenRequiredstringAnother step's id, or "end".Up to 40 characters.
elseRequiredstringAnother step's id, or "end".Up to 40 characters.

definition.steps[] with type confirm

FieldTypeDescription
idRequiredstringMatches ^[a-z][a-z0-9_]{0,39}$.
typeRequiredstringOne of confirm.
nextstringAnother step's id, or "end".Up to 40 characters.
promptRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–500 characters.
declineReplyRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–500 characters.

definition.steps[] with type reply

FieldTypeDescription
idRequiredstringMatches ^[a-z][a-z0-9_]{0,39}$.
typeRequiredstringOne of reply.
nextstringAnother step's id, or "end".Up to 40 characters.
messageRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–1000 characters.

definition.steps[] with type hand_off

FieldTypeDescription
idRequiredstringMatches ^[a-z][a-z0-9_]{0,39}$.
typeRequiredstringOne of hand_off.
nextstringAnother step's id, or "end".Up to 40 characters.
messageRequiredstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–500 characters.
summarystringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–500 characters.
teamAskstringMay use {{variable}}, {{patient.email}}, {{patient.externalId}} and {{run.id}}.1–300 characters.
categorystringThe team that gets it; defaults to the workflow's category. clinical is the care team (a refill request, for example). The patient isn't sent a second, generic acknowledgement after this step's message; staff see an internal summary of the patient's answers at the top of the conversation.One of support, billing, scheduling, fulfillment, clinical.

Rename a workflow

PATCH/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/{profileId}

Staff see the name; patients don't.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
profileIdRequiredpath · string (uuid)

Request body

FieldTypeDescription
nameRequiredstring1–120 characters.

Delete a workflow

DELETE/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/{profileId}

Only one that has never been live, with its drafts and their test results. Audited. One that has been live is refused with 409: archive it instead.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
profileIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/PROFILE_ID" \
  --request DELETE \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Archive a workflow

POST/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/{profileId}/archive

For one that has been live: it's switched off, out of the list and never matched, with its versions and runs kept. Audited.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
profileIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/PROFILE_ID/archive" \
  --request POST \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Restore a workflow

POST/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/{profileId}/restore

Brings an archived workflow back, still switched off. Audited.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
profileIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/PROFILE_ID/restore" \
  --request POST \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Create or reuse a draft

POST/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/{profileId}/draft

Without interrupting the live version.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
profileIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/PROFILE_ID/draft" \
  --request POST \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Switch a workflow off

POST/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/{profileId}/deactivate

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
profileIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/PROFILE_ID/deactivate" \
  --request POST \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

List recent runs

GET/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/{profileId}/runs

Step by step: outcomes only, never values.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
profileIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/PROFILE_ID/runs" \
  --request GET \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Save a draft

PUT/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/versions/{versionId}

Saves the current draft revision.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
versionIdRequiredpath · string (uuid)

Request body

FieldTypeDescription
expectedRevisionRequiredintegerAt least 1.
definitionRequiredobjectSteps run in order unless one says where to go next. Anything that changes an account (a non-GET call not marked readOnly) must come after a call that checks ownership and after a Confirm step; a call using anything the patient typed must check ownership. Both are enforced again while running.
definition.schemaintegerOne of 2.
definition.categoryRequiredstringOne of support, billing, scheduling, fulfillment.
definition.descriptionRequiredstring1–300 characters.Example: Tells a patient where their order is..
definition.triggerPhrasesarray of stringsUp to 20 items.
definition.excludePhrasesarray of stringsUp to 20 items.
definition.stepsRequiredarray of objectsAt least 1 item.Up to 30 items.

definition.steps[] with type ask

As in Create a workflow.

definition.steps[] with type call_api

As in Create a workflow.

definition.steps[] with type condition

As in Create a workflow.

definition.steps[] with type confirm

As in Create a workflow.

definition.steps[] with type reply

As in Create a workflow.

definition.steps[] with type hand_off

As in Create a workflow.

Discard a draft

DELETE/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/versions/{versionId}

Discards the draft on top of a live (or last live) version; that version is untouched. Audited. A workflow's only draft is deleted with the workflow instead.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
versionIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/versions/VERSION_ID" \
  --request DELETE \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Check readiness

GET/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/versions/{versionId}/readiness

What still blocks switching this version on.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
versionIdRequiredpath · string (uuid)
cURL
curl "https://api.nezercare.com/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/conversation-workflows/versions/VERSION_ID/readiness" \
  --request GET \
  --header "Authorization: Bearer $WORKFORCE_ID_TOKEN"

Test a version

POST/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/versions/{versionId}/test

Runs a saved version with a sample patient; returns the transcript and each step's request and response.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
versionIdRequiredpath · string (uuid)

Request body

FieldTypeDescription
expectedRevisionRequiredintegerAt least 1.
openingRequiredstring1–2000 characters.Example: Where is my order?.
repliesRequiredarray of stringsUp to 20 items.
patientEmailstringThe sample patient's email, for ownership checks and {{patient.email}}.Up to 200 characters.
patientIdstringOr the sample patient's ID in your system; also sent as {{patient.externalId}} (order lookups use it).Up to 200 characters.

Switch a version on

POST/organizations/{organizationId}/environments/{environmentId}/conversation-workflows/versions/{versionId}/activate

Only a draft that passed a test within 24 hours.

Staff sign-in. A Firebase ID token for a team member with integrations.manage; changes need a recent MFA sign-in. API keys aren't accepted.

Parameters

FieldTypeDescription
organizationIdRequiredpath · string (uuid)
environmentIdRequiredpath · string (uuid)
versionIdRequiredpath · string (uuid)

Request body

FieldTypeDescription
expectedRevisionRequiredintegerAt least 1.