Query preferences for multiple users

POST

/v1/preferences/{partition}/query

In your request headers, pass authorization: Bearer <<token>>.

If you're self-hosting Sombra, also add the request header x-sombra-authorization: Bearer <<sombraInternalKey>>. You can read more about request authorization here.

Requires scope:

View Managed Consent Database Admin API

authorizationstring
An API key generated from the Transcend dashboard: https://app.transcend.io/infrastructure/api-keys.
x-sombra-authorizationstring
The Sombra internal key. This header is only needed for self-hosted Sombra gateways. See https://docs.transcend.io/docs/dsr-automation/api-integration/authentication#authenticating-to-sombra
content-typestring
Specify content-type: application/json for a JSON response from the Transcend API.
partitionstring
The ID of the partition in the Preference Store.

application/json

filter
The filter to apply to the query.
Any of:
Filter by user identifiers
Filter by when the preference was last updated
Filter by system metadata
limitnumberdefault:50min:1max:50
Max number of users to return.

Request Body Examples

Query for a single user's consent preferences:

{
  "filter": {
    "identifiers": [
      {
        "name": "email",
        "value": "no-track@example.com"
      }
    ]
  }
}

Query for multiple users' consent preferences:

{
  "filter": {
    "identifiers": [
      {
        "name": "email",
        "value": "no-track@example.com"
      },
      {
        "name": "email",
        "value": "pls-no-track@example.com"
      },
      {
        "name": "email",
        "value": "foo@example.com"
      },
      {
        "name": "phone",
        "value": "+11234567890"
      }
    ]
  }
}

Query for the first 10 users' consent preferences:

{
  "limit": 10
}

Using cursor pagination:

{
  "cursor": "VGhpcyBpcyBhbiBleGFtcGxlIG9mIGEg...",
  "limit": 10
}

Query for all preferences collected in a given partition during a 24 hours period:

{
  "filter": {
    "timestampAfter": "2023-06-26T21:39:31.677769",
    "timestampBefore": "2023-06-27T21:39:31.677769"
  }
}

Query for preferences in a partition that were collected after a certain timestamp:

{
  "filter": {
    "timestampAfter": "2023-06-26T21:39:31.677769"
  }
}

Query for all preferences updated in a given partition during a 24 hours period:

{
  "filter": {
    "system": {
      "updatedAfter": "2024-08-26T21:21:19.677769",
      "updatedBefore": "2024-08-27T21:21:19.677769"
    }
  }
}

Query for preferences in a partition that were updated after a certain timestamp:

{
  "filter": {
    "system": {
      "updatedAfter": "2024-08-26T21:21:19.677769"
    }
  }
}

Queries with updatedAt with pagination:

{
  "filter": {
    "system": {
      "updatedBefore": "2024-08-27T21:21:19.677769"
    }
  },
  "cursor": "VGhpcyBpcyBhbiBleGFtcGxlIG9mIGEg..."
}

200 (OK)

application/json

Returns a list of users' preferences

Response Body

nodesarray<object>(required)
List of all user preference records that match the query filters.
cursorstring
The cursor for the next page. This is an opaque value that our servers use to track the next page of results.

Response Body Examples

Response for multiple users' preferences - queried by timestamp:

{
  "nodes": [
    {
      "identifiers": [
        {
          "name": "email",
          "value": "no-track@example.com"
        },
        {
          "name": "phone",
          "value": "+11234567890"
        }
      ],
      "partition": "ee1a0845-694e-4820-9d51-50c7d0a23467",
      "timestamp": "2023-04-11T15:09:28.403Z",
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": true
        },
        {
          "purpose": "ProductUpdates",
          "enabled": true,
          "preferences": [
            {
              "topic": "Frequency",
              "choice": {
                "selectValue": "Weekly"
              }
            },
            {
              "topic": "Channel",
              "choice": {
                "selectValues": [
                  "Email",
                  "Sms"
                ]
              }
            },
            {
              "topic": "GoDigital",
              "choice": {
                "booleanValue": true
              }
            }
          ]
        }
      ],
      "consentManagement": {
        "airgapVersion": null,
        "usp": null,
        "gpp": null,
        "tcf": null
      },
      "system": {
        "updatedAt": "2023-06-13T08:02:21.793Z",
        "decryptionStatus": "DECRYPTED"
      },
      "metadata": [
        {
          "key": "version",
          "value": "1.0.0"
        },
        {
          "key": "confirmationTimestamp",
          "value": "2023-06-13T07:03:12.621Z"
        }
      ],
      "metadataTimestamp": "2023-06-13T08:02:21.793Z"
    },
    {
      "identifiers": [
        {
          "name": "email",
          "value": "no-track-pls@example.com"
        },
        {
          "name": "phone",
          "value": "+11234567891"
        }
      ],
      "partition": "ee1a0845-694e-4820-9d51-50c7d0a23467",
      "timestamp": "2023-05-11T15:09:28.403Z",
      "purposes": [
        {
          "purpose": "SaleOfInfo",
          "enabled": false
        }
      ],
      "consentManagement": {
        "airgapVersion": null,
        "gpp": null,
        "tcf": null,
        "usp": "1YYN"
      },
      "system": {
        "updatedAt": "2023-06-13T08:02:21.793Z",
        "decryptionStatus": "DECRYPTED"
      },
      "metadata": [
        {
          "key": "version",
          "value": "1.0.0"
        },
        {
          "key": "confirmationTimestamp",
          "value": "2023-06-13T07:03:12.621Z"
        }
      ],
      "metadataTimestamp": "2023-06-13T08:02:21.793Z"
    }
  ]
}

