For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update message flags

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

Update message flags

patch

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

Authorizations
AuthorizationstringRequired

Bearer authentication using API tokens in the Authorization header.

Path parameters
mailboxResourceIdstringRequired

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

Example: AC1a2b3c4d5e6f7g
folderstringRequired

Folder path (URL-encoded).

Example: INBOX
uidinteger · min: 1Required

Message UID.

Example: 42
Body

Add and/or remove flags on a message. At least one of addFlags or removeFlags must be set.

addFlagsstring[]Optional

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

Example: ["\\Seen","\\Flagged","$forwarded"]
removeFlagsstring[]Optional

IMAP flags to clear from the message.

Example: ["\\Seen"]
Responses
200

Updated message.

application/json

Single message payload.

patch/api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid}
PATCH /api/v1/mailboxes/{mailboxResourceId}/folders/{folder}/messages/{uid} HTTP/1.1
Host: api.mail.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 73

{
  "addFlags": [
    "\\Seen",
    "\\Flagged",
    "$forwarded"
  ],
  "removeFlags": [
    "\\Seen"
  ]
}
{
  "data": {
    "uid": 123,
    "path": "INBOX",
    "date": "2024-01-15T10:30:00.000Z",
    "flags": [
      "\\Seen",
      "\\Flagged"
    ],
    "unseen": false,
    "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,
        "inline": false,
        "filename": "document.pdf",
        "contentId": "<attachment@example.com>"
      }
    ]
  }
}

Last updated

Was this helpful?