---
docId: doc_f6ca5d3f21974711b55d5d80117e90a0
title: Get a web chat
description: "Read a web chat's settings, pending changes, and embed code."
api:
  group: canales/webchat
  auth: bearer
  operations:
    - operationId: getWebchat
      method: GET
      path: '/v1/webchats/{webchatId}'
      postmanName: Get a web chat
---

<script>
  import { Ways } from '$lib/components';
</script>

# Get a web chat

Read the settings (`config`), unpublished changes, health (`health`), and code for your site (`embed`). Use it to recover the code or check what remains to be published.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/webchats/$WEBCHAT_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.webchats.get("webchat_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `webchatId` | string | Web chat id (`wc-…`), the same one that appears in [list channels](/api-reference/channels/list) | ✓ |

## Query parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `workspace` | string | Only if your credential has several workspaces: which one the web chat is in | — |

## Response

```json
{
  "status": "success",
  "message": "Web chat",
  "data": {
    "id": "wc-7Hq2LmN4pR8sT1vX",
    "name": "Acme Store",
    "agentId": "tVKljCHCNiebQdasHeit",
    "mode": "both",
    "allowedDomains": ["example.com"],
    "config": {
      "enabled": true,
      "appearance": {
        "mode": "light",
        "primary": "#00C577",
        "radius": 16,
        "font": "system",
        "colors": {
          "canvas": "#f7f8f5",
          "surface": "#ffffff",
          "surfaceMuted": "#f4f5f1",
          "text": "#343434",
          "textMuted": "#666666",
          "border": "#111111",
          "headerBackground": "#ffffff",
          "headerText": "#343434",
          "headerIcons": "#666666",
          "visitorBackground": "#eef0e9",
          "visitorText": "#343434",
          "composerBackground": "#ffffff",
          "composerInput": "#ffffff",
          "sendBackground": "#00C577",
          "sendIcon": "#111111",
          "error": "#ef4444",
          "online": "#00C577"
        },
        "visualEffects": { "enabled": true, "intensity": 60, "blur": 80, "motion": true }
      },
      "availability": { "status": "online" }
    },
    "published": true,
    "hasUnpublishedChanges": false,
    "embed": {
      "publicKey": "wc_pub_7Hq2LmN4pR8sT1vX",
      "script": "<script\n  src=\"https://chat.platica.mx/widget.js\"\n  data-webchat=\"wc_pub_7Hq2LmN4pR8sT1vX\"\n  defer>\n</script>",
      "inline": "<div id=\"platica-chat\"></div>\n\n<script\n  src=\"https://chat.platica.mx/widget.js\"\n  data-webchat=\"wc_pub_7Hq2LmN4pR8sT1vX\"\n  data-target=\"#platica-chat\"\n  defer>\n</script>",
      "pageUrl": "https://chat.platica.mx/chat?webchat=wc_pub_7Hq2LmN4pR8sT1vX"
    },
    "health": { "state": "ok", "reason": null, "since": "2026-11-12T18:30:00.000Z" },
    "creationDate": "2026-11-12T18:30:00.000Z",
    "lastUpdate": "2026-11-12T18:30:00.000Z",
    "nextStep": "Paste embed.script in the site's HTML, before </body>; embed.inline puts the chat inside a container of the page instead. Share embed.pageUrl, or open it to try the chat."
  }
}
```

The example shows only three parts of `config`; the response has all twelve. They are all in [create a web chat](/api-reference/web-chats/create#response).

### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Web chat id (`wc-…`). It is also its channel id |
| `name` | string \| null | Name of the web chat. It is only seen in Platica |
| `agentId` | string \| null | The agent that answers its conversations. `null` if none |
| `mode` | string | `embed` (on your site), `page` (on a Platica page), or `both` |
| `allowedDomains` | string[] | The domains where the chat may open. Empty: it does not open on any site |
| `config` | object \| null | The draft's configuration: what would be on your site once you publish. See [the configuration](/api-reference/web-chats#the-configuration) |
| `published` | boolean | Whether it was ever published |
| `hasUnpublishedChanges` | boolean | Whether the `config` draft differs from what is on your site |
| `embed` | object | How to put it in front of your visitors. See [`embed`](#embed) |
| `health` | object | Whether it works and what it needs. See [web chat `health`](/api-reference/web-chats#what-you-need-to-know) |
| `creationDate` | string \| null | When it was created, in ISO 8601 |
| `lastUpdate` | string \| null | Last change, in ISO 8601 |
| `nextStep` | string | English text that says what comes next. Do not program against its wording |

### `embed`

| Field | Type | Description |
|-------|------|-------------|
| `publicKey` | string \| null | The web chat's public key. It is the one that goes in `data-webchat` and in `window.PlaticaWebchat`. It is not secret: it travels in your site's HTML |
| `script` | string \| null | The floating button, to paste in your site's HTML. Only with `mode` `embed` or `both` |
| `inline` | string \| null | The chat inside a container of your page. Only with `mode` `embed` or `both` |
| `pageUrl` | string \| null | The Platica page with the chat. Only with `mode` `page` or `both` |

Paste the code once: publishing keeps it the same. See [embed it on your site](/api-reference/web-chats/embed) for installation options.

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | `webchatId` does not start with `wc-` |
| `404` | `WEBCHAT_NOT_FOUND` | The web chat does not exist in this workspace |

## Notes

- A workspace API key is enough, or an OAuth token of a person with access to Integrations.
