Atonom
DocumentationAPI Reference
Webhooks

External Chat

Conversation-close webhook for Slack, Google Chat, and Microsoft Teams

Slack, Google Chat, and Microsoft Teams send this webhook when a conversation closes.

Atonom sends the payload below after the conversation is closed and post-processing finishes. Verify the request with webhook authorization.

To learn how to specify webhook URLs for your cloud employees in the Atonom app, please see the webhook URLs configuration step in the quickstart guide.

Event type:

  • external-chat-data: sent when a Slack, Google Chat, or Microsoft Teams conversation closes

Payload

{
  "event": "external-chat-data",
  "obj_id": "15",
  "tenant_id": 42,
  "dialogue_id": "15",
  "session": {
    "session_id": 44,
    "provider": "slack",
    "workspace_id": "T0911AYU7HA",
    "chat_id": "D0C5VSW0R5K",
    "chat_kind": "dm",
    "bot_id": 9
  },
  "transcript_with_tools": [
    {
      "id": 3,
      "kind": "chat",
      "body": "What are your hours?",
      "participant_id": 8,
      "participant_name": "Sam",
      "created_timestamp": "2026-09-30T12:00:00Z"
    },
    {
      "id": 9,
      "kind": "tool_invocation",
      "body": "",
      "participant_id": 8,
      "data": {
        "type": "tool_invocation",
        "tool_name": "search_kb",
        "tool_call_id": "call-123",
        "tool_args": "{\"query\":\"hours\"}"
      },
      "created_timestamp": "2026-09-30T12:00:01Z"
    },
    {
      "id": 10,
      "kind": "tool_result",
      "body": "",
      "data": {
        "type": "tool_result",
        "tool_call_id": "call-123",
        "results": "{\"status\":\"ok\"}"
      },
      "created_timestamp": "2026-09-30T12:00:02Z"
    },
    {
      "id": 11,
      "kind": "agent_message",
      "body": "We are open 9am to 5pm.",
      "participant_id": 8,
      "participant_name": "Atonom",
      "created_timestamp": "2026-09-30T12:00:03Z"
    }
  ]
}

obj_id and dialogue_id are the same dialogue id. parent_id, participant_id, participant_name, and data are left out when empty. A tool result usually has no participant.

Session

FieldDescription
session_idAtonom id for this chat session
providerslack, googlechat, or msteams
workspace_idSlack workspace id, the Google Cloud project number, or the Microsoft Directory (tenant) ID
chat_idConversation id. The shape depends on the provider. See below
chat_kinddm or group
bot_idAtonom bot registration id
parent_idPresent when the conversation sits inside a larger room. Omitted when empty

Slack

FieldDescription
workspace_idSlack workspace id, such as T0911AYU7HA
chat_idDirect message: channel id, such as D0C5VSW0R5K. Thread: channel:thread_ts, such as C123:111.222
chat_kindDirect messages are dm. Channel messages are group
parent_idPresent for a thread. This is the Slack channel id, such as C123

Google Chat

workspace_id is the Google Cloud project number, such as 123456789012. It is not the project id slug.

Placechat_kindchat_idparent_id
Direct messagedmSpace name, such as spaces/AAAOmitted
Space threadgroupThread name, such as spaces/AAA/threads/BBBSpace name, such as spaces/AAA
Space with no threadgroupSpace name, such as spaces/AAAOmitted

Microsoft Teams

workspace_id is the Directory (tenant) ID. It is not the Application (client) ID.

Placechat_kindchat_idparent_id
Direct messagedmConversation id, such as a:1AbC...Omitted
{
  "session_id": 26,
  "provider": "googlechat",
  "workspace_id": "123456789012",
  "chat_id": "spaces/AAA/threads/BBB",
  "parent_id": "spaces/AAA",
  "chat_kind": "group",
  "bot_id": 1
}

Transcript

Each item in transcript_with_tools is one conversation event, in order.

FieldDescription
idConversation event id
kindEvent kind. Chat text is chat or user_message. The agent reply is agent_message. Tool calls are tool_invocation and tool_result
bodyMessage text. Empty for tool events
participant_idParticipant id, when the event has one
participant_nameDisplay name, when the event has one
created_timestampUTC time
dataTool payload. Present on tool events

body is the person's message text. Slack author tags are already removed.

Tool invocation

{
  "type": "tool_invocation",
  "tool_name": "search_kb",
  "tool_call_id": "call-123",
  "tool_args": "{\"query\":\"hours\"}"
}

Tool result

{
  "type": "tool_result",
  "tool_call_id": "call-123",
  "results": "{\"status\":\"ok\"}"
}

tool_args and results are strings. They are often JSON encoded as text. Match a result to its invocation with tool_call_id.

On this page