AnytimeReply

Working with customers

Contacts and verified identity

Keep your customers in one place, sign website visitors in with a JWT, and let the AI and actions use what you know about them.

Contacts (under your agent) lists everyone the agent knows: website visitors you sign in, leads who leave their email, WhatsApp and email customers, people you import and those you add through the API. Each contact can have an email, phone, your own user ID, tags and custom attributes — like *plan*, *orders* or *account manager* — and shows all their chats.

Custom attributes

Click Attributes to define the details you track (text, number, yes/no or date). Values arrive from the identity token, CSV imports, the API, or you edit them by hand.

When a customer is logged in to your site, pass a token so the agent knows who they are. Create a secret under Settings → Identity, then on your server sign a JWT with HS256:

const token = jwt.sign(
  { user_id: "u_42", email: "[email protected]", name: "Nadia", attributes: { plan: "Pro", orders: 7 } },
  process.env.ANYTIMEREPLY_SECRET,
  { algorithm: "HS256", expiresIn: "1h" }
);

and give it to the widget:

<script>window.AnytimeReplySettings = { identity: { token: "<%= token %>" } };</script>

(or later: AnytimeReply.identify({ token })). Supported claims: user_id (or sub), email, name, phone, attributes, exp. Tokens with a wrong signature, an expired exp or any algorithm other than HS256 are ignored. Never put the secret in your website's code. The older *email + hash* method still works.

What it's used for

  • Personal answers — the AI sees the contact's details (marked as verified or as given by the customer) and can use them, e.g. to tell a Pro customer about Pro features.
  • Actions — use {contact.email}, {contact.id} (your user ID), {contact.name}, {contact.phone} or any attribute like {contact.plan} in an action's URL or headers. They're filled from the record, never from what the customer types.
  • The inbox — the contact's details show at the top of every chat.
  • Broadcasts — contacts with a WhatsApp number can receive broadcasts.

Import

Upload a CSV with a header row: email, phone, name, external_id, tags and any other column becomes an attribute. Existing contacts are matched by user ID, then email, then phone, and updated.

API

GET /api/v1/agents/{id}/contacts?email=… (or external_id, phone, q), POST to create or update (matched like imports), GET/PATCH/DELETE /api/v1/agents/{id}/contacts/{contact}. PATCH merges attributes; send null to remove one.

All docs