Removing User Tags

POST https://api.hivemoderation.com/api/v1/user_tags/remove

Remove one or more tags from a patron. Returns an error if the patron does not exist.


Example Request

curl -X POST https://api.hivemoderation.com/api/v1/user_tags/remove
-H "Authorization: token <API_KEY>"
-H "Content-Type: application/json"
-d '{
"patron_id": "user_abc123",
"user_tags_api_fields": ["vip", "newsletter"]
}'

Request Headers

HeaderTypeRequiredDescription
AuthorizationstringYesAPI key from Hive Moderation Dashboard (per-application).
Content-TypestringYesSubmit JSON data in the request body.

Request Body Parameters

ParameterTypeRequiredDescription
patron_idstringYesThe unique identifier for the patron.
user_tags_api_fieldsarrayYesArray of tag api_field strings to remove.

Notes:

  • If a tag api_field does not exist in the application, it will be reported under failed, not non_existent.
  • If a tag is not currently on the patron, it will be reported under non_existent, not failed. This is a no-op.
  • Unlike the add endpoint, the patron must already exist. A 400 is returned if not found.
  • Response messages now reflect all possible dynamic outcomes (see table below).

Responses

Response Fields

FieldTypeAlways ReturnedDescription
messagestringYesHuman-readable result summary.
patron_idstringYesThe patron ID provided in the request.
removed_tag_idsarrayYesapi_fields successfully removed from the patron.
non_existent_tag_idsarrayYesapi_fields not present on the patron, no-op.
failedarrayYesapi_fields that could not be processed, including error message.

Updated Response Messages

/user_tags/remove

ScenarioMessage
All tags removed successfullySuccessfully removed tags from patron.
Removed + some don't existSuccessfully removed tags from patron. Some tags may not exist on patron.
Removed + some failedSome tags were removed. Some tags failed to remove.
Removed + some don't exist + some failedSome tags were removed. Some tags may not exist on patron. Some tags failed to remove.
All tags don't existNo tags were removed. All tags do not exist on patron.
All tags don't exist + some failedNo tags were removed. Some tags do not exist on patron. Some tags failed to remove.
All tags failed to removeNo tags were removed. All tags failed to remove.

Example Success

{
  "message": "Successfully removed tags from patron. Some tags may not exist on patron.",
  "patron_id": "user_abc123",
  "removed_tag_ids": ["vip"],
  "non_existent_tag_ids": ["newsletter"],
  "failed": []
}

Example Error Response

{
  "error": true,
  "status": 400,
  "error_code": "INVALID_PATRON",
  "message": "This Patron(patron-dne-222) does not exist",
  "show_alert": false
}

Common Errors

Status CodeError CodeDescription
400PARAM_REQUIREDA required parameter is missing or empty.
400INVALID_PATRONNo patron matches the provided patron_id.
403INVALID_API_KEYNo application matches the provided API key.