Getting started

The End Users API lets you create and work with end-user data in Ada and respond to changes as users interact across channels. This page highlights common integration patterns to help you get started quickly.

The guides below show how to:

For end-to-end examples and advanced patterns, see the developer guide. For a complete overview of end-user concepts and available endpoints, see the End Users API Overview.

Create an end user with context before a conversation

This flow is for custom channel (Conversations API) integrations only. For native chat, use the Chat SDK setMetaFields() instead.

Use POST /v2/end-users/ to create an end user with profile data (language, metadata) before starting a conversation. This ensures the AI Agent has full context from the greeting onward.

Before you begin

Steps

  1. Create the end user with language and metadata:
    $curl -X POST https://EXAMPLE.ada.support/api/v2/end-users/ \
    > -H "Authorization: Bearer YOUR_API_TOKEN" \
    > -H "Content-Type: application/json" \
    > -d '{
    > "profile": {
    > "language": "pt-BR",
    > "metadata": {
    > "region": "latam",
    > "plan_type": "enterprise"
    > }
    > }
    > }'
  2. Copy the end_user_id from the response.
  3. Start a conversation using the end_user_id:
    $curl -X POST https://EXAMPLE.ada.support/api/v2/conversations/ \
    > -H "Authorization: Bearer YOUR_API_TOKEN" \
    > -H "Content-Type: application/json" \
    > -d '{
    > "channel_id": "YOUR_CHANNEL_ID",
    > "end_user_id": "END_USER_ID_FROM_STEP_1"
    > }'
  4. The greeting fires in the correct language (pt-BR), with metadata values available as metavariables for Playbooks, Actions, and article rules.

Pass sensitive metadata securely

Use the sensitive_metadata field to pass auth tokens, session IDs, or personally identifiable information through a secure, write-only pathway. Values are encrypted at rest, redacted from the dashboard, excluded from LLM context, and automatically deleted after 24 hours.

sensitive_metadata is available on both POST /v2/end-users/ (custom channels) and PATCH /v2/end-users/:id (all channels).

Set sensitive metadata at user creation time

$curl -X POST https://EXAMPLE.ada.support/api/v2/end-users/ \
> -H "Authorization: Bearer YOUR_API_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "profile": {
> "language": "en-US",
> "sensitive_metadata": {
> "fields": {
> "auth_token": "eyJhbGciOiJIUzI1NiIs...",
> "session_id": "sess_abc123"
> }
> }
> }
> }'

The sensitive_metadata values do not appear in the response. The AI Agent can use them to execute authenticated Actions.

Update sensitive metadata mid-conversation

$curl -X PATCH https://EXAMPLE.ada.support/api/v2/end-users/END_USER_ID \
> -H "Authorization: Bearer YOUR_API_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "profile": {
> "sensitive_metadata": {
> "fields": {
> "auth_token": "eyJhbGciOiJSUzI1NiIs..."
> }
> }
> }
> }'

Remove a sensitive metavariable

Set the key to null:

$curl -X PATCH https://EXAMPLE.ada.support/api/v2/end-users/END_USER_ID \
> -H "Authorization: Bearer YOUR_API_TOKEN" \
> -H "Content-Type: application/json" \
> -d '{
> "profile": {
> "sensitive_metadata": {
> "fields": {
> "auth_token": null
> }
> }
> }
> }'

Change conversation language based on end user’s selection on any channel

Before you begin

Before you start, make sure you have everything you need:

Configure languages in your AI Agent

  1. In your AI Agent’s language settings, configure the following:
  2. In your AI Agent’s greeting, use a List Option block to present the language options you selected to your user.
  3. Use a Request block to set the end user’s language to their list selection.

    Language codes must be in BCP 47 4-digit format, per the End Users API schema.

  4. Save your greeting.
  5. Test the greeting in your Test Bot, embed, or any other channel. The conversation language should change immediately based on the end user’s selection, and the AI Agent should immediately respond using the appropriate translation.

Get notified at your webhook when an Ada end user is created or updated

Before you begin

Before you set up your webhook, make sure you have everything you need:

  • An Ada dashboard with the Test Bot enabled (or any other supported channel where your bot is active)
  • An API token

Set up your webhook

  1. Set up a test webhook, or bring your own, with Ada’s webhooks manager.
    1. On the Ada dashboard, find your webhook settings.
      • If you’re using a generative AI Agent, go to Platform > Webhooks.
      • If you’re using a scripted bot, go to Settings > Integrations > Webhooks.
    2. Click Add Endpoint to get started. If you don’t have your own endpoint, configure a test endpoint using Svix Play.
    3. In the Message Filtering section, subscribe to both v1.end_user.updated and v1.end_user.created events.
    4. Click Create to save your endpoint.
  2. Open your Test Bot in a new tab or window and start a conversation.
  3. In a separate tab, open the Webhooks Logs to monitor new events. You’ll see the conversation with your Test Bot has created an end user! There will be a corresponding log entry called v1.end_user.created.
  4. Click on the log to see the webhook event payload and copy the end_user_id value.
  5. Make a PATCH request with the following payload:
    JSON
    1{
    2 "profile": {
    3 "first_name": "Ada",
    4 "last_name": "Lovelace",
    5 "display_name": "Ada Lovelace",
    6 "avatar": "https://example.com/avatars/ada.png",
    7 "email": "ada.lovelace@ada.cx",
    8 "language": "en-US",
    9 "metadata": {
    10 "end_user_api_test": true
    11 }
    12 }
    13}
  6. Check the Webhooks Logs tab. A successful PATCH request will generate a v1.end_user.updated log.
  7. You can continue to chat with Test Bot while making these changes to the end user. The End Users API can update records at any point whether a conversation is active or not. Go ahead and send a few messages to your AI Agent!
  8. Finally, go the Conversations View and find your conversation. You’ll see that the metavariables are updated from the PATCH request.

That’s it! You have the building blocks to create an integration between your customer data platform and Ada’s End Users API. Your integration can ingest webhook events and use the PATCH endpoint to send user details to Ada so that features such as Article Rules can be applied automatically for your end users.