For the complete documentation index, see llms.txt. This page is also available as Markdown.

GraphQL queries

Fetch everything the platform knows about one user, in a single request.

Your goal

Get all kinds of data about one UserPoint - profile, activities, segments, identifiers - with a single request, fast enough for real-time use.

Expected outcome

A query returning exactly the fields your use case needs, within the endpoint's documented limits.

What the GraphQL API is for

The GraphQL API gives you the ability to query all kinds of UserPoint data as collected by the platform, with a single request.

The schema used by the GraphQL endpoint is based on your schema. To add or remove fields from the GraphQL API, update the schema.

The endpoint

POST /v1/datamarts/:datamartId/query_executions/graphql
Parameter
Description

datamartId

The datamart in which the UserPoint is looked up.

The body carries a query parameter containing your GraphQL query, starting with query MyQuery {. Escape double quotes where needed.

A 200 returns { "data": { ...GraphQL response... } }. A 429 means you have exceeded the rate limit.

Limits

That last limit is the one that produces wrong conclusions rather than errors - see the @filter warning below.

Selecting the UserPoint

Any identifier works, through a different function.

Both the compartment ID and the account ID are mandatory.

The identifier types are described in User identifiers.

A fuller query

This query relies on a customer-defined schema, so it may not work as-is on your datamart. Check your own field names before copying it.

Filtering

@filter selects only the elements matching a clause. The clause is a WHERE object tree expression, so anything valid there is valid here.

Tools

Use a dedicated editor to write and test GraphQL queries. A GraphQL playground is available in Computing Console.

Last updated

Was this helpful?