{ "opencollection": "1.0.0", "info": { "name": "Spruce Health API \u2014 Internal Endpoints", "version": "1.0.0" }, "request": { "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "items": [ { "info": { "name": "Internal Endpoints", "type": "folder" }, "items": [ { "info": { "name": "List all internal endpoints", "type": "http" }, "http": { "method": "GET", "url": "https://api.sprucehealth.com/v1/internalendpoints", "params": [ { "name": "Authorization", "value": "Bearer {{bearerToken}}", "type": "header" } ] }, "operationId": "InternalEndpoints", "docs": "This operation lists all internal endpoints which organizations can use to communicate with. This includes all Spruce phone numbers, fax numbers, email addresses and Spruce Links. You can then [use an internal endpoint to send a message](/reference/postmessagefromendpoint)." }, { "info": { "name": "Create an outbound proxy call", "type": "http" }, "http": { "method": "POST", "url": "https://api.sprucehealth.com/v1/internalendpoints/{internalEndpointId}/calls", "params": [ { "name": "s-idempotency-key", "value": "", "type": "header" }, { "name": "internalEndpointId", "value": "", "type": "path" }, { "name": "Authorization", "value": "Bearer {{bearerToken}}", "type": "header" } ] }, "operationId": "PostCreateProxyCall", "docs": "This operation creates an outbound proxy call from an internal endpoint to an external phone number and returns the proxy number for use.\nTo learn more about proxy calling on Spruce, [visit this link](https://help.sprucehealth.com/hc/en-us/articles/40126738273435-Web-Desktop-Phone-Calls#h_01K322JXWY7T60ESF4DFTBKZP0)." }, { "info": { "name": "Send a message from an internal endpoint", "type": "http" }, "http": { "method": "POST", "url": "https://api.sprucehealth.com/v1/internalendpoints/{internalEndpointId}/conversations", "params": [ { "name": "s-idempotency-key", "value": "", "type": "header" }, { "name": "internalEndpointId", "value": "", "type": "path" }, { "name": "Authorization", "value": "Bearer {{bearerToken}}", "type": "header" } ] }, "operationId": "PostMessageFromEndpoint", "docs": "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](/reference/internalendpoints). 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.\n\n## Send a secure message\n* Get the appropriate Spruce phone number from the [list of internal endpoints for an organization](/reference/internalendpoints) (of channel type `secure`)\n* Specify the internal endpoint's `endpoint.Id` in the `internalEndpointId` path parameter\n* Get the Id of the appropriate contact to send the secure message to. You can [list all contacts in the organization](/reference/listcontacts) or [search for the appropriate contact](/reference/searchcontacts) to determine the contact Id if you do not have it already.\n* Populate the `destination.secureEndpoint` object with the `contactId`, the appropriate `deliveryMethod` and `subject` for the conversation.\n\nThe `deliveryMethod` can be one of the following:\n* (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.\n* `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.\n* `new_conversation`: This option will create a new conversation, separate from any existing conversation.\n## Send an SMS\n* Get the appropriate Spruce phone number from the [list of internal endpoints for an organization](/reference/internalendpoints) (of channel type `phone`)\n* Specify the internal endpoint's `endpoint.Id` in the `internalEndpointId` path parameter\n* Specify the phone number to send the the message to in the `destination.smsOrEmailEndpoint` body parameter\n## Send an email\n* Get the appropriate Spruce phone number from the [list of internal endpoints for an organization](/reference/internalendpoints) (of channel type `email`)\n* Specify the internal endpoint's `endpoint.Id` in the `internalEndpointId` path parameter\n* Specify the email address to send the the message to in the `destination.smsOrEmailEndpoint` body parameter\n## Send a fax\n* Get the appropriate Spruce fax number from the [list of internal endpoints for an organization](/reference/internalendpoints) (of channel type `fax`)\n* Specify the internal endpoint's `endpoint.Id` in the `internalEndpointId` path parameter\n* Specify the fax number to send the the message to in the `destination.faxEndpoint` body parameter\n* Note: Each outbound fax message sent from an internal endpoint will result in a new fax conversation being created" } ] } ] }