> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morf.health/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversation

> Event payload details and trigger documentation for Conversation data from Spruce

<img src="https://mintcdn.com/morfhealth/EU2WCxuXGIUQcziR/images/spruce.svg?fit=max&auto=format&n=EU2WCxuXGIUQcziR&q=85&s=8a74ebc9757cf4bfebab7b5e33a27182" alt="images/spruce.svg" width="24" height="24" data-path="images/spruce.svg" />

# Events

## Triggering Webhook Types

The following event types are associated with the Conversation event payload from Spruce.

* `Spruce Conversation Created`
* `Spruce Conversation Updated`
* `Spruce Conversation Deleted`

<RequestExample>
  ```json Example theme={null}
  {
    "api_url": "https://api.sprucehealth.com/v1/conversations/conv_12345",
    "app_url": "https://app.sprucehealth.com/conversations/conv_12345",
    "archived": null,
    "assigned_to_member_id": "member_67890",
    "associated_contact_ids": [],
    "contact_id": "entity_0E5QDGJC03000",
    "conversation_type": "sms",
    "created_at": "2025-02-11T08:22:10Z",
    "external_participants": [
      {
        "contact": null,
        "display_names": "John Doe",
        "endpoint": {
          "channel": "sms",
          "display_value": "(555) 123-4567",
          "endpoint_id": null,
          "is_internal": null,
          "labels": "mobile",
          "object": "endpoint",
          "raw_value": {
            "email": "patient@example.com",
            "phone": "+15551231234",
            "value": "secure_channel_id"
          }
        }
      }
    ],
    "id": "conv_12345",
    "internal_endpoint": {
      "channel": "sms",
      "display_value": "(555) 123-4567",
      "endpoint_id": null,
      "is_internal": null,
      "labels": "mobile",
      "object": "endpoint",
      "raw_value": {
        "email": "patient@example.com",
        "phone": "+15551231234",
        "value": "secure_channel_id"
      }
    },
    "internal_member_ids": [],
    "is_read_only": null,
    "last_message_at": "2025-02-11T08:22:10Z",
    "object": "conversation",
    "subtitle": "Follow-up discussion",
    "tags": [
      {
        "id": "tag_0E5QDGJC03000",
        "value": "high-priority"
      }
    ],
    "title": "Patient Check-in"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Description theme={null}
  {
    "api_url": "API URL for this conversation.",
    "app_url": "App URL for this conversation.",
    "archived": "Whether this conversation is archived.",
    "assigned_to_member_id": "ID of the member assigned to this conversation.",
    "associated_contact_ids": "Contact IDs associated with this conversation.",
    "contact_id": "Unique identifier for the contact in the Spruce system that is the external participant in this conversation",
    "conversation_type": "Type of conversation (sms, email, etc.).",
    "created_at": "Timestamp when the conversation was created.",
    "external_participants": {
      "contact": "Contact ID of the external participant.",
      "display_names": "Display names for the external participant.",
      "endpoint": {
        "channel": "Communication channel type.",
        "display_value": "Human-readable display value.",
        "endpoint_id": "Unique identifier for the endpoint.",
        "is_internal": "Whether this is an internal endpoint.",
        "labels": "Labels associated with the endpoint.",
        "object": "Object type identifier.",
        "raw_value": {
          "email": "Email address value.",
          "phone": "Phone number value.",
          "value": "Secure channel identifier."
        }
      }
    },
    "id": "Unique identifier for the conversation in the Spruce system.",
    "internal_endpoint": {
      "channel": "Communication channel type.",
      "display_value": "Human-readable display value.",
      "endpoint_id": "Unique identifier for the endpoint.",
      "is_internal": "Whether this is an internal endpoint.",
      "labels": "Labels associated with the endpoint.",
      "object": "Object type identifier.",
      "raw_value": {
        "email": "Email address value.",
        "phone": "Phone number value.",
        "value": "Secure channel identifier."
      }
    },
    "internal_member_ids": "Internal member IDs participating in this conversation.",
    "is_read_only": "Whether this conversation is read-only.",
    "last_message_at": "Timestamp of the last message in this conversation.",
    "object": "Object type identifier.",
    "subtitle": "Subtitle for the conversation.",
    "tags": {
      "id": "Unique identifier for the tag.",
      "value": "Tag value."
    },
    "title": "Title of the conversation."
  }
  ```
</ResponseExample>

### Payload Field Details

