Batch-upsert preference records for multiple users

PUT

/v1/preferences

Request Authorization

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:

Modify User Stored Preferences

Request Parameters

Header Parameters

authorization string
An API key generated from the Transcend dashboard: https://app.transcend.io/infrastructure/api-keys.
x-sombra-authorization string
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-type string
Specifying content-type: application/json for a JSON response from the Transcend API.

Request Body

application/json

records array<object>(required)
The list of user preferences records to update.
skipWorkflowTriggers boolean
Whether to skip triggering workflows associated with the updated preferences. Defaults to false when not specified.

Request Body Examples

Query for upserting user preferences and triggering associated workflows:

{
  "records": [
    {
      "identifier": "no-track@example.com",
      "partition": "ea3a0845-694e-4820-9d51-50c7d0a23467",
      "timestamp": "2023-05-11T19:32:31.707Z",
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": false
        },
        {
          "purpose": "Product Updates",
          "enabled": true,
          "preferences": [
            {
              "topic": "Frequency",
              "choice": {
                "selectValue": "Weekly"
              }
            },
            {
              "topic": "Channel",
              "choice": {
                "selectValues": [
                  "Email",
                  "Sms"
                ]
              }
            },
            {
              "topic": "Unsubscribe",
              "choice": {
                "booleanValue": true
              }
            }
          ]
        }
      ]
    },
    {
      "identifier": "no-track-pls@example.com",
      "partition": "ea3a0845-694e-4820-9d51-50c7d0a2346",
      "timestamp": "2023-05-11T19:32:31.707Z",
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": true
        },
        {
          "purpose": "Product Updates",
          "enabled": false
        }
      ]
    }
  ],
  "skipWorkflowTriggers": false
}

Query for upserting iab string (similar for gpp and tcf):

{
  "records": [
    {
      "identifier": "no-track@example.com",
      "partition": "ea3a0845-694e-4820-9d51-50c7d0a23467",
      "timestamp": "2023-05-11T19:32:31.707Z",
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": true
        }
      ],
      "usp": "1YYN"
    },
    {
      "identifier": "no-track-pls@example.com",
      "partition": "ea3a0845-694e-4820-9d51-50c7d0a2346",
      "timestamp": "2023-05-11T19:32:31.707Z",
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": true
        }
      ],
      "usp": "1YYN"
    }
  ]
}

Response

200 (OK)

application/json

Returns whether the operation was successful and the upserted records

Response Body

success boolean
Whether the preferences were updated successfully
nodes array<object>
User's preference records

Response Body Example

Success Resoponse:

{
  "success": true,
  "nodes": [
    {
      "userId": "no-track@example.com",
      "partition": "ee1a0845-694e-4820-9d51-50c7d0a23467",
      "timestamp": "2023-04-11T15:09:28.403Z",
      "updatedAt": "2023-06-13T08:02:21.793Z",
      "decryptionStatus": "DECRYPTED",
      "usp": null,
      "gpp": null,
      "tcf": null,
      "airgapVersion": null,
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": true
        },
        {
          "purpose": "Product Updates",
          "enabled": true,
          "preferences": [
            {
              "topic": "Frequency",
              "choice": {
                "selectValue": "Weekly"
              }
            },
            {
              "topic": "Channel",
              "choice": {
                "selectValues": [
                  "Email",
                  "Sms"
                ]
              }
            },
            {
              "topic": "Unsubscribe",
              "choice": {
                "booleanValue": true
              }
            }
          ]
        }
      ]
    },
    {
      "userId": "no-track-pls@example.com",
      "partition": "ee1a0845-694e-4820-9d51-50c7d0a23467",
      "timestamp": "2023-05-11T15:09:28.403Z",
      "updatedAt": "2023-06-13T08:02:21.793Z",
      "purposes": [
        {
          "purpose": "Advertising",
          "enabled": true
        },
        {
          "purpose": "Analytics",
          "enabled": true
        },
        {
          "purpose": "Product Updates",
          "enabled": false
        }
      ],
      "gpp": null,
      "tcf": null,
      "airgapVersion": null,
      "usp": "1YYN"
    }
  ]
}

400 (Bad Request)

application/json

While this request passed authentication, the input is malformed. Please double-check that your code conforms to our API specification.

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

409 (Conflict)

application/json

You're attempting to modify a DSR that is not in a modifiable state. For example, the DSR may have already completed, or been revoked.

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.

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.