Assign Tag POST
Assigns a contact (Person) to a tag. Both the contact and the tag must belong to your account.
Authorization
API Key (Authentication) — send the header Authorization: Bearer <API_KEY> (API keys start with smsk_)
HTTP Request
http
POST https://public-api.smsup-plus.com/Tag/insertPersonTagContent Type
application/json
Parameter Description
| Property | Type | Required | Description |
|---|---|---|---|
personId | string | Required | Contact ID (must belong to your account and not be deleted) |
tagId | string | Required | Tag ID (must belong to your account and not be deleted) |
Response Description
| Property | Type | Description |
|---|---|---|
status | number | 200 on success |
description | string | Tag assigned. |
Request Example
bash
curl -X POST 'https://public-api.smsup-plus.com/Tag/insertPersonTag' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"personId": "3f8b2c1e-7a4d-4e9b-9c2f-1d5e6a7b8c90",
"tagId": "a1c2e3f4-5b6d-4e7f-8a9b-0c1d2e3f4a5b"
}'js
const res = await fetch('https://public-api.smsup-plus.com/Tag/insertPersonTag', {
method: 'POST',
headers: { Authorization: 'Bearer <API_KEY>', 'Content-Type': 'application/json' },
body: JSON.stringify({
personId: '3f8b2c1e-7a4d-4e9b-9c2f-1d5e6a7b8c90',
tagId: 'a1c2e3f4-5b6d-4e7f-8a9b-0c1d2e3f4a5b',
}),
})
console.log(await res.json())Response Example
json
{
"status": 200,
"description": "Tag assigned."
}Possible Errors
| HTTP | Response | Cause |
|---|---|---|
| 200 | {"status":400,"description":"personId and tagId are required."} | personId or tagId missing, or body is not JSON |
| 200 | {"status":404,"description":"Person not found."} | Contact does not exist, was deleted, or belongs to another account |
| 200 | {"status":404,"description":"Tag not found."} | Tag does not exist, was deleted, or belongs to another account |
| 200 | {"status":500,"description":"Failed to assign tag."} | Save failed — retry |
| 401 | {"error":"invalid api key"} | Invalid API key — see Errors |
WARNING
Once authenticated, this endpoint always answers HTTP 200. Check the status field in the body.
INFO
- Duplicate assignments are not checked — calling again with the same
personId/tagIdpair stores it again, and each Unassign Tag call removes one entry. - Assigning here does not change the contact's
tagsfield, which is what thetagfilter of Search Contacts uses.