<ResponseField name="Conversation" type="Event Payload">
  <Expandable title="fields" defaultOpen="true">
    <ResponseField name="id" type="string" required>
      `ID` Unique identifier for the conversation in the Spruce system.

      ```json CEL theme={null}
      id
      ```

      ```json Example theme={null}
      "conv_12345"
      ```
    </ResponseField>

    <ResponseField name="contact_id" type="string" required>
      `ID` Unique identifier for the contact in the Spruce system that is the external participant in this conversation

      ```json CEL theme={null}
      contact_id
      ```

      ```json Example theme={null}
      "entity_0E5QDGJC03000"
      ```
    </ResponseField>

    <ResponseField name="api_url" type="string">
      API URL for this conversation.

      ```json CEL theme={null}
      api_url
      ```

      ```json Example theme={null}
      "https://api.sprucehealth.com/v1/conversations/conv_12345"
      ```
    </ResponseField>

    <ResponseField name="app_url" type="string">
      App URL for this conversation.

      ```json CEL theme={null}
      app_url
      ```

      ```json Example theme={null}
      "https://app.sprucehealth.com/conversations/conv_12345"
      ```
    </ResponseField>

    <ResponseField name="archived" type="bool" required>
      Whether this conversation is archived.

      ```json CEL theme={null}
      archived
      ```

      ```json Example theme={null}
      null
      ```
    </ResponseField>

    <ResponseField name="assigned_to_member_id" type="string">
      `ID` ID of the member assigned to this conversation.

      ```json CEL theme={null}
      assigned_to_member_id
      ```

      ```json Example theme={null}
      "member_67890"
      ```
    </ResponseField>

    <ResponseField name="associated_contact_ids" type="[]string" required>
      `ID` Contact IDs associated with this conversation.

      ```json CEL theme={null}
      associated_contact_ids
      ```

      ```json Example theme={null}
      []
      ```
    </ResponseField>

    <ResponseField name="created_at" type="timing.v1.Timestamp" required>
      Timestamp when the conversation was created.

      ```json CEL theme={null}
      created_at
      ```

      ```json Example theme={null}
      "2025-02-11T08:22:10Z"
      ```
    </ResponseField>

    <ResponseField name="external_participants" type="[]object" required>
      External participants in the conversation.

      ```json CEL theme={null}
      external_participants
      ```

      ```json Example theme={null}
      [
      {
      "contact": null,
      "display_names": "John Doe",
      "endpoint": {
      "channel": "sms",
      "display_value": "(555) 123-4567",
      "endpoint_id": null,
      "is_internal": null,
      "labels": "mobile",
      "object": "endpoint",
      "raw_value": {
        "email": "patient@example.com",
        "phone": "+15551231234",
        "value": "secure_channel_id"
      }
      }
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="external_participants.map(x, x.contact)" type="[]string" required>
      `ID` Mapped array of: Contact ID of the external participant.

      ```json CEL theme={null}
      external_participants.map(x, x.contact)
      ```

      ```json Example theme={null}
      [
      null
      ]
      ```
    </ResponseField>

    <ResponseField name="external_participants.map(x, x.display_names)" type="[]bool" required>
      `PII` Mapped array of: Display names for the external participant.

      ```json CEL theme={null}
      external_participants.map(x, x.display_names)
      ```

      ```json Example theme={null}
      [
      "John Doe"
      ]
      ```
    </ResponseField>

    <ResponseField name="external_participants.map(x, x.endpoint)" type="[]bool" required>
      Mapped array of: Communication endpoint for the participant.

      ```json CEL theme={null}
      external_participants.map(x, x.endpoint)
      ```

      ```json Example theme={null}
      [
      {
      "channel": "sms",
      "display_value": "(555) 123-4567",
      "endpoint_id": null,
      "is_internal": null,
      "labels": "mobile",
      "object": "endpoint",
      "raw_value": {
      "email": "patient@example.com",
      "phone": "+15551231234",
      "value": "secure_channel_id"
      }
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint" type="object">
      Internal endpoint for the conversation.

      ```json CEL theme={null}
      internal_endpoint
      ```

      ```json Example theme={null}
      {
      "channel": "sms",
      "display_value": "(555) 123-4567",
      "endpoint_id": null,
      "is_internal": null,
      "labels": "mobile",
      "object": "endpoint",
      "raw_value": {
      "email": "patient@example.com",
      "phone": "+15551231234",
      "value": "secure_channel_id"
      }
      }
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.channel" type="string">
      Communication channel type.

      ```json CEL theme={null}
      internal_endpoint.channel
      ```

      ```json Example theme={null}
      "sms"
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.display_value" type="string">
      Human-readable display value.

      ```json CEL theme={null}
      internal_endpoint.display_value
      ```

      ```json Example theme={null}
      "(555) 123-4567"
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.endpoint_id" type="string">
      `ID` Unique identifier for the endpoint.

      ```json CEL theme={null}
      internal_endpoint.endpoint_id
      ```

      ```json Example theme={null}
      null
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.is_internal" type="bool">
      Whether this is an internal endpoint.

      ```json CEL theme={null}
      internal_endpoint.is_internal
      ```

      ```json Example theme={null}
      null
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.labels" type="[]string">
      Labels associated with the endpoint.

      ```json CEL theme={null}
      internal_endpoint.labels
      ```

      ```json Example theme={null}
      "mobile"
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.object" type="string">
      Object type identifier.

      ```json CEL theme={null}
      internal_endpoint.object
      ```

      ```json Example theme={null}
      "endpoint"
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.raw_value" type="object">
      Raw endpoint value with type-specific data.

      ```json CEL theme={null}
      internal_endpoint.raw_value
      ```

      ```json Example theme={null}
      {
      "email": "patient@example.com",
      "phone": "+15551231234",
      "value": "secure_channel_id"
      }
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.raw_value.email" type="string">
      `PII` Email address value.

      ```json CEL theme={null}
      internal_endpoint.raw_value.email
      ```

      ```json Example theme={null}
      "patient@example.com"
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.raw_value.phone" type="string">
      `PII` Phone number value.

      ```json CEL theme={null}
      internal_endpoint.raw_value.phone
      ```

      ```json Example theme={null}
      "+15551231234"
      ```
    </ResponseField>

    <ResponseField name="internal_endpoint.raw_value.value" type="string">
      `PII` Secure channel identifier.

      ```json CEL theme={null}
      internal_endpoint.raw_value.value
      ```

      ```json Example theme={null}
      "secure_channel_id"
      ```
    </ResponseField>

    <ResponseField name="internal_member_ids" type="[]string" required>
      `ID` Internal member IDs participating in this conversation.

      ```json CEL theme={null}
      internal_member_ids
      ```

      ```json Example theme={null}
      []
      ```
    </ResponseField>

    <ResponseField name="is_read_only" type="bool" required>
      Whether this conversation is read-only.

      ```json CEL theme={null}
      is_read_only
      ```

      ```json Example theme={null}
      null
      ```
    </ResponseField>

    <ResponseField name="last_message_at" type="timing.v1.Timestamp">
      Timestamp of the last message in this conversation.

      ```json CEL theme={null}
      last_message_at
      ```

      ```json Example theme={null}
      "2025-02-11T08:22:10Z"
      ```
    </ResponseField>

    <ResponseField name="object" type="string" required>
      Object type identifier.

      ```json CEL theme={null}
      object
      ```

      ```json Example theme={null}
      "conversation"
      ```
    </ResponseField>

    <ResponseField name="subtitle" type="string">
      Subtitle for the conversation.

      ```json CEL theme={null}
      subtitle
      ```

      ```json Example theme={null}
      "Follow-up discussion"
      ```
    </ResponseField>

    <ResponseField name="tags" type="[]object" required>
      Tags associated with the conversation.

      ```json CEL theme={null}
      tags
      ```

      ```json Example theme={null}
      [
      {
      "id": "tag_0E5QDGJC03000",
      "value": "high-priority"
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="tags.map(x, x.id)" type="[]string" required>
      `ID` Mapped array of: Unique identifier for the tag.

      ```json CEL theme={null}
      tags.map(x, x.id)
      ```

      ```json Example theme={null}
      [
      "tag_0E5QDGJC03000"
      ]
      ```
    </ResponseField>

    <ResponseField name="tags.map(x, x.value)" type="[]string" required>
      Mapped array of: Tag value.

      ```json CEL theme={null}
      tags.map(x, x.value)
      ```

      ```json Example theme={null}
      [
      "high-priority"
      ]
      ```
    </ResponseField>

    <ResponseField name="title" type="string">
      Title of the conversation.

      ```json CEL theme={null}
      title
      ```

      ```json Example theme={null}
      "Patient Check-in"
      ```
    </ResponseField>

    <ResponseField name="conversation_type" type="string">
      Type of conversation (sms, email, etc.).

      ```json CEL theme={null}
      conversation_type
      ```

      ```json Example theme={null}
      "sms"
      ```
    </ResponseField>
  </Expandable>
</ResponseField>
