> ## Documentation Index
> Fetch the complete documentation index at: https://tiktools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Chat

> Send a chat message to a live TikTok room as the logged-in user. The server signs, joins the room, sends, and confirms the message actually appeared in the live chat.

## `POST` `/chat-send`

Send a chat message to a live TikTok room on behalf of an authenticated user. One call - the server signs the request, joins the room, sends the message, and **confirms it actually appeared in the live chat**. Returns the real delivery result, not just TikTok's status code.

**Authentication:** include TikTok session cookies via the `x-cookie-header` header. The minimum required is **`sessionid` + `tt-target-idc`**. Get them from browser DevTools -> Application -> Cookies -> tiktok.com (`tt-target-idc` is the data-center cookie, e.g. `eu-ttp2`, `useast5`).

**Use a real, established account.** Brand-new TikTok accounts (auto usernames like `user35441...`, no avatar/nickname/posts, or under \~24h old) are auto-shadowbanned from live chat by TikTok - they return `delivered: false` no matter what. An aged, complete account is required.

**`delivered` is the truth.** TikTok returns `status_code: 0` even on messages it silently shadow-drops. This endpoint subscribes to the room's live event stream and confirms your exact message text appeared, then reports `delivered: true` / `false`. Do not rely on `status_code` alone.

### Parameters

| Parameter | Type   | Required | Description                                                           |
| --------- | ------ | -------- | --------------------------------------------------------------------- |
| `channel` | string | Yes      | The live creator's `@username` (the server resolves the current room) |
| `text`    | string | Yes      | Chat message text (max \~150 chars)                                   |

### Response

```json theme={null}
{
  "delivered": true,
  "status_code": 0,
  "msg_id": "7650032344963615510",
  "channel": "creatorname",
  "room": "7650027009598442262",
  "confirmed_via": "live-event"
}
```

`delivered: false` with an aged account usually means the creator restricted chat (followers-only / mod-only / chat off), or your account is rate-limited - try another live or slow down.

### Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const res = await fetch('https://api.tik.tools/chat-send?apiKey=YOUR_KEY', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-cookie-header': 'sessionid=YOUR_SESSIONID; tt-target-idc=eu-ttp2'
    },
    body: JSON.stringify({ channel: 'creatorname', text: 'Hello!' })
  });
  console.log(await res.json()); // { delivered: true, msg_id: '...', confirmed_via: 'live-event' }
  ```

  ```python Python theme={null}
  import requests
  res = requests.post('https://api.tik.tools/chat-send',
      params={'apiKey': 'YOUR_KEY'},
      headers={'x-cookie-header': 'sessionid=YOUR_SESSIONID; tt-target-idc=eu-ttp2'},
      json={'channel': 'creatorname', 'text': 'Hello!'},
      timeout=120)
  print(res.json())
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.tik.tools/chat-send?apiKey=YOUR_KEY" \
    -H "Content-Type: application/json" \
    -H "x-cookie-header: sessionid=YOUR_SESSIONID; tt-target-idc=eu-ttp2" \
    -d '{"channel": "creatorname", "text": "Hello!"}'
  ```

  ```java Java theme={null}
  HttpClient client = HttpClient.newHttpClient();
  String json = "{\"channel\": \"creatorname\", \"text\": \"Hello!\"}";
  HttpRequest req = HttpRequest.newBuilder()
      .uri(URI.create("https://api.tik.tools/chat-send?apiKey=YOUR_KEY"))
      .header("Content-Type", "application/json")
      .header("x-cookie-header", "sessionid=YOUR_SESSIONID; tt-target-idc=eu-ttp2")
      .POST(HttpRequest.BodyPublishers.ofString(json))
      .build();
  HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
  System.out.println(res.body());
  ```

  ```go Go theme={null}
  payload := bytes.NewBufferString(`{"channel":"creatorname","text":"Hello!"}`)
  req, _ := http.NewRequest("POST",
      "https://api.tik.tools/chat-send?apiKey=YOUR_KEY", payload)
  req.Header.Set("Content-Type", "application/json")
  req.Header.Set("x-cookie-header", "sessionid=YOUR_SESSIONID; tt-target-idc=eu-ttp2")
  resp, err := http.DefaultClient.Do(req)
  if err != nil { log.Fatal(err) }
  defer resp.Body.Close()
  body, _ := io.ReadAll(resp.Body)
  fmt.Println(string(body))
  ```

  ```csharp C# theme={null}
  using var client = new HttpClient();
  client.DefaultRequestHeaders.Add("x-cookie-header", "sessionid=YOUR_SESSIONID; tt-target-idc=eu-ttp2");
  var json = new StringContent(
      @"{""channel"":""creatorname"",""text"":""Hello!""}",
      Encoding.UTF8, "application/json");
  var res = await client.PostAsync(
      "https://api.tik.tools/chat-send?apiKey=YOUR_KEY", json);
  Console.WriteLine(await res.Content.ReadAsStringAsync());
  ```
</CodeGroup>

> **Migrating from `/webcast/chat`?** The older endpoint returned a `signed_url` for you to POST yourself, which TikTok shadow-drops unless you also replicate the room-join handshake. `/chat-send` does the join + send + delivery confirmation server-side - switch to it and pass `tt-target-idc` alongside `sessionid`.
