RealTimeX
Sign inStart for free
RealTimeXAPI Documentationv1
IntroductionAuthenticationBase URLHeadersError codes
GETGet profilePATCHUpdate profilePATCHChange passwordGETList conversationsGETConversation metadata keysGETGet conversationGETConversation messagesPATCHUpdate conversationDELDelete conversationPOSTBulk delete conversationsGETList messagesGETMessage metadata keysPATCHUpdate messageDELDelete messagePOSTBulk delete messagesGETList usersGETUser metadata keysGETGet userPATCHUpdate userDELDelete userPOSTBulk delete users
Sample requestsSample responsesStatus codesAppendixChangelog
API ReferenceAPI endpointsPlatform

Get Conversation Metadata Keys

Overview

Discover the custom metadata keys (and sample values) currently stored on conversations in the tenant workspace.

Use this endpoint to build filter UIs for metadata.<key> query parameters on List Conversations - for example metadata.workspaceId=c1 or metadata.department=support.

When to use this endpoint?

Use Get Conversation Metadata Keys when:

  • Building dynamic filters, facets, or dropdowns for conversation lists.
  • Discovering which metadata keys exist before hard-coding filter fields.
  • Showing admins how many conversations use each key and which values appear.
  • Keeping filter UIs in sync as your app stores new metadata over time.

After discovering keys, apply them as metadata.<yourKey>=value on Conversations → List Conversations.

GET{baseUrl}/api/{apiVersion}/client/conversations/metadata-keys
Authentication
Required (Bearer token)
Tenant-scoped
Yes (tenant DB - requires x-client-id)

Request Headers

HeaderValueDescription
AuthorizationBearer <access_token>Access Token from Login Client or Register Client.
is-tenanttrueTargets the tenant DB ("true", needs x-client-id) or the root DB ("false", e.g. client register/create).
x-client-id{{clientId}}Tenant (client) id. Required when is-tenant=true. Uses the {{clientId}} variable.

Success Response (HTTP 200 OK)

Each entry includes the metadata key, how many conversations use it (count), distinct value count, and sample values.

json
1{2  "success": true,3  "message": "Metadata keys fetched successfully",4  "data": {5    "keys": [6      {7        "key": "workspaceId",8        "count": 42,9        "totalValues": 3,10        "values": [11          "c1",12          "c2",13          "c3"14        ]15      },16      {17        "key": "department",18        "count": 17,19        "totalValues": 2,20        "values": [21          "sales",22          "support"23        ]24      }25    ]26  },27  "error": null28}

Common Errors

Metadata key discovery fails when authentication or tenant headers are missing or invalid.

CodeReason
401 UnauthorizedAccess Token is missing, invalid, or expired.
403 ForbiddenClient account is inactive or tenant access is restricted.
500 Internal Server ErrorAn unexpected error occurred while fetching metadata keys.

Best Practices

  • Call this endpoint when building or refreshing conversation filter UIs - do not hard-code keys if they can change.
  • Map each returned key to a metadata.<key> query param on List Conversations.
  • Use values as suggestions for filter dropdowns; treat them as samples, not a complete enum.
  • Always send tenant headers (is-tenant, x-client-id) with a valid Bearer token.

Filters ready to wire

Apply discovered keys as metadata.<key>=value on Conversations → List Conversations to filter the inbox by your custom fields.

PreviousList conversationsNextGet conversation

On this page

OverviewWhen to use this endpoint?Request HeadersSuccess Response (HTTP 200 OK)Common ErrorsBest Practices
Back to top