Trying to kill off a web messaging conversation from our backend service when a bot finishes routing. The guest API docs only show client-side methods, so I’m hitting the REST endpoint directly. I’m trying to terminate the session programmatically, but I can’t find a specific “close” endpoint in the v2 spec that matches the guest flow. The Node SDK doesn’t expose a closeConversation method for this either. Anyone got the exact auth header setup or a working fetch example? Checked the scope bindings three times. Still getting 404s when trying to end the interaction.
You’re likely hitting the wrong endpoint scope. The guest API is for client-side tokens. You need the Conversation API with conversation:write scope.
const client = await PlatformClient.init({ clientId, clientSecret });
await client.ConversationsApi.closeConversation(conversationId, { reason: "Bot finished" });
Check your OAuth scopes.
1 Like