Chat widget

Change a public chat token

Changes the name, the display name (the business name in the chat window and its greeting), the allowed origins, the bot check or the daily limit of a token. Fields you leave out stay as they are; allowed_origins replaces the whole list. The token itself stays the same, so the snippet on the website keeps working. A revoked token cannot be changed (409 chat_token_revoked): create a new one.

patch/chat-tokens/{id}

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/chat-tokens/{id}
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: chat:write)

Path parameters

idstring uuid required

The id of the public chat token.

Request body

namestring
display_namestring nullable

The name the assistant uses for the business in the chat window, like "Knip": in the greeting ("You are chatting with the digital assistant of Knip.") and in its answers. null or an empty string goes back to the name of the site the widget is on, and otherwise the project name.

allowed_originsstring[]
turnstileboolean
max_conversations_per_dayinteger

Response

The token as changed.

idstring uuid required

The id of the public chat token. Use it to change or revoke the token.

namestring required

Your name for the token, like the website it is for.

display_namestring nullable required

The name the assistant uses for the business in the chat window and its greeting, or null: then the name of the site the widget is on, and otherwise the project name.

tokenstring required

The public chat token: hm_pub_ (live) or hm_pubtest_ (test project) plus 24 characters. Not a secret: it goes in the page source of your website.

mode'live' | 'test' required

live or test, from the project the key belongs to.

allowed_originsstring[] required

The exact origins that may use the token, like https://www.example.com. A test token also works from localhost.

turnstileboolean required

Whether a visitor passes a bot check before a conversation starts.

max_conversations_per_dayinteger required

New conversations per day through this token, counted until midnight, Europe/Amsterdam.

revokedboolean required

true once the token is revoked: the widget stops working right away, also in open conversations.

revoked_atstring date-time nullable required

When the token was revoked.

last_used_atstring date-time nullable required

When a browser last used the token, to the minute.

created_atstring date-time required

When the token was created.

embed_codestring required

The script tag for your website, with this token in it. Paste it before </body>.

kind'chat' | 'form' required

chat: the chat widget, the cart, the checkout and forms. form: only forms that post to a collection with public_write (made by Hypamoon for a form on a site); it cannot chat.

Changes

No recorded changes to this operation across all 1 revision of this API.