Skip to content
Last updated

Update a Label

Endpoint:

PUT https://api.mailjet.com/v1/rest/labels/:id You can update a label using this endpoint. The label is identified by its unique ID, and you can update its name and color.

URL Parameters:

id = The ID of the label.

Body Parameters

NameTypeDescription
NamestringMust be unique.
ColorstringShould be a valid hexadecimal color (e.g., #FFFFFF)

Request Example:

curl --request PUT \
  --url https://api.mailjet.com/v1/rest/labels/5 / \
  --header 'Authorization: Bearer 612d5125131d406081abb9cd2afdc4e3' \
  --header 'Content-Type: application/json' \
  --data '{
    "Name": "Dog images",
}'

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": "Dog images",
        "Color": "#FFFFFF",
        "UsedFor": "image" 
      }
}