Get a web chat

SDK platic.webchats.get()

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

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

Path parameters

ParameterTypeDescriptionRequired
webchatIdstringWeb chat id (wc-…), the same one that appears in list channels✓

Query parameters

ParameterTypeDescriptionRequired
workspacestringOnly if your credential has several workspaces: which one the web chat is in—

Response

{
  "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.

Response fields

FieldTypeDescription
idstringWeb chat id (wc-…). It is also its channel id
namestring | nullName of the web chat. It is only seen in Platica
agentIdstring | nullThe agent that answers its conversations. null if none
modestringembed (on your site), page (on a Platica page), or both
allowedDomainsstring[]The domains where the chat may open. Empty: it does not open on any site
configobject | nullThe draft's configuration: what would be on your site once you publish. See the configuration
publishedbooleanWhether it was ever published
hasUnpublishedChangesbooleanWhether the config draft differs from what is on your site
embedobjectHow to put it in front of your visitors. See embed
healthobjectWhether it works and what it needs. See web chat health
creationDatestring | nullWhen it was created, in ISO 8601
lastUpdatestring | nullLast change, in ISO 8601
nextStepstringEnglish text that says what comes next. Do not program against its wording

embed

FieldTypeDescription
publicKeystring | nullThe 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
scriptstring | nullThe floating button, to paste in your site's HTML. Only with mode embed or both
inlinestring | nullThe chat inside a container of your page. Only with mode embed or both
pageUrlstring | nullThe 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 for installation options.

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTwebchatId does not start with wc-
404WEBCHAT_NOT_FOUNDThe 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.