Product & Technical Documentation
Breadcrumbs

GraphQL Profile API

The Profile API lets your own backend look up Profiles stored on our platform through GraphQL. It works without a user logging in: your system authenticates with its own Client Credentials and acts on behalf of the FunnelManager user who created them.

The flow has three steps:

  1. Create Client Credentials once, in FunnelManager.

  2. Request an Access Token from our Keycloak server using those credentials.

  3. Call the GraphQL API, sending the Access Token with every request.

Prerequisites

Your FunnelManager user needs the External Access permission to create Client Credentials, and access to the GraphQL API to use them. Your administrator assigns both. If you cannot see the "API credentials" section described below, ask your administrator for these permissions.

Credentials act on your behalf. Every request made with your Client Credentials runs as your user: with your permissions and against your query quota. If your account is disabled or loses one of these permissions, requests made with your credentials will be rejected.

Obtaining the Client Credentials

You create Client Credentials yourself in FunnelManager. Click your account icon and select "Account Options".

image-20261204-113259.png

Open the "Account Security" tab. The "API credentials" section is where you create and manage your Client Credentials. Give the new credentials a name that tells you where they are used (for example "CRM sync - production"). The name is required and can be at most 100 characters.

image-20261204-113844.png

When the Client Credentials are created, the following popup appears.

image-20261204-114019.png

The Client Secret is shown only once and cannot be retrieved later. If you lose it, revoke these credentials and create new ones.

Click "Download credentials" to save a JSON file with everything your backend needs. The file looks like this:

JSON
{
  "name": "CRM sync - production",
  "clientId": "fmbe_cc_f1zjob",
  "clientSecret": "iM9iH7ozskBVVZJutchPixRfES0bLsW8yVlqDSZH5YFSXVgevpBqxQBoqUtlrpGQ0OHNmnQXQMfySn6JFyGBxT",
  "grantType": "client_credentials",
  "tokenEndpoint": "https://keycloak.prod.teavaro.systems/realms/demo/protocol/openid-connect/token",
  "graphqlEndpoint": "https://fm-be.demo.teavaro.systems/api/v1/fm/graphql/query"
}

Field

Meaning

name

The name you gave the credentials

clientId

Identifies your credentials. Always starts with fmbe_cc_

clientSecret

The secret that goes with the Client ID. Keep it private

grantType

The OAuth 2.0 grant type to use, always client_credentials

tokenEndpoint

Where to request Access Tokens

graphqlEndpoint

Where to send GraphQL queries

Managing your Client Credentials

  • Each user can own a limited number of Client Credentials at a time. When you reach the limit, revoke credentials you no longer use before creating new ones.

  • The "API credentials" section lists your existing credentials by name and Client ID. The secret is never shown again.

  • Revoke credentials as soon as they are no longer needed or you suspect the secret has leaked. After revocation, no new Access Tokens can be issued for them.

  • Treat the Client Secret like a password. Keep it in your backend's secret store, never in frontend code, mobile apps or source control.

Getting the Access Token

Your Client Credentials are not sent to the GraphQL API directly. You exchange them for a short-lived Access Token at our Keycloak server, using the standard OAuth 2.0 / OpenID Connect Client Credentials grant. Most OAuth client libraries support this flow out of the box.

Send a POST request to the tokenEndpoint URL from your JSON file, with a form-encoded body:

Bash
curl -X POST "https://keycloak.prod.teavaro.systems/realms/demo/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=$CLIENT_ID" \
  -d "client_secret=$CLIENT_SECRET"

The Keycloak server responds with:

JSON
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6Ikp...<truncated>...",
  "expires_in": 300,
  "refresh_expires_in": 0,
  "token_type": "Bearer",
  "not-before-policy": 0,
  "scope": ""
}

Field

Meaning

access_token

The token to send with your GraphQL requests

expires_in

How long the token is valid, in seconds (300 seconds = 5 minutes)

token_type

Always Bearer: send the token in the Authorization header as Bearer <access_token>

refresh_expires_in

0: there is no Refresh Token in this flow

Send the access_token in the HTTP Authorization header, using the Bearer scheme (Authorization: Bearer <access_token>), with every GraphQL request.

Renewing the token. The Client Credentials flow gives no Refresh Token. When the token expires, request a new one with the same call. Recommended practice:

  • Reuse the token for all requests while it is valid. Do not request a new token for every API call.

  • Request a new token a little before expires_in runs out (for example 30 seconds before), so requests in flight do not fail.

  • If the Profile API answers HTTP 401, request a new token and retry the request once.

Accessing the GraphQL Profile API

Client Credentials give access to the following GraphQL queries:

Query

Purpose

Profiles

Returns one or more Profiles that hold a given identifier (name and value pair, e.g. a Customer ID)

Profile

Returns exactly one Profile by its TUID

IntrospectionQuery

Returns the full GraphQL schema, so you can see every available field and type

Send every request as an HTTP POST to the graphqlEndpoint URL from your JSON file, with:

  • Authorization: Bearer <access_token>

  • Content-Type: application/json

  • a JSON body with a query field holding the GraphQL query.

Only the read queries below are available with Client Credentials. Any other query, and any mutation or subscription, is refused with a FORBIDDEN_OPERATION error, even when it is sent together with an allowed query in the same request.

Fetch Profiles using a Customer ID