Response for preferences - queried by updatedAt:

{
  "nodes": [
    {
      "identifiers": [
        {
          "name": "email",
          "value": "no-track@example.com"
        },
        {
          "name": "phone",
          "value": "+11234567892"
        }
      ],
      "partition": "ee1a0845-694e-4820-9d51-50c7d0a23467",
      "timestamp": "2023-04-11T15:09:28.403Z",
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": true
        },
        {
          "purpose": "ProductUpdates",
          "enabled": true,
          "preferences": [
            {
              "topic": "Frequency",
              "choice": {
                "selectValue": "Weekly"
              }
            },
            {
              "topic": "Channel",
              "choice": {
                "selectValues": [
                  "Email",
                  "Sms"
                ]
              }
            },
            {
              "topic": "GoDigital",
              "choice": {
                "booleanValue": true
              }
            }
          ]
        }
      ],
      "consentManagement": {
        "airgapVersion": null,
        "usp": null,
        "gpp": null,
        "tcf": null
      },
      "system": {
        "updatedAt": "2023-06-13T08:02:21.793Z",
        "decryptionStatus": "DECRYPTED"
      },
      "metadata": [
        {
          "key": "version",
          "value": "1.0.0"
        },
        {
          "key": "confirmationTimestamp",
          "value": "2023-06-13T07:03:12.621Z"
        }
      ],
      "metadataTimestamp": "2023-06-13T08:02:21.793Z"
    }
  ],
  "cursor": "VGhpcyBpcyBhbiBleGFtcGxlIG9mIGEg..."
}

400 (Bad Request)

application/json

Bad Request

Response Body

errorsarray<string>
Examples:
  • Missing consent identifier encryption key. Please ensure that your Sombra is configured correctly with a `CONSENT_IDENTIFIER_ENCRYPTION_KEY`.
  • Cannot query by more than one of timestamp, updated, or encryptedIdentifiers at the same time
  • Invalid value provided for the "timestampBefore" or "timestampAfter" parameters. Please ensure that the consent timestamps are valid ISO 8601 timestamps.
  • Invalid value provided for the "updatedBefore" or "updatedAfter" parameters. Please ensure that the updated timestamps are valid ISO 8601 timestamps.
  • "startKey" should have either "updatedAt" or "timestamp". Please ensure that the "startKey" parameter is formatted correctly.
  • Payload does not conform to the expected schema
  • invalid partition provided. Must be one of the following: [valid_partitions]
  • Invalid Preference choice for topic: [topic_name]
  • No preference topic found for purpose: [purpose] and topic: [topic]
  • Invalid preference type for preference topic: [topic] and purpose: [purpose]
  • Invalid preference choice: [choice] for topic: [topic] and purpose: [purpose]
  • Invalid preference choices: [choices] for topic: [topic] and purpose: [purpose]
  • Each consent preference must have an identifier field.
  • All records in the update request must belong to the same partition. Found multiple partitions with ids: [partition_ids]
  • [purpose] cannot be updated. Please log in to manage your preferences.

401 (Unauthorized)

application/json

There was a problem authenticating your request. This may be an issue with the Transcend API key ("authorization" header), or the Sombra API key ("x-sombra-authorization" header used for self-hosted gateways only).

413 (Request Entity Too Large)

application/json

The request body is too large. JSON and raw bodies must be less than 50MB. URL encoded bodies must be less than 30MB.

429 (Too Many Requests)

application/json

You are sending requests too quickly and have hit our rate limit. If you hit this, you'll need to throttle your request velocity or try again later.

Response Headers

Retry-Afterinteger
X-RateLimit-Limitinteger
X-RateLimit-Remaininginteger
X-RateLimit-Resetinteger
Retry-Afterinteger
X-RateLimit-Limitinteger
X-RateLimit-Remaininginteger
X-RateLimit-Resetinteger
Retry-Afterinteger
X-RateLimit-Limitinteger
X-RateLimit-Remaininginteger
X-RateLimit-Resetinteger
Retry-Afterinteger
X-RateLimit-Limitinteger
X-RateLimit-Remaininginteger
X-RateLimit-Resetinteger

500 (Internal Server Error)

application/json

A 5xx error means there is either an issue with your self-hosted gateway, or a Transcend server is having issues. You check our system status at status.transcend.io. Please reach out to Transcend support if you're experiencing this error.

502 (Bad Gateway)

application/json

An upstream service on Transcend's side is having issues. You check our system status at status.transcend.io. Please reach out to Transcend support if you're experiencing this error.