Skip to main content

Tagging a user

Tagging a user

Contents

Overview

  • Call name: add-user-tag
  • Endpoint URL: https://{API hostname}/auth/add-user-tag
  • Request methods: POST
  • Request Content-Type: application/json or application/x-www-form-urlencoded
  • Response Content-Type: application/json
  • Auth required: yes

This endpoint allows a user with admin access to assign a tag with model_class user to a user.

Version-specific information

The following version-specific changes apply to this endpoint. See the versioning page for more details.

VersionChange details
N/AN/A

Permissions and Authentication

This API call requires admin authentication:

  • The performing user must be logged in and have WRITE access to the chain to which the user is connected
  • User and privileged authentication methods are not permitted for this endpoint

Headers

Standard headers are used for this endpoint. No special headers are required.

HTTP Parameters

The following HTTP parameters can be passed to the API:

ParameterDescription
chain(object, mandatory) Details of the chain which is submitting the request
chain.chain_id(integer, mandatory) The Spaaza Chain ID of the retailer entity
user(object, mandatory) Details of the user to tag
user.user_id(integer, conditional) The ID of the user to tag. At least one of user_id, username, member_number, authentication_point_identifier, auxiliary_identifier, or referral_code is required to identify the user
user.username(string, conditional, max=255) The username of the user to tag
user.member_number(string, conditional, max=255) The member number of the user to tag
user.authentication_point_identifier(string, conditional, max=255) The authentication point identifier of the user to tag
user.auxiliary_identifier(string, conditional, max=255) The auxiliary identifier of the user to tag
user.referral_code(string, conditional, max=255) The referral code of the user to tag
tag(object, mandatory) Details of the tag to assign
tag.id(integer, mandatory) The ID of the tag to assign
tag.value(string, mandatory, max=255) The string value of the tag

Sample request

POST /auth/add-user-tag HTTP/1.1
Content-Type: application/json

{
"chain": {
"chain_id": 1
},
"user": {
"user_id": 4
},
"tag": {
"id": 4,
"value": "baby_club_nov_2025"
}
}

Sample response

{
"result": {
"code": 1,
"status": "ok"
},
"results": {
"user_tag": {
"tag": {
"active": true,
"chain": {
"email_address": null,
"id": 1,
"name": "FOO Chain, inc.",
"phone_number": null
},
"created_date": "2025-01-24T14:54:27+00:00",
"deleted": false,
"id": 11,
"last_modified_date": "2025-01-24T14:54:27+00:00",
"model_class": "user",
"value": "baby_club_nov_2025"
},
"user_info": {
"address_housenumber": null,
"address_housenumber_extension": null,
"address_latitude": null,
"address_line_2": null,
"address_line_3": null,
"address_longitude": null,
"address_postalcode": null,
"address_regionstate": null,
"address_streetname": null,
"address_towncity": null,
"authentication_point": null,
"authentication_point_identifier": "10055501555",
"auxiliary_identifier": null,
"average_basket_value": null,
"birthday": null,
"business_group": null,
"country_code": null,
"created_date": "2025-01-24 14:54:25",
"days_since_last_purchase": null,
"entity_code": {
"code": "20000000000",
"type": "custom"
},
"favorite_store": null,
"first_name": "Janneke",
"frequency": null,
"gender": null,
"id": 4,
"is_employee": false,
"is_influencer": false,
"language": null,
"last_modified_date": "2025-01-24 14:54:25",
"last_name": "De Bruin",
"loyalty_status": null,
"mailing_list": null,
"member_number": "20000000000",
"monetary": null,
"number_of_purchases": null,
"obfuscated": false,
"offline_shopper": null,
"online_shopper": null,
"opt_in_programme": {
"join_date": "2025-01-24T14:54:25+00:00",
"programme_opted_in": true
},
"opt_in_secondary": false,
"opt_in_secondary_last_modified_date": "2025-01-24 14:54:25",
"overall": null,
"points_wallet_total": 0,
"push_notification_subscription": {
"subscribed": false,
"subscriptions": []
},
"recency": null,
"referral_channel": null,
"referral_code": "nsq5k3",
"referred": false,
"referring_user": null,
"registered": true,
"signup_channel": null,
"stores": null,
"tags": [
"baby_club_jun_2025",
"baby_club_jul_2025",
"baby_club_nov_2025"
],
"total_cashback_balance": 0,
"user_id": 4,
"username": "testchainuser@acme.com"
}
},
"result_type": "add-user-tag"
}
}

Possible error responses

The following represents a list of possible error responses for the add-user-tag endpoint:

CodeName and DescriptionHTTP Status Code
6no_valid_session
The user needs to be logged in and a valid session key needs to be sent
401
52missing_necessary_parameters
Required parameters (chain, user, tag) missing
400
68permission_denied_or_non_existent
This user has insufficient permissions for this object or the object does not exist
403
154chain_id_invalid
The supplied chain_id is not valid
400
230entity_not_found
The specified chain, user, or tag was not found
400
316parameter_supplied_not_boolean
A boolean parameter was supplied with a non-boolean value
400