All pages

API reference

End a conversation

POST /v1/conversations/{conversation_id}/end

View as Markdown

End a call or a chat that is still going. A call that is still ringing is cancelled; one in progress ends with the agent's own goodbye. Always answers 200 with the conversation, so it is safe to send again. Needs calls:write for calls and chats:write for chats.

Parameters

Name In Type Required Description
conversation_id path string (uuid) Yes

Answer

200 with Conversation.

Errors

Every error is a problem document with a stable code.

Status When
401 The key is missing, mistyped, unknown, revoked or expired.
403 The key lacks a permission, a live key was sent from a browser, or the organization is frozen and the request would change something.
404 This key reaches no such conversation.
409 A WhatsApp conversation, or a frozen project.
422 Validation Error
429 Too many requests for this key or its organization; see Retry-After.
500 Something went wrong on our side. Quote the request_id to support.

Examples

End a call or a chat
#!/bin/sh
# End a call or a chat
curl -sS --fail-with-body -X POST "https://api.aigently.ai/v1/conversations/5f0c9a52-7d3e-4b1a-9c8f-6e2d4a0b3c1d/end" \
  -H "Authorization: Bearer $AIGENTLY_API_KEY"

Try it

Sends this request to the API from your browser, with a test key. Nothing it does rings a phone.