Endpoint:
POST https://api.mailjet.com/v1/rest/labels
You can create a label using this endpoint. Labels can be used to categorize resources (templates) or images for better organization.
| Name | Type | Description |
|---|---|---|
Name | string | Required and unique. |
Color | string | Required and should be a valid hexadecimal color (e.g., #FFFFFF). |
UsedFor | string | Indicates if the label is used for a template (resource) or an image. Possible values are image or resource. Default is resource. |
curl --request POST \
--url https://api.mailjet.com/v1/rest/labels/ \
--header 'Authorization: Bearer 612d5125131d406081abb9cd2afdc4e3' \
--header 'Content-Type: application/json' \
--data '{
"Name": "Sport templates",
"Color": "#FFFFFF",
"UsedFor": "resource"
}'Status code: 201
curl --request POST \
--url https://api.mailjet.com/v1/rest/labels/ \
--header 'Authorization: Bearer 612d5125131d406081abb9cd2afdc4e3' \
--header 'Content-Type: application/json' \
--data '{
"Name": "Cat images",
"Color": "#FFFFFF",
"UsedFor": "image"
}'Status code: 201
| Name | Type | Description |
|---|---|---|
ID | integer | The ID of the label. |
Name | string | The name of the label. |
Color | string | The hexidecimal color of the label. |
UsedFor | string | Indicates if the label is used for a template (resource) or an image |
{
"Count": 1,
"Total": 1,
"Data": [
{
"ID": 5,
"OrganisationID": 2,
"Name": "Sport templates",
"Color": "#FFFFFF",
"UsedFor": "resource"
}
]
}{
"Count": 1,
"Total": 1,
"Data": [
{
"ID": 6,
"OrganisationID": 2,
"Name": "Cat images",
"Color": "#FFFFFF",
"UsedFor": "image"
}
]
}