---
agentTools:
  projectIndex: https://developers.brandwatch.com/llms.txt
---

# Creating Tags

Listing the Tags within your Project.

The following call will create a new Tag called "Test Tag- Purchase" in the Project with the ID `1998283571`:\
(Click [here](https://developers.brandwatch.com/docs/retrieving-projects) to learn how to get your Project ID)

```curl
curl -X POST 'https://api.brandwatch.com/projects/1998283571/ruletags' \
-h 'Content-Type: application/json' \
-d '{"name": "Test Tag - Purchase"}'
```

The response will look like this:

```json
{
    "id": 14811101,
    "name": "Test Tag - Purchase",
    "displayName": null,
    "queryIds": null,
    "rules": [],
    "matchingType": "manual"
}
```

## Creating a Tag using Searches and Filters

This endpoint also allows you to define searches and filters to automatically perform actions on mentions, both in the future and historically.

For example, you may set up a Tag that automatically applies a Tag with the name "Purchase" when the text of the Mention contains the phrase "I just bought", like in the example below:

```curl
curl -X POST 'https://api.brandwatch.com/projects/1998283571/ruletags' \
-h 'Content-Type: application/json' \
-d '{
    "rules": [
        {
            "filter": {
                "search": "\"I just bought\"",
                "sentiment": [
                    "positive"
                ]
            }
        }
    ],
    "name": "Test Tag - Purchase",
    "queryIds": []
}'
```

The response will look like this:

```json
{
    "id": 15429620,
    "name": "Test Tag - Purchase",
    "displayName": null,
    "queryIds": null,
    "rules": [
        {
            "id": 162563005,
            "projectId": null,
            "name": null,
            "filter": {
                "queryId": null,
                "queryGroupId": null,
                "projectId": null,
                "startDate": null,
                "endDate": null,
                "timezone": null,
                "search": "\"I just bought\"",
                "sinceAssignmentUpdated": null,
                "untilAssignmentUpdated": null,
                "author": null,
                "xauthor": null,
                "exactAuthor": null,
                "xexactAuthor": null,
                "authorGroup": null,
                "xauthorGroup": null,
                "sentiment": [
                    "positive"
                ],
                "pageType": null,
                "xpageType": null,
                "siteGroup": null,
                "xsiteGroup": null,
                "locationGroup": null,
                "xlocationGroup": null,
                "location": null,
                "xlocation": null,
                "category": null,
                "xcategory": null,
                "parentCategory": null,
                "xparentCategory": null,
                "tag": null,
                "xtag": null,
                "anyTag": null,
                "status": null,
                "xstatus": null,
                "priority": null,
                "xpriority": null,
                "checked": null,
                "starred": null,
                "assigned": null,
                "xassigned": null,
                "monthlyVisitorsMax": null,
                "monthlyVisitorsMin": null,
                "twitterFollowersMax": null,
                "twitterFollowersMin": null,
                "twitterFollowingMax": null,
                "twitterFollowingMin": null,
                "twitterReplyTo": null,
                "xtwitterReplyTo": null,
                "twitterRetweetOf": null,
                "xtwitterRetweetOf": null,
                "twitterPostCountMax": null,
                "twitterPostCountMin": null,
                "twitterRetweetsMax": null,
                "twitterRetweetsMin": null,
                "reachEstimateMin": null,
                "reachEstimateMax": null,
                "language": null,
                "xlanguage": null,
                "domain": null,
                "xdomain": null,
                "facebookAuthorId": null,
                "xfacebookAuthorId": null,
                "facebookRole": null,
                "xfacebookRole": null,
                "facebookSubtype": null,
                "xfacebookSubtype": null,
                "subtype": null,
                "xsubtype": null,
                "facebookCommentsMax": null,
                "facebookCommentsMin": null,
                "facebookLikesMax": null,
                "facebookLikesMin": null,
                "facebookSharesMax": null,
                "facebookSharesMin": null,
                "twitterVerified": null,
                "twitterRole": null,
                "twitterAuthorId": null,
                "xtwitterAuthorId": null,
                "impressionsMax": null,
                "impressionsMin": null,
                "impactMax": null,
                "impactMin": null,
                "instagramFollowersMax": null,
                "instagramFollowersMin": null,
                "instagramFollowingMax": null,
                "instagramFollowingMin": null,
                "instagramPostsMax": null,
                "instagramPostsMin": null,
                "instagramLikesMax": null,
                "instagramLikesMin": null,
                "instagramCommentsMax": null,
                "instagramCommentsMin": null,
                "instagramInteractionsMax": null,
                "instagramInteractionsMin": null,
                "threadId": null,
                "xthreadId": null,
                "threadEntryType": null,
                "xthreadEntryType": null,
                "threadAuthor": null,
                "xthreadAuthor": null,
                "postByAuthor": null,
                "xpostByAuthor": null,
                "shareOfAuthor": null,
                "xshareOfAuthor": null,
                "replyToAuthor": null,
                "xreplyToAuthor": null,
                "resourceType": null,
                "xresourceType": null,
                "insightsEmoticon": null,
                "insightsEmoji": null,
                "insightsHashtag": null,
                "insightsMentioned": null,
                "insightsUrl": null,
                "insightsSharedSite": null,
                "xinsightsEmoticon": null,
                "xinsightsEmoji": null,
                "xinsightsHashtag": null,
                "xinsightsMentioned": null,
                "xinsightsUrl": null,
                "xinsightsSharedSite": null,
                "gender": null,
                "accountType": null,
                "profession": null,
                "xprofession": null,
                "interest": null,
                "xinterest": null,
                "exclusiveLocation": null,
                "hourOfDay": null,
                "dayOfWeek": null,
                "geolocated": null,
                "latitudeMin": null,
                "latitudeMax": null,
                "longitudeMin": null,
                "longitudeMax": null,
                "logoImagesGroupId": null,
                "xlogoVersions": null,
                "logoVersions": null,
                "xclassifications": null,
                "classifications": null,
                "youtubeOnly": null,
                "audienceList": null,
                "xaudienceList": null
            },
            "scope": null,
            "enabled": true,
            "ruleAction": null,
            "queryName": null,
            "projectName": "Segmentation IA Test",
            "categoryId": 15429620,
            "queryIds": null
        }
    ],
    "matchingType": "keywords"
}
```

In order to tag existing (historical) Mentions, you must make a separate API call.

In the following example, `15429620` is the Tag `id` found in the response above.

```curl
curl -X POST 'https://api.brandwatch.com/projects/1998283571/rulebackfill/ruletags/15429620?earliest=2018-06-01'
```