Rename an agent chat

October 16, 2026

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

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

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Request Body
{
  "title": "Lighthouse campaign"
}
  • title is required, the new title.
    Maximum length: 200 characters.
Responses
  • 200 OK

    {
      "chatId": "c-u12345-email:[email protected]:f166200a-ea22-461a-bc68-47ff6d3ee500-chat:2586b4d7-6652-40f8-8ba4-b0e812e7de10-bot:google-flow",
      "title": "Lighthouse campaign"
    }
    
  • 400 Bad Request

    title is missing or too long, or the path value is not a chatId.

    {
      "error": "Parameter title is required",
      "code": 400
    }
    
  • 401 Unauthorized

    Invalid API token.

    {
      "error": "useapi.net ⁝ Unauthorized",
      "code": 401
    }
    
  • 403 Forbidden

    The chatId belongs to another useapi.net user.

    {
      "error": "This chat belongs to another user",
      "code": 403
    }
    
  • 404 Not Found

    The chat was deleted, or its account is not added.

    {
      "error": "Chat not found: it was deleted or never existed",
      "code": 404
    }
    
  • 409 Conflict

    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
    }
    
  • 503 Service Unavailable

    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())
    
Try It