curl https://api.thanxsandbox.com/users/${user_id}/tags \
-X PUT \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "X-ClientId: ${client_id}" \
-d '{
"key": "allergens",
"values": ["gluten", "soy"]
}'
{}
Sandbox Testing
Set a Test User's Tag
Creates or replaces a tag on a test user, to test tag-driven behavior such as segments.
PUT
/
users
/
{user_id}
/
tags
curl https://api.thanxsandbox.com/users/${user_id}/tags \
-X PUT \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "X-ClientId: ${client_id}" \
-d '{
"key": "allergens",
"values": ["gluten", "soy"]
}'
{}
Please review proper request headers here.
This endpoint is only available in SANDBOX. It returns
403 in production.Authenticate with your merchant app's
X-ClientId and Accept-Version: v4.0. No user token is needed. Do not send an Authorization: Bearer header: when a valid Bearer token is present, the API registers a device for that token's user as a side effect. See the Sandbox Testing guide.key that was set through this endpoint, its values are replaced. To read a user’s tags, use Look Up Test Users.
Parameters
Response
Returns201 Created with an empty JSON object ({}).
Errors
| Status | Code | Message | When |
|---|---|---|---|
400 | BAD_REQUEST | maximum of 50 tag values | More than 50 values |
400 | BAD_REQUEST | values must not be empty | Every value is blank |
400 | BAD_REQUEST | key is a reserved tag name | The key is reserved |
400 | BAD_REQUEST | key is already set by another source | The user already has this key from another source, for example a partner integration. This endpoint only manages tags it set. |
400 | CLIENT_ID_HEADER_INVALID | X-ClientId header is invalid | The X-ClientId header is missing or doesn’t match an app |
403 | FORBIDDEN | You do not have access to this resource. | Called in production, or your X-ClientId isn’t tied to exactly one merchant |
404 | RESOURCE_NOT_FOUND | User not found | No active user with this user_id is a member of your merchant |
curl https://api.thanxsandbox.com/users/${user_id}/tags \
-X PUT \
-H "Content-Type: application/json" \
-H "Accept-Version: v4.0" \
-H "Accept: application/json" \
-H "X-ClientId: ${client_id}" \
-d '{
"key": "allergens",
"values": ["gluten", "soy"]
}'
{}