Site tags
List, create, and delete site tags using the Platform API.
Site tag endpoints let you manage and customize tags on your Productsup sites. Tags provide a flexible way to identify and reference sites using your own key-value pairs.
List
Use a GET request to list all tags for a site or retrieve a specific tag by its ID.
List all tags for a site
GET https://platform-api.productsup.io/platform/v2/sites/<siteId>/tags
curl --location 'https://platform-api.productsup.io/platform/v2/sites/<SITE_ID>/tags' \
--header 'X-Auth-Token: TOKEN'| Field | Type | Description |
|---|---|---|
siteId | integer | Site to list tags for |
{
"success": true,
"Tags": [
{
"id": 1,
"key": "region",
"value": "emea",
"readonly": 0
}
]
}Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates request status |
Tags | array | List of tag fields |
Tag fields
| Field | Type | Description |
|---|---|---|
id | integer | Tag identifier |
key | string | Name of the tag |
value | string | Value of the tag |
readonly | integer | 1 when end users cannot edit this tag in the platform UI, otherwise 0 |
Get a tag by its identifier
GET https://platform-api.productsup.io/platform/v2/sites/<siteId>/tags/<tagId>
curl --location 'https://platform-api.productsup.io/platform/v2/sites/<SITE_ID>/tags/<TAG_ID>' \
--header 'X-Auth-Token: TOKEN'| Field | Type | Description |
|---|---|---|
siteId | integer | Site the tag belongs to |
tagId | integer | Tag to retrieve |
Create
Use a POST request to create a new tag for a site.
POST https://platform-api.productsup.io/platform/v2/sites/<siteId>/tags
curl --location 'https://platform-api.productsup.io/platform/v2/sites/<SITE_ID>/tags' \
--header 'X-Auth-Token: TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"site_id": "<SITE_ID>",
"key": "<TAG_KEY>",
"value": "<TAG_VALUE>",
"readonly": 0
}'Request body fields
| Field | Type | Description |
|---|---|---|
site_id | string | Required. Site the tag belongs to. |
key | string | Required. Name of the tag. |
value | string | Required. Value of the tag. |
readonly | integer | Set to 1 to prevent end users from editing this tag in the platform UI. Defaults to 0. |
See response fields and tag fields for the response structure.
Response status codes
| Code | Message | Details |
|---|---|---|
| 201 | — | Tag created |
| 400 | Bad Request | The request body is missing a required field or is malformed |
| 401 | Unauthorized | Invalid authentication token |
| 404 | The requested resource could not be found | The site does not exist |
A tag's key must be unique per site. Creating a tag with a key that already exists for that site returns an error.
Delete
Use a DELETE request to remove a tag from a site.
DELETE https://platform-api.productsup.io/platform/v2/sites/<siteId>/tags/<tagId>
curl --location --request DELETE 'https://platform-api.productsup.io/platform/v2/sites/<SITE_ID>/tags/<TAG_ID>' \
--header 'X-Auth-Token: TOKEN'| Field | Type | Description |
|---|---|---|
siteId | integer | Site the tag belongs to |
tagId | integer | Tag to delete |
Response status codes
| Code | Message | Details |
|---|---|---|
| 204 | — | Tag deleted; no response body |
| 401 | Unauthorized | Invalid authentication token |
| 404 | The requested resource could not be found | The site or tag does not exist |
How is this guide?