Removing a bot
Learn how to remove or delete bots from meetings
You can remove a bot from a meeting or delete bot data using the v2 API. There are two operations:
- Leave meeting: Instruct a bot to leave the meeting immediately (while it's active)
- Delete data: Permanently delete a bot and all its data (after it's completed or failed)
Leave Meeting
To instruct a bot to leave the meeting immediately:
curl -X POST "https://api.meetingbaas.com/v2/bots/BOT-ID/leave" \
-H "x-meeting-baas-api-key: YOUR-API-KEY"Response:
{
"success": true,
"data": {
"message": "Bot leave request sent successfully."
}
}When Can You Leave a Bot?
The leave endpoint works for bots in any active (non-terminal) state:
queued: Bot hasn't started joining yetpickup_delayed: Bot has stayed in thequeuedstatus longer than the expected pickup windowjoining_call: Bot is attempting to join the meetingin_waiting_room: Bot is waiting in the meeting's waiting roomin_call_not_recording: Bot is in the meeting but not recordingin_call_recording: Bot is actively recordingrecording_paused: Bot recording is pausedrecording_resumed: Bot recording has resumed
It also works for scheduled bots that haven't spawned yet — the scheduled bot will be cancelled atomically.
Error Responses
404 Not Found:
{
"success": false,
"error": "Not Found",
"message": "Bot with ID 'BOT-ID' not found",
"code": "FST_ERR_BOT_NOT_FOUND_BY_ID",
"statusCode": 404
}409 Conflict (Bot status doesn't allow leaving):
{
"success": false,
"error": "Conflict",
"message": "Status of bot 'BOT-ID' is: completed. Operation not permitted in this state.",
"code": "FST_ERR_BOT_STATUS",
"statusCode": 409
}This error occurs when the bot is in a terminal status:
completed: Bot has already completedfailed: Bot has already failed
How It Works
When you call the leave endpoint:
- The stop signal is delivered to the bot process asynchronously with retries
- If the bot hasn't started yet (e.g., still
queued), it will check for pending stop requests on startup and abort before joining the meeting - Pre-recording stops (bot was in
queued,joining_call,in_waiting_room, orin_call_not_recording): The bot exits with anEXITING_MEETING_BEFORE_RECORDerror code. No tokens are consumed. - Recording stops (bot was in
in_call_recording,recording_paused, orrecording_resumed): The bot stops recording and transitions tocompletedstatus. Tokens are consumed based on recording duration. - A final webhook event will be sent when the bot finishes processing.
Delete Bot Data
To permanently delete a bot and all its associated data (recordings, transcriptions, etc.):
curl -X DELETE "https://api.meetingbaas.com/v2/bots/BOT-ID/delete-data" \
-H "x-meeting-baas-api-key: YOUR-API-KEY"Response:
{
"success": true,
"data": {
"bot_id": "123e4567-e89b-12d3-a456-426614174000",
"deleted": true
}
}When Can You Delete Bot Data?
The delete endpoint can only be called when the bot is in one of these statuses:
completed: Bot has successfully completed recording and processingfailed: Bot has failed
Error Responses
404 Not Found:
{
"success": false,
"error": "Not Found",
"message": "Bot with ID 'BOT-ID' not found",
"code": "FST_ERR_BOT_NOT_FOUND_BY_ID",
"statusCode": 404
}409 Conflict (Bot status doesn't allow deletion):
{
"success": false,
"error": "Conflict",
"message": "Status of bot 'BOT-ID' is: in_call_recording. Operation not permitted in this state.",
"code": "FST_ERR_BOT_STATUS",
"statusCode": 409
}This error occurs when the bot is still active (e.g., in_call_recording, transcribing, etc.). You must wait for the bot to complete or fail, or use the leave endpoint first.
Note: This permanently deletes the bot and all its data. This action cannot be undone.
Cancel Scheduled Bot
To cancel a scheduled bot:
curl -X DELETE "https://api.meetingbaas.com/v2/bots/scheduled/SCHEDULED-BOT-ID" \
-H "x-meeting-baas-api-key: YOUR-API-KEY"This can be called at any time before the bot reaches a terminal state (cancelled, completed, or failed). If the bot hasn't been spawned yet, the scheduled bot record is cancelled atomically. If the scheduling cron has already spawned the bot, the stop request is persisted and delivered to the bot process. If the bot hadn't started recording, it will exit with EXITING_MEETING_BEFORE_RECORD and no tokens are consumed. If recording was already in progress, the bot stops recording normally and tokens are consumed up to the stop time.
Note: You can also use the leave endpoint (POST /v2/bots/:bot_id/leave) with the scheduled bot's UUID to achieve the same result.
Important Notes
- Deleting a bot's data removes all associated data including recordings, transcriptions, and screenshots
- Deleted data cannot be recovered
- If a bot is currently recording, leaving it will stop the recording. Use the delete data endpoint afterward to remove artifacts.
- Scheduled and calendar bots can be cancelled at any time — if a bot has already been spawned, it will be stopped automatically
