Skip to content
Last updated

Update Image Metadata

Endpoint:

PUT https://api.mailjet.com/v1/REST/images/:id

Update the metadata of an existing image using its unique ID. This endpoint allows you to modify the metadata of the image, such as the name, status and more.

Info

Only the metadata of the image can be updated through this endpoint, not the image file itself.

URL Parameters

id: The ID of the image.

Body Parameters

NameTypeDescription
NamestringThe name of the image.
StatusstringAccepted values: open or locked.
LabelIDsarray of integersAn array of IDs representing labels associated with the image or images.
IsStarredbooleanIndicates whether the image is marked as a favorite. True = favorite.

Example Request

curl --request PUT \
  --url https://api.mailjet.com/v1/data/images/a3da1de2-2319-44e9-9c75-e6a00a2ec5da \
  --header 'Authorization: Bearer 612d5125131d406081abb9cd2afdc4e3' \
  --header 'Content-Type: application/json' \
  --data '{  
"Name": "myotherimage"
}'

Status code: 200

Response Data Field Structure:

NameTypeDescription
IDstringThe ID of the image.
NamestringThe name of the image.
StatusstringIndicates whether the image is open or locked.
TargetContentstringIndicates the purpose of the image. Possible values: image, background, video or social.
ImageSizeintegerThe size of the image file in bytes.
LabelIDsarray of integersAn array of IDs representing labels associated with the image.
IsStarredbooleanIndicates whether the image is marked as a favorite.
ImageURLstringThe URL where the image is stored.
ThumbnailUrlstringThe URL where the thumbnail is stored.
CreatedAtDateTime UTCThe date and time when the image was created.
UpdatedAtDateTime UTCThe date and time when the image was last updated.
ExpiresAtDateTime UTCThe date and time when the image will expire.

Example API Response

{
    "Count": 1,
    "Total": 1,
    "Data": [
        {
            "ID": "a3da1de2-2319-44e9-9c75-e6a00a2ec5da",
            "OrganisationID": 2,
            "Name": "myotherimage",
            "Status": "open",
            "TargetContent": "image",
            "ImageSize": 425155,
            "ThumbnailSize": 425155,
            "TotalSize": 850310,
            "LabelIDs": [],
            "IsStarred": false,
            "ImageUrl": "https://0abcd.mjt.lu/img2/0abcd/a3da1de2-2319-44e9-9c75-e6a00a2ec5da/content",
            "ThumbnailUrl": "https://0abcd.mjt.lu/img2/0abcd/a3da1de2-2319-44e9-9c75-e6a00a2ec5da/thumbnail",
            "CreatedAt": "2024-05-23T12:51:58.97041Z",
            "UpdatedAt": "2024-05-23T13:20:14.461823Z",
            "ExpiresAt": "2025-03-20T14:13:28.08024Z"
        }
    ]
}