Tags
Tags are key-value pairs that you attach to a Cohort or Snapshot to organize and categorize those resources. Twilio Cohorts does not interpret tag values; you can use them operationally, for example, to group resources by team, environment, or campaign.
1"tags": {2"team": "growth",3"environment": "production"4}
Tags are supported on Cohorts and Snapshots. Operations do not support tags.
Pass a tags object when you create a Cohort or Snapshot. You can update a Cohort's tags later. A Snapshot's tags are fixed upon creation, just like the rest of its immutable data.
The following constraints apply to tags:
- A resource can contain up to 10 tag key-value pairs.
- Keys can contain up to 128 characters; values can contain up to 256 characters.
- Allowed characters: letters, numbers, periods (
.), underscores (_), tildes (~), and hyphens (-). - Tag values must not be empty strings.
- Tag keys must not begin with the
twilio__prefix, which is reserved. - If you omit
tagswhen you create a resource, the field is returned asnullin API responses. - To remove a tag from a Cohort, set its value to
nullin an update request.
Pass a tags query parameter to List Cohorts or List Snapshots (see the Cohorts API reference) to filter results by one or more tags.
GET /preview/Cohorts?tags=team:growth,environment:production
Separate multiple tags with commas. When you specify more than one tag, the results must match all of the specified criteria.
1curl -X GET 'https://audiences.twilio.com/preview/Cohorts?tags=team:growth,environment:production' \2-u $TWILIO_API_KEY:$TWILIO_API_SECRET
- Learn about Cohorts and Snapshots.
- See the Cohorts API reference.