The Profiles query takes two required arguments:

  • idName: the identifier name, for example customer-id.

  • idValue: the identifier value to look for.

It returns a list. The list can hold several Profiles when the identifier is shared by more than one Profile (for example a group identifier), and it is empty when no Profile matches.

Bash
curl --url 'https://fm-be.demo.teavaro.systems/api/v1/fm/graphql/query' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'content-type: application/json' \
  --data-raw '{"query":"{\n  Profiles(idName:\"customer-id\",idValue:\"e4c3b8ef10937e995f1cceb6ab793c2ae87ecd2254abeb97ed25d1e037ecb478\"){\n    identifiers {\n      name\n      value\n    }\n    type\n    category\n    source\n    creation_date\n    change_date\n    last_seen\n  }\n}"}'

A response may look like this:

JSON
{
  "data": {
    "Profiles": [
      {
        "identifiers": [
          {
            "name": "customer-id",
            "value": "e4c3b8ef10937e995f1cceb6ab793c2ae87ecd2254abeb97ed25d1e037ecb478"
          },
          {
            "name": "email-sha2",
            "value": "6f8805c6d8f1bfd9227dc58ac2642fd30bc4eba649f8f72779f76a80d276c0ad"
          },
          {
            "name": "umid",
            "value": "52a5611e-a98b-423e-a561-1ea98b523ec2"
          }
        ],
        "type": "C0",
        "category": "customer",
        "source": "brand-demo-info",
        "creation_date": "2026-09-29T04:40:10.148Z",
        "change_date": "2026-11-25T13:23:22.354Z",
        "last_seen": "2026-11-27T11:56:44.989Z"
      }
    ]
  }
}

GraphQL returns only the fields you ask for. Add or remove fields in the query to fit your needs; the schema introspection lists every available field.

Fetch a Profile using the TUID

The TUID is the platform's unique Profile ID. The Profile query takes one required argument, tuid, which must be a valid UUID. It returns the matching Profile, or null when no Profile has that TUID.

Bash
curl --url 'https://fm-be.demo.teavaro.systems/api/v1/fm/graphql/query' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'content-type: application/json' \
  --data-raw '{"query":"{\n  Profile(tuid:\"0199f30c-1f85-75a8-9d7d-d7b144fee599\"){\n    identifiers {\n      name\n      value\n    }\n    type\n    category\n    source\n    creation_date\n    change_date\n    last_seen\n  }\n}"}'

A response may look like this:

JSON
{
  "data": {
    "Profile": {
      "identifiers": [
        {
          "name": "umid",
          "value": "17495156-4489-4ce4-bba4-d4c55d5333e5"
        }
      ],
      "type": "V0",
      "category": "visitor",
      "source": "brand-demo-info",
      "creation_date": "2025-03-27T10:33:00.437Z",
      "change_date": "2025-03-27T10:33:09.436Z",
      "last_seen": "2025-03-27T10:33:10.427Z"
    }
  }
}

As with Profiles, you can request any other Profile fields defined in the GraphQL schema.

GraphQL Schema Introspection

The standard GraphQL IntrospectionQuery returns the full schema: every Profile field, its type, and the arguments of each query. Tools such as Postman, Insomnia, GraphiQL or GraphQL code generators can read this result to give you autocompletion or generate typed clients. Introspection does not count toward your quota.

Bash
curl -X POST https://fm-be.demo.teavaro.systems/api/v1/fm/graphql/query \
  -H "Content-Type: application/json" \
  -H "authorization: Bearer $TOKEN" \
  -d '{"query":"query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { name } types { ...FullType } directives { name description locations args { ...InputValue } } } } fragment FullType on __Type { kind name description fields(includeDeprecated: true) { name description args { ...InputValue } type { ...TypeRef } isDeprecated deprecationReason } inputFields { ...InputValue } interfaces { ...TypeRef } enumValues(includeDeprecated: true) { name description isDeprecated deprecationReason } possibleTypes { ...TypeRef } } fragment InputValue on __InputValue { name description type { ...TypeRef } defaultValue } fragment TypeRef on __Type { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } } }"}'

The schema also describes queries used by FunnelManager itself. With Client Credentials, only Profile, Profiles and introspection are available.

Usage Quota

The number of Profiles you can retrieve is limited by a quota that resets periodically:

  • Each Profile returned by Profile or Profiles counts against the quota. Introspection is free.

  • The quota belongs to the user who created the Client Credentials. All of that user's credentials share it with the user's own FunnelManager activity.

  • When the quota is used up, the API answers HTTP 429 with a quota exceeded error (code RATE_LIMITED) until the quota resets.

Please contact the administrator to request a higher daily quota.

Errors and Troubleshooting

Response

Likely cause

What to do

HTTP 401

Access Token missing, malformed or expired

Check the Authorization: Bearer … header; request a new token

HTTP 403

The credentials' owner is disabled or lacks the required permissions, or the token was sent to an endpoint other than GraphQL

Ask your administrator to check the owner's permissions

HTTP 429, RATE_LIMITED

Quota used up

Wait for the quota to reset (see X-RateLimit-Until)

GraphQL error FORBIDDEN_OPERATION

The request contains a query or mutation that Client Credentials cannot run

Use only Profile, Profiles and introspection

Error from the token endpoint (e.g. invalid_client)

Wrong Client ID or Secret, or the credentials were revoked

Check the values or create new credentials