Deletes a bot that has been scheduled but has not yet joined the meeting. This prevents the bot from joining.
Method Signature
bot.deleteScheduledBot(params: BaseBotParams): Promise<void>
Parameters
The unique identifier of the bot to delete
Response
Returns void on successful deletion.
Example
import { Recall } from '@recall.ai/sdk';
const client = new Recall({
apiKey: 'your-api-key',
region: 'us-west-2'
});
// Create a scheduled bot
const joinTime = new Date();
joinTime.setHours(joinTime.getHours() + 2);
const bot = await client.bot.create({
meeting_url: 'https://zoom.us/j/123456789',
join_at: joinTime
});
console.log(`Bot ${bot.id} scheduled to join at ${bot.join_at}`);
// Delete the scheduled bot
await client.bot.deleteScheduledBot({
id: bot.id
});
console.log('Bot deleted successfully');
Example: Cancel All Scheduled Bots for a Meeting
// Get all bots for a specific meeting
const bots = await client.bot.list({
meeting_url: 'https://zoom.us/j/123456789',
status: 'ready'
});
// Delete all scheduled bots
for (const bot of bots.results) {
await client.bot.deleteScheduledBot({ id: bot.id });
console.log(`Deleted bot ${bot.id}`);
}
Example: Safe Delete with Error Handling
try {
await client.bot.deleteScheduledBot({
id: 'bot_1234567890'
});
console.log('Bot deleted successfully');
} catch (error) {
if (error.response?.status === 404) {
console.log('Bot not found or already deleted');
} else if (error.response?.status === 400) {
console.log('Cannot delete: bot may have already joined the meeting');
} else {
console.error('Error deleting bot:', error.message);
}
}
Notes
- This method only works for bots that haven’t joined yet (typically in
ready status)
- Once a bot has joined a meeting, use bot.leaveCall() instead
- Deleting a bot is permanent and cannot be undone
- If the bot has already been deleted or doesn’t exist, a 404 error will be returned