There are two kinds of tag. Subscriber tags belong to a list and label contacts. They can start journeys and filter segments. Campaign tags belong to the account and group campaigns for reports. All commands take APIKey and are sent to POST https://app.emailmarketer.io/api.php with Command.
Tag names may contain letters, numbers, spaces, -, _ and %.
Subscriber tags
subscriber.tags.create
Requires ListID and TagName. Optional TagDescription.
curl https://app.emailmarketer.io/api.php \
-d Command=subscriber.tags.create \
-d APIKey="$EM_API_KEY" \
-d ListID=123 \
-d TagName=VIP \
-d TagDescription="High-value customers"
{ "Success": true, "ErrorCode": 0, "TagID": 789 }
Errors: 1 missing ListID, 2 missing TagName, 3 invalid characters, 4 invalid ListID, 5 the name exists.
subscriber.tags.get
Requires ListID.
curl https://app.emailmarketer.io/api.php \
-d Command=subscriber.tags.get \
-d APIKey="$EM_API_KEY" \
-d ListID=123
{ "Success": true, "ErrorCode": 0, "Tags": [{ "TagID": 789, "TagName": "VIP", "TagDescription": "High-value customers", "SubscriberCount": 50 }] }
Errors: 1 missing ListID, 2 invalid ListID.
subscriber.tags.update
Requires ListID and TagID. Optional TagName, TagDescription. Errors: 1 missing ListID, 2 missing TagID, 3 invalid characters, 4 invalid list, tag or empty name, 5 the name exists.
curl https://app.emailmarketer.io/api.php \
-d Command=subscriber.tags.update \
-d APIKey="$EM_API_KEY" \
-d ListID=123 \
-d TagID=789 \
-d TagName="VIP customers"
subscriber.tags.delete
Requires SubscriberListID and TagIDs (comma-separated, at least one). Errors: 2 missing list ID, 4 list not found, 5 missing or invalid tag IDs.
curl https://app.emailmarketer.io/api.php \
-d Command=subscriber.tags.delete \
-d APIKey="$EM_API_KEY" \
-d SubscriberListID=123 \
-d TagIDs=789,790
subscriber.tag and subscriber.untag
Add or remove tags on subscribers. Tagging can start journeys that use a tag trigger.
| Parameter | Type | Required | Description |
|---|---|---|---|
SubscriberListID |
int | Yes | |
TagID |
int, string or array | Yes | One ID, comma-separated IDs or an array |
SubscriberID |
int or string | Yes, or rules | One ID or comma-separated IDs |
RulesJSON, RulesOperator |
string | Instead of SubscriberID |
Tag everyone who matches rules |
curl https://app.emailmarketer.io/api.php \
-d Command=subscriber.tag \
-d APIKey="$EM_API_KEY" \
-d SubscriberListID=123 \
-d TagID=789 \
-d SubscriberID=456
Errors: 1 missing TagID, 2 missing list ID, 4 invalid list, 6 missing RulesJSON or unknown TagID, 7 missing RulesOperator or invalid RulesJSON, 8 query failed.
Campaign tags
| Command | Required | Returns | Errors |
|---|---|---|---|
tags.get |
none | TotalTagCount, Tags (TagID, Tag) |
none documented |
tag.create |
Tag |
TagID |
1 missing, 2 exists, 3 invalid characters, 4 empty |
tag.update |
TagID, Tag |
Success |
1 missing TagID, 2 missing Tag, 3 invalid characters, 4 empty |
tags.delete |
Tags (comma-separated IDs) |
Success |
1 missing |
tag.assigntocampaigns |
TagID, CampaignIDs (comma-separated) |
Success |
1 missing TagID, 2 missing CampaignIDs |
tag.unassignfromcampaigns |
TagID, CampaignIDs |
Success |
1, 2 as above |
Examples:
# tags.get
curl https://app.emailmarketer.io/api.php \
-d Command=tags.get \
-d APIKey="$EM_API_KEY"
# tag.create
curl https://app.emailmarketer.io/api.php \
-d Command=tag.create \
-d APIKey="$EM_API_KEY" \
-d Tag="Product updates"
# tag.update
curl https://app.emailmarketer.io/api.php \
-d Command=tag.update \
-d APIKey="$EM_API_KEY" \
-d TagID=12 \
-d Tag="Product news"
# tags.delete
curl https://app.emailmarketer.io/api.php \
-d Command=tags.delete \
-d APIKey="$EM_API_KEY" \
-d Tags=12,13
# tag.assigntocampaigns
curl https://app.emailmarketer.io/api.php \
-d Command=tag.assigntocampaigns \
-d APIKey="$EM_API_KEY" \
-d TagID=12 \
-d CampaignIDs=12345,12346
# tag.unassignfromcampaigns
curl https://app.emailmarketer.io/api.php \
-d Command=tag.unassignfromcampaigns \
-d APIKey="$EM_API_KEY" \
-d TagID=12 \
-d CampaignIDs=12345