Skip to content
Last updated

List Labels

Endpoint:

GET https://api.mailjet.com/v1/rest/labels You can retrieve a list of your labels using this endpoint.

Query Parameters

Sort is available for Name. Default: ID ASC

NameTypeDescription
NamestringSearch by the name of the label.
IDsarray of integersSearch using an array of label IDs.
UsedForstringSpecify if you want to retrieve labels for images or templates (resource). Possible values are image or resource. You cannot retrieve both in one request. Default: resource

Request Example:

curl --request GET \
  --url https://api.mailjet.com/v1/rest/labels?Limit=3&Sort=name%20asc,id%20asc&UsedFor=image' / \
  --header 'Authorization: Bearer 612d5125131d406081abb9cd2afdc4e3'

Status code: 200

Response Data Field Structure

NameTypeDescription
IDintegerThe ID of the label.
NamestringThe name of the label.
ColorstringThe hexidecimal color of the label.
UsedForstringIndicates if the label is used for a template (resource) or an image.

API Response Example:

{
    "Count": 2,
    "Total": 2,
    "Data": [
        {
            "ID": 6,
            "OrganisationID": 2,
            "Name": "Cat images",
            "Color": "#FFFFFF",
            "UsedFor": "image"
        },
        {
            "ID": 7,
            "OrganisationID": 2,
            "Name": "Cat images 2",
            "Color": "#FFFFFF",
            "UsedFor": "image"
        }
    ]
}

Retrieve a single label

Endpoint:

GET https://api.mailjet.com/v1/rest/labels/:id You can retrieve a single label using this endpoint. The label is identified by its unique ID.

URL Parameters:

id = The ID of the label.

Status code: 200

Response Data Field Structure

NameTypeDescription
IDintegerThe ID of the label.
NamestringThe name of the label.
ColorstringThe hexidecimal color of the label.
UsedForstringIndicates if the label is used for a template (resource) or an image.

API Response Example

{
    "Count": 1,
    "Total": 1,
    "Data": [
    {
        "ID": 5,
        "OrganisationID": 2,
        "Name": "Cat images",
        "Color": "#FFFFFF",
        "UsedFor": "image"
    }]
}