post https://api.sprucehealth.com/v1/internalendpoints//conversations
This operation sends a message to an external endpoint (phone number or email address) or a contact (secure messaging). Only one of secureEndpoint or smsOrEmailEndpoint should be specified. You will need to also specify the appropriate internal endpoint from the list of available internal endpoints for an organization. The RequestID returned by this API may be used to match against the RequestID
field of the conversationItem.created
webhook event to identify when the message is posted.
NOTE: Message attachments are not yet supported in the API.
Send a secure message
- Get the appropriate Spruce phone number from the list of internal endpoints for an organization (of channel type
secure
) - Specify the internal endpoint's
endpoint.Id
in theinternalEndpointId
path parameter - Get the Id of the appropriate contact to send the secure message to. You can list all contacts in the organization or search for the appropriate contact to determine the contact Id if you do not have it already.
- Populate the
destination.secureEndpoint
object with thecontactId
, the appropriatedeliveryMethod
andsubject
for the conversation.
The deliveryMethod
can be one of the following:
- (Default)
any_available_secure_conversation
: The system will first try to deliver messages using conversations from the specified internal endpoint. Then it will try to deliver to any existing secure conversation with the recipient. Then, if no conversation exists, a new secure conversation will be created. only_conversations_matching_internal_endpoint
: The system will deliver messages in conversations from the specified internal endpoint. If such a conversation doesn't yet exist, a new one will be created.new_conversation
: This option will create a new conversation, separate from any existing conversation.
Send an SMS
- Get the appropriate Spruce phone number from the list of internal endpoints for an organization (of channel type
phone
) - Specify the internal endpoint's
endpoint.Id
in theinternalEndpointId
path parameter - Specify the phone number to send the the message to in the
destination.smsOrEmailEndpoint
body parameter
Send an email
- Get the appropriate Spruce phone number from the list of internal endpoints for an organization (of channel type
email
) - Specify the internal endpoint's
endpoint.Id
in theinternalEndpointId
path parameter - Specify the email address to send the the message to in the
destination.smsOrEmailEndpoint
body parameter