Delete an agent chat
October 16, 2026
Table of contents
Delete a chat’s conversation from Google. It disappears from GET /agent/chats and the Flow web app, and its chatId stops working. The images and videos the agent made stay in the project. Delete them with DELETE /assets/email if you want them gone too. A chat cannot be deleted while a turn runs in it.
https://api.useapi.net/v1/google-flow/agent/chats/
chatId
chatIdis required, URL-encoded in the path (it contains:and@), from POST /agent/chats or GET /agent/chats.
Request Headers
Authorization: Bearer {API token}
API tokenis required, see Setup useapi.net for details.
Responses
-
The chat was deleted. The response has no body.
-
The path value is not a
chatId.{ "error": "Path parameter chatId (not-a-chat-id) is not a chat id from POST /agent/chats or GET /agent/chats", "code": 400 } -
Invalid API token.
{ "error": "useapi.net ⁝ Unauthorized", "code": 401 } -
The
chatIdbelongs to another useapi.net user.{ "error": "This chat belongs to another user", "code": 403 } -
The chat was already deleted, or its account is not added.
{ "error": "Chat not found: it was deleted or never existed", "code": 404 } -
A turn is running in this chat. Delete it after the turn ends.
{ "error": "A turn is running in this chat. Wait for it to finish", "code": 409 } -
Google Flow could not be reached, and nothing happened. Retry shortly.
{ "error": "Google Flow is not reachable right now and could not delete the chat. Retry", "code": 503 }
Examples
-
CHATID="c-u12345-email:[email protected]:f166200a-...-chat:2586b4d7-...-bot:google-flow" curl -X DELETE -H "Authorization: Bearer YOUR_API_TOKEN" \ "https://api.useapi.net/v1/google-flow/agent/chats/$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1],safe=''))" "$CHATID")" -
const token = 'YOUR_API_TOKEN' const chatId = 'chatId from POST /agent/chats' const response = await fetch(`https://api.useapi.net/v1/google-flow/agent/chats/${encodeURIComponent(chatId)}`, { method: 'DELETE', headers: { 'Authorization': `Bearer ${token}` } }) console.log(response.status) -
import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' chatId = 'chatId from POST /agent/chats' r = requests.delete( f'https://api.useapi.net/v1/google-flow/agent/chats/{quote(chatId, safe="")}', headers={'Authorization': f'Bearer {token}'}, ) print(r.status_code)