Fluxmail

Modify messages

Apply one mailbox action to a batch of messages.

POST /api/v1/accounts/{accountId}/messages/actions

Apply one mailbox action to a batch of messages.

Authentication

Pass a Fluxmail API key as a bearer token. The key determines the member, mailbox scope, and permissions for the request.

Request

curl 'http://localhost:8977/api/v1/accounts/acct_123/messages/actions' \
  -X POST \
  -H "Authorization: Bearer $FLUXMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "messageIds": [
    "msg_123"
  ],
  "action": "markRead"
}'

Parameters

NameLocationRequiredTypeDetails
accountIdpathYesstringMinimum length: 1.

Request body

Content type: application/json

{
  "type": "object",
  "properties": {
    "messageIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "example": "msg_123"
      },
      "minItems": 1
    },
    "action": {
      "type": "string",
      "enum": [
        "markRead",
        "markUnread",
        "star",
        "unstar",
        "archive",
        "trash",
        "untrash",
        "delete",
        "move",
        "addLabels",
        "removeLabels"
      ]
    },
    "folder": {
      "type": "string",
      "minLength": 1,
      "description": "Required when action is move. Use archive or trash instead of moving to those folders."
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "maxItems": 100,
      "description": "Required when action is addLabels or removeLabels. Change system labels with dedicated actions."
    }
  },
  "required": [
    "messageIds",
    "action"
  ],
  "additionalProperties": false
}

Responses

StatusDescriptionContent type
200Messages modifiedapplication/json
400Invalid requestapplication/json
401Authentication requiredapplication/json
403Permission or plan deniedapplication/json
404Resource not foundapplication/json
409Request conflictapplication/json
422Unsupported capabilityapplication/json
429Provider rate limitapplication/json
500Internal errorapplication/json
503Provider unavailableapplication/json

200 response

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "modified": {
          "type": "integer"
        },
        "action": {
          "type": "string",
          "enum": [
            "markRead",
            "markUnread",
            "star",
            "unstar",
            "archive",
            "trash",
            "untrash",
            "delete",
            "move",
            "addLabels",
            "removeLabels"
          ]
        }
      },
      "required": [
        "modified",
        "action"
      ],
      "additionalProperties": false
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}

Last updated