List the items in a conversation

Requires Spruce Embedded Secure Messaging, a paid add-on. This endpoint is part of Spruce Embedded Secure Messaging, which is not included with standard Public API access. Contact Spruce Support at [email protected] to learn more.

This operation lists the messages, system messages and change events in a conversation, oldest first by default. A deleted message stays in the list at its id with deleted set and no text or attachments, and a messageDeleted or messageRestored event is appended at the time of the change. A systemMessage item is a line Spruce wrote about the conversation, such as "Dr. So and So deleted a message."; it is not something a person sent, so show it as a status line between the messages, as the Spruce app does, and never as a message. If hasMore is true, pass the returned paginationToken to fetch the next page. To show the latest items first and load history as the patient scrolls back, pass order=newest_first: the first page holds the newest items, newest first, and each paginationToken sent with order=newest_first again returns the next older page. To poll for new items, pass the newest item's createdAt as startFrom; items created at or after that time are returned, so an item already seen can appear again and should be matched by id. startFrom is a lower bound only; there is no upper time bound, so older items are reached by paging with order=newest_first.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

The id of the conversation to list items for

Query Params
int32
1 to 200
Defaults to 20

How many items to return at one time, 20 when omitted (max 200)

string
enum

The order in which items are returned, oldest first by default. With newest_first, the first page holds the newest items, newest first, and each following page is older. Send the same order with every paginationToken.

Allowed:
string

After fetching a page of items, use the returned paginationToken to fetch the next page in the same order: newer items with oldest_first, older items with newest_first. Cannot be combined with startFrom.

date-time

The created time at or after which to list items, for polling new items in a conversation. Cannot be combined with paginationToken.

Headers
string

The device id returned beside the token when it was minted. Recommended on every request; it is recorded with the request but the token, not the header, names the device.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json