.my.salesforce.com/services/oauth2/token`)
* Client ID
* Client secret
* Username\*
* Password\*
Username and password are optional. When specified, the Password grant will be used to authenticate with the Salesforce API. When left blank, the Client Credentials grant will be used.
#### Create a Lead [#create-a-lead]
A lead is a standard Salesforce object (sObject). You can use this action to create a Lead object.
#### Update a lead [#update-a-lead]
Updates a Lead record based on the specified data and provided Lead record ID. Field values provided replace the existing values in the Lead record (PATCH).
## Changelog [#changelog]
## Salesforce changelog [#salesforce-changelog]
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Sendbird
URL: https://docs.awellhealth.com/docs/marketplace/sendbird
Sendbird is a cloud-based chat and messaging platform.
Category: Communication. Adds 13 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Application ID | Yes | Visit [https://dashboard.sendbird.com/](https://dashboard.sendbird.com/) to retrieve Application ID for the app of your choosing Stored as a secret. |
| Chat API token | Yes | Visit Application's settings and go to Settings > Application > General > API tokens to retrieve either Master API token or Secondary API token Stored as a secret. |
| Desk API token | Yes | Visit Application's settings and go to Settings > Desk > Credentials to retrieve Desk API token Stored as a secret. |
## Actions [#actions]
Sendbird adds these 13 actions to a care flow. Add one to a step, then fill in its inputs.
### Activate user [#activate-user]
Activates a user using the Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------- | -------- | -------- | --------------------------------- |
| User ID | `string` | Yes | The user's unique ID in Sendbird. |
Activates a user, using the "Update user" endpoint, in the Chat API. The user is activated by setting `is_active` to true.
### Create customer [#create-customer]
Creates a customer using the Desk API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------------------ |
| Sendbird ID | `string` | Yes | The Sendbird ID of a customer which must be an ID that already exists in Sendbird (eg: user id). |
Returns:
| Data point | Type |
| ------------ | -------- |
| `customerId` | `number` |
Creates a customer using the Desk API. Only the `sendbirdId` is passed and it must be an ID that already exists in Sendbird's Chat platform (eg: the `userId` of an existing user). The `customerId` of the newly created customer is stored as data point.
To add custom fields to your customer, use the [Update custom fields action](#update-customers-custom-fields).
### Create ticket [#create-ticket]
Creates a ticket using the Desk API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Customer ID | `numeric` | Yes | A customer's unique ID. |
| Channel name | `string` | Yes | Specifies the title of a ticket, which will be the group channel name in Sendbird Chat platform as well. Maximum length is 100 characters. |
| Related channel URLs | `string` | No | A comma-separated string of group channel URLs for reference, where the corresponding customer belongs. Can have up to 3 group channel URLs. |
| Group key | `string` | No | Specifies the unique key of a group for ticket assignment. The key can be a mix of lowercase letters, hyphens, underscores, or numbers. |
| Priority | `string` | No | Specifies the priority of a ticket. Acceptable values are the following: "LOW", "MEDIUM", "HIGH", and "URGENT". Defaults to: "MEDIUM". |
| Custom fields | `json` | No | A JSON object that can store up to twenty key-value items for additional customer information. The specified keys must be registered as a custom field in Sendbird. |
Returns:
| Data point | Type |
| -------------------- | -------- |
| `channelUrl` | `string` |
| `relatedChannelUrls` | `string` |
| `ticketId` | `number` |
Creates a ticket using the Desk API. The `ticketId` of the newly created ticket is stored as data point.
Please note that the Ticket won't be shown in the Sendbird console **until** the user for which that Ticket was created writes a message inside the Chat.
### Create user [#create-user]
Creates a user using the Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| User ID | `string` | Yes | Specify a unique ID for the user, maximum length is 80 characters. Don't use personally identifiable information (PII) for the ID. |
| Nickname | `string` | No | The user's nickname. Maximum length is 80 characters. If left empty, we will use the patient's first and last name. |
| Issue access token | `boolean` | No | Determines whether to create an access token for the user. |
| Profile URL | `string` | No | The URL of the user's profile image. |
| Metadata | `json` | No | Specifies a JSON object to store up to five key-value items for additional user information such as a phone number, an email address, or a long description of the user. The key must not have a comma (,) and its length is limited to 128 characters. The value must be a string and its length is limited to 190 characters. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `userId` | `string` |
Creates a user in Sendbird using the Chat API. See [Update metadata](#update-metadata) to check metadata field details. The `userId` of the newly created user is then saved as a data point.
### Deactivate user [#deactivate-user]
Deactivates a user using the Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------------------------------------ | --------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| User ID | `string` | Yes | The user's unique ID in Sendbird. |
| Leave all group channels upon deactivation | `boolean` | No | Determines whether the user leaves all joined group channels upon deactivation. Defaults to true if not specified. |
Deactivates a user, using the "Update user" endpoint, in the Chat API. Optionally, it can be set for the user to `Leave all group channels upon deactivation`.
The user is deactivated by setting `is_active` to false.
### Delete metadata [#delete-metadata]
Deletes metadata from a user using the Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------ | -------- | -------- | ------------------------------------------------------------------------------------------------ |
| User ID | `string` | Yes | The user's unique ID in Sendbird. |
| Metadata key | `string` | No | The key of the metadata item to delete. If not specified, all items of the metadata are deleted. |
Deletes user metadata using the Chat API. Takes the key of a metadata item to be deleted (deletes one key at a time if a key is provided). If not specified, all items of the metadata are deleted.
### Delete user [#delete-user]
Deletes a user using the Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------- | -------- | -------- | --------------------------------- |
| User ID | `string` | Yes | The user's unique ID in Sendbird. |
Deletes a user in Sendbird using the Chat API.
### Get customer [#get-customer]
Retrieve information about a customer using the Desk API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------- | --------- | -------- | ------------------------------------- |
| Customer ID | `numeric` | Yes | The customer's unique ID in Sendbird. |
Returns:
| Data point | Type |
| -------------- | -------- |
| `channelType` | `string` |
| `createdAt` | `date` |
| `customFields` | `string` |
| `displayName` | `string` |
| `project` | `number` |
| `sendbirdId` | `string` |
Retrieves information on a specific customer using the Desk API. The following fields are saved as a data point:
* Sendbird ID
* Channel Type
* Project
* Created At
* Display Name
* Custom Fields (stored as string)
### Get user [#get-user]
Gets user using Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------- | -------- | -------- | --------------------------------- |
| User ID | `string` | Yes | The user's unique ID in Sendbird. |
Returns:
| Data point | Type |
| ----------------- | --------- |
| `accessToken` | `string` |
| `createdAt` | `date` |
| `hasEverLoggedIn` | `boolean` |
| `isActive` | `boolean` |
| `lastSeenAt` | `date` |
| `metadata` | `string` |
| `nickname` | `string` |
Retrieve information about a user using the Chat API. The following fields are saved as a data point:
* Nickname
* Access token
* Is active
* Created at
* Last seen at
* Has ever logged in
* Metadata (stored as string)
### Update customer's custom fields [#update-customers-custom-fields]
Updates custom fields of a customer using the Desk API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Customer ID | `numeric` | Yes | The customer's unique ID in Sendbird. |
| Custom fields | `json` | Yes | A JSON object that can store up to twenty key-value items for additional customer information. The specified keys must be registered as a custom field in Sendbird. |
Updates a customer's custom fields using the Desk API.
Custom fields is a JSON object that can store up to twenty key-value items for additional customer information such as a phone number, an email address, or a long description of the customer.
The specified keys must be registered as a custom field in Settings > Customer fields of your dashboard beforehand. The key must not have a comma (,) and its length is limited to 20 characters. The value's length is limited to 190 characters.
### Update metadata [#update-metadata]
Updates user metadata using Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------- | -------- | -------- | ---------------------------------------------------------------------------------------- |
| User ID | `string` | Yes | The user's unique ID in Sendbird. |
| Metadata | `json` | Yes | A JSON object that can store up to five key-value items for additional user information. |
Updates the user's metadata using the Chat API. Only updates existing or adds new fields to metadata. To delete some metedata fields, check the [Delete metadata action](#delete-metadata).
Metadata is a JSON object that can store up to five key-value items of additional user information such as a phone number, an email address, or a long description of the user. The key must not have a comma (,) and its length is limited to 128 characters. The value must be a string and its length is limited to 190 characters.
### Update ticket [#update-ticket]
Update a ticket using the Desk API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Ticket ID | `numeric` | Yes | A customer's unique ID. |
| Priority | `string` | No | Specifies the priority of a ticket. Acceptable values are the following: "LOW", "MEDIUM", "HIGH", and "URGENT". Defaults to: "MEDIUM". |
| Related channel URLs | `string` | No | A comma-separated string of group channel URLs for reference, where the corresponding customer belongs. Can have up to 3 group channel URLs. |
### Update user [#update-user]
Updates a user using the Chat API.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------------ | --------- | -------- | ----------------------------------------------------------------------------------------- |
| User ID | `string` | Yes | The user's unique ID in Sendbird. |
| Nickname | `string` | No | The user's nickname. Maximum length is 80 characters. |
| Issue access token | `boolean` | No | Determines whether to revoke the existing access token and create a new one for the user. |
| Profile URL | `string` | No | The URL of the user's profile image. |
Updates a user using the Chat API.
Please note that updating `metadata` of a user needs to be done with the [Update metadata action](#update-metadata).
## Setup and notes [#setup-and-notes]
Sendbird is a cloud-based chat and messaging platform that enables developers to integrate real-time messaging functionality into their applications.
Sendbird offers a range of features, including real-time chat, group chat, one-on-one messaging, push notifications, and file sharing. It supports various platforms and programming languages, making it flexible and accessible for developers to integrate with different applications.
### Extension settings [#extension-settings]
In order to set up this extension, you will need:
1. An **Application ID** - visit [https://dashboard.sendbird.com/](https://dashboard.sendbird.com/) to retrieve \*\*Application ID for the app of your choosing
2. A Chat API token\*\* - visit Application's settings and go to \*\*Settings > Application > General > API tokens to retrieve either Master API token or Secondary API token
3. A Desk API token\*\* - visit Application's settings and go to **Settings > Desk > Credentials** to retrieve Desk API token
## Changelog [#changelog]
### 2023-08-22 [#2023-08-22]
* add `relatedChannelUrls` field to `Create ticket` action
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Sendgrid
URL: https://docs.awellhealth.com/docs/marketplace/sendgrid
SendGrid is a cloud-based email delivery platform that provides services for sending and managing email campaigns, transactional emails, and other types of messages.
Category: Communication. Adds 6 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| ---------- | -------- | -------------------------------------------------------------------------------------------------- |
| API Key | Yes | Your Sendgrid API Key so the extension can authenticate with the Sendgrid API. Stored as a secret. |
| From email | No | The email address that will be used for the "From" header. |
| From name | No | The name that will be used for the "From" header. |
## Actions [#actions]
Sendgrid adds these 6 actions to a care flow. Add one to a step, then fill in its inputs.
### Add or update contact [#add-or-update-contact]
Add or update contact
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------- | -------- | -------- | -------------------------------------------------------------------------------------------- |
| List IDs | `string` | Yes | A comma-separated string of list IDs the contact will be added to. |
| Email | `string` | Yes | The contact's primary email. |
| First Name | `string` | No | The contact's first name. |
| Last Name | `string` | No | The contact's last name. |
| Custom fields | `json` | No | An object of custom field IDs and the values you want to associate with those custom fields. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `jobId` | `string` |
Allows adding or updating contacts. The contact to update will be determined only by the email field and any fields omitted from the request will remain as they were. A contact's ID cannot be used to update the contact.
Please note that custom fields need to have been already created if you wish to set their values for the contacts being upserted. To do this, please use the "Create Custom Field Definition" endpoint. They also can be created in **Marketing -> Custom Fields** section in Sendgrid.
### Add Email to Suppression Lists [#add-email-to-suppression-lists]
Adds an email to one or more suppression lists.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------ | -------- | -------- | --------------------------------------------------------- |
| Email | `string` | Yes | The email address you would like to suppress |
| Groups | `string` | Yes | A comma-separated list of group IDs (e.g. `12345, 12346`) |
### Status of Import [#status-of-import]
Get the status of an Import job
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------------- | --------- | -------- | ----------------------------------------------------------------------------------- |
| Job ID | `string` | Yes | The ID of the Sendgrid Job (usually obtained from the Add or Update Contact action) |
| Wait for finished | `boolean` | No | If true, the action will wait for the import job to finish before completing. |
Returns:
| Data point | Type |
| -------------- | -------- |
| `finishedAt` | `date` |
| `id` | `string` |
| `importStatus` | `string` |
| `jobType` | `string` |
| `startedAt` | `date` |
### Remove Email from Suppression Lists [#remove-email-from-suppression-lists]
Remove an email address from one or more suppression lists.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------ | -------- | -------- | -------------------------------------------------------------------- |
| Email | `string` | Yes | The email address you would like to remove from the suppression list |
| Groups | `string` | Yes | A comma-separated list of group IDs (e.g. `12345, 12346`) |
### Send email [#send-email]
Send an email.
| Input | Type | Required | Description |
| ---------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| From name | `string` | No | The name that will be used for the "From" header. When left blank, the value specified in the extension settings will be used. |
| From email | `string` | No | The email address that will be used for the "From" header. When left blank, the value specified in the extension settings will be used. |
| To | `string` | Yes | The email address of the recipient. |
| Subject | `string` | Yes | The subject of your email. |
| Body | `html` | Yes | The content of your message. |
Allows for sending a plain email to a recipient.
### Send email with template [#send-email-with-template]
Send an email based on a template to a recipient of your choice.
| Input | Type | Required | Description |
| ---------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| From name | `string` | No | The name that will be used for the "From" header. When left blank, the value specified in the extension settings will be used. |
| From email | `string` | No | The email address that will be used for the "From" header. When left blank, the value specified in the extension settings will be used. |
| To | `string` | Yes | The email address of the recipient. |
| Template ID | `string` | Yes | The immutable ID of a template that exists in your account. |
| Subject | `string` | No | The subject of your email. If you would like to compose a dynamic subject line then pass a subject field with the template content below. |
| Template content | `json` | No | Specify a JSON blob containing the dynamic data of your template. Read the Sendgrid documentation to learn more about dynamic template data. |
## Setup and notes [#setup-and-notes]
SendGrid is a cloud-based email delivery platform that provides services for sending and managing email campaigns, transactional emails, and other types of messages.
### Extension settings [#extension-settings]
In order to set up this extension, you will need to provide:
1. An API key
2. A from name
3. A from email
#### Send email with a template [#send-email-with-a-template]
Allows for sending an email based on a template to a recipient. You can also insert variables so they are rendered in your template.
#### Add and remove emails from suppression lists [#add-and-remove-emails-from-suppression-lists]
Suppression lists ([link on SendGrid's website](https://docs.sendgrid.com/api-reference/suppressions-suppressions/add-suppressions-to-a-suppression-group)) are unsubscribe groups. Use these actions to add an email address to any number of unsubscribe groups. You can apply a suppression add/remove to multiple groups by using comma-separated lists for the groups. Only a single email can be used. This functionality is different from SendGrid's API, which allows multiple email addresses for a single group.
#### Check an import status [#check-an-import-status]
Allows user to check the status of contact import jobs when given a jobID. Statuses are either: `pending`, `completed`, `failed`, or `errored`.
## Changelog [#changelog]
### July 7, 2023 [#july-7-2023]
Added "Add Email to Suppression Lists" and "Remove Email from Suppression Lists" actions.
### July 15, 2023 [#july-15-2023]
Updated "Add or Update Contact" acction to create a datapoint of the Job ID.
Added "Check Import Status" action.
### July 27, 2023 [#july-27-2023]
Adds "Finished At" data point to the importStatus action.
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Shelly
URL: https://docs.awellhealth.com/docs/marketplace/shelly
Library of AI-powered actions
Category: Workflow. Adds 9 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| ---------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Default disclaimer placement | No | Optional tenant-level default disclaimer placement for Shelly summaries. Options: "top" or "bottom" (case-insensitive). Action-level disclaimer placement overrides this setting. If neither is configured, Shelly uses "top". |
| Default disclaimer text | No | Optional tenant-level default disclaimer for Shelly summaries. Action-level disclaimer text overrides this setting. If neither is configured, Shelly uses its existing defaults, such as "Important Notice: The content provided is an AI-generated summary." for care-flow summaries and "Important Notice: The content provided is an AI-generated summary of the form responses." for form summaries. Example compliance text: "This is an AI-generated summary. It presents information already recorded in the care flow and does not generate, recommend, or make any clinical decision. Always review for accuracy and completeness." |
## Actions [#actions]
Shelly adds these 9 actions to a care flow. Add one to a step, then fill in its inputs.
### Categorize Message [#categorize-message]
Categorizes messages into predefined categories with explanation.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------------ | -------- | -------- | ---------------------------------------------------------------------------------------- |
| Message Data Point | `string` | No | The message to be categorized. Use this if you want to use a data point for the message. |
| Message | `text` | No | The message to be categorized. Use this if you want to use a text for the message. |
| Categories | `string` | Yes | List of categories (comma-separated, no spaces) |
| Instructions | `text` | No | Add additional instructions prompt for the LLM |
Returns:
| Data point | Type |
| ------------- | -------- |
| `category` | `string` |
| `explanation` | `string` |
This tool automatically analyzes and categorizes incoming messages based on a set of predefined categories that you specify. It's particularly useful for triaging patient communications and routing them to the appropriate part of your care flow based on content and urgency.
\*\*What it needs (Inputs):
* `Message` (Required): The text of the message that needs categorization.
* `Categories` (Required): A list of predefined categories to classify against, separated by commas (e.g., "Medication Refill,Appointment Request,Symptom Report,Insurance Question,Urgent Medical Issue").
What it gives back (Outputs):
* `Category`: The determined ONE category from your predefined list. If no suitable match is found, it returns "None".
* `Explanation`: A concise explanation (in HTML format) of the reasoning behind the categorization, which can be displayed to care team or used for auditing.
Tips for best results:
* Use distinct categories that align with your clinical workflows.
* Categories should reflect common patient communication types in your practice.
* Avoid ambiguity as current Categorize Message selects only one suitable category.
Example\*\*:
```
Input:
Message: "Hello, I need a refill for my blood pressure medication (Lisinopril 20mg). I've been taking it for the past year, and I'm down to my last few pills. My prescription number is RX43821. Can you please send a refill request to my usual pharmacy? I haven't had any side effects or issues with this medication."
Categories: "Medication Refill Request,Appointment Scheduling,Non-urgent Symptom Report,Insurance/Billing Question,Urgent Medical Concern"
Output:
Category: "Medication Refill Request"
Explanation: "This message clearly states a need for medication refill, specifically for Lisinopril. The patient provides prescription details and mentions having no side effects or issues. The communication is straightforward and fits perfectly into the 'Medication Refill Request' category as the patient is explicitly asking for a prescription renewal rather than scheduling an appointment, reporting symptoms, asking about insurance, or expressing an urgent concern."
```
### Generate Message [#generate-message]
Generate a personalized message
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Communication Objective | `text` | Yes | Provide the main purpose of the message. Add any important message context. |
| Personalization Input | `text` | No | \[Optional] Specify the personalization input for the message (name, age, gender, date of the last checkup, etc). This is used to personalize the message to the recipient. |
| Stakeholder | `string` | No | \[Optional]Specify the recipient role; defaults to "Patient." Used for personalization. |
| Language | `string` | No | \[Optional]Specify the language of the message; defaults to English. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `message` | `string` |
| `subject` | `string` |
This tool creates contextually appropriate, personalized communications for patients or healthcare team members based on specific clinical situations and communication needs.
\*\*What it needs (Inputs):
* `Communication Objective` (Required): The clinical purpose and context of the message (e.g., "Welcome the patient to our chronic care management program", "Gather initial health information before the first appointment", "Remind the patient about their upcoming medication refill deadline," "Provide detailed preparation instructions for the upcoming colonoscopy procedure").
* `Personalization Input` (Optional): Clinical and demographic information to personalize the message (e.g., patient name, patient demographics, any other relevant information).
* `Stakeholder` (Optional): The intended recipient's role (e.g., "Patient", "Caregiver", "Primary Care Provider", "Specialist"). Defaults to "Patient".
* `Language` (Optional): The language for the message. Defaults to English.
What it gives back (Outputs):
* `Subject`: A clinically appropriate subject line for the message.
* `Message`: The complete message content (in HTML format).
Tips for best results:
* Include relevant context in the communication objective.
* Make sure to include all personalization details for better personalized outreach.
Example\*\*:
```
Input:
Communication Objective: "Remind the patient about their upcoming appointment and provide preparation instructions (fasting 8 hours before, come 15 minutes early)."
Personalization Input: "Patient Name: Emma Johnson, Appointment Date: July 15, 2023, Appointment Time: 2:30 PM, Provider: Dr. Sarah Chen, Appointment Type: Annual Physical Exam, Fasting Required: Yes (8 hours)"
Stakeholder: "Patient"
Language: "English"
Output:
Subject: "Reminder: Your Appointment with Dr. Chen on July 15"
Message: "Dear Emma,
This is a friendly reminder about your upcoming appointment:
Date: July 15, 2023
Time: 2:30 PM
Provider: Dr. Sarah Chen
Type: Annual Physical Exam
Important Preparation Instructions:
- Please fast for 8 hours before your appointment (water is permitted)
- Arrive 15 minutes early to complete any necessary paperwork
- Bring your identification and insurance information
We look forward to seeing you!
Best regards,
The Care Team
"
```
### Extract medication from image (Experimental) [#extract-medication-from-image-experimental]
Generates structured medication list from picture
| Input | Type | Required | Description |
| --------- | -------- | -------- | ----------------------------- |
| Image URL | `string` | Yes | The URL to the uploaded image |
Returns:
| Data point | Type |
| ------------------ | -------- |
| `data` | `json` |
| `medicationAsText` | `string` |
### Parse Structured Data [#parse-structured-data]
Extracts structured data from unstructured text messages using a provided JSON schema.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------------ | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Message Data Point | `string` | No | The message to parse. Use this if you want to use a data point for the message. |
| Message | `text` | No | The message to parse. Use this if you want to use a text for the message. |
| Schema | `json` | Yes | JSON schema defining the structure to extract from the message. Example: \{"name": "string", "age": "number", "email": "string"} |
| Instructions | `text` | No | Add additional instructions prompt for the LLM |
Returns:
| Data point | Type |
| ----------------- | -------- |
| `confidenceLevel` | `number` |
| `explanation` | `string` |
| `parsedData` | `json` |
### Review medication extraction [#review-medication-extraction]
Allow a stakeholder to review the medication extraction
| Input | Type | Required | Description |
| --------------- | -------- | -------- | ----------------------------- |
| Image URL | `string` | Yes | The URL to the uploaded image |
| Medication data | `json` | Yes | The medication data to review |
Returns:
| Data point | Type |
| --------------- | ------ |
| `validatedData` | `json` |
This tool enables qualified clinical staff to review, validate, and if necessary, correct medication information extracted from images.
\*\*What it needs (Inputs):
* `Image URL` (Required): The URL of the medication image that was processed.
* `Extracted Medication` (Required): The structured medication data generated by the Medication From Image action.
What it gives back (Outputs):
* `Reviewed Data`: The validated or corrected medication information in JSON format.
* `Review Status`: The verification status (e.g., "Verified Without Changes", "Corrected", "Rejected").
Tips for best results\*\*:
* Assign this task to staff members with clinical medication knowledge.
* The interface presents both the original image and extracted data side-by-side.
* Corrections made during review are captured for quality improvement.
* Consider implementing this as part of a medication reconciliation workflow.
### Summarize Care Flow [#summarize-care-flow]
Summarize the care flow up until now
| Input | Type | Required | Description |
| ----------------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Additional instructions | `text` | No | Specify additional instructions for summarization, for example format, length, what to focus on etc. If not specified, default instructions will be used. |
| Stakeholder | `string` | No | Indicates who the summarization is intended for. Defaults to "Clinician" |
| Disclaimer text | `text` | No | Optional action-level disclaimer text override. If not provided, the tenant-level default is used when configured. Otherwise, the action keeps its existing default disclaimer (for example: Important Notice: The content provided is an AI-generated summary.). |
| Disclaimer placement | `string` | No | Optional action-level disclaimer placement override. Use top or bottom. If not provided, the tenant-level default is used when configured. Otherwise, Shelly defaults to top. One of: top, bottom. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `summary` | `string` |
This tool generates comprehensive, contextualized summaries of a patient's progress through their care flow, highlighting key activities, routes taken, and outcomes.
\*\*What it needs (Inputs):
* `Additional Instructions` (Optional): Specific focus areas for the summary (e.g., "Focus on form completions and reminder effectiveness," "Summarize patient engagement patterns").
* `Stakeholder` (Optional): The intended audience (e.g., "Care Coordinator", "Administrator", "Patient", "Provider"). This affects terminology and detail level.
What it gives back (Outputs):
* `Summary`: A comprehensive summary of the care flow progress (in HTML format). All summaries include an AI-generated disclaimer for transparency and regulatory compliance.
Tips for best results:
* Use additional instructions to focus on specific care flow parts.
* Specify the stakeholder to ensure appropriate terminology and detail level.
Example\*\*:
```
Input:
Additional Instructions: "Focus on patient engagement with the intake forms, summarize the reminder sequence and when forms were completed."
Stakeholder: "Care Coordinator"
Output:
Summary: "Important Notice: This is an AI-generated summary for the 'New Patient Intake' care flow (ID: cf_12345).
Summary: Patient Intake Process
Patient Alex Morgan (38) was enrolled in the New Patient Intake process on June 3, 2023. The care flow included three required forms: Personal Information, Medical History, and Insurance Verification.
Form Completion Timeline:
- Personal Information Form: Completed immediately during enrollment (June 3)
- Medical History Form: Not completed initially
- First reminder sent: June 5 via email
- Second reminder sent: June 8 via text message
- Form completed: June 9 (after 2 reminders)
- Insurance Verification Form: Not completed initially
- First reminder sent: June 5 via email
- Second reminder sent: June 8 via text message
- Third reminder sent: June 12 via phone call
- Form completed: June 12 (after 3 reminders during call)
Engagement Analysis: Patient responded to text message reminders most effectively (completed Medical History form within 24 hours of text reminder). The Insurance Verification form required additional support, which was successfully provided during the phone call reminder.
Next Steps: All required intake forms have been completed. Patient is now ready for their first appointment on June 15, 2023.
"
```
### Summarize Form [#summarize-form]
Summarize form responses with AI. Defaults to the latest form in the current step, but can summarize all forms in the step or across the track.
| Input | Type | Required | Description |
| ----------------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Scope | `string` | No | The scope in which to look for forms. Default is "Step" (current step only). One of: Step, Track. |
| Form selection | `string` | No | Whether to summarize the most recent form or all forms in the scope. Default is "Latest". One of: Latest, All. |
| Summary Format | `string` | No | Format of the summary. Acceptable values are "Bullet-points" and "Text paragraph". Defaults to Bullet-points. One of: Bullet-points, Text paragraph. |
| Language | `string` | No | \[Optional] Language of the summarization. Defaults to the language of the form. |
| Additional Instructions | `text` | No | \[Optional] Specify additional instructions for the AI to generate the form summary. You can include details about: specific questions to focus on, desired level of detail, information to emphasize or exclude, etc. |
| Disclaimer text | `text` | No | Optional action-level disclaimer text override. If not provided, the tenant-level default is used when configured. Otherwise, the action keeps its existing default disclaimer (for example: Important Notice: The content provided is an AI-generated summary of the form responses.). |
| Disclaimer placement | `string` | No | Optional action-level disclaimer placement override. Use top or bottom. If not provided, the tenant-level default is used when configured. Otherwise, Shelly defaults to top. One of: top, bottom. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `summary` | `string` |
This tool analyzes patient-reported data from forms and generates concise, relevant summaries that highlight key findings in question-answer pairs. It focuses on the last form in the step before this AI Action is included in.
\*\*What it needs (Inputs):
* `Summary Format` (Required): Preferred format for the summary ("Bullet Points" or "Paragraph").
* `Language` (Optional): Desired language for the summary. If not set, it automatically detects the form's language.
* `Additional Instructions` (Optional): Any additional instructions like specific questions to focus on, desired level of detail, information to emphasize or exclude, etc.
What it gives back (Outputs):
* `Summary`: A formatted summary of form responses (in HTML format). All summaries include an AI-generated disclaimer for transparency and regulatory compliance.
Tips for best results:
* Use bullet point format for symptom reports and clinical findings.
* Use paragraph format for narrative elements like patient experiences.
* Additional instructions can help prioritize significant responses and level of details for your use case needs.
* Remember this is a summary, not a transcript - question-answer pairs from the form won't appear verbatim, and the AI will intelligently condense unnecessary details while preserving important information.
Example\*\*:
```
Input:
Summary Format: "Bullet Points"
Language: "English"
Additional Instructions: "Highlight any pain scores >5, medication side effects, and changes since last assessment. Flag any responses requiring urgent clinical attention."
Output:
Summary: "Important Notice: This is an AI-generated summary for form responses in version 2.3 of the 'Post-Surgical Follow-up' care flow (ID: cf_789).
Post-Operative Assessment Summary:
- Pain Assessment: Reports pain level of 7/10 at surgical site (CLINICAL ATTENTION ADVISED)
- Pain characteristics: Described as 'sharp and throbbing,' worse with movement
- Pain management: Taking prescribed oxycodone-acetaminophen as directed, but reporting inadequate relief
- Incision Site: Reports increasing redness and warmth around incision since yesterday (CLINICAL ATTENTION ADVISED)
- Drainage: Minimal serous drainage, no purulence reported
- Functional Status: Ambulating with assistance, able to perform basic ADLs with moderate difficulty
- Medication Side Effects: Reports nausea and constipation with pain medication
- Vital Signs (self-reported): Temperature 99.8°F (37.7°C), slightly elevated from last assessment (98.6°F)
- Change Since Last Assessment: Patient reports increased pain and incision site changes over past 24 hours
"
```
### Summarize Forms in Step [#summarize-forms-in-step]
Summarize the responses of all forms in the step with AI.
| Input | Type | Required | Description |
| -------------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Summary Format | `string` | No | Specify the format of the summary. Acceptable values are "Bullet-points" and "Text paragraph". Defaults to Bullet-points. |
| Language | `string` | No | \[Optional] Indicates the language of the summarization. Defaults to the language of the form. |
| Disclaimer text | `text` | No | Optional action-level disclaimer text override. If not provided, the tenant-level default is used when configured. Otherwise, the action keeps its existing default disclaimer (for example: Important Notice: The content provided is an AI-generated summary of the form responses.). |
| Disclaimer placement | `string` | No | Optional action-level disclaimer placement override. Use top or bottom. If not provided, the tenant-level default is used when configured. Otherwise, Shelly defaults to top. One of: top, bottom. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `summary` | `string` |
This tool analyzes data from multiple forms completed in a single step and creates summaries for each form. It processes all forms in the current step where this AI Action is included and organizes them by form title.
\*\*What it needs (Inputs):
* `Summary Format` (Required): Preferred format for the summary ("Bullet Points" or "Paragraph").
* `Language` (Optional): Desired language for the summary. If not set, it automatically detects the predominant language.
* `Additional Instructions` (Optional): Any additional instructions like specific questions to focus on, desired level of detail, information to emphasize or exclude, etc.
What it gives back (Outputs):
* `Summary`: A formatted collection of all form responses in the step, organized by form title (in HTML format). All summaries include an AI-generated disclaimer for transparency and regulatory compliance.
Tips for best results:
* Particularly valuable for multi-form assessments that gather related information.
* Reduces the need to read through multiple form submissions separately.
* Remember this is a summary, not a transcript - question-answer pairs from the forms won't appear verbatim, and the AI will intelligently condense unnecessary details while preserving important information.
Example\*\*:
```
Input:
Summary Format: "Bullet Points"
Language: "Default"
Additional Instructions: "Highlight key symptoms and lifestyle factors that might affect the patient's condition."
Output:
Summary: "Important Notice: This is an AI-generated summary for form responses in the 'Diabetes Management' care flow (ID: cf_789).
Blood Glucose Monitoring Form:
- Morning readings averaging 145 mg/dL (target: <120 mg/dL)
- Evening readings within normal range (average 115 mg/dL)
- Two hypoglycemic events reported this week (both after exercise)
- Consistent monitoring schedule (14/14 planned measurements completed)
Nutrition Assessment Form:
- Carbohydrate intake: 45-60g per meal, within recommended range
- Reported difficulty avoiding carbs at dinner social events
- Successfully increased vegetable consumption to 3-4 servings daily
- Water intake below recommendation (4 glasses vs. recommended 8)
Physical Activity Log:
- Walking: 20 minutes daily (consistent pattern)
- Strength training: 2 sessions this week (target: 3 sessions)
- Reports joint pain in knees after longer walking sessions
- Activity level increases on weekends, with lower glucose readings noted after weekend activities
"
```
### Summarize Track Outcome [#summarize-track-outcome]
Summarize the care flow track outcome and activities that led to the outcome
| Input | Type | Required | Description |
| -------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Instructions | `text` | No | Specify instructions for the AI to generate the track outcome summary. You can include details about: what outcome to focus on, where to find it in the track, specific forms to analyze, desired length and format, parts of the track to exclude, level of detail for decision paths, etc. |
| Disclaimer text | `text` | No | Optional action-level disclaimer text override. If not provided, the tenant-level default is used when configured. Otherwise, the action keeps its existing default disclaimer (for example: Important Notice: The content provided is an AI-generated summary.). |
| Disclaimer placement | `string` | No | Optional action-level disclaimer placement override. Use top or bottom. If not provided, the tenant-level default is used when configured. Otherwise, Shelly defaults to top. One of: top, bottom. |
Returns:
| Data point | Type |
| ---------------- | -------- |
| `outcomeSummary` | `string` |
This tool analyzes the progression through a specific track in a care flow, highlighting key routes taken and outcomes.
\*\*What it needs (Inputs):
* `Instructions` (Optional): Specific focus for the analysis (e.g., "Summarize outcome, focus on semantic information in form and messages").
What it gives back (Outputs):
* `Outcome Summary`: A comprehensive summary of the track's progression and outcomes (in HTML format).
Tips for best results:
* Make sure you build a care flow in a way that AI action can leverage semantic information (meaningful names of steps, labels, meaningful names of actions)
* NOTE: AI action does not have access to transition logic; it only can see which routes were taken and which steps were discarded.
Example\*\*:
```
Input:
Instructions: "Summarize outcome, focus on semantic information in form and messages"
Output:
Outcome Summary: "Important Notice: This is an AI-generated summary for the 'Patient Symptom Assessment' care flow (ID: cf_567).
Track Outcome Summary:
Outcome: The initial assessment form was completed, summarizing the patient's symptoms and concerns.
Details Supporting the Outcome:
- The initial assessment form was presented to the patient, Samantha Joe, who provided responses indicating symptoms of fever, fatigue, and shortness of breath, with a severity level of 8.
- The patient confirmed having experienced these symptoms before and expressed a need for help with anxiety.
- The form responses were summarized, highlighting the patient's primary concerns and symptom details.
- The process concluded with the successful completion of the form summary.
"
```
## Setup and notes [#setup-and-notes]
Shelly provides a set of smart tools that use artificial intelligence (most precisely Large Language Models) to help automate tasks and manage information within your care flow.
### Disclaimer settings [#disclaimer-settings]
Shelly summary actions always include an AI-generated disclaimer. You can configure disclaimer behavior at two levels:
* \*\*Shelly extension settings (tenant-level defaults): configure `Default disclaimer text` and `Default disclaimer placement` once for the tenant/organization. Existing care-flow action instances pick up these settings without being deleted and re-added.
* Action settings: configure `Disclaimer text` and `Disclaimer placement` on an individual Shelly summary action when a specific care flow needs different wording or placement. Action-level settings take precedence over the tenant-level defaults.
If neither tenant-level nor action-level settings are configured, Shelly preserves the existing defaults: care-flow summaries use `Important Notice: The content provided is an AI-generated summary.`, form summaries use `Important Notice: The content provided is an AI-generated summary of the form responses.`, dynamic form/track provenance disclaimers remain enabled where available, and placement defaults to `top`.
For compliance wording similar to Wellpath's requirements, set the tenant-level `Default disclaimer text` to:
```
This is an AI-generated summary. It presents information already recorded in the care flow and does not generate, recommend, or make any clinical decision. Always review for accuracy and completeness.
```
Set `Default disclaimer placement` to `top` or `bottom`. Use action-level overrides only for individual summaries that need different wording or placement.
Below is a detailed look at each tool Shelly offers, what it needs to work, what it gives you back, and how to use it best.
#### Medication From Image (Experimental) [#medication-from-image-experimental]
This tool uses advanced image processing and AI to extract structured medication information from images of prescription labels, medication packaging, or pill bottles.
What it needs (Inputs):
* `Image URL` (Required): The URL of the medication image to be processed.
What it gives back (Outputs):
* `Data`: Structured medication information in JSON format, including elements like medication name, dosage, frequency, and instructions.
* `Medication As Text`: A formatted plain text version of the extracted medication information for easier human readability.
Tips for best results:
* Ensure adequate lighting and focus when capturing images.
* Position the camera to capture the entire medication label clearly.
* The tool can process various image types:
* Prescription labels and bottles
* Medication packaging and boxes
* Handwritten or printed medication lists
* Photos of medication tables or charts
* Images containing multiple medications
* For medication lists, ensure the text is clearly visible and the image is not blurry.
* Multiple medications in a single image will be identified and separated when possible.
Example\*\*:
```
Input:
Image URL: "https://example.com/rx_image.jpg"
Output:
Data: '{"medications":[{"name":"Atorvastatin","dosage":"40 mg","frequency":"Once daily","instructions":"Take in the evening","prescriber":"Dr. Jennifer Wilson","pharmacy":"CityHealth Pharmacy","rxNumber":"RX80442553","dateIssued":"2023-05-15","refills":"2 remaining"}]}'
Medication As Text: "Name: Atorvastatin\nDosage: 40 mg\nFrequency: Once daily\nInstructions: Take in the evening\nPrescriber: Dr. Jennifer Wilson\nPharmacy: CityHealth Pharmacy\nRx Number: RX80442553\nDate Issued: 2023-05-15\nRefills: 2 remaining"
```
## Changelog [#changelog]
### Unreleased [#unreleased]
* Added tenant-level Shelly disclaimer text and placement settings with action-level overrides.
* Documented disclaimer precedence and defaults for Shelly summaries.
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Slack
URL: https://docs.awellhealth.com/docs/marketplace/slack
Send messages to Slack channels from your care flows to keep your team informed.
Category: Communication. Adds 1 action to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Bot Token | Yes | Your Slack Bot User OAuth Token (starts with xoxb-). You can find this in your Slack App settings under "OAuth & Permissions". The bot needs the chat:write scope. Stored as a secret. |
## Actions [#actions]
Slack adds this action to a care flow. Add one to a step, then fill in its inputs.
### Send Message to Channel [#send-message-to-channel]
Send a message to a Slack channel.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Channel | `string` | Yes | The Slack channel to send the message to. Use the channel ID (e.g., C1234567890) or channel name (e.g., #general). The bot must be invited to the channel. |
| Message | `text` | Yes | The message content to send to the channel. |
Returns:
| Data point | Type |
| ----------- | -------- |
| `channelId` | `string` |
| `messageTs` | `string` |
Send a message to a Slack channel.
\*\*Input fields:
* Channel (required): The Slack channel to send the message to. You can use either the channel ID (e.g., `C1234567890`) or the channel name (e.g., `#general`). The bot must be invited to the channel.
* Message (required): The message content to send to the channel.
Output data points:
* messageTs: The timestamp/ID of the posted message. This can be used for threading or updating the message later.
* channelId\*\*: The channel ID where the message was posted.
## Setup and notes [#setup-and-notes]
Slack is a messaging platform for teams that brings all your communication together, giving everyone a shared workspace where conversations are organized and accessible.
This extension allows you to send messages to Slack channels from your care flows, keeping your team informed about important events and updates.
### Extension settings [#extension-settings]
In order to set up this extension, you will need:
1. A Slack App with a Bot User OAuth Token (starts with `xoxb-`)
2. The bot must have the `chat:write` OAuth scope
#### Setting up your Slack App [#setting-up-your-slack-app]
1. Go to [https://api.slack.com/apps](https://api.slack.com/apps) and click "Create New App"
2. Choose "From scratch" and give your app a name
3. Navigate to "OAuth & Permissions" in the sidebar
4. Under "Scopes", add the `chat:write` Bot Token Scope
5. Click "Install to Workspace" at the top of the page
6. Copy the "Bot User OAuth Token" (starts with `xoxb-`)
7. Use this token in the extension settings
#### Inviting the bot to channels [#inviting-the-bot-to-channels]
Before the bot can post messages to a channel, it must be invited to that channel. You can do this by:
1. Going to the channel in Slack
2. Typing `/invite @YourBotName`
## Changelog [#changelog]
### Initial release [#initial-release]
Initial release of the Slack extension with the following action:
* **Send Message to Channel**: Send a message to a Slack channel from your care flow.
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# SRFax
URL: https://docs.awellhealth.com/docs/marketplace/srfax
Retrieve faxes from SRFax and extract text using LandingAI OCR.
Category: Document Management. Adds 1 action to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| ---------- | -------- | --------------------- |
| Account ID | Yes | — |
| Base URL | No | — |
| Password | Yes | — Stored as a secret. |
## Actions [#actions]
SRFax adds this action to a care flow. Add one to a step, then fill in its inputs.
### Get fax document with OCR [#get-fax-document-with-ocr]
Get fax document with SRFax and extract structured data with OCR
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Fax Id | `string` | Yes | SRFax FaxDetailsID (the number after the "\|" in FileName) or full FileName |
| OCR Provider | `string` | Yes | The provider or service used for OCR One of: Awell (Landing.ai). |
| OCR Provider API Key | `string` | Yes | We advise using a obfuscated constant |
| Fields schema | `json` | No | Defines the structure of the fields to extract from the document. Providing a schema is optional but strongly recommended, as it significantly improves the accuracy of the extracted data. |
Returns:
| Data point | Type |
| ---------------------------- | -------- |
| `chunks` | `json` |
| `date` | `date` |
| `direction` | `string` |
| `extractedDataBasedOnSchema` | `json` |
| `extractedMetadata` | `json` |
| `format` | `string` |
| `markdown` | `string` |
| `pageCount` | `number` |
| `status` | `string` |
## Setup and notes [#setup-and-notes]
Retrieve fax documents from SRFax and extract text via LandingAI OCR.
### Extension settings [#extension-settings]
* Account ID (required)
* Password (required)
* Base URL (optional, default: [https://www.srfax.com/SRF\_SecWebSvc.php](https://www.srfax.com/SRF_SecWebSvc.php))
### Action: Get fax document with OCR [#action-get-fax-document-with-ocr]
* Inputs
* faxId (string, required): SRFax FaxDetailsID (number after the `|`) or full FileName
* ocrProvider: `awell-landing-ai`
* ocrProviderApiKey (string, required)
* fieldsSchema (JSON, optional)
* Outputs
* markdown (string)
* chunks (json)
* extractedDataBasedOnSchema (json)
* extractedMetadata (json)
* direction (string)
* date (date)
* status (string)
* format (string)
* pageCount (number)
## Changelog [#changelog]
All notable changes to the SRFax extension will be documented in this file.
### 1.0.0 [#100]
* Initial release: getFaxDocumentWithOCR action using SRFax Retrieve\_Fax and LandingAI OCR (base64 mode).
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Stedi
URL: https://docs.awellhealth.com/docs/marketplace/stedi
Automate healthcare transactions like real-time eligibility checks and claims processing with APIs that support thousands of payers.
Category: Billing. Adds 1 action to a care flow.
## Actions [#actions]
Stedi adds this action to a care flow. Add one to a step, then fill in its inputs.
### Check eligibility [#check-eligibility]
This is a dummy action that checks eligibility for a given request.
| Input | Type | Required | Description |
| ----- | -------- | -------- | -------------------------------------------------------------- |
| Data | `string` | Yes | Paste example JSON here that mocks the data Stedi would return |
Returns:
| Data point | Type |
| ---------- | -------- |
| `data` | `string` |
## Setup and notes [#setup-and-notes]
Automate healthcare transactions like real-time eligibility checks and claims processing with APIs that support thousands of payers.
## Changelog [#changelog]
## CHANGELOG [#changelog-1]
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Stripe (alpha)
URL: https://docs.awellhealth.com/docs/marketplace/stripe
Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.
Category: Billing. Adds 3 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| --------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
| Hosted Pages environment variable | Yes | This will be removed once the extension is out of alpha mode. This needs to be configured by an Awell developer. |
| Live mode publishable key | Yes | This key is used for testing Embedded checkout in Awell Hosted Pages |
| Live mode secret key | Yes | This key is used to authenticate requests on your server when in live mode Stored as a secret. |
| Mode | Yes | "Test" or "Live", defaults to "Test". Make sure to have a secret key set for live mode when enabling it. |
| Test mode publishable key | Yes | This key is used for testing Embedded checkout in Awell Hosted Pages |
| Test mode secret key | Yes | This key is used to authenticate requests on your server when in test mode Stored as a secret. |
## Actions [#actions]
Stripe (alpha) adds these 3 actions to a care flow. Add one to a step, then fill in its inputs.
### Create customer [#create-customer]
Create a customer in Stripe
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------- |
| Email | `string` | No | Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. |
| Name | `string` | No | The customer’s full name or business name. |
Returns:
| Data point | Type |
| ------------ | -------- |
| `customerId` | `string` |
### Create subscription [#create-subscription]
Create a subscription in Stripe
| Input | Type | Required | Description |
| -------- | -------- | -------- | ------------------------------------------- |
| Customer | `string` | Yes | The identifier of the customer to subscribe |
| Item | `string` | Yes | The ID of the price object |
Returns:
| Data point | Type |
| ---------------- | -------- |
| `subscriptionId` | `string` |
### Embedded checkout [#embedded-checkout]
Embedded checkout in Awell Hosted Pages
| Input | Type | Required | Description |
| ----- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------- |
| Mode | `string` | Yes | The mode of the checkout session which can be 'payment', 'setup', and 'subscription' One of: Payment, Setup, Subscription. |
| Item | `string` | Yes | The id of the item (price ID) the customer is purchasing |
Returns:
| Data point | Type |
| ---------- | --------- |
| `success` | `boolean` |
## Setup and notes [#setup-and-notes]
### Stripe [#stripe]
Stripe powers online and in-person payment processing and financial solutions for businesses of all sizes.
### Extension settings [#extension-settings]
For the extension to function correctly, you must configure the following settings:
* Secret key (test and live mode)
* Publishable key (test and live mode)
* Mode ("Test" or "Live")
## Changelog [#changelog]
## Stripe changelog [#stripe-changelog]
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Talkdesk
URL: https://docs.awellhealth.com/docs/marketplace/talkdesk
Talkdesk is a cloud-based customer experience and contact center software company.
Category: Communication. Adds 1 action to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| --------------------- | -------- | ------------------------------------------------------------------------- |
| Client ID | Yes | The client ID for OAuth2 Password authentication. |
| Client Secret | Yes | The client secret for OAuth2 Password authentication. Stored as a secret. |
| Region | No | US, EU, or Canada. Defaults to US. |
| Talkdesk account name | Yes | — |
## Actions [#actions]
Talkdesk adds this action to a care flow. Add one to a step, then fill in its inputs.
### Trigger flow [#trigger-flow]
Trigger a flow in Talkdesk
| Input | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Flow ID | `string` | Yes | The ID of the flow you would like to trigger |
| Autocomplete | `boolean` | No | If true, the activity will not wait for the flow to complete (default: false) |
| Data | `json` | Yes | Data to be ingested when triggering the flow, including the `awell_activity_id` so the flow can perform the appropriate completeExtensionActivity callback. |
Returns:
| Data point | Type |
| ------------------ | -------- |
| `agent` | `string` |
| `call_duration_ms` | `number` |
| `call_end_time` | `date` |
| `call_start_time` | `date` |
| `call_status` | `string` |
| `disposition` | `string` |
| `flowVersionId` | `string` |
| `interactionId` | `string` |
Enables the initiation of a Talkdesk flow directly from an Awell careflow. This feature triggers an interaction using the most recent published version of a specific Studio flow. You'll need to supply the ID of the flow and the data (as a JSON object) that you want to input into the flow.
Important: Please note that Talkdesk sets a restriction of up to two API requests per second (rps) for each account using their Flows API.
[Click here](https://studio.talkdesk.com/docs/sending-notifications-to-contacts-via-api-request) to learn more about triggering flows via the Talkdesk API and here to read the [API docs](https://docs.talkdesk.com/reference/flows-api-ref).
## Setup and notes [#setup-and-notes]
Talkdesk is a cloud-based customer experience and contact center software company. It provides a platform that enables businesses to set up and manage their customer service and support operations. Talkdesk offers a range of features and tools to streamline and enhance communication between businesses and their customers.
### Setup [#setup]
To set up the extension, you'll need your Talkdesk account name along with a client ID and client secret. Please ensure that the credentials you provide are associated with the necessary permissions, or "scopes," to run the extension:
* flows-interactions:start
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Text-em-all
URL: https://docs.awellhealth.com/docs/marketplace/text-em-all
Send text messages to your patients.
Category: Communication. Adds 1 action and 1 webhook to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| --------------- | -------- | ----------------------------------------------------- |
| Customer Key | Yes | Your Text-Em-All customer key. Stored as a secret. |
| Customer Secret | Yes | Your Text-Em-All customer secret. Stored as a secret. |
| Token | Yes | Your Text-Em-All token. Stored as a secret. |
## Actions [#actions]
Text-em-all adds this action to a care flow. Add one to a step, then fill in its inputs.
### Send a new SMS broadcast [#send-a-new-sms-broadcast]
Send a text message to a recipient. Returns the delivery result (sent, invalid\_number, failed, etc.) for triage purposes.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Broadcast Name | `string` | Yes | The name of the broadcast. |
| Phone Number | `string` | No | The primary phone number of the recipient. Must be a valid NANP phone number. If omitted, falls back to the patient mobile phone from their profile. |
| First Name | `string` | No | The first name of the contact. If omitted, falls back to the patient first name from their profile. |
| Last Name | `string` | No | The last name of the contact. If omitted, falls back to the patient last name from their profile. |
| Notes | `string` | No | Notes about the contact (e.g., "Eligibility form from Awell"). |
| Integration Data | `string` | No | Extra field for integration information. |
| Text Message | `text` | Yes | The text of the message for a text type broadcast. The max length is based on the setting in your account. |
| Text Number ID | `numeric` | No | The ID of the text number your messages will be sent from. If omitted, the default text number on your account will be used. |
| Start Date | `date` | No | The time the broadcast should start. Will default to start immediately. If provided must be a datetime as ISO 8601 string and time to send the message in UTC |
| Check Calling Window | `boolean` | No | Whether to enforce the calling window restrictions. Defaults to false. |
Returns:
| Data point | Type |
| ------------------------- | --------- |
| `broadcastId` | `number` |
| `broadcastStartDate` | `string` |
| `broadcastStatus` | `string` |
| `broadcastStatusCategory` | `string` |
| `deliveryResult` | `string` |
| `deliveryResultDetails` | `string` |
| `success` | `boolean` |
| `uriBroadcastDetails` | `string` |
## Webhooks [#webhooks]
Text-em-all can send this event into Awell, where each one can start a care flow or move a patient along. Point the webhook at the URL Studio shows you when you enable it.
### `broadcastStatusChange` [#broadcaststatuschange]
Payload:
| Data point | Type |
| ----------------- | -------- |
| `broadcastId` | `number` |
| `broadcastStatus` | `string` |
## Setup and notes [#setup-and-notes]
Text-Em-All is a texting and automated calling service that enables organizations to communicate with patients.
### Supported Actions [#supported-actions]
* \*\*sendSMSBroadcast - Schedule SMS message to a specified user
* sendCallBroadcast\*\* - Schedule an Call message to a specified user
### Webhooks [#webhooks-1]
## Broadcast Status Change [#broadcast-status-change]
Triggered when the status of a call or text broadcast changes to one of the following states:
| Status | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `created` | A broadcast has been created on your Call-Em-All account. It may be scheduled to run in the future and it may not have all the information set up to run yet. |
| `ready` | The broadcast has all information necessary to run and is waiting for its start time. |
| `broadcasting` | The broadcast started to send out phone calls or text messages. |
| `completed` | The broadcast has finished sending out all phone calls or text messages. |
| `paused` | The broadcast has been paused and no calls or texts are going out. |
| `resumed` | A paused broadcast resumes. |
| `canceled` | The broadcast was canceled. |
| `expired` | The window that was set up for the broadcast by the user was insufficient to send out all the calls or texts. The broadcast has been expired and some of the calls and texts are not delivered. |
Webhook includes:
* Broadcast ID
* Broadcast status
### Setup [#setup]
The Text-Em-All extension requires the following settings to be configured:
| Setting name | Required | Description |
| ---------------- | -------- | -------------------------------- |
| `customerKey` | Yes | Your Text-Em-All customer key |
| `customerSecret` | Yes | Your Text-Em-All customer secret |
| `token` | Yes | Your Text-Em-All token |
| `baseUrl` | Yes | Your Text-Em-All base URL |
## Find out more [#find-out-more]
For detailed information about setting up webhooks, notification formats, and additional event types, please visit the [Text-Em-All Webhooks documentation](https://dev.text-em-all.com/Webhooks#events).
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# TextLine
URL: https://docs.awellhealth.com/docs/marketplace/textline
Textline's business texting software offers solutions for sales, marketing, customer service, and beyond. Utilize the power of SMS to grow quickly.
Category: Communication. Adds 3 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Access Token | Yes | Find your Access Token at [https://application.textline.com/organization/api\_settings](https://application.textline.com/organization/api_settings). Stored as a secret. |
## Actions [#actions]
TextLine adds these 3 actions to a care flow. Add one to a step, then fill in its inputs.
### Get messages [#get-messages]
Get a list of text messages matching the given criteria. You can also filter the Messages by providing one of the allowed filters.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ---------------------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| Phone number to filter | `string` | No | Search for text messages received from this phone number |
| Messages after | `string` | No | The id of a message to use as non inclusive lower bound of post results. |
| Department Id | `string` | No | The ID of the department from which you want to retrieve the message. Defaults to to your first department. |
Returns:
| Data point | Type |
| ------------------ | --------------- |
| `allMessages` | `strings_array` |
| `latestMessage` | `string` |
| `numberOfMessages` | `number` |
This action retrieves received messages. One can apply the `phoneNumber` filter to this action to display only received messages from that `phoneNumber`.
Only the last 30 messages are returned.
### Send SMS [#send-sms]
Send a text message from a given telephone number to a recipient of your choice.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------------- | -------- | -------- | --------------------------------------------------------------------------------------------- |
| "To" phone number | `string` | Yes | The phone number you would like to send the text message to. |
| Message | `text` | Yes | The message you would like to send. |
| Department Id | `string` | No | The department from which you want to send the message. Defaults to to your first department. |
Returns:
| Data point | Type |
| ---------------- | -------- |
| `conversationId` | `string` |
| `messageId` | `string` |
Send an SMS with TextLine to a recipient of your liking.
### Set Contact Consent [#set-contact-consent]
Set contact consent status. You can set consent as true or false.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------------- | --------- | -------- | ------------------------------------------------------------- |
| "To" phone number | `string` | Yes | The phone number you would like set the consent status. |
| Set customer consent | `boolean` | Yes | A true or false value to set the consent status of a contact. |
For HIPAA and Pro accounts setup with Contact Consent, this action can set contact's consent status. To do this, your account must have API import allowed and the user making the API request must have the "Can manually set consent" permission on for their role. You must then use the Contact's phone number and their consent status (true or false).
## Setup and notes [#setup-and-notes]
TextLine is a customer engagement platform used by hundreds of thousands of businesses and more than ten million developers worldwide to build unique, personalized experiences for their customers.
They are known for democratizing channels like voice, text, chat, video, and email through APIs, making it easy for every organization to build meaningful interactions with customers on the channels they prefer.
### Extension settings [#extension-settings]
In order to set up this extension, you will need:
1. A TextLine API key or auth token which can be found in the TextLine console.
2. Your account SID which can be found in the TextLine console.
3. A phone number to send the message from. This must be a TextLine phone number that you own.
##### Simple Use Case [#simple-use-case]
\*\*Initiating a Conversation: A user sends a message to "Number A", initiating a conversation.
Receiving a Response: "Number A" responds to the message, contributing to the ongoing conversation.
Searching Messages & Applying Filters\*\*: To focus on the responses from "Number A", \`phoneNumber\`\` filter can be applied to only show received messages from "Number A" within the conversation. This allows users to easily review and manage responses from "Number A", without the clutter of other received messages.
## Changelog [#changelog]
### 2024-03-11 [#2024-03-11]
1. Add option to set department ID when sending messages and when retrieving messages. Check official documentation here: [https://textline.docs.apiary.io/#reference/conversations/phone-numbers/message-a-phone-number](https://textline.docs.apiary.io/#reference/conversations/phone-numbers/message-a-phone-number)
### 2024-03-5 [#2024-03-5]
1. Add capability to set contact consent status ([https://textline.docs.apiary.io/#reference/customers/set-contact-consent/set-contact-consent](https://textline.docs.apiary.io/#reference/customers/set-contact-consent/set-contact-consent))
2. Add several fixes and tweaks to improve current actions
### 2024-02-26 [#2024-02-26]
1. Add capability to search for messages using all the allowed filters provided by TextLine API.
2. Add "Send SMS" action
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Transform
URL: https://docs.awellhealth.com/docs/marketplace/transform
Transform is an extension on Awell's Marketplace with utility functions that allows you to transform data from one type to another.
Category: Data. Adds 12 actions to a care flow.
## Actions [#actions]
Transform adds these 12 actions to a care flow. Add one to a step, then fill in its inputs.
### Combine date and time [#combine-date-and-time]
Combine a reference date with a time string to create an ISO8601 datetime in UTC.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------- | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Reference date | `date` | Yes | The date you want to use as the base for the combined datetime. |
| Time string | `string` | Yes | The time in ISO format HH:mm:ss (e.g., "14:30:00" not "2PM") or full ISO8601 datetime with timezone (e.g., "2025-09-06T15:34:44+02:00"). |
Returns:
| Data point | Type |
| ------------------ | ------ |
| `combinedDateTime` | `date` |
Combines a reference date with a time string to create a complete datetime in UTC format. This action supports two input formats for the time string:
1. \*\*Simple time format (HH:mm:ss): Combines the reference date with the specified time in ISO format (e.g., "14:30:00" not "2PM")
2. Full datetime with timezone: Accepts ISO8601 datetime strings with timezone offsets and converts them to UTC
Examples:
Example 1 - Simple time combination:
```
Reference date: 2025-09-13
Time string: 17:45:00
Result: 2025-09-13T17:45:00Z
```
Example 2 - Reference date precedence with timezone-aware datetime:
```
Reference date: 2025-09-01
Time string: 2025-09-06T15:34:44+02:00
Result: 2025-09-01T13:34:44Z (reference date takes precedence, time converted from +02:00 to UTC)
```
Example 3 - Different timezone offset\*\*:
```
Reference date: 2025-09-06
Time string: 2025-09-06T10:30:00-05:00
Result: 2025-09-06T15:30:00Z (converted from -05:00 to UTC)
```
This action is particularly useful for scheduling systems like Bland API where you need to combine dates and times from different sources, or when working with timezone-aware scheduling data that needs to be normalized to UTC.
### Feet and inches to inches [#feet-and-inches-to-inches]
Transform feet and inches to inches
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------ | --------- | -------- | ----------- |
| Feet | `numeric` | Yes | — |
| Inches | `numeric` | Yes | — |
Returns:
| Data point | Type |
| ---------- | -------- |
| `inches` | `number` |
Converts a measurement in feet and inches to just inches.
### Generate dynamic URL [#generate-dynamic-url]
Generate a dynamic URL based on a URL template with a placeholder and a data point
| Input | Type | Required | Description |
| ------------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL template | `string` | Yes | The URL with the placeholder marked by double curly braces like (e.g. [https://your-url.com/\[placeholder](https://your-url.com/\[placeholder)]). |
| Value | `string` | No | The actual value to replace the placeholder with. When left blank, we will use the id of orchestrated care flow. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `url` | `string` |
Generate a dynamic URL based on a URL template with placeholder and a data point value.
```
urlTemplate https://your-url.com/{{placeholder}}
value hello-world
outcome https://your-url.com/hello-world
```
### HTML to PDF [#html-to-pdf]
Convert an HTML string to a PDF base64 string, to be uploaded or sent in a future action
| Input | Type | Required | Description |
| ----------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| HTML string | `string` | Yes | The HTML string to convert to a PDF. |
| Options | `json` | No | The options for the PDF. See [https://pptr.dev/api/puppeteer.pdfoptions](https://pptr.dev/api/puppeteer.pdfoptions) |
Returns:
| Data point | Type |
| ----------- | -------- |
| `base64Pdf` | `string` |
### List to comma separated text [#list-to-comma-separated-text]
Transform or parse list (string array) to a comma separated text.
| Input | Type | Required | Description |
| ----- | -------------- | -------- | --------------------------------------------------------- |
| List | `string_array` | Yes | The list you want to transform to a comma separated text. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `listText` | `string` |
### Parse date to unix timestamp [#parse-date-to-unix-timestamp]
Transform or parse a date to a unix timestamp.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----- | ------ | -------- | ----------------------------------------------- |
| Date | `date` | Yes | The date you want to parse to a unix timestamp. |
Returns:
| Data point | Type |
| --------------- | -------- |
| `unixTimestamp` | `string` |
Transform or parse a date to a unix timestamp.
### Parse number to text [#parse-number-to-text]
Transform or parse number to text (string).
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------ | --------- | -------- | ------------------------------------------------ |
| Number | `numeric` | Yes | The number you want to parse to a text (string). |
Returns:
| Data point | Type |
| ---------- | -------- |
| `text` | `string` |
Transform or parse a number to text (string).
### Parse number to text with dictionary [#parse-number-to-text-with-dictionary]
Transform or parse a number to text based on a dictionary.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ---------- | --------- | -------- | --------------------------------------------------------------------------------------------------------- |
| Number | `numeric` | Yes | The number you want to parse to a text (string) |
| Dictionary | `json` | Yes | A JSON dictionary where each string key represents a number and maps to a corresponding string/text value |
Returns:
| Data point | Type |
| ---------- | -------- |
| `text` | `string` |
Transform or parse a number to a string using a dictionary. Useful for when you have numeric data points but want to map them to strings based on a dictionary. When the action is called with a number that does not have a corresponding mapping in the provided dictionary, it simply returns the number itself as a string.
The dictionary should be structured in JSON format with string keys mapping to string values. Each key represents a number (as a string), and each value is the corresponding text representation.
**Example**:
```json
{
"0": "Male",
"1": "Female",
"2": "Not known",
// ... other number mappings ...
}
```
### Parse text to phone number [#parse-text-to-phone-number]
Transform or parse text to a phone number.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Text | `string` | Yes | The text you want to parse to a phone number |
| Country calling code | `numeric` | No | The country calling code you want to use for the phone number in case the phone number is not in E164 format. Enter the country calling code as a number. |
Returns:
| Data point | Type |
| ------------- | ----------- |
| `phoneNumber` | `telephone` |
### Parse text to number [#parse-text-to-number]
Transform or parse text (string) to a number. Will return NaN if the input data is not a number.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----- | -------- | -------- | --------------------------------------------------------------------------------------------- |
| Text | `string` | Yes | The text you want to parse to a number. Will return NaN if the input is not an actual number. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `number` | `number` |
Transform or parse text (string) to a number. Will return NaN if the input data is not an actual number.
### Parse unix timestamp to date [#parse-unix-timestamp-to-date]
Transform or parse a unix timestamp to a date.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------- | --------- | -------- | ----------------------------------------------- |
| Unix timestamp | `numeric` | Yes | The unix timestamp you want to parse to a date. |
Returns:
| Data point | Type |
| ---------- | ------ |
| `date` | `date` |
### Serialize JSON [#serialize-json]
Serialize a JSON object
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----- | ------ | -------- | ------------------------------------------- |
| JSON | `json` | Yes | The data object you would like to stringify |
Returns:
| Data point | Type |
| ---------------- | -------- |
| `serializedJson` | `string` |
## Setup and notes [#setup-and-notes]
Transform is an extension on Awell's Marketplace with utility functions that allows you to transform data from one type to another. These functions are particularly useful e.g. when system A works with IDs that are numbers but system B works with IDs that are strings.
#### Parse unix timestamp to unix date [#parse-unix-timestamp-to-unix-date]
Transform or parse a unix timestamp to a date.
## Changelog [#changelog]
### June 2024 [#june-2024]
* Added "Feet and inches to inches" action
### March 2024 [#march-2024]
* Added "Generate dynamic URL" action
### January 2024 [#january-2024]
* Added "Parse number to text with dictionary" action
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Twilio
URL: https://docs.awellhealth.com/docs/marketplace/twilio
Add robust messaging capabilities to your care flow.
Category: Communication. Adds 5 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| --------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Account SID | Yes | Find your Account SID at twilio.com/console. Stored as a secret. |
| Add opt-out language | No | On by default, set to "Off" if you don't want to add opt-out language to your text messages. |
| Auth token | Yes | Find your Auth Token at twilio.com/console. Stored as a secret. |
| Client ID | No | Find your Client ID at twilio.com/console. Stored as a secret. |
| "From" number | No | A Twilio phone number that you own in E.164 format which will be used to send text messages. If you are using a Messaging Service you can leave this field empty. |
| Language | No | The language you are sending text messages in. Possible options: fr, en (default), nl. |
| Messaging Service SID | No | The SID of the Messaging Service you want to associate with the Message. If you are not using a Messaging Service but a "from" number, then you can leave this field empty. |
| Opt-out language | No | The sentence that is appended at the end of your text messages that informs recipients of how they can opt out. If not specified, standard opt-out language is appended to your messages. |
| Region | No | Possible options: IE1, AU1, US1 - Default is IE1. |
## Actions [#actions]
Twilio adds these 5 actions to a care flow. Add one to a step, then fill in its inputs.
### Start a new execution of a pre-existing flow [#start-a-new-execution-of-a-pre-existing-flow]
Send a text message from a given telephone number to a recipient of your choice.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| "From" number | `string` | No | The phone number that will send the text messages, it must be a Twilio phone number that you own. When left blank, the "From" number from the extension settings will be used. |
| "To" phone number | `string` | Yes | The phone number you would like to send the text message to. |
| Flow ID | `string` | Yes | Flow ID (FWXXXXX...) |
| Parameters | `json` | Yes | Context to be passed into the flow (as an flat object) |
Returns:
| Data point | Type |
| ------------- | -------- |
| `executionId` | `string` |
### Get messages [#get-messages]
Get a list of text messages matching the given criteria. You can also filter the Messages by providing one of the allowed filters.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| --------------------- | --------- | -------- | ----------------------------------------------------------------- |
| "From" number | `string` | No | Search for text messages sent from a specific phone number |
| "To" number | `string` | No | Search for text messages sent to a specific phone number |
| Page Size | `numeric` | No | The number of results per page. Minimum is 1 and maximum is 1000. |
| Sent date after than | `date` | No | Search for messages sent after a given date |
| Sent date before than | `date` | No | Search for messages sent before a given date |
| Sent date | `date` | No | Search for messages sent on a given date |
Returns:
| Data point | Type |
| ------------------ | --------------- |
| `allMessages` | `strings_array` |
| `latestMessage` | `string` |
| `numberOfMessages` | `number` |
Get a list of text messages matching the given criteria. Only the last 50 messages are returned.
### Send SMS (with from number) [#send-sms-with-from-number]
Send a text message from a given telephone number to a recipient of your choice.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| "From" number | `string` | No | The phone number that will send the text messages, it must be a Twilio phone number that you own. When left blank, the "From" number from the extension settings will be used. |
| "To" phone number | `string` | Yes | The phone number you would like to send the text message to. |
| Message | `text` | Yes | The message you would like to send. |
Returns:
| Data point | Type |
| ------------ | -------- |
| `messageSid` | `string` |
Send an SMS with Twilio to a recipient of your liking.
### Send SMS during business hours [#send-sms-during-business-hours]
Send a text message during business hours from a given telephone number to a recipient of your choice.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| --------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Messaging Service SID | `string` | No | The SID of the Messaging Service you want to associate with the Message. If left blank, the SID specified in the settings will be used. |
| "To" phone number | `string` | Yes | The phone number you would like to send the text message to. |
| Message | `text` | Yes | The message you would like to send. |
| Timezone | `text` | No | Specify the IANA time zone to determine if the current time (in UTC) falls within business hours in your timezone. The default time zone used for this check is UTC. |
Returns:
| Data point | Type |
| ------------ | --------- |
| `messageSid` | `string` |
| `scheduled` | `boolean` |
| `sendAt` | `date` |
### Send SMS (with Messaging Service) [#send-sms-with-messaging-service]
Send a text message from a Messaging Service to a recipient of your choice.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| --------------------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Messaging Service SID | `string` | No | The SID of the Messaging Service you want to associate with the Message. If left blank, the SID specified in the settings will be used. |
| "To" phone number | `string` | Yes | The phone number you would like to send the text message to. |
| Message | `text` | Yes | The message you would like to send. |
Returns:
| Data point | Type |
| ------------ | -------- |
| `messageSid` | `string` |
## Setup and notes [#setup-and-notes]
Twilio is a customer engagement platform used by hundreds of thousands of businesses and more than ten million developers worldwide to build unique, personalized experiences for their customers.
They are known for democratizing channels like voice, text, chat, video, and email through APIs, making it easy for every organization to build meaningful interactions with customers on the channels they prefer.
### Extension settings [#extension-settings]
In order to set up this extension, you will need:
1. A Twilio API key or auth token which can be found in the Twilio console.
2. Your account SID which can be found in the Twilio console.
3. A phone number to send the message from. This must be a Twilio phone number that you own.
### User consent [#user-consent]
The extension has some built-in mechanisms to enforce compliance with [Twilio's messaging policy](https://www.twilio.com/en-us/legal/messaging-policy).
#### Opt-out [#opt-out]
By default, every text message will be appended with standard opt-out language ("Reply STOP to unsubscribe."). You can specify custom opt-out language within the settings of the extension but make sure the opt-out keywords used are supported. STOP, UNSTOP, UNSUBSCRIBE or CANCEL are the default opt-out keywords supported but Twilio also supports defining custom stop keywords.
If you don't want to append opt-out language to your text messages, set the "Add opt-out language" setting to "Off".
For more information, please visit the Twilio docs.
#### Sending text messages to recipients that opted out [#sending-text-messages-to-recipients-that-opted-out]
If you attempt to send a text message to a recipient who has opted out, the message will fail to be delivered and the action will be marked as failed. This is the default behavior of Twilio's API, which prevents sending texts to anyone who has chosen to opt out.
### Send SMS during working hours [#send-sms-during-working-hours]
This action allows for the scheduling of SMS messages to be sent within the "daily operational hours" of 9 AM to 5 PM. It ensures that text messages are dispatched at appropriate times during the day, avoiding early morning or late-night disturbances to recipients.
**Here's how it works**:
* If the action is activate during business hours (9 AM to 5 PM), the SMS is sent immediately.
* If activated before 9 AM, the SMS is scheduled to be sent at 9 AM on the same day.
* If activated after 5 PM, the SMS is scheduled to be sent at 9 AM the following day.
This setup ensures that all messages reach your respondents during reasonable daytime hours, enhancing the likelihood of a timely and considerate communication. It's important to mention that messages will still be dispatched over the weekend, but they will adhere to the "business hours" schedule of 9 AM to 5 PM.
Note that scheduling messages with Twilio is only possible if you send text messages using a MessagingServiceSid.
## Changelog [#changelog]
### v2 2024-02-22 [#v2-2024-02-22]
1. Add capability to search for messages using all the allowed filters provided by Twilio API. Check here: [https://www.twilio.com/docs/messaging/api/message-resource#read-multiple-message-resources](https://www.twilio.com/docs/messaging/api/message-resource#read-multiple-message-resources)
### v2 2023-06-23 [#v2-2023-06-23]
Full description: [https://github.com/awell-health/awell-extensions/issues/157](https://github.com/awell-health/awell-extensions/issues/157)
1. "Send SMS" action
1. Change label from "Send SMS" to "Send SMS (with from number)"
2. Throw error when "From" number in both settings and in fields is not provided
2. Add new action "Send SMS (with Messaging Service)"
### v2 [#v2]
Compared to v1 (pre-beta release), the extension only has one custom action "Send SMS" instead of two. The Custom Action allows for:
1. Sending a text message to a recipient (phone number) stored in a data point, including patient profile data points.
2. Sending a text message to a fixed recipient (phone number).
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# WestFax
URL: https://docs.awellhealth.com/docs/marketplace/westfax
Send faxes securely and in compliance with HIPAA regulations using WestFax.
Category: Communication. Adds 3 actions and 1 webhook to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| ---------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| URL to facesheet (PDF) | No | An optional URL for a face sheet document (in PDF format) which will be attached at the beginning of your actual message or document for faxes. This face sheet will only be included if it has been enabled at the action level. Stored as a secret. |
| Password | Yes | Your WestFax password Stored as a secret. |
| Product ID | No | Your WestFax product ID. Required for some functionality in the extension. |
| Username | Yes | Your WestFax username |
## Actions [#actions]
WestFax adds these 3 actions to a care flow. Add one to a step, then fill in its inputs.
### Get fax document [#get-fax-document]
Get fax document with WestFax.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------ | -------- | -------- | ---------------------------------------- |
| Fax Id | `string` | Yes | Sometimes also referred to as the job ID |
Returns:
| Data point | Type |
| ----------- | -------- |
| `date` | `date` |
| `direction` | `string` |
| `format` | `string` |
| `pageCount` | `number` |
| `status` | `string` |
Retrieve a fax document using a fax ID, sometimes also referred to as a job ID.
### Get fax document with OCR [#get-fax-document-with-ocr]
Get fax document with WestFax and extract structured data with OCR
| Input | Type | Required | Description |
| -------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Fax Id | `string` | Yes | Sometimes also referred to as the job ID |
| OCR Provider | `string` | Yes | The provider or service used for OCR One of: Awell (Landing.ai). |
| OCR Provider API Key | `string` | Yes | We advise using a obfuscated constant |
| Fields schema | `json` | No | Defines the structure of the fields to extract from the document. Providing a schema is optional but strongly recommended, as it significantly improves the accuracy of the extracted data. |
Returns:
| Data point | Type |
| ---------------------------- | -------- |
| `chunks` | `json` |
| `date` | `date` |
| `direction` | `string` |
| `extractedDataBasedOnSchema` | `json` |
| `extractedMetadata` | `json` |
| `format` | `string` |
| `markdown` | `string` |
| `pageCount` | `number` |
| `status` | `string` |
### Send fax [#send-fax]
Send fax with WestFax.
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| -------------- | --------- | -------- | ------------------------------------------------------------ |
| Product Id | `string` | Yes | E.g. 12345678-1234-1234-1234-123456789abc |
| Feedback Email | `string` | No | Send a report to this address when the fax is sent |
| Number | `string` | Yes | Destination fax number |
| Add face sheet | `boolean` | No | Add cover sheet that precedes the actual message or document |
| Fax content | `html` | No | Content of the fax |
Returns:
| Data point | Type |
| ---------- | -------- |
| `faxId` | `string` |
## Webhooks [#webhooks]
WestFax can send this event into Awell, where each one can start a care flow or move a patient along. Point the webhook at the URL Studio shows you when you enable it.
### `faxReceived` [#faxreceived]
Payload:
| Data point | Type |
| ---------- | -------- |
| `dir` | `string` |
| `jobId` | `string` |
| `prod` | `string` |
## Setup and notes [#setup-and-notes]
[WestFax](https://westfax.com/) is a cloud-based faxing service that offers a variety of features, including:
* Secure faxing: WestFax uses end-to-end encryption to protect your documents from unauthorized access.
* HIPAA compliance: WestFax is HIPAA compliant, so you can be sure that your medical records are safe.
* Integration with other applications: WestFax can be integrated with your existing email, CRM, and other applications.
* Mobile app: You can send and receive faxes from your mobile device with the WestFax mobile app.
* Paperless faxing: WestFax can store your faxes in the cloud, so you can access them from anywhere.
### WestFax x Awell [#westfax-x-awell]
This extension allows you to let a stakeholder (eg: a patient) send a fax as part of a care flow.
### Extension settings [#extension-settings]
In order to set up this extension, **you will need to provide a WestFax Username and Password**. You will need as well to provide the ProductId when setting up the action - check how [here](https://westfax.com/how-to-get-productid/).
### Webhooks [#webhooks-1]
#### Fax received [#fax-received]
Trigger a care flow when a fax is received. Currently only works together with [https://github.com/awell-health/westfax-webhook-handler](https://github.com/awell-health/westfax-webhook-handler)
## Changelog [#changelog]
### February 2024 [#february-2024]
* Initial action to send an fax to an email
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Workramp
URL: https://docs.awellhealth.com/docs/marketplace/workramp
An LMS platform. The system identifier used is [https://www.workramp.com/](https://www.workramp.com/)
Category: Content & Files. Adds 1 webhook to a care flow.
## Webhooks [#webhooks]
Workramp can send this event into Awell, where each one can start a care flow or move a patient along. Point the webhook at the URL Studio shows you when you enable it.
### `eventWebhook` [#eventwebhook]
Payload:
| Data point | Type |
| ----------- | -------- |
| `eventType` | `string` |
## Setup and notes [#setup-and-notes]
Workramp is a learning management platform helping to upskill employees and educate partners and customers.
### Extension settings [#extension-settings]
There are no extension settings (e.g. API keys) to set. Simply enable the extension and then utilize the EventPayload webhook to subscribe to events.
### Webhooks [#webhooks-1]
#### EventPayload [#eventpayload]
Listens to an event and starts a care flow, using the `user.id` field as a unique patient identifier.
To learn more about webhooks, visit [their developer site](https://developers.workramp.com/reference/introduction-to-webhooks).
## Changelog [#changelog]
### 2024-08-28 [#2024-08-28]
Created the extension.
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Zendesk Support
URL: https://docs.awellhealth.com/docs/marketplace/zendesk
Zendesk Support is a customer service platform that provides ticketing, knowledge base, and customer communication tools.
Category: Customer Support. Adds 3 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| ----------------- | -------- | ---------------------------------------------------------------- |
| API Token | Yes | Your Zendesk API token Stored as a secret. |
| Zendesk Subdomain | Yes | Your Zendesk subdomain (e.g., "company" for company.zendesk.com) |
| User Email | Yes | Your Zendesk user email address |
## Actions [#actions]
Zendesk Support adds these 3 actions to a care flow. Add one to a step, then fill in its inputs.
### Create ticket [#create-ticket]
Creates a new support ticket in Zendesk
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ----------- | --------- | -------- | ------------------------------------------------------------------------------------ |
| Subject | `string` | Yes | The subject line of the ticket. |
| Comment | `string` | Yes | The initial comment/description for the ticket. |
| Group ID | `numeric` | No | The ID of the group to assign the ticket to. |
| Priority | `string` | No | The priority level: urgent, high, normal, or low. One of: urgent, high, normal, low. |
| External ID | `string` | No | An external identifier to link this ticket to your system. |
| Tag | `string` | No | A tag to add to the ticket. |
Returns:
| Data point | Type |
| ----------- | -------- |
| `ticketId` | `number` |
| `ticketUrl` | `string` |
Creates a new support ticket in Zendesk with the specified details.
\*\*Required fields:
* Subject: The subject line of the ticket
* Comment: The initial comment/description for the ticket
Optional fields:
* Group ID: The ID of the group to assign the ticket to
* Priority: The priority level (urgent, high, normal, or low)
* External ID: An external identifier to link this ticket to your system
* Tag: A tag to add to the ticket
Returns\*\*:
* Ticket ID: The unique identifier of the created ticket
* Ticket URL: Direct link to the ticket in Zendesk agent interface
### Delete ticket [#delete-ticket]
Deletes a support ticket in Zendesk
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| --------- | --------- | -------- | ------------------------------- |
| Ticket ID | `numeric` | Yes | The ID of the ticket to delete. |
Deletes a support ticket in Zendesk. This action permanently removes the ticket from your Zendesk instance.
\*\*Required fields:
* Ticket ID: The unique identifier of the ticket to delete
Note\*\*: This action cannot be undone. Deleted tickets are permanently removed from Zendesk.
### Update ticket [#update-ticket]
Updates an existing support ticket in Zendesk
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| --------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------- |
| Ticket ID | `numeric` | Yes | The ID of the ticket to update. |
| Comment | `string` | No | Add a comment to the ticket. |
| Priority | `string` | No | The priority level: urgent, high, normal, or low. One of: urgent, high, normal, low. |
| Status | `string` | No | The status: new, open, pending, hold, solved, or closed. One of: new, open, pending, hold, solved, closed. |
## Setup and notes [#setup-and-notes]
Zendesk Support is a customer service platform that provides ticketing, knowledge base, and customer communication tools.
### Extension settings [#extension-settings]
To set up this extension, you will need to provide the following:
1. \*\*Zendesk Subdomain: your Zendesk subdomain (e.g., "company" for company.zendesk.com)
2. User Email: your Zendesk user email address
3. API Token\*\*: your Zendesk API token
You can generate an API token in your Zendesk admin settings under API > Zendesk API.
## Changelog [#changelog]
All notable changes to this project will be documented in this file.
### \[1.0.0] - 2025-01-10 [#100---2025-01-10]
#### Added [#added]
* Initial release of Zendesk Support extension
* Create Ticket action with OAuth authentication
* Support for all major ticket fields: subject, comment, group\_id, priority, external\_id, tags
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Zendesk Sell
URL: https://docs.awellhealth.com/docs/marketplace/zendesksell
Zendesk Sell is a customer service and support platform that provides a suite of tools and software for businesses to manage their customer interactions.
Category: Customer Support. Adds 2 actions to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Sales API token | Yes | Visit Zendesk Sales CRM dashboard and go to Settings > Integration > OAuth to enable and create an API token Stored as a secret. |
## Actions [#actions]
Zendesk Sell adds these 2 actions to a care flow. Add one to a step, then fill in its inputs.
### Complete a task [#complete-a-task]
Completes a task in Zendesk
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------- | --------- | -------- | ----------------------------------------- |
| Task ID | `numeric` | Yes | The ID of the task to complete in Zendesk |
Marks a task as completed.
### Create task [#create-task]
Creates a new task in Zendesk
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| ------------- | --------- | -------- | ------------------------------------------------------------------------------------------------ |
| Content | `string` | Yes | Content of the task. |
| Due date | `date` | No | — |
| Owner ID | `numeric` | No | Unique identifier of the user the task is assigned to, defaults to the user who created the task |
| Resource type | `string` | No | Name of the resource type the task is attached to. Possible values: "lead", "contact", "deal". |
| Resource ID | `numeric` | No | Unique identifier of the resource the task is attached to. |
| Completed? | `boolean` | No | Indicator of whether the task is completed or not. |
| Remind at | `date` | No | The date at which Zendesk should send you a reminder about the task. |
Returns:
| Data point | Type |
| ---------- | -------- |
| `taskId` | `number` |
Creates a new task. You can create either a floating task or create a related task and associate it with one of the resource types: Leads, Contacts, Deals.
## Setup and notes [#setup-and-notes]
Zendesk Sell is a customer service and support platform that provides a suite of tools and software for businesses to manage their customer interactions. It offers a range of customer service solutions, including help desk ticketing systems, customer support and engagement, and self-service options. Zendesk is designed to help companies streamline their customer support processes, improve communication with their customers, and resolve issues more efficiently.
### Extension settings [#extension-settings]
In order to set up this extension, you will to authenticate with the Sell API and need an API token. You can visit Zendesk Sales CRM dashboard and go to **Settings > Integration > OAuth** to enable and create an API token. Read more about how to get an access token for the Sell API [here](https://developer.zendesk.com/documentation/sales-crm/first-call/).
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
# Zoom
URL: https://docs.awellhealth.com/docs/marketplace/zoom
Zoom is a communications platform that allows users to connect with video, audio, phone, and chat.
Category: Communication. Adds 1 action to a care flow.
## What to configure [#what-to-configure]
Set these once, on the extension in Awell Studio. An action fails at run time if a
required setting is missing.
| Setting | Required | Notes |
| ------------- | -------- | ------------------------------------------------------------------------------- |
| Account ID | Yes | The account ID of your Zoom account. |
| Client ID | Yes | The client ID issued by the Server-to-Server OAuth app. |
| Client Secret | Yes | The client secret issued by the Server-to-Server OAuth app. Stored as a secret. |
## Actions [#actions]
Zoom adds this action to a care flow. Add one to a step, then fill in its inputs.
### Send SMS [#send-sms]
Send an SMS
This action can be previewed in Studio before you publish.
| Input | Type | Required | Description |
| --------------------- | -------- | -------- | ---------------------------------------------------------------------------------------------- |
| Contact center number | `string` | Yes | This must be an SMS capable phone number allocated to Zoom Contact Center within your account. |
| To | `string` | Yes | The phone number of the person receiving the SMS. |
| Body | `text` | Yes | The content that needs to be sent as an SMS. Maximum length is 500 characters. |
Returns:
| Data point | Type |
| ----------- | --------- |
| `code` | `string` |
| `messageId` | `string` |
| `success` | `boolean` |
Send an SMS to a recipient.
Ensure your Server-to-Server OAuth app has the following scopes set:
* Scopes: `contact_center_sms:write:admin`
* Granular Scopes: `contact_center:write:sms:admin`
## Setup and notes [#setup-and-notes]
Zoom is a communications platform that allows users to connect with video, audio, phone, and chat.
### Extension settings [#extension-settings]
To set up this extension, you will need to provide the following:
1. \*\*Account ID: your Zoom account ID, found on the Server to Server app build page.
2. Client ID: the client ID of the OAuth app you created in Zoom
3. Client secret: the client secret of the OAuth app you created in Zoom
You'll have to set up a [Server-to-Server OAuth app](https://developers.zoom.us/docs/internal-apps/create/) in Zoom to provision a client ID and secret.
##### Result codes [#result-codes]
On completion, the action returns a `code` data point indicating the outcome:
* SUCCESS: SMS was sent successfully.
* INVALID\_CONSUMER\_NUMBER\_FORMAT: Invalid consumer number; E.164 format is required.
* CONTACT\_CENTER\_NUMBER\_USED: Zoom Contact Center numbers cannot be used as consumer numbers.
* CONSUMER\_NOT\_OPTED\_IN: The consumer number you have messaged has not opted in.
* CONSUMER\_OPTED\_OUT: The consumer number has opted out of receiving SMS from this Zoom Contact Center number.
* CONSUMER\_BLOCK\_LISTED: The consumer number is block-listed by your Zoom Contact Center administrator.
* INTERNATIONAL\_SMS\_NOT\_SUPPORTED: International messaging is not supported on this account.
* BODY\_TOO\_LONG\*\*: Validation error — body exceeds 500 characters.
## Changelog [#changelog]
## CHANGELOG [#changelog-1]
## Where this page comes from [#where-this-page-comes-from]
The settings, actions, inputs, outputs and webhooks above are generated from the
extension's own code, at `@awell-health/awell-extensions` v2.1.159. They match what the
platform actually does rather than a description of it.
Field-level detail also appears in Awell Studio when you configure the action.
Something wrong or missing? Email [support@awellhealth.com](mailto:support@awellhealth.com).
---
# API Reference
# API reference
URL: https://docs.awellhealth.com/api-reference
The Orchestration API is how your systems read and write care-orchestration data (patients,
care flows, activities, and more) over a single GraphQL endpoint.
Start with the guides, then use the operation reference for the domain you need.
## Guides [#guides]
* **[Getting started](/api-reference/guides/getting-started)** — make your first authenticated request.
* **[Authentication](/api-reference/guides/authentication)** — obtain and send an API key.
* **[Environments](/api-reference/guides/environments)** — sandbox, production, and regions.
* **[Pagination](/api-reference/guides/pagination)** — page and sort list results.
* **[Errors](/api-reference/guides/errors)** — read the `code` / `success` envelope and GraphQL errors.
* **[Rate limits](/api-reference/guides/rate-limits)** — limits and backoff.
* **[Mutations](/api-reference/guides/mutations)** — an orientation to the write API.
* **[Webhooks](/api-reference/guides/webhooks)** — receive, inspect, and retry webhook calls.
## Reference [#reference]
Operations are grouped by domain:
* [Patients](/api-reference/reference/patients)
* [Care flows](/api-reference/reference/care-flows)
* [Activities](/api-reference/reference/activities)
* [Activity types](/api-reference/reference/activity-types)
* [Tracks](/api-reference/reference/tracks)
* [Stakeholders](/api-reference/reference/stakeholders)
* [Timers](/api-reference/reference/timers)
* [Hosted sessions & pages](/api-reference/reference/hosted-sessions)
* [API calls & webhooks](/api-reference/reference/api-calls-and-webhooks)
* [Subscriptions](/api-reference/reference/subscriptions)
* [Tenant](/api-reference/reference/tenant)
# Authentication
URL: https://docs.awellhealth.com/api-reference/guides/authentication
Every request to the Orchestration API must be authenticated. This page explains how to obtain
a key and how to send it. It is the single source of truth for authentication; other pages
link here rather than repeating it.
## Obtain an API key [#obtain-an-api-key]
An administrator creates API keys in the CareOps portal — you don't need to ask Awell for one.
1. Open **Integrations** from the bottom of the left navigation.
2. Go to the **API keys** tab.
3. Click **Create API key**.
**The key is shown once, when you create it.** Copy it straight into your secrets store — you
cannot retrieve it later, and the list above shows only its name and when it was created. If you
lose it, create a new key and delete the old one.
Keys are **per environment**, so a key created in Sandbox does not work against production. See
[Environments](/api-reference/guides/environments).
Keys do not expire, and there is no rotation schedule to keep up with.
## Send the key [#send-the-key]
Put the key in an `apiKey` header on every request. The value is the key itself — there is no
`Bearer` prefix and no other header to set. The endpoint you send it to is what selects the
environment, so nothing in the request names one.
```bash
curl https://api.sandbox.awellhealth.com/orchestration/m2m/graphql \
-H 'Content-Type: application/json' \
-H 'apiKey: YOUR_API_KEY' \
-d '{"query": "query { patients(pagination: {count: 1, offset: 0}) { patients { id } } }"}'
```
### Send it from a backend, never a browser [#send-it-from-a-backend-never-a-browser]
The Orchestration API is a **machine-to-machine API**. A key authenticates as your whole tenant, so
anyone holding one can create patients, list every care flow, or start care flows on your behalf.
That rules out calling this API from front-end code. Anything in a browser or mobile app ships the
key to whoever is looking. Requests belong in a backend service that can hold the key without
exposing it.
## Keep keys safe [#keep-keys-safe]
* Give a key only to the people and services that need it.
* Keep keys out of source control. Store them in environment variables or a secrets manager.
* Replace a key if you suspect it has been exposed: create a new one, move your callers over, then
delete the old one. There is no scheduled rotation, so this is the only time you need to.
## Related [#related]
* [Getting started](/api-reference/guides/getting-started)
* [Environments](/api-reference/guides/environments)
# Domain model
URL: https://docs.awellhealth.com/api-reference/guides/domain-model
Every interaction with Awell Orchestration goes through the API. This page is the mental model the rest
of the reference assumes. **Read it before the activity queries**, which are hard to use without it.
## A typical lifecycle [#a-typical-lifecycle]
1. **Create a patient.** Nothing else can happen first, because every care flow belongs to a patient.
See [Patients](/api-reference/reference/patients).
2. **Start a care flow** for that patient. See [Start a care flow](/api-reference/guides/start-a-care-flow).
3. **Get the pending activities** for that care flow. See
[Query activities](/api-reference/guides/query-activities).
4. **Request the details** of the next activity, for example a form's questions.
5. **Complete the activity**, for example by submitting a form response. See
[Work with forms](/api-reference/guides/work-with-forms).
Then repeat from step 3: an integration is a loop over activities rather than a linear script.
## Definitions and instances [#definitions-and-instances]
The API separates designs from instances:
* A **care flow definition** is the template designed in Studio.
* A **care flow** is one patient's instance of it.
* A **data point definition** is a field in the design; a **data point** is one patient's value.
Query definitions to ask about your design; query care flows and data points to ask about patients. See
[Versions and releases](/api-reference/guides/versions-and-releases) for why a definition's version
matters.
## Activities are the unit of work [#activities-are-the-unit-of-work]
An **activity** is one thing to be done or that happened. Activities cover more than user tasks: track
activations, step completions and reminders are activities too, so the activity list is the full history
of a care flow rather than a to-do list.
Consequences for an integration:
* **Expect system activities** you didn't ask for, and filter rather than assuming everything is a task.
* **Expect repetition.** A looping track produces the same step's activity many times for one patient.
## Why GraphQL [#why-graphql]
Awell chose GraphQL as the primary programmatic interface:
* **You query only what you need**, which keeps responses small.
* **Types and schemas** mean client libraries can consume the API without manual parsing.
* **Client independence**: you can change what you request without waiting for a new endpoint.
## Next steps [#next-steps]
**Next:** [Start a care flow](/api-reference/guides/start-a-care-flow).
# E.164 phone numbers
URL: https://docs.awellhealth.com/api-reference/guides/e164-phone-numbers
Every phone number written to Awell has to be in E.164 format: a `+`, a country calling code, and
the national number, with nothing else in between. `+16175551212` is accepted; `(617) 555-1212` is
not. This page gives the rules the API applies and how to convert numbers that arrive in another
shape.
The patient profile fields `phone` (landline) and `mobile_phone` both take an E.164 string. See
[Patients](/api-reference/reference/patients) for the operations that write them.
## E.164 gives a number one written form everywhere [#e164-gives-a-number-one-written-form-everywhere]
[E.164](https://en.wikipedia.org/wiki/E.164) is an international telephone numbering plan for the
worldwide public switched telephone network and some other data networks. It defines a general
format for international telephone numbers that ensures each device on the network has a globally
unique number, so calls and text messages can be routed to individual phones in different
countries.
ISO 8601 does the same job for dates and times. E.164 is the equivalent standard for telephone
numbers, and Awell requires it for the same reason: one unambiguous written form per value keeps
data interoperable and consistent across every system a care flow touches. `06 17 55 51 21` is a
French mobile number written the way someone would type it locally, and it identifies nobody until
a reader supplies the country. `+33617555121` is the same number, and it needs no context.
The format is fixed: a leading `+`, then a country calling code of one to three digits, then the
national subscriber number. Everything after the `+` is 15 digits at most.
## Validation rules [#validation-rules]
A phone number passed to the API is subjected to the following validation rules:
1. It contains no whitespace.
2. It starts with a `+`.
3. Aside from the leading `+`, it contains only numbers ranging from 0 to 9.
4. It is a possible phone number: 15 digits or fewer, with a correct country code.
| Value | Verdict |
| ------------------- | ---------------------------------------------------- |
| `+16175551212` | Accepted |
| `16175551212` | No leading `+` |
| `+1 617 555 1212` | Contains whitespace |
| `+1 (617) 555-1212` | Contains whitespace and characters other than 0 to 9 |
| `+1617555121212345` | 16 digits, so not a possible number |
A conforming value in a create-patient input:
```json
{
"input": {
"mobile_phone": "+16175551212",
"phone": "+16175551212"
}
}
```
A value that fails these rules is rejected rather than stored. See
[Errors](/api-reference/guides/errors) for reading the response.
## Awell checks that a number is possible, not that it is real [#awell-checks-that-a-number-is-possible-not-that-it-is-real]
The check is whether a number is technically possible according to the E.164 format. It is not a
check that the number is an actual, working phone number.
`+16175550100` can satisfy every rule above and still be unassigned, out of service, or belong to
someone other than the patient. Nothing in the format proves a message will arrive, so treat a
successful write as a format guarantee only.
## Convert to E.164 at the integration boundary [#convert-to-e164-at-the-integration-boundary]
Source systems frequently store numbers the way a person typed them: a national format, sometimes
with a separate country column, often with spaces, parentheses, hyphens, or a leading trunk `0`.
Convert those into E.164 before the API call rather than sending them through as they are.
* **Combine the number with its country.** E.164 has no meaning without a country calling code.
Phone libraries accept a default country alongside a national number and produce the E.164 string
from both, which is also how a national trunk prefix such as the leading `0` used across much of
Europe gets dropped correctly instead of stripped by hand.
* **Store the result, not just the input.** Normalizing once on write and keeping the E.164 string
in the source system avoids every later call re-deriving it, and makes a bad number visible in
one place.
* **Send no number rather than a guessed one.** A national number with no reliable country context
cannot be converted safely: eight local digits identify a different subscriber in every country.
In healthcare, a number normalized to the wrong country sends care instructions to a stranger.
Leave the field empty, fix the record at source, and send it once it is right.
* **Validate before the call, not after.** Running the same rules in the integration turns a
rejected mutation into a data-quality item on a system that can fix it.
## Libraries that format and validate numbers [#libraries-that-format-and-validate-numbers]
* [libphonenumber-js](https://www.npmjs.com/package/libphonenumber-js#using-phone-number-validation-feature),
for formatting and validating numbers, including conversion to E.164 from a national number plus
a country.
* [react-international-phone](https://www.npmjs.com/package/react-international-phone), an
international phone input component for React, for collecting a number in E.164 form at the point
of entry.
## Related [#related]
* [Manage patients](/api-reference/guides/manage-patients), which covers the rest of the create and
update behavior.
* [Patients](/api-reference/reference/patients) for the operations and fields.
* [Errors](/api-reference/guides/errors) for how the API reports a rejected write.
* [Patient identifiers](/docs/connect-systems/patient-identifiers), the other format convention an
integration has to get right before sending patient data.
* [Patient Demographics Query](/docs/connect-systems/patient-demographics-query), which returns
`phone` and `mobile_phone` as E.164 strings.
# Environments
URL: https://docs.awellhealth.com/api-reference/guides/environments
Awell runs the Orchestration API in more than one environment and region. Use Sandbox to build and
test, and a production environment for live care. Send each request to the endpoint for the
environment and region your data lives in.
## Environments [#environments]
There are two: **Sandbox** and **Production**. Sandbox is for exploring, testing and building your
integration. Production runs live care and is available once your implementation goes live.
Production is deployed in three regions — **EU**, **UK** and **US** — and your data lives in exactly
one of them. Sandbox is a single environment.
## API endpoints [#api-endpoints]
Each environment and region has its own GraphQL endpoint. Send every request to the one your data
lives in.
| Environment | Endpoint |
| --------------- | --------------------------------------------------------------- |
| Sandbox | `https://api.sandbox.awellhealth.com/orchestration/m2m/graphql` |
| Production — EU | `https://api.awellhealth.com/orchestration/m2m/graphql` |
| Production — US | `https://api.us.awellhealth.com/orchestration/m2m/graphql` |
| Production — UK | `https://api.uk.awellhealth.com/orchestration/m2m/graphql` |
## Where to get a key [#where-to-get-a-key]
API keys are created in the CareOps portal, which is a separate address per environment:
| Environment | CareOps portal |
| --------------- | ------------------------------------------ |
| Sandbox | `https://careops.sandbox.awellhealth.com/` |
| Production — EU | `https://careops.awellhealth.com/` |
| Production — UK | `https://careops.uk.awellhealth.com/` |
| Production — US | `https://careops.us.awellhealth.com/` |
These are portal addresses for people to sign in to — not API endpoints. See
[Authentication](/api-reference/guides/authentication) for creating a key.
**An API key belongs to one environment.** A Sandbox key does not authenticate against production,
and a key from one production region does not work in another. Moving an integration from Sandbox to
production means a new key as well as a new endpoint.
## Related [#related]
* [Authentication](/api-reference/guides/authentication)
* [Getting started](/api-reference/guides/getting-started)
# Errors
URL: https://docs.awellhealth.com/api-reference/guides/errors
The Orchestration API reports outcomes through a `code` and `success` envelope on every response
payload, and through standard GraphQL `errors` for request-level failures. Check both.
**Start here: a failed request usually still returns HTTP `200`.** Being GraphQL, this API reports
problems in the response body, not in the status code — an invalid field name and a record that
does not exist both come back `200 OK`. Code that branches on the HTTP status alone will treat those
as successes.
## The response envelope [#the-response-envelope]
Every operation returns a payload that includes two fields:
| Field | Type | Description |
| --------- | ---------- | ------------------------------------- |
| `success` | `Boolean!` | Whether the operation succeeded. |
| `code` | `String!` | A status code describing the outcome. |
**`success` is the field to branch on.** It is on every payload object, and for a mutation it is the
only reliable way to know whether the write happened. `code` accompanies it as a string describing
the outcome; Awell does not publish an enumerated list of its values, so treat it as something to
log and read when diagnosing rather than something to switch on in code.
## GraphQL errors [#graphql-errors]
For request-level failures such as malformed queries, authentication failures, or server errors,
the response includes a top-level `errors` array, as defined by the
[GraphQL specification](https://spec.graphql.org/). A response can contain both `data` and
`errors`.
```json
{
"data": null,
"errors": [
{
"message": "...",
"path": ["patient"]
}
]
}
```
Awell does not publish a set of machine-readable codes on these errors, so match on the shape of the
response and the `message`, not on a code that may not be there.
## What the HTTP status does tell you [#what-the-http-status-does-tell-you]
| Status | What it means |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200` | The request reached the API and was executed. It may still have failed — read `errors` and `success`. |
| `4xx` | Uncommon here, and usually your network or connection rather than your query. GraphQL reports query problems inside a `200`. The exception is a request sent with an `Idempotency-Key` header, which is refused with `400`, `409`, or `422` when the key is malformed, still in flight, or reused. See [Idempotent requests](/api-reference/guides/idempotency). |
| `5xx` | An error inside Awell. Retry, and contact [support](mailto:support@awellhealth.com) if it persists. |
`5xx` is the only status worth an automatic retry. Retrying a `200` that contained an error just
repeats the same failure.
## Related [#related]
* [Authentication](/api-reference/guides/authentication)
* [Rate limits](/api-reference/guides/rate-limits)
* [Idempotent requests](/api-reference/guides/idempotency)
# Getting started
URL: https://docs.awellhealth.com/api-reference/guides/getting-started
The Orchestration API is a single GraphQL endpoint your systems call to read and write
care-orchestration data: patients, care flows, activities, and more. This page walks you
through your first request end to end.
## Before you start [#before-you-start]
You need an API key. See [Authentication](/api-reference/guides/authentication) to obtain one
and learn how to send it.
## 1. Find the endpoint [#1-find-the-endpoint]
One GraphQL endpoint per environment and region. If you are building, that is Sandbox:
```
https://api.sandbox.awellhealth.com/orchestration/m2m/graphql
```
Production is regional — EU, US or UK. See
[Environments](/api-reference/guides/environments) for all four addresses and for which one your
data lives in.
## 2. Send an authenticated request [#2-send-an-authenticated-request]
`POST` to that endpoint with your key in an `apiKey` header and a JSON body holding `query`
and, if the query takes any, `variables`:
```bash
curl https://api.sandbox.awellhealth.com/orchestration/m2m/graphql \
-H 'Content-Type: application/json' \
-H 'apiKey: YOUR_API_KEY' \
-d '{"query": "query { patients(pagination: {count: 1, offset: 0}) { patients { id } } }"}'
```
The value is the key itself — no `Bearer` prefix. See
[Authentication](/api-reference/guides/authentication) for where keys come from and why they belong
in a backend service.
## 3. Run your first query [#3-run-your-first-query]
Retrieve a single patient by Awell patient ID:
```graphql
query GetPatient($id: String!) {
patient(id: $id) {
patient {
id
profile {
first_name
last_name
email
}
}
}
}
```
Variables:
```json
{
"id": ""
}
```
Every response carries a `code` and a `success` boolean alongside its data. See
[Errors](/api-reference/guides/errors) for how to read them.
## Next steps [#next-steps]
* Browse the full operation catalog under **Reference** (for example,
[Patients](/api-reference/reference/patients) and [Care flows](/api-reference/reference/care-flows)).
* Learn how list queries page through results in [Pagination](/api-reference/guides/pagination).
# Idempotent requests
URL: https://docs.awellhealth.com/api-reference/guides/idempotency
A client that retries a mutation after a timeout cannot tell whether the first attempt ran. Sending
an `Idempotency-Key` header on the mutation lets the Orchestration API tell it: a retry of a request
that already completed returns the original response, and the mutation does not run a second time.
The same header works on [extension webhooks](#extension-webhooks): a system that delivers an event
to an Awell extension webhook URL can retry the delivery without the event being processed twice.
The header is optional. Without it, every request executes and nothing on this page applies.
The behavior follows the IETF HTTPAPI draft
[The Idempotency-Key HTTP Header Field](https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-idempotency-key-header):
the header name, the quoted value, the status codes, and the wording of the errors. Where GraphQL
forces a different shape, this page says so.
## Send the header [#send-the-header]
Add `Idempotency-Key` to a mutation request. The value is an RFC 8941 String: double-quoted, with
`\"` and `\\` as the only escapes. Inside the quotes, use 1 to 255 printable ASCII characters with
no whitespace. A UUID generated per logical request is the recommended value.
```bash
curl https://api.sandbox.awellhealth.com/orchestration/m2m/graphql \
-H 'Content-Type: application/json' \
-H 'apiKey: YOUR_API_KEY' \
-H 'Idempotency-Key: "6f1c2e0e-3f0b-4c1e-9a1b-0d2c9c0f7b21"' \
-d '{
"query": "mutation StartPathway($input: StartPathwayInput!) { startPathway(input: $input) { code success pathway_id } }",
"variables": { "input": { "pathway_definition_id": "DEFINITION_ID", "patient_id": "PATIENT_ID" } }
}'
```
If this request times out and is sent again with the same key, the second attempt returns the
`pathway_id` the first one created. Without the key, the retry starts a second care flow for the
patient.
Rules for the value:
* One key per logical request. A retry reuses the key; a new request gets a new key.
* Retry with the same query, the same variables, and the same API key. The API compares all three.
* Use a key that cannot collide with one from another system or job sending requests to the same
organization, such as a UUID. Keys derived from a shared identifier, such as a record ID, can meet
each other and produce `422` errors that look like bugs.
* Send the quoted form only. A bare value, a value with parameters, or anything else the grammar
rejects is refused with `400`.
Queries ignore the header. Only mutations are guarded.
### From the SDK [#from-the-sdk]
The [server-side SDK](/api-reference/tools/api-tools#server-side-sdk) sends the header for you:
`sdk.withIdempotencyKey(key)` returns an orchestration client whose every request carries that key,
quoted as above.
Where this pays off is a handler that makes more than one call. Say an incoming event makes you
create a patient and then complete an activity, and the second call fails. Whatever retries the
handler, your queue or the system that sent the event, runs the first call again too, and creates a
second patient. With a key on each call, the retried first call replays the patient it already
created and only the failed call actually executes. Derive one key per call from the identity of the
event, such as `${event.id}:patient` and `${event.id}:complete`, so a retry of the same event reuses
them and a different event never can.
```javascript
const client = sdk.withIdempotencyKey(`${event.id}:patient`)
const result = await client.mutation({
createPatient: {
__args: { input: { first_name, last_name, email } },
patient: { id: true },
},
})
```
Refusals arrive as an `AwellApiError` carrying the HTTP `status` and the `code` from the table
below, so a caller can branch on them instead of parsing a message:
```javascript
import { AwellApiError } from '@awell-health/awell-sdk'
try {
await client.mutation({ ... })
} catch (err) {
if (err instanceof AwellApiError && err.code === 'IDEMPOTENCY_KEY_IN_FLIGHT') {
// the first attempt is still running: retry shortly
}
throw err
}
```
`AwellApiError` is thrown for any response that carries GraphQL errors, on any HTTP status, and
extends the generated client's `GenqlError`, so existing error handling keeps working. To tell a
replay from a fresh execution, pass `{ onResponse }` as the second argument; it receives the status
and whether the response was replayed.
## What comes back [#what-comes-back]
| State of the key | This request | Response |
| --------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------------------------- |
| Unused | Any mutation | Executes normally. The response is stored. |
| Held by a request still running | Same key | `409 Conflict`, code `IDEMPOTENCY_KEY_IN_FLIGHT`. Nothing executes. |
| Used by any completed request | Different query, variables, or API key | `422 Unprocessable Content`, code `IDEMPOTENCY_KEY_REUSED`. Nothing executes. |
| Used by a completed request | Same query, variables, and API key | The stored response, with `Idempotency-Replayed: true`. Nothing executes. |
| Used, but the response was too large to store | Same query, variables, and API key | `200`, code `IDEMPOTENCY_REPLAY_UNAVAILABLE`. Nothing executes. |
| Any | Malformed header value | `400 Bad Request`, code `IDEMPOTENCY_KEY_INVALID`. |
| Any | The key store is unreachable | `503 Service Unavailable`, code `IDEMPOTENCY_STORE_UNAVAILABLE`. Nothing executes. |
**A key is never a reason to execute twice.** Every row above either runs the mutation exactly once
or refuses to run it.
### Replays [#replays]
A replay returns the response the original request received, as a normal GraphQL response body,
plus an `Idempotency-Replayed: true` header. The header is the only way to tell a replay from a
fresh execution. The draft defines no replay indicator; this header is an Awell addition.
### Failures are outcomes too [#failures-are-outcomes-too]
A mutation that fails with a client error is replayed like a success, because the retry would fail
the same way. Client errors are those whose GraphQL errors all carry a 4xx `statusCode` in
`extensions`, such as a validation failure, a missing record, or a denied permission, plus argument
validation failures. To send a corrected request, use a new key.
A mutation that fails for any other reason, such as a `5xx` or an error with no status, releases the
key. The retry then runs for real, so a transient failure stays retryable.
### Concurrent duplicates [#concurrent-duplicates]
While the first request with a key is still running, a second request with the same key gets `409`
and is not queued. Retry after a short pause to receive the replay. Two requests with **different**
keys that touch the same record are two separate requests; both execute, and the mutation's own
rules decide the result.
## How errors are reported [#how-errors-are-reported]
The draft describes these errors as RFC 9457 problem details. A GraphQL endpoint answers with a
GraphQL response, so the same content arrives inside the error object:
```json
{
"errors": [
{
"message": "Idempotency-Key is already used",
"extensions": {
"code": "IDEMPOTENCY_KEY_REUSED",
"type": "IDEMPOTENCY_KEY_REUSED",
"statusCode": 422,
"problem": {
"type": "https://docs.awellhealth.com/api-reference/guides/idempotency",
"title": "Idempotency-Key is already used",
"detail": "Idempotency Key MUST not be reused across different payloads of this operation."
}
}
}
]
}
```
* `message` is the problem title, using the draft's wording.
* `extensions.code`, `extensions.type`, and `extensions.statusCode` follow the same convention as
every other error on this API. See [Errors](/api-reference/guides/errors).
* `extensions.problem` carries the problem details. Its `type` links to this page.
* The HTTP status matches `statusCode`, and the response also carries a
`Link: ; rel="describedby"` header.
Unlike most errors on this API, these arrive with a `4xx` or `5xx` status. A client that branches on
the HTTP status can distinguish an idempotency refusal from a normal GraphQL failure.
## Extension webhooks [#extension-webhooks]
The header also guards the URLs Awell issues for **extension webhooks**: the incoming webhooks of
type *Extension webhook* described in
[Start a care flow from an incoming webhook](/docs/automate-with-events/start-a-care-flow-from-an-incoming-webhook),
at the URL Studio shows when you enable one. Both the current and the older URL format are covered. A
webhook URL you post to directly, the other webhook type on that screen, does not read the header
yet.
Send `Idempotency-Key` with the delivery, in the same quoted form as above. One key per event;
a redelivery of the same event reuses it.
```bash
curl https://EXTENSION_WEBHOOK_URL \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: "8e03978e-40d5-43e8-bc93-6894a57f9324"' \
-d '{ "event": "appointment.booked", "id": "APPOINTMENT_ID" }'
```
Keys are unique per webhook URL. Two systems delivering to the same URL share a key space, so use a
value that cannot collide between them, such as a UUID, rather than a shared record ID. "The same
delivery" means the same JSON body to the same URL; whitespace and key order in the body do not
matter.
| State of the key | This delivery | Response |
| -------------------------------- | ---------------------------- | ------------------------------------------------------------------ |
| Unused | Any | The webhook runs. Its reply is stored. |
| Held by a delivery still running | Same key | `409 Conflict`. Nothing runs. |
| Used by any completed delivery | Different body | `422 Unprocessable Content`. Nothing runs. |
| Used by a completed delivery | Same body | The stored reply, with `Idempotency-Replayed: true`. Nothing runs. |
| Any | Malformed header value | `400 Bad Request`. |
| Any | The key store is unreachable | `503 Service Unavailable`. Nothing runs. |
"Nothing runs" means exactly that: the extension's webhook code is not invoked, no care flow is
started or advanced, and no webhook log entry is written for the retry. A replay returns the HTTP
status and body the webhook originally answered with. A reply the webhook chose with a `4xx` status
is stored and replayed too, as with mutations; a `5xx` releases the key so the retry runs for real.
Because these are plain HTTP endpoints, refusals arrive as RFC 9457 problem details rather than a
GraphQL error:
```http
HTTP/1.1 422 Unprocessable Content
Content-Type: application/problem+json
Link: ; rel="describedby"
{
"type": "https://docs.awellhealth.com/api-reference/guides/idempotency",
"title": "Idempotency-Key is already used",
"status": 422,
"detail": "Idempotency Key MUST not be reused across different payloads of this operation.",
"code": "IDEMPOTENCY_KEY_REUSED"
}
```
`code` takes the same values as `extensions.code` does for mutations. The expiry rules below apply
to webhook deliveries as well.
## Expiry [#expiry]
A completed key is remembered for **7 days**. A retry after that executes again, as a new request.
While a request is running, its key is held for at most **60 seconds**; if the request is still
running past that, a retry is no longer refused with `409` and may run alongside it.
The stored response is kept up to 5 MiB. A larger response is not kept, and a replay of it is
refused with `IDEMPOTENCY_REPLAY_UNAVAILABLE` rather than re-executed. Read the current state with a
query instead of retrying.
## Outgoing API calls and webhooks [#outgoing-api-calls-and-webhooks]
Awell also sends the header, on both kinds of request a care flow makes to your systems:
* An [API call action](/docs/connect-systems/the-api-call-action-graphql-and-rest#every-call-carries-an-idempotency-key)
sends `Idempotency-Key` with the id of that API call activity as the value.
* A [webhook](/api-reference/guides/webhooks) delivery sends `Idempotency-Key` with the id of that
webhook call as the value.
Both use the same quoted form, and there is nothing to configure.
```http
POST /your/endpoint
Content-Type: application/json
Idempotency-Key: "5f3d1c2e9b7a4d0f8e6c1a2b"
```
The value is the same on every retry of that call, whether Awell retries automatically or someone
retries it from Awell Care, so your endpoint can treat a repeated key as the same request and answer
with the result it already produced instead of acting twice. A different activity or delivery always
carries a different key, and a test call made while designing an API call action gets a new id each
time.
## Related [#related]
* [The API call action](/docs/connect-systems/the-api-call-action-graphql-and-rest)
* [Receive webhook events](/docs/automate-with-events/receive-webhook-events)
* [Start a care flow from an incoming webhook](/docs/automate-with-events/start-a-care-flow-from-an-incoming-webhook)
* [Errors](/api-reference/guides/errors)
* [Mutations](/api-reference/guides/mutations)
* [Rate limits](/api-reference/guides/rate-limits)
# Guides
URL: https://docs.awellhealth.com/api-reference/guides
The guides cover how to work with the Orchestration API: getting a key accepted, reading what comes
back, and carrying out specific integration jobs. Operation-by-operation detail lives in
[Reference](/api-reference/reference).
## Read these first [#read-these-first]
Read them in this order on a first integration.
1. [Getting started](/api-reference/guides/getting-started). The endpoint, the auth header, and a working query.
2. [Authentication](/api-reference/guides/authentication). How to obtain an API key and send it with every request.
3. [Environments](/api-reference/guides/environments). Sandbox, production, and the regional endpoints.
4. [Domain model](/api-reference/guides/domain-model). The objects the API works with, and the lifecycle of a typical integration.
## The behavior that applies to every call [#the-behavior-that-applies-to-every-call]
| Page | Covers |
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| [Pagination](/api-reference/guides/pagination) | Paging and sorting list results. |
| [Errors](/api-reference/guides/errors) | The `code` / `success` envelope, plus GraphQL errors. |
| [Rate limits](/api-reference/guides/rate-limits) | The limits, and how to handle throttling. |
| [Mutations](/api-reference/guides/mutations) | An orientation to the write operations. |
| [Idempotent requests](/api-reference/guides/idempotency) | The `Idempotency-Key` header on mutations and extension webhooks, and what a retry returns. |
| [E.164 phone numbers](/api-reference/guides/e164-phone-numbers) | The phone number format every write has to use. |
| [Versions and releases](/api-reference/guides/versions-and-releases) | Why care flow queries need the right `release_id`. |
## Guides for specific integration jobs [#guides-for-specific-integration-jobs]
| Page | Covers |
| ------------------------------------------------------------ | --------------------------------------------------------------------- |
| [Start a care flow](/api-reference/guides/start-a-care-flow) | Prerequisites, the start mutations, and hosted-pages sessions. |
| [Query activities](/api-reference/guides/query-activities) | The activity lookups and the server-side filters. |
| [Work with forms](/api-reference/guides/work-with-forms) | Rendering, conditional logic, and submitting answers. |
| [Manage patients](/api-reference/guides/manage-patients) | Creating and updating patients, and the identifier behavior to watch. |
| [Webhooks](/api-reference/guides/webhooks) | How care flows call other systems, and how to inspect and retry. |
| [Webhook payloads](/api-reference/guides/webhook-payloads) | The payload shape for each event. |
**Next:** [Getting started](/api-reference/guides/getting-started) — confirm a key works before building anything on it.
# Manage patients
URL: https://docs.awellhealth.com/api-reference/guides/manage-patients
Field-level reference is in [Patients](/api-reference/reference/patients). This page covers the behavior
worth knowing first.
## Search before you create [#search-before-you-create]
Creating a patient who already exists produces two records for one person. The API can merge them with
[`mergePatients`](/api-reference/reference/patients), though Awell Care offers no way to do it. Always
**search** by your own identifier before creating.
## Updating identifiers replaces them [#updating-identifiers-replaces-them]
> **Passing a patient identifier object to the update mutation REPLACES any existing identifiers.**
If you want to *add* one, use the dedicated add-identifier mutation instead.
An update that includes one identifier, intended as a no-op for the others, removes the others, and
anything looking a patient up by a removed identifier stops finding them. See
[Patient identifiers](/docs/connect-systems/patient-identifiers).
## Validation [#validation]
Certain fields expect particular formats: dates as ISO 8601, phone numbers as E.164. The create mutation's
validation section is the authoritative list, and the update mutation follows the same rules.
[E.164 phone numbers](/api-reference/guides/e164-phone-numbers) gives the phone rules in full.
## Patient language [#patient-language]
A patient's preferred language can be set through the API, and it affects what they see on
[Hosted Pages](/docs/embed-and-host/overview-hosted-pages). Set it when you create the patient if you know
it; changing it later doesn't retranslate anything already sent.
## Anonymous patients [#anonymous-patients]
Awell supports patients with no PHI, which suits an intake flow where you don't yet know who the person
is. See [Before you trigger a care flow](/docs/automate-with-events/before-you-trigger-a-care-flow).
## Next steps [#next-steps]
**Next:** [Versions and releases](/api-reference/guides/versions-and-releases).
# Mutations
URL: https://docs.awellhealth.com/api-reference/guides/mutations
Queries read data; **mutations** change it. Use mutations to create and update patients, start
and stop care flows, submit activities, and retry failed integrations. This page orients you to
what's available and where to find it.
Mutations are grouped with their domain in the **Reference** section. The main write operations:
| Domain | Examples |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [Patients](/api-reference/reference/patients) | `createPatient`, `updatePatient`, `mergePatients`, `setPatientDataPointValue` |
| [Care flows](/api-reference/reference/care-flows) | `startPathway`, `stopPathway`, `pauseCareFlow`, `completeCareflow` |
| [Activities](/api-reference/reference/activities) | `retryActivity`, `expireActivity`, `completeExtensionActivity` |
| [Activity types](/api-reference/reference/activity-types) | `submitFormResponse`, `submitChecklist`, `markMessageAsRead` |
| [Tracks](/api-reference/reference/tracks) | `addTrack`, `scheduleTrack`, `stopTrack` |
| [Hosted sessions & pages](/api-reference/reference/hosted-sessions) | `startHostedPathwaySession`, `completeSession` |
| [API calls & webhooks](/api-reference/reference/api-calls-and-webhooks) | `retryApiCall`, `retryWebhookCall` |
Every mutation returns a payload with a `code` and `success` field — see
[Errors](/api-reference/guides/errors) for how to read them. To make a mutation safe to retry, send an
`Idempotency-Key` header — see [Idempotent requests](/api-reference/guides/idempotency).
## Related [#related]
* [Getting started](/api-reference/guides/getting-started)
* Browse the full write API under **Reference**.
# Pagination
URL: https://docs.awellhealth.com/api-reference/guides/pagination
List queries return results in pages. You control the page with `pagination` parameters and the
order with `sorting` parameters, and the response tells you how many results exist in total so
you can page through them.
## Pagination parameters [#pagination-parameters]
List queries accept a `pagination` argument of type `PaginationParams`:
| Field | Type | Description |
| -------- | ------ | ----------------------------------------------- |
| `count` | `Int!` | The number of results to return (page size). |
| `offset` | `Int!` | The number of results to skip before this page. |
Pagination is **offset-based**: request the first page with `offset: 0`, the second with
`offset: count`, and so on.
**Two limits worth knowing before you build a loop:**
* **Omitting `pagination` does not return everything.** A list query with no pagination argument
returns the first 10 results.
* **`count` is capped at 100.** A larger value does not error. The query succeeds and returns 100
records, so code that asks for 500 and trusts the number it asked for misses data with nothing in
the response to say so. Page instead: compare `offset + count` against `total_count`.
## Sorting parameters [#sorting-parameters]
List queries also accept a `sorting` argument of type `SortingParams`:
| Field | Type | Description |
| ----------- | --------- | --------------------- |
| `field` | `String!` | The field to sort by. |
| `direction` | `String!` | `"ASC"` or `"DESC"`. |
`direction` is a string, not an enum, and the values are **uppercase**. `"asc"` is not the same
thing as `"ASC"`.
**Which fields you can sort by depends on the query, and nested fields are not sortable.** For
`patients`, only top-level profile fields work — `last_name`, `birth_date`, `sex`, `patient_code`
and the like — while something like `address.city` is not supported. `patients` sorts by
`last_name` ascending when you don't pass a `sorting` argument.
## Reading the response [#reading-the-response]
List responses include a `pagination` object of type `PaginationOutput`:
| Field | Type | Description |
| ------------- | ----- | -------------------------------------- |
| `count` | `Int` | The number of results in this page. |
| `offset` | `Int` | The offset this page started at. |
| `total_count` | `Int` | The total number of results available. |
Keep increasing `offset` by your page size until `offset + count` reaches `total_count`.
## Example [#example]
```graphql
query PatientsPage($pagination: PaginationParams, $sorting: SortingParams) {
patients(pagination: $pagination, sorting: $sorting) {
patients {
id
}
pagination {
count
offset
total_count
}
}
}
```
Variables:
```json
{
"pagination": { "count": 25, "offset": 0 },
"sorting": { "field": "last_name", "direction": "ASC" }
}
```
# Query activities
URL: https://docs.awellhealth.com/api-reference/guides/query-activities
Activities are the unit of work in Awell. Read the
[domain model](/api-reference/guides/domain-model) first; these queries are hard to use
without it.
Field-level reference is in [Activities](/api-reference/reference/activities).
## Which query [#which-query]
| Query | Use when |
| -------------------------------- | ----------------------------------------------------------------- |
| `careflowActivities` | You want everything in one care flow, including system activities |
| `activitiesByPatient` | You want activities across all of one patient's care flows |
| `activitiesByCareflowDefinition` | You want activities across all patients on one definition |
| `activity` | You have an activity ID |
`careflowActivities` requires a `pathway_id`. The by-patient and by-definition queries are the ones to
reach for when the question spans care flows, for example building a worklist.
## Filtering happens server-side [#filtering-happens-server-side]
Filters are **optional**, and with none supplied the response contains **every activity in the care
flow**, including calculations, track activations and other system activities.
Available filters cover activity status, activity type, action, stakeholders, care flow status, and
date range.
**Filter server-side rather than fetching everything and filtering in your client.** A long-running care
flow accumulates a lot of system activities, and the response grows with it.
## Paging and sorting [#paging-and-sorting]
Results support pagination and sorting. Page through rather than raising a limit: a care flow's activity
count grows for as long as the patient is enrolled.
## Pending activities for a user [#pending-activities-for-a-user]
There's a dedicated query for a user's pending activities, suited to a task list rather than a history.
It expects particular headers to identify the user.
## Expect repetition [#expect-repetition]
A [looping track](/docs/design-care-flows/track-looping) produces the same step's activities many times
for one patient. Code that assumes one activity per step shows the wrong one.
## Next steps [#next-steps]
**Next:** [Work with forms](/api-reference/guides/work-with-forms) to complete the activities you found.
# Rate limits
URL: https://docs.awellhealth.com/api-reference/guides/rate-limits
**Awell does not publish request-rate limits for the Orchestration API.** There is no documented
ceiling on requests per second or per minute, and nothing that says whether one would apply per API
key, per tenant, or per environment.
That is a statement about what is documented, not a promise that you can send unlimited traffic. If
you are planning something high-volume — a bulk import, a nightly sync over a large population, a
backfill — ask [support@awellhealth.com](mailto:support@awellhealth.com) what the ceiling is before
you build against an assumption.
## The limit that does exist [#the-limit-that-does-exist]
List queries cap the number of records you get back per request:
* `count` above **100** does not error. The query succeeds and returns 100 records.
* Omitting `pagination` altogether returns **10**.
That is a result-size limit rather than a rate limit, and it is the one most likely to surprise you.
See [Pagination](/api-reference/guides/pagination).
## Behave well anyway [#behave-well-anyway]
Whether or not a rate limit is enforced, these hold:
* **Retry `5xx`, with exponential backoff.** A `5xx` is an error inside Awell and may clear on its
own. Back off between attempts rather than retrying immediately.
* **Do not retry a `200`.** GraphQL returns `200` even when the request failed, so a retry loop that
branches on the HTTP status will hammer the API repeating a request that will never succeed. See
[Errors](/api-reference/guides/errors).
* **Page rather than widening.** If a list is large, walk it with `offset` instead of raising
`count`, which is capped anyway.
## Related [#related]
* [Errors](/api-reference/guides/errors)
* [Pagination](/api-reference/guides/pagination)
# Start a care flow
URL: https://docs.awellhealth.com/api-reference/guides/start-a-care-flow
Reference for the mutations themselves is in [Care flows](/api-reference/reference/care-flows). This page
covers what you need to know around them.
## Prerequisites [#prerequisites]
**A care flow can only be started for a patient, so create the patient first.** See
[Patients](/api-reference/reference/patients).
Creating a patient returns an Awell patient ID. If you created the patient using your own business
identifiers, you can start a care flow with those instead, which means your system never has to store an
Awell ID. Identifiers must be set up at tenant level first. See
[Patient identifiers](/docs/connect-systems/patient-identifiers).
## Which start mutation [#which-start-mutation]
The two mutations differ only in how the patient is identified:
| Mutation | Identifies the patient by |
| ----------------------------------- | -------------------------------- |
| `startPathway` | The Awell patient ID |
| `startPathwayWithPatientIdentifier` | One of your business identifiers |
Prefer the identifier version if your system is the source of truth for patients; it removes a whole
class of "which ID is this" bugs.
## Which version starts [#which-version-starts]
**Awell automatically starts the most recent published version** of the care flow definition.
You can pass a `release_id` to start a specific version instead. A patient stays on the version they
started on for the life of their care flow, so the version passed at start determines their experience
months later. See
[Versions and releases](/api-reference/guides/versions-and-releases).
## Baseline data at start [#baseline-data-at-start]
If the care flow defines required baseline data points, supply them at start or the request is rejected.
If the care flow's logic reads an optional baseline data point and the value is missing, the flow halts
at that logic with no error. See
[Enrich your care flow with baseline data](/docs/design-care-flows/enrich-your-care-flow-with-baseline-data).
## Starting a hosted-pages session at the same time [#starting-a-hosted-pages-session-at-the-same-time]
If a patient should immediately interact with their first activity, one mutation both starts the care
flow and returns a hosted-pages session URL. Use it for self-enrollment, where the person is present and
waiting.
See [Hosted sessions](/api-reference/reference/hosted-sessions), and
[Trigger with a Hosted Pages link](/docs/automate-with-events/trigger-with-a-hosted-pages-link) for the
no-code equivalent.
**Sessions expire.** Generate the session at the moment you hand the patient over, not in advance.
## Next steps [#next-steps]
**Next:** [Query activities](/api-reference/guides/query-activities) to find out what the care flow
produced.
# Versions and releases
URL: https://docs.awellhealth.com/api-reference/guides/versions-and-releases
Care flow definitions are versioned, and a patient stays on the version their care flow started on.
Queries that read data point definitions therefore need the right `release_id`.
## A patient stays on the version they started on [#a-patient-stays-on-the-version-they-started-on]
**Every patient is enrolled in the version of the care flow that was live at the moment their care flow
started.** Care flows evolve, so the version an old patient is on can have a materially different design
from today's.
Version pinning is deliberate: changing a live care flow doesn't reshape the journey of someone already
mid-flow.
## The data dictionary differs by version [#the-data-dictionary-differs-by-version]
The oldest version of your care flow can have a **different set of data points** from the most
recent one. Questions get added, removed and renamed.
So to retrieve the data point definitions for a care flow, you must specify **which version** you mean,
using the `release_id`.
## A wrong version returns no error [#a-wrong-version-returns-no-error]
A query that assumes the latest version returns the latest version's dictionary, which:
* omits data points that only older versions collected
* includes data points that older patients never had
Neither case returns an error. The result is smaller or differently shaped, with no indication that it's
incomplete, so an analysis can under-count a cohort.
**Fetch the `release_id` from the care flow you're querying**, rather than assuming.
## `version` and `release_id` are not the same [#version-and-release_id-are-not-the-same]
Both exist on a care flow definition, and they mean different things. Check which one a query expects
before filtering on it, because filtering on the wrong one changes which care flows match.
## Next steps [#next-steps]
* [Data schema](/docs/data/data-schema) for the same distinction in the data warehouse.
* [Publish and set your care flow live](/docs/design-care-flows/publish-set-your-care-flow-live) for how
versions are created.
# Webhook payloads
URL: https://docs.awellhealth.com/api-reference/guides/webhook-payloads
This page shows the payload Awell posts to your endpoint for each event. Which events exist and when they
fire is in the [webhook event catalog](/docs/automate-with-events/webhook-event-catalog); building the
endpoint is in [Receive webhook events](/docs/automate-with-events/receive-webhook-events).
**Payloads carry identifiers, not clinical detail.** Fetch what you need through the API using them.
## Every payload [#every-payload]
All payloads include an `event_type` identifying which event fired, and an `id`. Always **switch** on
`event_type` rather than inferring the event from which fields are present.
## Activity events [#activity-events]
`activity.created` · `activity.completed` · `activity.updated` · `activity.expired` ·
`activity.failed` · `activity.deleted`
**These share one payload shape**, so handle them with one parser and branch on `event_type`.
```json
{
"event_type": "",
"activity": {
"id": "",
"stream_id": "",
"date": "",
"action": "",
"status": "",
"subject": { "type": "awell", "name": "Awell" },
"object": { "id": "", "type": "", "name": "" },
"indirect_object": { "id": "", "type": "", "name": "" },
"context": { "instance_id": "", "pathway_id": "", "track_id": "", "step_id": "", "action_id": "" },
"sub_activities": [],
"label": { "id": "", "text": "", "color": "" },
"track": { "id": "", "title": "" }
}
}
```
The `context` object locates the activity in the care flow's structure, and `object` says what the
activity is about; both matter when deciding whether to act on an event.
## Care flow events [#care-flow-events]
`pathway.started` · `pathway.completed` · `pathway.stopped` · `pathway.deleted`
**Note the event name.** These use `pathway`, not `care_flow`. The product renamed *pathway*
to *care flow*; the wire format did not follow, which is also why the payload wrapper below is
`pathway`. Subscribe to the names above — they are what the platform sends and what the event
picker in Studio lists.
```json
{
"event_type": "",
"pathway": {
"id": "",
"pathway_definition_id": "",
"pathway_title": "",
"patient_id": "",
"patient_identifiers": [{ "system": "", "value": "" }],
"start_date": "",
"tenant_id": ""
}
}
```
`patient_identifiers` lets you match the care flow to a patient in your own system without storing
Awell IDs.
## Patient events [#patient-events]
`patient.created` · `patient.updated` · `patient.deleted`
```json
{
"event_type": "",
"patient": {
"id": "",
"patient_code": "",
"identifier": [{ "system": "", "value": "" }],
"profile": {
"first_name": "", "last_name": "", "birth_date": "",
"sex": "", "email": "", "phone": "", "mobile_phone": "",
"preferred_language": "", "national_registry_number": "",
"address": { "street": "", "city": "", "zip": "", "state": "", "country": "" }
}
}
}
```
Patient payloads are the one exception to identifiers-not-detail: they carry profile fields, because the
event *is* about the profile. Treat them as PHI accordingly.
## Track, session, form and note events [#track-session-form-and-note-events]
`track.started` · `track.completed` · `track.stopped` · `session.started` · `session.completed` ·
`session.expired` · `form.submitted` · `data_point.collected` · `clinical_note.created` ·
`reminder.created`
Each carries `event_type` plus an object naming what it concerns, following the same identifier-led shape
as above.
## Handling advice [#handling-advice]
* **Switch on `event_type`.** Never infer the event from field presence.
* **Expect unknown event types.** New events get added, so an unrecognized type should be ignored, not
fatal.
* **Order isn't guaranteed and delivery can repeat.** See
[Webhooks and events](/docs/automate-with-events/webhooks-and-events).
# Webhooks
URL: https://docs.awellhealth.com/api-reference/guides/webhooks
A care flow can call out to your systems as it runs, for example to notify you when an
activity completes. Awell records each of these as a **webhook call** you can inspect and retry
through the API.
## Inspecting and retrying webhook calls [#inspecting-and-retrying-webhook-calls]
The API exposes webhook calls as data you can query and act on:
* Query them with `webhookCall`, `webhookCalls`, and related operations. See
[API calls & webhooks](/api-reference/reference/api-calls-and-webhooks).
* Retry failed deliveries with `retryWebhookCall` and the bulk `retryAll…` mutations.
* Subscribe to `webhookCallCreated` and `webhookCallUpdated` for real-time updates. See
[Subscriptions](/api-reference/reference/subscriptions).
## Receiving and verifying webhooks [#receiving-and-verifying-webhooks]
Configuring, receiving and verifying are covered in full elsewhere on this site rather than repeated
here — this page is about the webhook calls the API exposes as data.
| To do this | Go to |
| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| Build the endpoint, verify the signature, handle repeats | [Receive webhook events](/docs/automate-with-events/receive-webhook-events) |
| See what each event reports, and what it does not | [Webhook event catalog](/docs/automate-with-events/webhook-event-catalog) |
| See the shape of what arrives | [Webhook payloads](/api-reference/guides/webhook-payloads) |
| Turn webhooks on for one care flow | [Configure webhooks in Studio](/docs/automate-with-events/configure-webhooks-in-studio) |
| Turn them on for every published care flow at once | [Configure webhooks for all care flows](/docs/automate-with-events/configure-webhooks-for-all-care-flows) |
Before you build the receiving end: payloads carry **identifiers, not clinical detail**, so you fetch
what you need through the API using them. Delivery also repeats and can arrive out of order, so the
endpoint has to be idempotent. Every delivery carries an `Idempotency-Key` header whose value stays
the same on each retry of that delivery, so the endpoint can recognize a repeat — see
[Idempotent requests](/api-reference/guides/idempotency#outgoing-api-calls-and-webhooks).
## Related [#related]
* [API calls & webhooks reference](/api-reference/reference/api-calls-and-webhooks)
* [Subscriptions reference](/api-reference/reference/subscriptions)
# Work with forms
URL: https://docs.awellhealth.com/api-reference/guides/work-with-forms
Rendering an Awell form yourself means fetching the questions, evaluating conditional logic as the user
answers, and submitting the response.
If you'd rather not build this, [Navi](/docs/embed-and-host/what-is-navi) does it for you.
## Evaluate conditional logic on every answer [#evaluate-conditional-logic-on-every-answer]
Forms can hide and show questions based on earlier answers. A mutation evaluates all of a form's
conditional logic and tells you which questions should be visible or hidden.
> **Call it every time the user answers any question**, so they only ever see the relevant
> questions.
Evaluating once at the start gives you the right questions for an empty form and the wrong ones from the
second answer onward.
## Send every answer value as a string [#send-every-answer-value-as-a-string]
> **Form responses are polymorphic, so an answer value is always sent as a string.**
Awell validates and deserializes on its side, and **rejects** a value that doesn't match the data
point's value type. So the string has to be the right shape for the underlying type:
| Question type | Data point type | Send |
| --------------- | --------------- | ------------------------------------- |
| Date | `date` | An ISO 8601 string |
| Number, slider | `number` | The number as a string |
| Single select | as defined | The answer's **value**, not its label |
| Multiple select | as defined | The selected values |
| Short/long text | `string` | The text |
For a single select, send the value the option carries, not the label the user saw. See
[Encode questions and answer options](/docs/design-care-flows/encode-questions-and-answer-options).
## Specifying who answered [#specifying-who-answered]
When submitting, you can specify which user the response is attributed to. Do it, because an
unattributed clinical answer is a gap in the record.
## Reading responses back [#reading-responses-back]
A separate query returns a submitted form response, including the data points it produced. Use it to
confirm what Awell stored rather than assuming your submission was interpreted as intended.
## Next steps [#next-steps]
* [Manage patients](/api-reference/guides/manage-patients)
* [Versions and releases](/api-reference/guides/versions-and-releases) for why a form's questions differ
between care flow versions
# Activities
URL: https://docs.awellhealth.com/api-reference/reference/activities
Query the activities in a care flow and retry, expire, or annotate them.
## Queries [#queries]
### `activitiesByCareflowDefinition` [#activitiesbycareflowdefinition]
Returns the activities recorded across care flows of a given care flow definition.
**Arguments**
| Argument | Type | Required | Description |
| ------------------------ | --------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `careflow_definition_id` | `String!` | Yes | The ID of the care flow definition |
| `filters` | `FilterActivitiesByCareflowDefinitionFilters` | No | Filters to narrow the results |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `ActivitiesPayload!`
**Example**
```graphql
query ActivitiesByCareflowDefinition($careflow_definition_id: String!, $filters: FilterActivitiesByCareflowDefinitionFilters, $pagination: PaginationParams, $sorting: SortingParams) {
activitiesByCareflowDefinition(careflow_definition_id: $careflow_definition_id, filters: $filters, pagination: $pagination, sorting: $sorting) {
activities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
metadata {
stakeholders {
email
id
name
preferred_language
type
}
}
pagination {
count
offset
total_count
}
success
}
}
```
Variables:
```json
{
"careflow_definition_id": "",
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"sorting": {
"direction": "",
"field": ""
}
}
```
### `activitiesByPatient` [#activitiesbypatient]
Returns the activities recorded across a patient's care flows.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ---------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `FilterActivitiesByPatientFilters` | No | Filters to narrow the results |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `patient_id` | `String!` | Yes | The ID of the patient |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `ActivitiesPayload!`
**Example**
```graphql
query ActivitiesByPatient($filters: FilterActivitiesByPatientFilters, $pagination: PaginationParams, $patient_id: String!, $sorting: SortingParams) {
activitiesByPatient(filters: $filters, pagination: $pagination, patient_id: $patient_id, sorting: $sorting) {
activities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
metadata {
stakeholders {
email
id
name
preferred_language
type
}
}
pagination {
count
offset
total_count
}
success
}
}
```
Variables:
```json
{
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"patient_id": "",
"sorting": {
"direction": "",
"field": ""
}
}
```
### `activity` [#activity]
Returns a single activity by its ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | ---------------------- |
| `id` | `String!` | Yes | The ID of the activity |
**Returns:** `ActivityPayload!`
**Example**
```graphql
query Activity($id: String!) {
activity(id: $id) {
activity {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `careflowActivities` [#careflowactivities]
Returns the activities in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ----------------- | -------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `FilterCareflowActivitiesParams` | No | Filters to narrow the results |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `skip_enrichment` | `Boolean` | No | Whether to skip enrichment of the returned activities |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `ActivitiesPayload!`
**Example**
```graphql
query CareflowActivities($filters: FilterCareflowActivitiesParams, $pagination: PaginationParams, $pathway_id: String!, $skip_enrichment: Boolean, $sorting: SortingParams) {
careflowActivities(filters: $filters, pagination: $pagination, pathway_id: $pathway_id, skip_enrichment: $skip_enrichment, sorting: $sorting) {
activities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
metadata {
stakeholders {
email
id
name
preferred_language
type
}
}
pagination {
count
offset
total_count
}
success
}
}
```
Variables:
```json
{
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"pathway_id": "",
"skip_enrichment": true,
"sorting": {
"direction": "",
"field": ""
}
}
```
### `careflowActivityTypes` [#careflowactivitytypes]
Returns the activity types present in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | --------- | -------- | ----------------------- |
| `careflow_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ActivityTypesPayload!`
**Example**
```graphql
query CareflowActivityTypes($careflow_id: String!) {
careflowActivityTypes(careflow_id: $careflow_id) {
activityTypes
code
success
}
}
```
Variables:
```json
{
"careflow_id": ""
}
```
### `extensionActivityRecord` [#extensionactivityrecord]
Returns the extension activity record for an activity.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | --------------------------------------- |
| `id` | `String!` | Yes | The ID of the extension activity record |
**Returns:** `ExtensionActivityRecordPayload!`
**Example**
```graphql
query ExtensionActivityRecord($id: String!) {
extensionActivityRecord(id: $id) {
code
record {
activity_id
data_points {
label
value
valueType
}
date
fields {
id
label
type
value
}
id
pathway_id
plugin_action_key
plugin_key
settings {
key
label
value
}
}
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `myActivities` [#myactivities]
Returns the activities in a care flow that are assigned to the authenticated user.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
| `track_id` | `String` | No | The ID of the track |
**Returns:** `ActivitiesPayload!`
**Example**
```graphql
query MyActivities($pagination: PaginationParams, $pathway_id: String!, $sorting: SortingParams, $track_id: String) {
myActivities(pagination: $pagination, pathway_id: $pathway_id, sorting: $sorting, track_id: $track_id) {
activities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
metadata {
stakeholders {
email
id
name
preferred_language
type
}
}
pagination {
count
offset
total_count
}
success
}
}
```
Variables:
```json
{
"pagination": {
"count": 0,
"offset": 0
},
"pathway_id": "",
"sorting": {
"direction": "",
"field": ""
},
"track_id": ""
}
```
## Mutations [#mutations]
### `addActivityMetadata` [#addactivitymetadata]
Adds metadata to an activity.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------------- | -------- | ------------------------------------------ |
| `input` | `AddActivityMetadataInput!` | Yes | The activity and the metadata to add to it |
**Returns:** `AddActivityMetadataPayload!`
**Example**
```graphql
mutation AddActivityMetadata($input: AddActivityMetadataInput!) {
addActivityMetadata(input: $input) {
activity {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": "",
"metadata": ""
}
}
```
### `completeExtensionActivity` [#completeextensionactivity]
Completes an extension activity.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------------------- | -------- | ------------------------------------------------- |
| `input` | `CompleteExtensionActivityInput!` | Yes | The details of the extension activity to complete |
**Returns:** `CompleteExtensionActivityPayload!`
**Example**
```graphql
mutation CompleteExtensionActivity($input: CompleteExtensionActivityInput!) {
completeExtensionActivity(input: $input) {
activity {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": "",
"data_points": [
{
"key": "",
"value": ""
}
]
}
}
```
### `expireActivity` [#expireactivity]
Expires an activity.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ---------------------- | -------- | ------------------------------------- |
| `input` | `ExpireActivityInput!` | Yes | The details of the activity to expire |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation ExpireActivity($input: ExpireActivityInput!) {
expireActivity(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": "",
"reason": "",
"user_email": "",
"user_id": ""
}
}
```
### `retryActivities` [#retryactivities]
Retry failed activities by their IDs. Limited to 1000 activities per call.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------- | -------- | ---------------------------------- |
| `input` | `RetryActivitiesInput!` | Yes | The IDs of the activities to retry |
**Returns:** `RetryActivitiesPayload!`
**Example**
```graphql
mutation RetryActivities($input: RetryActivitiesInput!) {
retryActivities(input: $input) {
code
result {
failed
skipped
succeeded
}
success
}
}
```
Variables:
```json
{
"input": {
"activity_ids": [
""
]
}
}
```
### `retryActivity` [#retryactivity]
Retries a single failed activity.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | ------------------------------------ |
| `input` | `RetryActivityInput!` | Yes | The details of the activity to retry |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation RetryActivity($input: RetryActivityInput!) {
retryActivity(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": ""
}
}
```
# Activity types
URL: https://docs.awellhealth.com/api-reference/reference/activity-types
Work with the specific activity types — forms, checklists, messages, clinical notes, calculations, and EMR reports.
## Queries [#queries]
### `calculationAction` [#calculationaction]
Returns the calculation activity for the given ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | ---------------------------------- |
| `id` | `String!` | Yes | The ID of the calculation activity |
**Returns:** `ActionPayload!`
**Example**
```graphql
query CalculationAction($id: String!) {
calculationAction(id: $id) {
calculationId
code
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `calculationResults` [#calculationresults]
Returns the results of a calculation activity.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | --------- | -------- | ----------------------- |
| `activity_id` | `String!` | Yes | The ID of the activity |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `CalculationResultsPayload!`
**Example**
```graphql
query CalculationResults($activity_id: String!, $pathway_id: String!) {
calculationResults(activity_id: $activity_id, pathway_id: $pathway_id) {
code
result {
label
status
subresult_id
unit
value
value_type
}
success
}
}
```
Variables:
```json
{
"activity_id": "",
"pathway_id": ""
}
```
### `checklist` [#checklist]
Returns a checklist activity by its ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | -------------------------------- |
| `id` | `String!` | Yes | The ID of the checklist activity |
**Returns:** `ChecklistPayload!`
**Example**
```graphql
query Checklist($id: String!) {
checklist(id: $id) {
checklist {
items
title
}
code
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `clinicalNote` [#clinicalnote]
Returns a clinical note activity by its ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | ------------------------------------ |
| `id` | `String!` | Yes | The ID of the clinical note activity |
**Returns:** `ClinicalNotePayload!`
**Example**
```graphql
query ClinicalNote($id: String!) {
clinicalNote(id: $id) {
clinical_note {
context {
key
value
}
id
narratives {
body
id
key
title
}
}
code
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `emrReport` [#emrreport]
Returns an EMR report activity by its ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | --------------------------------- |
| `id` | `String!` | Yes | The ID of the EMR report activity |
**Returns:** `EmrReportPayload!`
**Example**
```graphql
query EmrReport($id: String!) {
emrReport(id: $id) {
code
report {
id
message_html
metadata {
id
label
name
value
}
}
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `form` [#form]
Returns a form activity by its ID.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | --------------------------- |
| `id` | `String!` | Yes | The ID of the form activity |
| `pathway_id` | `String` | No | The ID of the care flow |
**Returns:** `FormPayload!`
**Example**
```graphql
query Form($id: String!, $pathway_id: String) {
form(id: $id, pathway_id: $pathway_id) {
code
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
success
}
}
```
Variables:
```json
{
"id": "",
"pathway_id": ""
}
```
### `formActivityDataPoints` [#formactivitydatapoints]
Returns the data points captured by a form activity.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | --------- | -------- | ----------------------- |
| `activity_id` | `String!` | Yes | The ID of the activity |
| `careflow_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `FormActivityDataPointsPayload!`
**Example**
```graphql
query FormActivityDataPoints($activity_id: String!, $careflow_id: String!) {
formActivityDataPoints(activity_id: $activity_id, careflow_id: $careflow_id) {
code
data_points {
key
value
valueType
}
success
}
}
```
Variables:
```json
{
"activity_id": "",
"careflow_id": ""
}
```
### `formResponse` [#formresponse]
Returns the response submitted for a form activity.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | --------- | -------- | ----------------------- |
| `activity_id` | `String!` | Yes | The ID of the activity |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `FormResponsePayload!`
**Example**
```graphql
query FormResponse($activity_id: String!, $pathway_id: String!) {
formResponse(activity_id: $activity_id, pathway_id: $pathway_id) {
code
response {
answers {
label
question_id
value
value_type
}
}
success
}
}
```
Variables:
```json
{
"activity_id": "",
"pathway_id": ""
}
```
### `forms` [#forms]
Returns the forms defined in a care flow definition.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------- | --------- | -------- | -------------------------------------------------------------- |
| `pathway_definition_id` | `String!` | Yes | The ID of the care flow definition |
| `release_id` | `String` | No | The ID of the published care flow definition version (release) |
**Returns:** `FormsPayload!`
**Example**
```graphql
query Forms($pathway_definition_id: String!, $release_id: String) {
forms(pathway_definition_id: $pathway_definition_id, release_id: $release_id) {
code
forms {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
success
}
}
```
Variables:
```json
{
"pathway_definition_id": "",
"release_id": ""
}
```
### `message` [#message]
Returns a message activity by its ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | ------------------------------ |
| `id` | `String!` | Yes | The ID of the message activity |
**Returns:** `MessagePayload!`
**Example**
```graphql
query Message($id: String!) {
message(id: $id) {
code
message {
attachments {
id
name
type
url
}
body
format
id
subject
}
success
}
}
```
Variables:
```json
{
"id": ""
}
```
## Mutations [#mutations]
### `evaluateFormRules` [#evaluateformrules]
Evaluates a form's rules against a set of answers.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------- | -------- | ------------------------------------------------------ |
| `input` | `EvaluateFormRulesInput!` | Yes | The form and the answers to evaluate its rules against |
**Returns:** `EvaluateFormRulesPayload!`
**Example**
```graphql
mutation EvaluateFormRules($input: EvaluateFormRulesInput!) {
evaluateFormRules(input: $input) {
code
results {
question_id
rule_id
satisfied
}
success
}
}
```
Variables:
```json
{
"input": {
"answers": [
{
"question_id": "",
"value": ""
}
],
"form_id": ""
}
}
```
### `markMessageAsRead` [#markmessageasread]
Marks a message activity as read.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------- | -------- | --------------------------------------------------- |
| `input` | `MarkMessageAsReadInput!` | Yes | The details of the message activity to mark as read |
**Returns:** `MarkMessageAsReadPayload!`
**Example**
```graphql
mutation MarkMessageAsRead($input: MarkMessageAsReadInput!) {
markMessageAsRead(input: $input) {
activity {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": ""
}
}
```
### `submitChecklist` [#submitchecklist]
Submits a checklist activity.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------- | -------- | ----------------------------------------------- |
| `input` | `SubmitChecklistInput!` | Yes | The details of the checklist activity to submit |
**Returns:** `SubmitChecklistPayload!`
**Example**
```graphql
mutation SubmitChecklist($input: SubmitChecklistInput!) {
submitChecklist(input: $input) {
activity {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": ""
}
}
```
### `submitFormResponse` [#submitformresponse]
Submits a response to a form activity.
**Arguments**
| Argument | Type | Required | Description |
| -------- | -------------------------- | -------- | -------------------------------------------- |
| `input` | `SubmitFormResponseInput!` | Yes | The form activity and the response to submit |
**Returns:** `SubmitFormResponsePayload!`
**Example**
```graphql
mutation SubmitFormResponse($input: SubmitFormResponseInput!) {
submitFormResponse(input: $input) {
activity {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": "",
"response": [
{
"question_id": "",
"value": ""
}
]
}
}
```
### `updateEmrReportStatus` [#updateemrreportstatus]
Updates the status of an EMR report.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------------- | -------- | -------------------------------------------- |
| `input` | `UpdateEmrReportStatusInput!` | Yes | The EMR report request and the status to set |
**Returns:** `UpdateEmrReportStatusPayload!`
**Example**
```graphql
mutation UpdateEmrReportStatus($input: UpdateEmrReportStatusInput!) {
updateEmrReportStatus(input: $input) {
code
request {
id
status
}
success
}
}
```
Variables:
```json
{
"input": {
"reason": "",
"request_id": "",
"status": ""
}
}
```
# API calls & webhooks
URL: https://docs.awellhealth.com/api-reference/reference/api-calls-and-webhooks
Inspect the API calls and webhook calls a care flow makes, and retry failed ones.
## Queries [#queries]
### `apiCall` [#apicall]
Fetches a single API call by its ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | ---------------------- |
| `id` | `String!` | Yes | The ID of the API call |
**Returns:** `ApiCallPayload!`
**Example**
```graphql
query ApiCall($id: String!) {
apiCall(id: $id) {
api_call {
created_at
id
request {
body
endpoint
method
}
responses {
body
date
status
}
status
title
}
code
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `apiCalls` [#apicalls]
Lists the API calls made by a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ApiCallsPayload!`
**Example**
```graphql
query ApiCalls($pathway_id: String!) {
apiCalls(pathway_id: $pathway_id) {
api_calls {
created_at
id
request {
body
endpoint
method
}
responses {
body
date
status
}
status
title
}
code
success
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `webhookCall` [#webhookcall]
Fetches a single webhook call by its ID.
**Arguments**
| Argument | Type | Required | Description |
| ----------------- | --------- | -------- | -------------------------- |
| `webhook_call_id` | `String!` | Yes | The ID of the webhook call |
**Returns:** `WebhookCallPayload!`
**Example**
```graphql
query WebhookCall($webhook_call_id: String!) {
webhookCall(webhook_call_id: $webhook_call_id) {
code
success
webhook_call {
created_at
event_type
id
pathway {
id
pathway_definition_id
patient_id
start_date
}
request {
body
endpoint
method
}
responses {
body
date
status
}
status
webhook_id
webhook_name
}
}
}
```
Variables:
```json
{
"webhook_call_id": ""
}
```
### `webhookCalls` [#webhookcalls]
Lists the webhook calls made by a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `WebhookCallFiltersInput` | No | Filters to apply to the webhook calls |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `WebhookCallsPayload!`
**Example**
```graphql
query WebhookCalls($filters: WebhookCallFiltersInput, $pagination: PaginationParams, $pathway_id: String!, $sorting: SortingParams) {
webhookCalls(filters: $filters, pagination: $pagination, pathway_id: $pathway_id, sorting: $sorting) {
code
pagination {
count
offset
total_count
}
sorting {
direction
field
}
success
webhook_calls {
created_at
event_type
id
pathway {
id
pathway_definition_id
patient_id
start_date
}
request {
body
endpoint
method
}
responses {
body
date
status
}
status
webhook_id
webhook_name
}
}
}
```
Variables:
```json
{
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"pathway_id": "",
"sorting": {
"direction": "",
"field": ""
}
}
```
### `webhookCallsForPathwayDefinition` [#webhookcallsforpathwaydefinition]
Lists the webhook calls made across all care flows of a care flow definition.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------- | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `WebhookCallFiltersInput` | No | Filters to apply to the webhook calls |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `pathway_definition_id` | `String!` | Yes | The ID of the care flow definition |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `WebhookCallsPayload!`
**Example**
```graphql
query WebhookCallsForPathwayDefinition($filters: WebhookCallFiltersInput, $pagination: PaginationParams, $pathway_definition_id: String!, $sorting: SortingParams) {
webhookCallsForPathwayDefinition(filters: $filters, pagination: $pagination, pathway_definition_id: $pathway_definition_id, sorting: $sorting) {
code
pagination {
count
offset
total_count
}
sorting {
direction
field
}
success
webhook_calls {
created_at
event_type
id
pathway {
id
pathway_definition_id
patient_id
start_date
}
request {
body
endpoint
method
}
responses {
body
date
status
}
status
webhook_id
webhook_name
}
}
}
```
Variables:
```json
{
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"pathway_definition_id": "",
"sorting": {
"direction": "",
"field": ""
}
}
```
### `webhookCallsForTenant` [#webhookcallsfortenant]
Lists the webhook calls made across the tenant.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `WebhookCallFiltersInput` | No | Filters to apply to the webhook calls |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `WebhookCallsPayload!`
**Example**
```graphql
query WebhookCallsForTenant($filters: WebhookCallFiltersInput, $pagination: PaginationParams, $sorting: SortingParams) {
webhookCallsForTenant(filters: $filters, pagination: $pagination, sorting: $sorting) {
code
pagination {
count
offset
total_count
}
sorting {
direction
field
}
success
webhook_calls {
created_at
event_type
id
pathway {
id
pathway_definition_id
patient_id
start_date
}
request {
body
endpoint
method
}
responses {
body
date
status
}
status
webhook_id
webhook_name
}
}
}
```
Variables:
```json
{
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"sorting": {
"direction": "",
"field": ""
}
}
```
## Mutations [#mutations]
### `retryAllApiCalls` [#retryallapicalls]
Retries all API calls for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------ | -------- | -------------------------------------- |
| `input` | `RetryAllApiCallsInput!` | Yes | The care flow whose API calls to retry |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation RetryAllApiCalls($input: RetryAllApiCallsInput!) {
retryAllApiCalls(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": ""
}
}
```
### `retryAllFailedApiCalls` [#retryallfailedapicalls]
Retries all failed API calls for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------------ | -------- | --------------------------------------------- |
| `input` | `RetryAllFailedApiCallsInput!` | Yes | The care flow whose failed API calls to retry |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation RetryAllFailedApiCalls($input: RetryAllFailedApiCallsInput!) {
retryAllFailedApiCalls(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": ""
}
}
```
### `retryAllFailedWebhookCalls` [#retryallfailedwebhookcalls]
Retries all failed webhook calls for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ---------------------------------- | -------- | ------------------------------------------------- |
| `input` | `RetryAllFailedWebhookCallsInput!` | Yes | The care flow whose failed webhook calls to retry |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation RetryAllFailedWebhookCalls($input: RetryAllFailedWebhookCallsInput!) {
retryAllFailedWebhookCalls(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": ""
}
}
```
### `retryAllFailedWebhookCallsForPathwayDefinition` [#retryallfailedwebhookcallsforpathwaydefinition]
Retries all failed webhook calls across all care flows of a care flow definition.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------------------------------------ | -------- | ------------------------------------------------------------ |
| `input` | `RetryAllFailedWebhookCallsForPathwayDefinitionInput!` | Yes | The care flow definition whose failed webhook calls to retry |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation RetryAllFailedWebhookCallsForPathwayDefinition($input: RetryAllFailedWebhookCallsForPathwayDefinitionInput!) {
retryAllFailedWebhookCallsForPathwayDefinition(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_definition_id": ""
}
}
```
### `retryAllWebhookCalls` [#retryallwebhookcalls]
Retries all webhook calls for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ---------------------------- | -------- | ------------------------------------------ |
| `input` | `RetryAllWebhookCallsInput!` | Yes | The care flow whose webhook calls to retry |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation RetryAllWebhookCalls($input: RetryAllWebhookCallsInput!) {
retryAllWebhookCalls(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": ""
}
}
```
### `retryApiCall` [#retryapicall]
Retries a single API call.
**Arguments**
| Argument | Type | Required | Description |
| -------- | -------------------- | -------- | --------------------- |
| `input` | `RetryApiCallInput!` | Yes | The API call to retry |
**Returns:** `RetryApiCallPayload!`
**Example**
```graphql
mutation RetryApiCall($input: RetryApiCallInput!) {
retryApiCall(input: $input) {
api_call {
created_at
id
request {
body
endpoint
method
}
responses {
body
date
status
}
status
title
}
code
success
}
}
```
Variables:
```json
{
"input": {
"api_call_id": ""
}
}
```
### `retryPushToEmr` [#retrypushtoemr]
Retries pushing an activity's data to the EMR.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ---------------------- | -------- | ------------------------------------------- |
| `input` | `RetryPushToEmrInput!` | Yes | The activity whose push to the EMR to retry |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation RetryPushToEmr($input: RetryPushToEmrInput!) {
retryPushToEmr(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": ""
}
}
```
### `retryWebhookCall` [#retrywebhookcall]
Retries a single webhook call.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------ | -------- | ------------------------- |
| `input` | `RetryWebhookCallInput!` | Yes | The webhook call to retry |
**Returns:** `RetryWebhookCallPayload!`
**Example**
```graphql
mutation RetryWebhookCall($input: RetryWebhookCallInput!) {
retryWebhookCall(input: $input) {
code
success
webhook_call {
created_at
event_type
id
pathway {
id
pathway_definition_id
patient_id
start_date
}
request {
body
endpoint
method
}
responses {
body
date
status
}
status
webhook_id
webhook_name
}
}
}
```
Variables:
```json
{
"input": {
"webhook_call_id": ""
}
}
```
# Care flows
URL: https://docs.awellhealth.com/api-reference/reference/care-flows
Start, stop, pause, and inspect care flows, their activities, and their data points.
## Queries [#queries]
### `baselineInfo` [#baselineinfo]
Returns the baseline info data points for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `BaselineInfoPayload!`
**Example**
```graphql
query BaselineInfo($pathway_id: String!) {
baselineInfo(pathway_id: $pathway_id) {
baselineDataPoints {
definition {
category
id
key
optional
pii
source_definition_id
title
unit
valueType
}
value
}
code
success
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `baselineInfoLog` [#baselineinfolog]
Returns a paginated log of a care flow's baseline info data points.
**Arguments**
| Argument | Type | Required | Description |
| -------------------------- | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `data_point_definition_id` | `String` | No | The ID of the data point definition |
| `data_point_key` | `String` | No | The key of the data point |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `BaselineInfoLogPayload!`
**Example**
```graphql
query BaselineInfoLog($data_point_definition_id: String, $data_point_key: String, $pagination: PaginationParams, $pathway_id: String!, $sorting: SortingParams) {
baselineInfoLog(data_point_definition_id: $data_point_definition_id, data_point_key: $data_point_key, pagination: $pagination, pathway_id: $pathway_id, sorting: $sorting) {
code
dataPoints {
activity_id
data_point_definition_id
data_set_id
date
id
key
label
serialized_value
status
valueType
}
pagination {
count
offset
total_count
}
sorting {
direction
field
}
success
}
}
```
Variables:
```json
{
"data_point_definition_id": "",
"data_point_key": "",
"pagination": {
"count": 0,
"offset": 0
},
"pathway_id": "",
"sorting": {
"direction": "",
"field": ""
}
}
```
### `getPublishedCareflowVersions` [#getpublishedcareflowversions]
Lists the published versions (releases) of a care flow definition.
**Arguments**
| Argument | Type | Required | Description |
| ------------------------ | -------- | -------- | ---------------------------------- |
| `careflow_definition_id` | `String` | No | The ID of the care flow definition |
**Returns:** `CareflowVersionsPayload!`
**Example**
```graphql
query GetPublishedCareflowVersions($careflow_definition_id: String) {
getPublishedCareflowVersions(careflow_definition_id: $careflow_definition_id) {
careflowVersions {
careflow_definition_id
versions {
live
release_date
release_id
title
version
}
}
}
}
```
Variables:
```json
{
"careflow_definition_id": ""
}
```
### `latestCareFlowDataPoints` [#latestcareflowdatapoints]
Returns the latest data point values for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | --------- | -------- | -------------------------------------------------------------- |
| `careflow_id` | `String!` | Yes | The ID of the care flow |
| `release_id` | `String!` | Yes | The ID of the published care flow definition version (release) |
**Returns:** `DataPointPayload!`
**Example**
```graphql
query LatestCareFlowDataPoints($careflow_id: String!, $release_id: String!) {
latestCareFlowDataPoints(careflow_id: $careflow_id, release_id: $release_id) {
code
dataPoints {
activity_id
data_point_definition_id
data_set_id
date
id
key
label
serialized_value
status
valueType
}
pagination {
count
offset
total_count
}
sorting {
direction
field
}
success
}
}
```
Variables:
```json
{
"careflow_id": "",
"release_id": ""
}
```
### `pathway` [#pathway]
Retrieves a single care flow by its ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | ----------------------- |
| `id` | `String!` | Yes | The ID of the care flow |
**Returns:** `PathwayPayload!`
**Example**
```graphql
query Pathway($id: String!) {
pathway(id: $id) {
code
pathway {
complete_date
created {
date
user_email
user_id
user_name
}
id
is_archived
latestActivities {
action
container_name
date
expires_at
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
pathway_definition_id
patient {
id
tenant_id
}
patient_id
release_id
start_date
status
status_explanation
stop_date
title
version
}
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `pathwayActivities` [#pathwayactivities]
Activities of a care flow. Alias of careflowActivities — the original public name, kept for backward compatibility.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
| `track_id` | `String` | No | The ID of the track |
**Returns:** `ActivitiesPayload!`
**Example**
```graphql
query PathwayActivities($pagination: PaginationParams, $pathway_id: String!, $sorting: SortingParams, $track_id: String) {
pathwayActivities(pagination: $pagination, pathway_id: $pathway_id, sorting: $sorting, track_id: $track_id) {
activities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
metadata {
stakeholders {
email
id
name
preferred_language
type
}
}
pagination {
count
offset
total_count
}
success
}
}
```
Variables:
```json
{
"pagination": {
"count": 0,
"offset": 0
},
"pathway_id": "",
"sorting": {
"direction": "",
"field": ""
},
"track_id": ""
}
```
### `pathwayDataPointDefinitions` [#pathwaydatapointdefinitions]
Lists the data point definitions for a care flow definition release.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------- | ----------------------------------------- | -------- | -------------------------------------------------------------- |
| `filters` | `FilterPathwayDataPointDefinitionsParams` | No | Filters to narrow the results |
| `pathway_definition_id` | `String` | No | The ID of the care flow definition |
| `release_id` | `String!` | Yes | The ID of the published care flow definition version (release) |
**Returns:** `PathwayDataPointDefinitionsPayload!`
**Example**
```graphql
query PathwayDataPointDefinitions($filters: FilterPathwayDataPointDefinitionsParams, $pathway_definition_id: String, $release_id: String!) {
pathwayDataPointDefinitions(filters: $filters, pathway_definition_id: $pathway_definition_id, release_id: $release_id) {
code
data_point_definitions {
category
id
key
metadata {
key
value
}
optional
pii
possibleValues {
label
value
}
range {
max
min
}
source_definition_id
title
unit
valueType
}
success
}
}
```
Variables:
```json
{
"filters": {},
"pathway_definition_id": "",
"release_id": ""
}
```
### `pathwayDataPoints` [#pathwaydatapoints]
Returns the data points collected in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------------------------- | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `activity_id` | `String` | No | The ID of the activity |
| `data_point_definition_id` | `String` | No | The ID of the data point definition |
| `data_point_key` | `String` | No | The key of the data point |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `DataPointPayload!`
**Example**
```graphql
query PathwayDataPoints($activity_id: String, $data_point_definition_id: String, $data_point_key: String, $pagination: PaginationParams, $pathway_id: String!, $sorting: SortingParams) {
pathwayDataPoints(activity_id: $activity_id, data_point_definition_id: $data_point_definition_id, data_point_key: $data_point_key, pagination: $pagination, pathway_id: $pathway_id, sorting: $sorting) {
code
dataPoints {
activity_id
data_point_definition_id
data_set_id
date
id
key
label
serialized_value
status
valueType
}
pagination {
count
offset
total_count
}
sorting {
direction
field
}
success
}
}
```
Variables:
```json
{
"activity_id": "",
"data_point_definition_id": "",
"data_point_key": "",
"pagination": {
"count": 0,
"offset": 0
},
"pathway_id": "",
"sorting": {
"direction": "",
"field": ""
}
}
```
### `pathwayFacts` [#pathwayfacts]
Returns a paginated list of facts recorded for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `PathwayFactsFilters!` | Yes | Filters to narrow the results |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `OrchestrationFactsPayload!`
**Example**
```graphql
query PathwayFacts($filters: PathwayFactsFilters!, $pagination: PaginationParams, $sorting: SortingParams) {
pathwayFacts(filters: $filters, pagination: $pagination, sorting: $sorting) {
code
facts {
content
date
level
pathway_id
}
pagination {
count
offset
total_count
}
sorting {
direction
field
}
success
}
}
```
Variables:
```json
{
"filters": {
"pathway_id": ""
},
"pagination": {
"count": 0,
"offset": 0
},
"sorting": {
"direction": "",
"field": ""
}
}
```
### `pathways` [#pathways]
Lists care flows, with optional filtering, pagination, and sorting.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `FilterPathways` | No | Filters to narrow the results |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `PathwaysPayload!`
**Example**
```graphql
query Pathways($filters: FilterPathways, $pagination: PaginationParams, $sorting: SortingParams) {
pathways(filters: $filters, pagination: $pagination, sorting: $sorting) {
code
pagination {
count
offset
total_count
}
pathways {
complete_date
id
pathway_definition_id
patient_id
start_date
status
status_explanation
stop_date
title
version
}
sorting {
direction
field
}
success
}
}
```
Variables:
```json
{
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"sorting": {
"direction": "",
"field": ""
}
}
```
### `pathwayStepActivities` [#pathwaystepactivities]
Lists the activities for a step within a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `step_id` | `String!` | Yes | The ID of the step |
**Returns:** `ActivitiesPayload!`
**Example**
```graphql
query PathwayStepActivities($pathway_id: String!, $step_id: String!) {
pathwayStepActivities(pathway_id: $pathway_id, step_id: $step_id) {
activities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
metadata {
stakeholders {
email
id
name
preferred_language
type
}
}
pagination {
count
offset
total_count
}
success
}
}
```
Variables:
```json
{
"pathway_id": "",
"step_id": ""
}
```
### `publishedPathwayDefinitions` [#publishedpathwaydefinitions]
Lists the published care flow definitions.
**Returns:** `PublishedPathwayDefinitionsPayload!`
**Example**
```graphql
query PublishedPathwayDefinitions {
publishedPathwayDefinitions {
code
pagination {
count
offset
total_count
}
publishedPathwayDefinitions {
created {
date
user_email
user_id
user_name
}
data_point_definitions {
category
id
key
optional
pii
source_definition_id
title
unit
valueType
}
data_store_version
id
last_updated {
date
user_email
user_id
user_name
}
release_date
release_id
title
version
}
sorting {
direction
field
}
success
}
}
```
## Mutations [#mutations]
### `completeCareflow` [#completecareflow]
Complete a care flow explicitly (the outcome happened). Records manual completion provenance (who/why); a no-op when the care flow is already completed or stopped.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------ | -------- | ---------------------------------------- |
| `input` | `CompleteCareflowInput!` | Yes | The details of the care flow to complete |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation CompleteCareflow($input: CompleteCareflowInput!) {
completeCareflow(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"careflow_id": ""
}
}
```
### `deletePathway` [#deletepathway]
Deletes a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | -------------------------------------- |
| `input` | `DeletePathwayInput!` | Yes | The details of the care flow to delete |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation DeletePathway($input: DeletePathwayInput!) {
deletePathway(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": ""
}
}
```
### `pauseCareFlow` [#pausecareflow]
Pauses a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | ------------------------------------- |
| `input` | `PauseCareFlowInput!` | Yes | The details of the care flow to pause |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation PauseCareFlow($input: PauseCareFlowInput!) {
pauseCareFlow(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"careflow_id": ""
}
}
```
### `saveBaselineInfo` [#savebaselineinfo]
Saves the baseline info for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------ | -------- | ------------------------- |
| `input` | `SaveBaselineInfoInput!` | Yes | The baseline info to save |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation SaveBaselineInfo($input: SaveBaselineInfoInput!) {
saveBaselineInfo(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"baseline_info": [
{
"data_point_definition_id": "",
"value": ""
}
],
"pathway_id": ""
}
}
```
### `startPathway` [#startpathway]
Starts a care flow for a patient from a care flow definition.
**Arguments**
| Argument | Type | Required | Description |
| -------- | -------------------- | -------- | ------------------------------------- |
| `input` | `StartPathwayInput!` | Yes | The details of the care flow to start |
**Returns:** `StartPathwayPayload!`
**Example**
```graphql
mutation StartPathway($input: StartPathwayInput!) {
startPathway(input: $input) {
code
pathway_id
stakeholders {
clinical_app_role
definition_id
id
label {
en
}
release_id
version
}
success
}
}
```
Variables:
```json
{
"input": {
"pathway_definition_id": "",
"patient_id": ""
}
}
```
### `startPathwayWithPatientIdentifier` [#startpathwaywithpatientidentifier]
Starts a care flow for the patient matching a business identifier.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------------------------- | -------- | ----------------------------------------------------------------------- |
| `input` | `StartPathwayWithPatientIdentifierInput!` | Yes | The details of the care flow to start, including the patient identifier |
**Returns:** `StartPathwayWithPatientIdentifierPayload!`
**Example**
```graphql
mutation StartPathwayWithPatientIdentifier($input: StartPathwayWithPatientIdentifierInput!) {
startPathwayWithPatientIdentifier(input: $input) {
code
pathway_id
patient_id
stakeholders {
clinical_app_role
definition_id
id
label {
en
}
release_id
version
}
success
}
}
```
Variables:
```json
{
"input": {
"pathway_definition_id": "",
"patient_identifier": {
"system": "",
"value": ""
}
}
}
```
### `stopPathway` [#stoppathway]
Stops a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------- | -------- | ------------------------------------ |
| `input` | `StopPathwayInput!` | Yes | The details of the care flow to stop |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation StopPathway($input: StopPathwayInput!) {
stopPathway(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": ""
}
}
```
### `unpauseCareFlow` [#unpausecareflow]
Resumes a paused care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------- | -------- | --------------------------------------- |
| `input` | `UnpauseCareFlowInput!` | Yes | The details of the care flow to unpause |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation UnpauseCareFlow($input: UnpauseCareFlowInput!) {
unpauseCareFlow(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"careflow_id": ""
}
}
```
### `updateBaselineInfo` [#updatebaselineinfo]
Updates the baseline info for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | -------------------------- | -------- | --------------------------- |
| `input` | `UpdateBaselineInfoInput!` | Yes | The baseline info to update |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation UpdateBaselineInfo($input: UpdateBaselineInfoInput!) {
updateBaselineInfo(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"baseline_info": [
{
"data_point_definition_id": "",
"value": ""
}
],
"pathway_id": ""
}
}
```
# Hosted sessions & pages
URL: https://docs.awellhealth.com/api-reference/reference/hosted-sessions
Start and complete Awell-hosted sessions and hosted pages for stakeholders to complete activities.
## Queries [#queries]
### `hostedPagesLink` [#hostedpageslink]
Returns the hosted pages link for a stakeholder in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ---------------- | --------- | -------- | ------------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
| `stakeholder_id` | `String!` | Yes | The ID of the stakeholder |
**Returns:** `HostedPagesLinkPayload!`
**Example**
```graphql
query HostedPagesLink($pathway_id: String!, $stakeholder_id: String!) {
hostedPagesLink(pathway_id: $pathway_id, stakeholder_id: $stakeholder_id) {
code
hosted_pages_link {
id
pathway_id
stakeholder_id
url
}
success
}
}
```
Variables:
```json
{
"pathway_id": "",
"stakeholder_id": ""
}
```
### `hostedPagesLinks` [#hostedpageslinks]
Returns the hosted pages links for all stakeholders in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `HostedPagesLinksPayload!`
**Example**
```graphql
query HostedPagesLinks($pathway_id: String!) {
hostedPagesLinks(pathway_id: $pathway_id) {
code
hosted_pages_links {
id
pathway_id
stakeholder_definition_id
stakeholder_id
stakeholder_label
url
}
success
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `hostedSession` [#hostedsession]
Returns the current hosted session, including its branding, metadata, and session details.
**Returns:** `HostedSessionPayload!`
**Example**
```graphql
query HostedSession {
hostedSession {
branding {
accent_color
custom_theme
hosted_page_auto_progress
hosted_page_autosave
hosted_page_title
logo_url
}
code
metadata {
pathway_definition_id
tenant_id
}
session {
cancel_url
created_at
expires_at
id
organization_slug
pathway_id
stakeholder {
id
name
type
}
status
success_url
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
user_context {
stytch_member_email
stytch_member_id
}
}
success
}
}
```
### `hostedSessionActivities` [#hostedsessionactivities]
Returns the activities for the current hosted session.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------------- | --------- | -------- | --------------------------------------------------- |
| `only_stakeholder_activities` | `Boolean` | No | Whether to return only the stakeholder's activities |
**Returns:** `HostedSessionActivitiesPayload!`
**Example**
```graphql
query HostedSessionActivities($only_stakeholder_activities: Boolean) {
hostedSessionActivities(only_stakeholder_activities: $only_stakeholder_activities) {
activities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
code
success
}
}
```
Variables:
```json
{
"only_stakeholder_activities": true
}
```
## Mutations [#mutations]
### `completeSession` [#completesession]
Completes a hosted session.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------- | -------- | --------------------------------------------- |
| `input` | `CompleteSessionInput!` | Yes | The input identifying the session to complete |
**Returns:** `CompleteSessionPayload!`
**Example**
```graphql
mutation CompleteSession($input: CompleteSessionInput!) {
completeSession(input: $input) {
code
session {
cancel_url
created_at
expires_at
id
organization_slug
pathway_id
stakeholder {
id
name
type
}
status
success_url
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
user_context {
stytch_member_email
stytch_member_id
}
}
success
}
}
```
Variables:
```json
{
"input": {
"session_id": ""
}
}
```
### `startHostedActivitySession` [#starthostedactivitysession]
Starts a hosted activity session for a stakeholder in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ---------------------------------- | -------- | -------------------------------------------------- |
| `input` | `StartHostedActivitySessionInput!` | Yes | The input for starting the hosted activity session |
**Returns:** `StartHostedActivitySessionPayload!`
**Example**
```graphql
mutation StartHostedActivitySession($input: StartHostedActivitySessionInput!) {
startHostedActivitySession(input: $input) {
code
language
organization_slug
session_id
session_url
success
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
user_context {
stytch_member_email
stytch_member_id
}
}
}
```
Variables:
```json
{
"input": {
"pathway_id": "",
"stakeholder_id": ""
}
}
```
### `startHostedActivitySessionViaHostedPagesLink` [#starthostedactivitysessionviahostedpageslink]
Starts a hosted activity session from a hosted pages link.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ---------------------------------------------------- | -------- | -------------------------------------------------------------------------- |
| `input` | `StartHostedActivitySessionViaHostedPagesLinkInput!` | Yes | The input for starting the hosted activity session via a hosted pages link |
**Returns:** `StartHostedActivitySessionPayload!`
**Example**
```graphql
mutation StartHostedActivitySessionViaHostedPagesLink($input: StartHostedActivitySessionViaHostedPagesLinkInput!) {
startHostedActivitySessionViaHostedPagesLink(input: $input) {
code
language
organization_slug
session_id
session_url
success
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
user_context {
stytch_member_email
stytch_member_id
}
}
}
```
Variables:
```json
{
"input": {
"hosted_pages_link_id": ""
}
}
```
### `startHostedPathwaySession` [#starthostedpathwaysession]
Start a hosted pathway session for a patient uniquely identified by patient\_id or patient\_identifier. If neither patient\_id or patient\_identifier is provided, a new anonymous patient will be created.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------------------- | -------- | --------------------------------------------------- |
| `input` | `StartHostedPathwaySessionInput!` | Yes | The input for starting the hosted care flow session |
**Returns:** `StartHostedPathwaySessionPayload!`
**Example**
```graphql
mutation StartHostedPathwaySession($input: StartHostedPathwaySessionInput!) {
startHostedPathwaySession(input: $input) {
code
organization_slug
pathway_id
session_id
session_url
stakeholder {
id
name
type
}
success
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
user_context {
stytch_member_email
stytch_member_id
}
}
}
```
Variables:
```json
{
"input": {
"pathway_definition_id": ""
}
}
```
### `startHostedPathwaySessionFromLink` [#starthostedpathwaysessionfromlink]
Starts a hosted care flow session from a link.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------------------------- | -------- | --------------------------------------------------------------- |
| `input` | `StartHostedPathwaySessionFromLinkInput!` | Yes | The input for starting the hosted care flow session from a link |
**Returns:** `StartHostedPathwaySessionFromLinkPayload!`
**Example**
```graphql
mutation StartHostedPathwaySessionFromLink($input: StartHostedPathwaySessionFromLinkInput!) {
startHostedPathwaySessionFromLink(input: $input) {
code
organization_slug
session_url
success
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
}
}
```
Variables:
```json
{
"input": {
"id": ""
}
}
```
# Reference
URL: https://docs.awellhealth.com/api-reference/reference
The queries, mutations, and subscriptions in the Orchestration API, grouped by the object each one
acts on. For the behavior that applies across all of them (authentication, paging, errors,
versions), see [Guides](/api-reference/guides).
## Operations by object [#operations-by-object]
| Page | Covers |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [Patients](/api-reference/reference/patients) | Create, find, update, and manage patients and their data points. |
| [Care flows](/api-reference/reference/care-flows) | Start, stop, pause, and inspect care flows, their activities, and their data points. |
| [Activities](/api-reference/reference/activities) | Query the activities in a care flow, and retry, expire, or annotate them. |
| [Activity types](/api-reference/reference/activity-types) | Forms, checklists, messages, clinical notes, calculations, and EMR reports. |
| [Tracks](/api-reference/reference/tracks) | Query and schedule tracks — the groupings of steps within a care flow. |
| [Stakeholders](/api-reference/reference/stakeholders) | Look up the stakeholders that participate in a care flow. |
| [Timers](/api-reference/reference/timers) | Query and expire the timers that delay steps. |
| [Hosted sessions & pages](/api-reference/reference/hosted-sessions) | Start and complete Awell-hosted sessions for stakeholders. |
| [API calls & webhooks](/api-reference/reference/api-calls-and-webhooks) | Inspect the calls a care flow makes, and retry failed ones. |
| [Subscriptions](/api-reference/reference/subscriptions) | Real-time events for activities, sessions, care flows, API calls, and webhooks. |
| [Tenant](/api-reference/reference/tenant) | Read information about the current tenant. |
# Patients
URL: https://docs.awellhealth.com/api-reference/reference/patients
Patients are the people receiving care in Awell. Use these operations to create and update
patients, look them up by Awell ID or by a business identifier, and read or write their data
points.
Pick the retrieval operation based on the identifier you hold:
| Operation | When to use |
| --------------------------------------------- | ----------------------------------------------------------- |
| [`patient`](#patient) | You have the Awell patient ID. |
| [`patientByIdentifier`](#patientbyidentifier) | You have a business identifier (a `system` + `value` pair). |
A **business identifier** is a `system` + `value` pair, following the FHIR identifier model. The
`system` is a namespace, given as an absolute URL so the pair is globally unique. The `value` is the
identifier within that namespace. One patient can hold several: an MRN from one system, a payer ID
from another. For the full treatment, see
[patient identifiers](https://developers.awellhealth.com/awell-orchestration/docs/misc/patient-identifiers)
on the developer hub.
## Queries [#queries]
### `patient` [#patient]
Retrieves a single patient by their Awell ID.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | --------------------------- |
| `id` | `String!` | Yes | The Awell ID of the patient |
**Returns:** `PatientPayload!`
**Example**
```graphql
query Patient($id: String!) {
patient(id: $id) {
code
patient {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"id": ""
}
```
### `patientByIdentifier` [#patientbyidentifier]
Retrieves a single patient by a business identifier (a system and value pair).
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------- | -------- | --------------------- |
| `system` | `String!` | Yes | The identifier system |
| `value` | `String!` | Yes | The identifier value |
**Returns:** `PatientPayload!`
**Example**
```graphql
query PatientByIdentifier($system: String!, $value: String!) {
patientByIdentifier(system: $system, value: $value) {
code
patient {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"system": "",
"value": ""
}
```
### `patientDataPointHistory` [#patientdatapointhistory]
Full change history (newest first) of one of a patient's data points, with every value audited.
**Arguments**
| Argument | Type | Required | Description |
| -------------------------- | --------- | -------- | ----------------------------------- |
| `data_point_definition_id` | `String!` | Yes | The ID of the data point definition |
| `patient_id` | `String!` | Yes | The ID of the patient |
**Returns:** `[PatientDataPointGraphqlType!]!`
**Example**
```graphql
query PatientDataPointHistory($data_point_definition_id: String!, $patient_id: String!) {
patientDataPointHistory(data_point_definition_id: $data_point_definition_id, patient_id: $patient_id) {
activity_id
data_point_definition_id
data_set_id
data_source_id
date
id
key
label
provenance {
activity_id
actor
actor_email
actor_name
careflow_id
collected_at
ingestion_id
method
step_id
track_id
}
serialized_value
status
valueType
}
}
```
Variables:
```json
{
"data_point_definition_id": "",
"patient_id": ""
}
```
### `patientDataPoints` [#patientdatapoints]
Latest value per data point for a patient, as shown in the data viewer's list.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | --------------------- |
| `patient_id` | `String!` | Yes | The ID of the patient |
**Returns:** `[PatientDataPointGraphqlType!]!`
**Example**
```graphql
query PatientDataPoints($patient_id: String!) {
patientDataPoints(patient_id: $patient_id) {
activity_id
data_point_definition_id
data_set_id
data_source_id
date
id
key
label
provenance {
activity_id
actor
actor_email
actor_name
careflow_id
collected_at
ingestion_id
method
step_id
track_id
}
serialized_value
status
valueType
}
}
```
Variables:
```json
{
"patient_id": ""
}
```
### `patientDemographicsQueryConfiguration` [#patientdemographicsqueryconfiguration]
Returns the configuration for querying patient demographics.
**Returns:** `PatientDemographicsQueryConfigurationPayload!`
**Example**
```graphql
query PatientDemographicsQueryConfiguration {
patientDemographicsQueryConfiguration {
input_box_text
is_enabled
}
}
```
### `patientPathways` [#patientpathways]
Lists the care flows for a patient.
**Arguments**
| Argument | Type | Required | Description |
| -------------------- | ----------------------- | -------- | --------------------------------------------------------------- |
| `filters` | `FilterPatientPathways` | No | Filters to narrow the results |
| `patient_id` | `String` | No | The ID of the patient |
| `patient_identifier` | `IdentifierInput` | No | A business identifier for the patient (a system and value pair) |
**Returns:** `PatientPathwaysPayload!`
**Example**
```graphql
query PatientPathways($filters: FilterPatientPathways, $patient_id: String, $patient_identifier: IdentifierInput) {
patientPathways(filters: $filters, patient_id: $patient_id, patient_identifier: $patient_identifier) {
code
patientPathways {
active_activities
archived_date
baseline_info {
value
}
complete_date
created {
date
user_email
user_id
user_name
}
failed_activities
id
is_archived
latest_activity_date
latest_activity_title
latest_activity_type
pathway_definition_id
release_id
start_date
status
status_explanation
stop_date
title
total_activities
version
}
success
}
}
```
Variables:
```json
{
"filters": {
"status": {}
},
"patient_id": "",
"patient_identifier": {
"system": "",
"value": ""
}
}
```
### `patients` [#patients]
Lists patients, with optional filtering, pagination, and sorting.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | ------------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| `filters` | `FilterPatients` | No | Filters to narrow the results |
| `pagination` | `PaginationParams` | No | How many results to return and the offset to start from — see [Pagination](/api-reference/guides/pagination) |
| `sorting` | `SortingParams` | No | The field to sort by and the sort direction — see [Pagination](/api-reference/guides/pagination) |
**Returns:** `PatientsPayload!`
**Example**
```graphql
query Patients($filters: FilterPatients, $pagination: PaginationParams, $sorting: SortingParams) {
patients(filters: $filters, pagination: $pagination, sorting: $sorting) {
code
pagination {
count
offset
total_count
}
patients {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
sorting {
direction
field
}
success
}
}
```
Variables:
```json
{
"filters": {},
"pagination": {
"count": 0,
"offset": 0
},
"sorting": {
"direction": "",
"field": ""
}
}
```
### `searchPatientsByNationalRegistryNumber` [#searchpatientsbynationalregistrynumber]
Searches for patients by national registry number.
**Arguments**
| Argument | Type | Required | Description |
| -------------------------- | --------- | -------- | -------------------------------------- |
| `national_registry_number` | `String!` | Yes | The patient's national registry number |
**Returns:** `SearchPatientsPayload!`
**Example**
```graphql
query SearchPatientsByNationalRegistryNumber($national_registry_number: String!) {
searchPatientsByNationalRegistryNumber(national_registry_number: $national_registry_number) {
code
patients {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"national_registry_number": ""
}
```
### `searchPatientsByPatientCode` [#searchpatientsbypatientcode]
Searches for patients by patient code.
**Arguments**
| Argument | Type | Required | Description |
| -------------- | --------- | -------- | ---------------- |
| `patient_code` | `String!` | Yes | The patient code |
**Returns:** `SearchPatientsPayload!`
**Example**
```graphql
query SearchPatientsByPatientCode($patient_code: String!) {
searchPatientsByPatientCode(patient_code: $patient_code) {
code
patients {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"patient_code": ""
}
```
## Mutations [#mutations]
### `addIdentifierToPatient` [#addidentifiertopatient]
Adds a business identifier to a patient.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------------ | -------- | -------------------------------------------------- |
| `input` | `AddIdentifierToPatientInput!` | Yes | The identifier to add and the patient to add it to |
**Returns:** `AddIdentifierToPatientPayload!`
**Example**
```graphql
mutation AddIdentifierToPatient($input: AddIdentifierToPatientInput!) {
addIdentifierToPatient(input: $input) {
code
patient {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"input": {
"identifier": {
"system": "",
"value": ""
},
"patient_id": ""
}
}
```
### `clearPatientData` [#clearpatientdata]
Clear patient data-point values by stable id: appends a null "no value" version per profile field (restorable from history); removes the patient’s value for an identifier system.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------ | -------- | ------------------------------------------ |
| `input` | `ClearPatientDataInput!` | Yes | The details of which patient data to clear |
**Returns:** `[PatientDataPointGraphqlType!]!`
**Example**
```graphql
mutation ClearPatientData($input: ClearPatientDataInput!) {
clearPatientData(input: $input) {
activity_id
data_point_definition_id
data_set_id
data_source_id
date
id
key
label
provenance {
activity_id
actor
actor_email
actor_name
careflow_id
collected_at
ingestion_id
method
step_id
track_id
}
serialized_value
status
valueType
}
}
```
Variables:
```json
{
"input": {
"keys": [
""
],
"patient_id": ""
}
}
```
### `createPatient` [#createpatient]
Creates a patient.
**Arguments**
| Argument | Type | Required | Description |
| -------- | -------------------- | -------- | ------------------------------------ |
| `input` | `CreatePatientInput` | No | The details of the patient to create |
**Returns:** `CreatePatientPayload!`
**Example**
```graphql
mutation CreatePatient($input: CreatePatientInput) {
createPatient(input: $input) {
code
patient {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"input": {}
}
```
### `deletePatient` [#deletepatient]
Deletes a patient.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | ------------------------------------ |
| `input` | `DeletePatientInput!` | Yes | The details of the patient to delete |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation DeletePatient($input: DeletePatientInput!) {
deletePatient(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {}
}
```
### `mergePatients` [#mergepatients]
Merges two patients into one, transferring the deleted patient's care flows to the patient that is kept.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | --------------------------------------------- |
| `input` | `MergePatientsInput!` | Yes | The patient to keep and the patient to delete |
**Returns:** `MergePatientsPayload!`
**Example**
```graphql
mutation MergePatients($input: MergePatientsInput!) {
mergePatients(input: $input) {
code
deleted_patient_id
success
transferred_careflow_ids
transferred_count
}
}
```
Variables:
```json
{
"input": {
"patient_id_to_delete": "",
"patient_id_to_keep": ""
}
}
```
### `requestPatientDemographics` [#requestpatientdemographics]
Retrieve patient demographics from an external system
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------------- | -------- | --------------------------------------- |
| `input` | `PatientDemographicsInput!` | Yes | The details of the demographics request |
**Returns:** `PatientDemographicsPayload!`
**Example**
```graphql
mutation RequestPatientDemographics($input: PatientDemographicsInput!) {
requestPatientDemographics(input: $input) {
code
entry {
address {
city
country
state
street
zip
}
birth_date
email
first_name
identifier {
system
value
}
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
query_id
status
success
total
}
}
```
Variables:
```json
{
"input": {
"patient_identifier": ""
}
}
```
### `setPatientDataPointValue` [#setpatientdatapointvalue]
Manually set a patient data-point value, the operation behind the patient data viewer's Save/Restore.
**Arguments**
| Argument | Type | Required | Description |
| -------- | -------------------------------- | -------- | --------------------------- |
| `input` | `SetPatientDataPointValueInput!` | Yes | The data point value to set |
**Returns:** `PatientDataPointGraphqlType`
**Example**
```graphql
mutation SetPatientDataPointValue($input: SetPatientDataPointValueInput!) {
setPatientDataPointValue(input: $input) {
activity_id
data_point_definition_id
data_set_id
data_source_id
date
id
key
label
provenance {
activity_id
actor
actor_email
actor_name
careflow_id
collected_at
ingestion_id
method
step_id
track_id
}
serialized_value
status
valueType
}
}
```
Variables:
```json
{
"input": {
"data_point_definition_id": "",
"patient_id": "",
"valueType": "ATTACHMENT"
}
}
```
### `updatePatient` [#updatepatient]
Updates a patient's profile.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | ------------------------------------ |
| `input` | `UpdatePatientInput!` | Yes | The details of the patient to update |
**Returns:** `UpdatePatientPayload!`
**Example**
```graphql
mutation UpdatePatient($input: UpdatePatientInput!) {
updatePatient(input: $input) {
code
patient {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"input": {
"patient_id": "",
"profile": {}
}
}
```
### `updatePatientData` [#updatepatientdata]
Write patient-profile data-point VALUES (profile fields + identifier values) to the patient-data store. Values only.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------------- | -------- | -------------------------- |
| `input` | `UpdatePatientDataInput!` | Yes | The patient data to update |
**Returns:** `[PatientDataPointGraphqlType!]!`
**Example**
```graphql
mutation UpdatePatientData($input: UpdatePatientDataInput!) {
updatePatientData(input: $input) {
activity_id
data_point_definition_id
data_set_id
data_source_id
date
id
key
label
provenance {
activity_id
actor
actor_email
actor_name
careflow_id
collected_at
ingestion_id
method
step_id
track_id
}
serialized_value
status
valueType
}
}
```
Variables:
```json
{
"input": {
"patient_id": ""
}
}
```
### `updatePatientDemographicsQuery` [#updatepatientdemographicsquery]
Update which patient was created after import request for logging purposes
**Arguments**
| Argument | Type | Required | Description |
| -------- | -------------------------------------- | -------- | ----------------------------------------------- |
| `input` | `UpdatePatientDemographicsQueryInput!` | Yes | The details of the demographics query to update |
**Returns:** `UpdatePatientDemographicsQueryPayload!`
**Example**
```graphql
mutation UpdatePatientDemographicsQuery($input: UpdatePatientDemographicsQueryInput!) {
updatePatientDemographicsQuery(input: $input) {
code
created_patient_entry_index
created_patient_id
success
}
}
```
Variables:
```json
{
"input": {
"created_patient_entry_index": 0,
"created_patient_id": "",
"query_id": ""
}
}
```
### `updatePatientLanguage` [#updatepatientlanguage]
Updates a patient's preferred language.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------------------- | -------- | ----------------------------------------- |
| `input` | `UpdatePatientLanguageInput!` | Yes | The patient and preferred language to set |
**Returns:** `UpdatePatientLanguagePayload!`
**Example**
```graphql
mutation UpdatePatientLanguage($input: UpdatePatientLanguageInput!) {
updatePatientLanguage(input: $input) {
code
success
user {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
}
}
```
Variables:
```json
{
"input": {
"preferred_language": ""
}
}
```
### `upsertPatient` [#upsertpatient]
Creates a patient, or updates the existing patient matching the identifier.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | ---------------------------------------------- |
| `input` | `UpsertPatientInput!` | Yes | The details of the patient to create or update |
**Returns:** `UpsertPatientPayload!`
**Example**
```graphql
mutation UpsertPatient($input: UpsertPatientInput!) {
upsertPatient(input: $input) {
code
patient {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
success
}
}
```
Variables:
```json
{
"input": {
"patient_identifier": {
"system": "",
"value": ""
}
}
}
```
# Stakeholders
URL: https://docs.awellhealth.com/api-reference/reference/stakeholders
Look up the stakeholders that participate in a care flow.
## Queries [#queries]
### `filterStakeholders` [#filterstakeholders]
Returns the stakeholders matching the given care flow definition, release, and stakeholder definition filters.
**Arguments**
| Argument | Type | Required | Description |
| ---------------------------- | ----------- | -------- | ----------------------------------------------------------------- |
| `pathway_definition_ids` | `[String!]` | No | The IDs of the care flow definitions |
| `release_ids` | `[String!]` | No | The IDs of the published care flow definition versions (releases) |
| `stakeholder_definition_ids` | `[String!]` | No | The IDs of the stakeholder definitions |
**Returns:** `StakeholdersPayload!`
**Example**
```graphql
query FilterStakeholders($pathway_definition_ids: [String!], $release_ids: [String!], $stakeholder_definition_ids: [String!]) {
filterStakeholders(pathway_definition_ids: $pathway_definition_ids, release_ids: $release_ids, stakeholder_definition_ids: $stakeholder_definition_ids) {
code
stakeholders {
clinical_app_role
definition_id
id
label {
en
}
release_id
version
}
success
}
}
```
Variables:
```json
{
"pathway_definition_ids": [
""
],
"release_ids": [
""
],
"stakeholder_definition_ids": [
""
]
}
```
### `stakeholdersByDefinitionIds` [#stakeholdersbydefinitionids]
Returns the stakeholders for the given stakeholder definition IDs.
**Arguments**
| Argument | Type | Required | Description |
| ---------------------------- | ------------ | -------- | -------------------------------------- |
| `stakeholder_definition_ids` | `[String!]!` | Yes | The IDs of the stakeholder definitions |
**Returns:** `StakeholdersPayload!`
**Example**
```graphql
query StakeholdersByDefinitionIds($stakeholder_definition_ids: [String!]!) {
stakeholdersByDefinitionIds(stakeholder_definition_ids: $stakeholder_definition_ids) {
code
stakeholders {
clinical_app_role
definition_id
id
label {
en
}
release_id
version
}
success
}
}
```
Variables:
```json
{
"stakeholder_definition_ids": [
""
]
}
```
### `stakeholdersByPathwayDefinitionIds` [#stakeholdersbypathwaydefinitionids]
Returns the stakeholders for the given care flow definition IDs.
**Arguments**
| Argument | Type | Required | Description |
| ------------------------ | ------------ | -------- | ------------------------------------ |
| `pathway_definition_ids` | `[String!]!` | Yes | The IDs of the care flow definitions |
**Returns:** `StakeholdersPayload!`
**Example**
```graphql
query StakeholdersByPathwayDefinitionIds($pathway_definition_ids: [String!]!) {
stakeholdersByPathwayDefinitionIds(pathway_definition_ids: $pathway_definition_ids) {
code
stakeholders {
clinical_app_role
definition_id
id
label {
en
}
release_id
version
}
success
}
}
```
Variables:
```json
{
"pathway_definition_ids": [
""
]
}
```
### `stakeholdersByReleaseIds` [#stakeholdersbyreleaseids]
Returns the stakeholders for the given published care flow definition versions (releases).
**Arguments**
| Argument | Type | Required | Description |
| ------------- | ------------ | -------- | ----------------------------------------------------------------- |
| `release_ids` | `[String!]!` | Yes | The IDs of the published care flow definition versions (releases) |
**Returns:** `StakeholdersPayload!`
**Example**
```graphql
query StakeholdersByReleaseIds($release_ids: [String!]!) {
stakeholdersByReleaseIds(release_ids: $release_ids) {
code
stakeholders {
clinical_app_role
definition_id
id
label {
en
}
release_id
version
}
success
}
}
```
Variables:
```json
{
"release_ids": [
""
]
}
```
# Subscriptions
URL: https://docs.awellhealth.com/api-reference/reference/subscriptions
Real-time GraphQL subscriptions for activity, session, care flow, API call, and webhook events.
## Subscriptions [#subscriptions]
### `activityCompleted` [#activitycompleted]
Emits when an activity is completed.
**Arguments**
| Argument | Type | Required | Description |
| ------------------------- | --------- | -------- | --------------------------------------- |
| `only_patient_activities` | `Boolean` | No | Only emit events for patient activities |
| `pathway_id` | `String` | No | The ID of the care flow |
**Returns:** `Activity!`
**Example**
```graphql
subscription ActivityCompleted($only_patient_activities: Boolean, $pathway_id: String) {
activityCompleted(only_patient_activities: $only_patient_activities, pathway_id: $pathway_id) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_patient_activities": true,
"pathway_id": ""
}
```
### `activityCreated` [#activitycreated]
Emits when an activity is created.
**Arguments**
| Argument | Type | Required | Description |
| ------------------------- | --------- | -------- | --------------------------------------- |
| `only_patient_activities` | `Boolean` | No | Only emit events for patient activities |
| `pathway_id` | `String` | No | The ID of the care flow |
**Returns:** `Activity!`
**Example**
```graphql
subscription ActivityCreated($only_patient_activities: Boolean, $pathway_id: String) {
activityCreated(only_patient_activities: $only_patient_activities, pathway_id: $pathway_id) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_patient_activities": true,
"pathway_id": ""
}
```
### `activityExpired` [#activityexpired]
Emits when an activity expires.
**Arguments**
| Argument | Type | Required | Description |
| ------------------------- | --------- | -------- | --------------------------------------- |
| `only_patient_activities` | `Boolean` | No | Only emit events for patient activities |
| `pathway_id` | `String` | No | The ID of the care flow |
**Returns:** `Activity!`
**Example**
```graphql
subscription ActivityExpired($only_patient_activities: Boolean, $pathway_id: String) {
activityExpired(only_patient_activities: $only_patient_activities, pathway_id: $pathway_id) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_patient_activities": true,
"pathway_id": ""
}
```
### `activityUpdated` [#activityupdated]
Emits when an activity is updated.
**Arguments**
| Argument | Type | Required | Description |
| ------------------------- | --------- | -------- | --------------------------------------- |
| `only_patient_activities` | `Boolean` | No | Only emit events for patient activities |
| `pathway_id` | `String` | No | The ID of the care flow |
**Returns:** `Activity!`
**Example**
```graphql
subscription ActivityUpdated($only_patient_activities: Boolean, $pathway_id: String) {
activityUpdated(only_patient_activities: $only_patient_activities, pathway_id: $pathway_id) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_patient_activities": true,
"pathway_id": ""
}
```
### `apiCallCreated` [#apicallcreated]
Emits when an API call is created.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ApiCall!`
**Example**
```graphql
subscription ApiCallCreated($pathway_id: String!) {
apiCallCreated(pathway_id: $pathway_id) {
created_at
id
request {
body
endpoint
headers {
key
value
}
method
}
responses {
body
date
status
}
status
title
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `apiCallUpdated` [#apicallupdated]
Emits when an API call is updated.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ApiCall!`
**Example**
```graphql
subscription ApiCallUpdated($pathway_id: String!) {
apiCallUpdated(pathway_id: $pathway_id) {
created_at
id
request {
body
endpoint
headers {
key
value
}
method
}
responses {
body
date
status
}
status
title
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `pathwayUpdated` [#pathwayupdated]
Emits when a care flow is updated.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----- | -------- | ----------------------- |
| `id` | `ID!` | Yes | The ID of the care flow |
**Returns:** `Pathway!`
**Example**
```graphql
subscription PathwayUpdated($id: ID!) {
pathwayUpdated(id: $id) {
complete_date
created {
date
user_email
user_id
user_name
}
id
is_archived
latestActivities {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
pathway_definition_id
patient {
id
profile {
birth_date
email
first_name
last_name
mobile_phone
name
national_registry_number
patient_code
patient_timezone
phone
preferred_language
sex
}
tenant_id
}
patient_id
release_id
start_date
status
status_explanation
stop_date
title
version
}
}
```
Variables:
```json
{
"id": ""
}
```
### `sessionActivityCompleted` [#sessionactivitycompleted]
Emits when an activity in a hosted session is completed.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------------- | --------- | -------- | ------------------------------------------- |
| `only_stakeholder_activities` | `Boolean` | No | Only emit events for stakeholder activities |
**Returns:** `Activity!`
**Example**
```graphql
subscription SessionActivityCompleted($only_stakeholder_activities: Boolean) {
sessionActivityCompleted(only_stakeholder_activities: $only_stakeholder_activities) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_stakeholder_activities": true
}
```
### `sessionActivityCreated` [#sessionactivitycreated]
Emits when an activity in a hosted session is created.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------------- | --------- | -------- | ------------------------------------------- |
| `only_stakeholder_activities` | `Boolean` | No | Only emit events for stakeholder activities |
**Returns:** `Activity!`
**Example**
```graphql
subscription SessionActivityCreated($only_stakeholder_activities: Boolean) {
sessionActivityCreated(only_stakeholder_activities: $only_stakeholder_activities) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_stakeholder_activities": true
}
```
### `sessionActivityExpired` [#sessionactivityexpired]
Emits when an activity in a hosted session expires.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------------- | --------- | -------- | ------------------------------------------- |
| `only_stakeholder_activities` | `Boolean` | No | Only emit events for stakeholder activities |
**Returns:** `Activity!`
**Example**
```graphql
subscription SessionActivityExpired($only_stakeholder_activities: Boolean) {
sessionActivityExpired(only_stakeholder_activities: $only_stakeholder_activities) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_stakeholder_activities": true
}
```
### `sessionActivityUpdated` [#sessionactivityupdated]
Emits when an activity in a hosted session is updated.
**Arguments**
| Argument | Type | Required | Description |
| ----------------------------- | --------- | -------- | ------------------------------------------- |
| `only_stakeholder_activities` | `Boolean` | No | Only emit events for stakeholder activities |
**Returns:** `Activity!`
**Example**
```graphql
subscription SessionActivityUpdated($only_stakeholder_activities: Boolean) {
sessionActivityUpdated(only_stakeholder_activities: $only_stakeholder_activities) {
action
action_component {
definition_id
release_id
title
}
container_name
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
date
expires_at
form {
definition_id
id
key
metadata
previous_answers {
activity_id
date
}
questions {
dataPointValueType
definition_id
id
key
metadata
page
questionType
title
title_html
userQuestionType
}
release_id
title
trademark
}
form_display_mode
icon_url
id
isUserActivity
metadata
public
reference_id
reference_type
resolution
session_id
status
stream_id
}
}
```
Variables:
```json
{
"only_stakeholder_activities": true
}
```
### `sessionCompleted` [#sessioncompleted]
Emits when a hosted session is completed.
**Returns:** `HostedSession!`
**Example**
```graphql
subscription SessionCompleted {
sessionCompleted {
cancel_url
created_at
expires_at
id
organization_slug
pathway_id
stakeholder {
id
name
type
}
status
success_url
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
user_context {
stytch_member_email
stytch_member_id
}
}
}
```
### `sessionExpired` [#sessionexpired]
Emits when a hosted session expires.
**Returns:** `HostedSession!`
**Example**
```graphql
subscription SessionExpired {
sessionExpired {
cancel_url
created_at
expires_at
id
organization_slug
pathway_id
stakeholder {
id
name
type
}
status
success_url
tracking {
custom
utm_campaign
utm_content
utm_medium
utm_source
utm_term
}
user_context {
stytch_member_email
stytch_member_id
}
}
}
```
### `webhookCallCreated` [#webhookcallcreated]
Emits when a webhook call is created.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `WebhookCall!`
**Example**
```graphql
subscription WebhookCallCreated($pathway_id: String!) {
webhookCallCreated(pathway_id: $pathway_id) {
created_at
event_type
id
pathway {
id
pathway_definition_id
patient_id
start_date
}
request {
body
endpoint
headers {
key
value
}
method
}
responses {
body
date
status
}
status
webhook_id
webhook_name
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `webhookCallUpdated` [#webhookcallupdated]
Emits when a webhook call is updated.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `WebhookCall!`
**Example**
```graphql
subscription WebhookCallUpdated($pathway_id: String!) {
webhookCallUpdated(pathway_id: $pathway_id) {
created_at
event_type
id
pathway {
id
pathway_definition_id
patient_id
start_date
}
request {
body
endpoint
headers {
key
value
}
method
}
responses {
body
date
status
}
status
webhook_id
webhook_name
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
# Tenant
URL: https://docs.awellhealth.com/api-reference/reference/tenant
Read information about the current tenant.
## Queries [#queries]
### `tenant` [#tenant]
Returns the current tenant, including its branding and identifier systems.
**Returns:** `TenantPayload!`
**Example**
```graphql
query Tenant {
tenant {
code
success
tenant {
accent_color
hosted_page_title
identifier_systems {
display_name
name
system
}
is_default
logo_path
name
}
}
}
```
# Timers
URL: https://docs.awellhealth.com/api-reference/reference/timers
Query and expire the timers that delay steps in a care flow.
## Queries [#queries]
### `activityTimer` [#activitytimer]
Returns the timer for a given activity in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | --------- | -------- | ----------------------- |
| `activity_id` | `String!` | Yes | The ID of the activity |
| `careflow_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ActivityTimerPayload!`
**Example**
```graphql
query ActivityTimer($activity_id: String!, $careflow_id: String!) {
activityTimer(activity_id: $activity_id, careflow_id: $careflow_id) {
code
success
timer {
activity_id
careflow_id
completion_reason
created_at
id
job_id
name
readable_explanation
resource_id
scheduled_date
status
type
updated_at
}
}
}
```
Variables:
```json
{
"activity_id": "",
"careflow_id": ""
}
```
### `careflowTimers` [#careflowtimers]
Returns the timers for a care flow, optionally filtered by status.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | --------- | -------- | ----------------------------- |
| `careflow_id` | `String!` | Yes | The ID of the care flow |
| `status` | `String` | No | The timer status to filter by |
**Returns:** `CareflowTimersPayload!`
**Example**
```graphql
query CareflowTimers($careflow_id: String!, $status: String) {
careflowTimers(careflow_id: $careflow_id, status: $status) {
code
success
timers {
activity_id
careflow_id
completion_reason
created_at
id
job_id
name
readable_explanation
resource_id
scheduled_date
status
type
updated_at
}
}
}
```
Variables:
```json
{
"careflow_id": "",
"status": ""
}
```
## Mutations [#mutations]
### `expireTimer` [#expiretimer]
Expires a timer, allowing the step it delays to proceed.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ------------------- | -------- | ---------------------------------------- |
| `input` | `ExpireTimerInput!` | Yes | The input specifying the timer to expire |
**Returns:** `EmptyPayload!`
**Example**
```graphql
mutation ExpireTimer($input: ExpireTimerInput!) {
expireTimer(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"activity_id": "",
"user_name": ""
}
}
```
# Tracks
URL: https://docs.awellhealth.com/api-reference/reference/tracks
Query and schedule tracks — the groupings of steps within a care flow.
## Queries [#queries]
### `adHocTracksByPathway` [#adhoctracksbypathway]
Returns the ad hoc tracks that can be triggered for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `TracksPayload!`
**Example**
```graphql
query AdHocTracksByPathway($pathway_id: String!) {
adHocTracksByPathway(pathway_id: $pathway_id) {
code
success
tracks {
can_trigger_manually
id
release_id
title
}
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `adHocTracksByRelease` [#adhoctracksbyrelease]
Returns the ad hoc tracks available in a published care flow definition version (release).
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | -------------------------------------------------------------- |
| `release_id` | `String!` | Yes | The ID of the published care flow definition version (release) |
**Returns:** `TracksPayload!`
**Example**
```graphql
query AdHocTracksByRelease($release_id: String!) {
adHocTracksByRelease(release_id: $release_id) {
code
success
tracks {
can_trigger_manually
id
release_id
title
}
}
}
```
Variables:
```json
{
"release_id": ""
}
```
### `careflowTracks` [#careflowtracks]
Returns the tracks in a care flow, optionally filtered by status.
**Arguments**
| Argument | Type | Required | Description |
| ------------- | ----------- | -------- | ------------------------------- |
| `careflow_id` | `String!` | Yes | The ID of the care flow |
| `statuses` | `[String!]` | No | The track statuses to filter by |
**Returns:** `CareflowTracksPayload!`
**Example**
```graphql
query CareflowTracks($careflow_id: String!, $statuses: [String!]) {
careflowTracks(careflow_id: $careflow_id, statuses: $statuses) {
code
success
tracks {
definition_id
end_date
id
start_date
started_by_user_id
started_by_user_name
status
stop_reason
stopped_by_user_id
stopped_by_user_name
title
}
}
}
```
Variables:
```json
{
"careflow_id": "",
"statuses": [
""
]
}
```
### `scheduledDestinations` [#scheduleddestinations]
Returns the scheduled destinations for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ScheduledDestinationsPayload!`
**Example**
```graphql
query ScheduledDestinations($pathway_id: String!) {
scheduledDestinations(pathway_id: $pathway_id) {
code
destinations {
date
node {
date
definition_id
definition_type
id
name
track_definition_id
}
}
success
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `scheduledSteps` [#scheduledsteps]
Returns the scheduled steps for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ScheduledStepsPayload!`
**Example**
```graphql
query ScheduledSteps($pathway_id: String!) {
scheduledSteps(pathway_id: $pathway_id) {
code
steps {
activity_type
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
definition_id
end_date
id
label {
color
id
text
}
name
parent_id
stakeholders {
id
name
}
start_date
status
type
}
success
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `scheduledTracksForPathway` [#scheduledtracksforpathway]
Returns the scheduled tracks for a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `ScheduledTracksPayload!`
**Example**
```graphql
query ScheduledTracksForPathway($pathway_id: String!) {
scheduledTracksForPathway(pathway_id: $pathway_id) {
code
scheduled_tracks {
created_by_user_id
created_date
id
modified_date
pathway_id
release_id
scheduled_date
status
tenant_id
title
track_definition_id
}
success
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
### `tracksByPathway` [#tracksbypathway]
Returns the tracks in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| ------------ | --------- | -------- | ----------------------- |
| `pathway_id` | `String!` | Yes | The ID of the care flow |
**Returns:** `TracksPayload!`
**Example**
```graphql
query TracksByPathway($pathway_id: String!) {
tracksByPathway(pathway_id: $pathway_id) {
code
success
tracks {
can_trigger_manually
id
release_id
title
}
}
}
```
Variables:
```json
{
"pathway_id": ""
}
```
## Mutations [#mutations]
### `addTrack` [#addtrack]
Adds a track to a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ---------------- | -------- | ------------------------------- |
| `input` | `AddTrackInput!` | Yes | The details of the track to add |
**Returns:** `AddTrackPayload!`
**Example**
```graphql
mutation AddTrack($input: AddTrackInput!) {
addTrack(input: $input) {
code
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": "",
"track_id": ""
}
}
```
### `scheduleTrack` [#scheduletrack]
Schedules a track to start on a future date.
**Arguments**
| Argument | Type | Required | Description |
| -------- | --------------------- | -------- | ------------------------------------ |
| `input` | `ScheduleTrackInput!` | Yes | The details of the track to schedule |
**Returns:** `ScheduleTrackPayload!`
**Example**
```graphql
mutation ScheduleTrack($input: ScheduleTrackInput!) {
scheduleTrack(input: $input) {
code
id
success
}
}
```
Variables:
```json
{
"input": {
"pathway_id": "",
"scheduled_date": "",
"track_id": ""
}
}
```
### `stopTrack` [#stoptrack]
Stops a running track in a care flow.
**Arguments**
| Argument | Type | Required | Description |
| -------- | ----------------- | -------- | -------------------------------- |
| `input` | `StopTrackInput!` | Yes | The details of the track to stop |
**Returns:** `StopTrackPayload!`
**Example**
```graphql
mutation StopTrack($input: StopTrackInput!) {
stopTrack(input: $input) {
code
success
track {
activity_type
context {
action_id
agent_config_id
agent_id
agent_thread_id
instance_id
pathway_id
run_id
step_id
track_id
}
definition_id
end_date
id
label {
color
id
text
}
name
parent_id
stakeholders {
id
name
}
start_date
status
type
}
}
}
```
Variables:
```json
{
"input": {
"pathway_id": "",
"track_id": "