RealTimeX
Start For Free

RealTimeX

API Documentation

IntroductionAuthenticationBase URLHeadersError codes
Get profileUpdate profileChange passwordList conversationsConversation metadata keysGet conversationConversation messagesUpdate conversationDelete conversationBulk delete conversationsList messagesMessage metadata keysUpdate messageDelete messageBulk delete messagesList usersUser metadata keysGet userUpdate userDelete userBulk delete users
Sample requestsSample responsesStatus codesAppendixChangelog

API Reference

Get User Metadata Keys

Overview

Discover the custom metadata keys (and sample values) currently stored on tenant users.

These keys help you build filter UIs for metadata.<key> query parameters on list endpoints such as List Users. Instead of hard-coding filter fields, call this endpoint to learn which keys exist, how often they appear, and which distinct values are in use.

When to use this endpoint?

Use Get User Metadata Keys when:

  • Building dynamic filter controls for metadata.<key>=value on List Users.
  • You need to know which metadata keys exist across the tenant’s users.
  • Populating dropdowns with distinct values (for example tier → gold / silver).
  • Auditing custom fields before updating user metadata via Update User.
GET{baseUrl}/api/{apiVersion}/client/users/metadata-keys

Authentication

Required (Bearer token)

Tenant-scoped

Yes (tenant DB — requires x-client-id)

Request Headers

HeaderValueDescription
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)

On success, the API returns each metadata key with usage counts and distinct values you can use for filter UIs.

json
{
  "success": true,
  "message": "Metadata keys fetched successfully",
  "data": {
    "keys": [
      {
        "key": "workspaceId",
        "count": 57,
        "totalValues": 3,
        "values": [
          "c1",
          "c2",
          "c3"
        ]
      },
      {
        "key": "tier",
        "count": 12,
        "totalValues": 2,
        "values": [
          "gold",
          "silver"
        ]
      }
    ]
  },
  "error": null
}

Common Errors

HTTP 200 OK means metadata keys were fetched successfully. Failures usually indicate missing tenant headers or an invalid token.

CodeReason
400 Bad RequestRequired headers are missing or invalid.
401 UnauthorizedAccess Token is missing, invalid, or expired.
500 Internal Server ErrorAn unexpected error occurred while fetching metadata keys.

Best Practices

  • Load metadata keys when mounting your filter bar so options stay in sync with stored user data.
  • Map each returned key to a metadata.<key> query param on List Users.
  • Prefer the provided values array for select inputs when the set is small.
  • Re-fetch keys after bulk metadata updates so new fields appear in the UI.

Ready to filter by metadata

Use the returned keys to build filter controls, then call List Users with metadata.<yourKey>=value (for example metadata.tier=gold).

PreviousList usersNextGet user

On this page

OverviewWhen to use this endpoint?Request HeadersSuccess ResponseCommon ErrorsBest Practices