Tags New

Mailgun allows you to tag your email with unique identifiers. Tags are visible via our analytics tags API endpoint.

Update account tag

put/v1/analytics/tags

Updates the tag description for an account

SecuritybasicAuth
Request
Request Body schema: application/json
required
tag
string

The tag to update.

description
string

The updated tag description.

Responses
200

A 200 response

Response Schema: application/json
string
400

A 400 response

Request samples
application/json
{
  • "tag": "name-of-tag-to-update",
  • "description": "updated tag description"
}
Response samples
application/json
"Tag updated"

Post query to list account tags or search for single tag

post/v1/analytics/tags

Gets the list of all tags, or filtered by tag prefix, for an account

SecuritybasicAuth
Request
Request Body schema: application/json
required
object
include_subaccounts
boolean

Boolean indicating whether or not to include data from all subaccounts. Default false.

include_metrics
boolean

Boolean indicating whether or not to include metrics for tags. Default false. When true max limit is 20.

tag
string

The tag or tag prefix.

Responses
200

A 200 response

Response Schema: application/json
required
Array of objects
object
400

A 400 response

Request samples
application/json
{
  • "pagination": {
    • "sort": "lastseen:desc",
    • "limit": 10
    },
  • "include_subaccounts": true
}
Response samples
application/json
{
  • "items": [
    • {
      },
    • {
      }
    ],
  • "pagination": {
    • "sort": "lastseen:desc",
    • "limit": 10,
    • "total": 2
    }
}

Delete account tag

delete/v1/analytics/tags

Deletes the tag for an account

SecuritybasicAuth
Request
Request Body schema: application/json
required
tag
string

The tag to delete.

Responses
200

A 200 response

Response Schema: application/json
string
400

A 400 response

Request samples
application/json
{
  • "tag": "name-of-tag-to-delete"
}
Response samples
application/json
"Tag deleted"

Get account tag limit information

get/v1/analytics/tags/limits

Gets the tag limit and current number of unique tags for an account

SecuritybasicAuth
Responses
200

A 200 response

Response Schema: application/json
limit
required
integer <int32>
count
required
integer <int64>
limit_reached
required
boolean
400

A 400 response

Request samples
Response samples
application/json
{
  • "limit": 0,
  • "count": 0,
  • "limit_reached": true
}