Messages

Update message flags

Add and/or remove flags on a single message. Returns the updated message.

patch/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}

Request

  • Base URL: https://api.mail.hostinger.com
  • URL: https://api.mail.hostinger.com/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}
  • Auth: HTTP bearer

Path parameters

mailboxResourceIdstring required

Resource ID of the managed mailbox the bearer token is authorized for.

folderstring required

Folder path (URL-encoded).

uidinteger required

Message UID.

Request body

addFlagsstring[]

IMAP flags to set on the message, e.g. \Seen, \Flagged, \Answered, $forwarded.

removeFlagsstring[]

IMAP flags to clear from the message.

Example request

{
  "addFlags": [
    "\\Seen",
    "\\Flagged",
    "$forwarded"
  ],
  "removeFlags": [
    "\\Seen"
  ]
}

Response

Updated message.

Example response

{
  "data": {
    "uid": 123,
    "path": "INBOX",
    "date": "2024-01-15T10:30:00.000Z",
    "flags": [
      "\\Seen",
      "\\Flagged"
    ],
    "size": 2048,
    "subject": "Test Email Subject",
    "from": {
      "name": "John Doe",
      "address": "john@example.com"
    },
    "to": [
      {
        "name": "John Doe",
        "address": "john@example.com"
      }
    ],
    "cc": [
      {
        "name": "John Doe",
        "address": "john@example.com"
      }
    ],
    "bcc": [
      {
        "name": "John Doe",
        "address": "john@example.com"
      }
    ],
    "messageId": "<1234567890@example.com>",
    "inReplyTo": "<0987654321@example.com>",
    "attachments": [
      {
        "id": "YXR0YWNobWVudDpJTkJPWDoxMjM6MS4y",
        "contentType": "application/pdf",
        "sizeBytes": 1024,
        "filename": "document.pdf",
        "contentId": "<attachment@example.com>"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.