---
title: "Bot ended"
method: POST
path: "speaking_bot.ended"
tags: ["events"]
---

# Bot ended

`POST speaking_bot.ended` (webhook)

The bot has left the meeting; nothing follows this event.

Carries the final usage report, the briefing when one was requested and
every escalation of the call with its answer. Unlike the others this one
is awaited before the bot's process exits, so it is delivered even when
the call ends abruptly.

Delivered as an HTTP POST to the bot's `callback_url`, with the event name in the `x-speaking-bot-event` header and, when the bot was created with a `callback_secret`, `x-speaking-bot-signature: sha256=<hex>`: the HMAC-SHA256 of the exact request body with that secret. Answer with any 2xx. Network errors and 5xx are retried three times (after 1, 3 and 9 seconds); a redirect counts as a failed delivery and is not followed.

## Payload

- EndedEvent: ``speaking_bot.ended``: the bot has left; the last event for this bot.
  - `event_id` string, required: Unique per delivery; use it to drop duplicates
  - `bot_id` string, required: The MeetingBaas bot ID returned by POST /bots
  - `client_id` string, required: The server's internal ID for the bot
  - `created_at` string, date-time, required: When the event was produced, ISO 8601 with offset
  - `event` 'speaking_bot.ended', required
  - `data` EndedEventData, required
    - `status` 'completed' | 'failed', required
    - `reason` string, required: Why the bot stopped: 'call ended (...)', 'removed by caller', 'bot failed (...)' or 'never admitted'
    - `usage` UsageReport: What one bot consumed on each provider, from Pipecat's usage metrics.
      - `bot_id` string, required
      - `meetingbaas_bot_id` string, nullable
      - `stt_provider` string, required
      - `tts_provider` string, required
      - `llm_provider` string, nullable
      - `llm_model` string, nullable
      - `key_sources` object: Per provider: 'platform' (ran on the server's key) or 'caller'
      - `started_at` number, required
      - `ended_at` number, nullable
      - `duration_seconds` number, required
      - `stt_audio_seconds` number, required
      - `tts_characters` integer, required
      - `tts_requests` integer, required
      - `llm_turns` integer, required
      - `llm_prompt_tokens` integer, required
      - `llm_cached_prompt_tokens` integer, required
      - `llm_completion_tokens` integer, required
      - `llm_total_tokens` integer, required
    - `briefing` BriefingReport: The post-meeting briefing for the bot's owner.
      - `language` string
      - `summary` string
      - `decisions` string[]
      - `actions` BriefingAction[]
        - `owner` string, nullable
        - `task` string, nullable
        - `due` string, nullable
      - `unresolved` string[]
      - `what_the_representative_said` string[]
      - `escalations` BriefingEscalation[]
        - `question` string, nullable
        - `status` string, nullable
        - `answer` string, nullable
      - `coverage_notes` string[]
      - `generated_at` number, nullable
      - `llm_provider` string, nullable
      - `llm_model` string, nullable
    - `escalations` Escalation[]: Every escalation of the call, with answers
      - `escalation_id` string, required
      - `question` string, required: The exact decision asked for, with amounts, names and dates
      - `category` 'spending' | 'commitment' | 'approval' | 'scheduling' | 'information' | 'other', required
      - `context` string: What led to the question and who asked, in one or two sentences
      - `asked_by` string, nullable: The participant who asked, when known
      - `number` integer, nullable: 1-based position among this bot's escalations
      - `created_at` number, required: Unix timestamp of when the bot raised it
      - `status` 'pending' | 'answered'
      - `response` string, nullable: The owner's answer, once posted
      - `decision` 'approved' | 'declined' | 'deferred' | 'info', nullable: How the owner decided, when it was a yes/no question
      - `answered_at` number, nullable: Unix timestamp of the owner's answer

## Acknowledgement `200`

Received. Any 2xx counts as delivered.

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/meeting-baas/apis/meeting-baas-api.md) - [All operations](https://skmtc.dev/meeting-baas/apis/meeting-baas-api/llms.txt) - [OpenAPI document](https://skmtc.dev/meeting-baas/apis/meeting-baas-api/revisions/1a4957849576?raw)
