Rename an agent chat
October 16, 2026
Table of contents
Give a chat a new title. Google titles each chat on its own, and the new title replaces it in GET /agent/chats and in the Flow web app. A chat cannot be renamed 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}
Content-Type: application/json
API tokenis required, see Setup useapi.net for details.
Request Body
{
"title": "Lighthouse campaign"
}
titleis required, the new title.
Maximum length:200characters.
Responses
-
{ "chatId": "c-u12345-email:[email protected]:f166200a-ea22-461a-bc68-47ff6d3ee500-chat:2586b4d7-6652-40f8-8ba4-b0e812e7de10-bot:google-flow", "title": "Lighthouse campaign" } -
titleis missing or too long, or the path value is not achatId.{ "error": "Parameter title is required", "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 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. Rename 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 rename the chat. Retry", "code": 503 }
Model
{ // TypeScript, all fields are optional
chatId: string
title: string
error?: string // errors only
code?: number // errors only
}
Examples
-
CHATID="c-u12345-email:[email protected]:f166200a-...-chat:2586b4d7-...-bot:google-flow" curl -X PATCH "https://api.useapi.net/v1/google-flow/agent/chats/$(python3 -c "import urllib.parse,sys;print(urllib.parse.quote(sys.argv[1],safe=''))" "$CHATID")" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -d '{ "title": "Lighthouse campaign" }' -
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: 'PATCH', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${token}` }, body: JSON.stringify({ title: 'Lighthouse campaign' }) }) console.log(response.status, await response.json()) -
import requests from urllib.parse import quote token = 'YOUR_API_TOKEN' chatId = 'chatId from POST /agent/chats' r = requests.patch( f'https://api.useapi.net/v1/google-flow/agent/chats/{quote(chatId, safe="")}', headers={'Authorization': f'Bearer {token}'}, json={'title': 'Lighthouse campaign'}, ) print(r.status_code, r.json())