Fluxmail

Connect or reauthorize a mailbox account

Reference for POST /api/v1/accounts/connections.

POST /api/v1/accounts/connections

Reference for POST /api/v1/accounts/connections.

Authentication

Pass a Fluxmail member session as a bearer token. API keys cannot use this endpoint.

Request

curl 'http://localhost:8977/api/v1/accounts/connections' \
  -X POST \
  -H "Authorization: Bearer $FLUXMAIL_SESSION" \
  -H "Content-Type: application/json" \
  --data '{
  "provider": "gmail"
}'

Request body

Content type: application/json

{
  "type": "object",
  "properties": {
    "provider": {
      "type": "string",
      "enum": [
        "gmail",
        "outlook",
        "imap"
      ]
    },
    "reauthorizeAccountId": {
      "type": "string"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "displayName": {
      "type": "string"
    },
    "imap": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "security": {
          "type": "string",
          "enum": [
            "tls",
            "starttls"
          ]
        },
        "user": {
          "type": "string",
          "minLength": 1,
          "maxLength": 320
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "required": [
        "host",
        "port",
        "security",
        "user",
        "password"
      ],
      "additionalProperties": false
    },
    "smtp": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "security": {
          "type": "string",
          "enum": [
            "tls",
            "starttls"
          ]
        },
        "user": {
          "type": "string",
          "minLength": 1,
          "maxLength": 320
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "required": [
        "host",
        "port",
        "security",
        "user",
        "password"
      ],
      "additionalProperties": false
    },
    "saveSent": {
      "type": "boolean"
    },
    "folderOverrides": {
      "type": "object",
      "properties": {
        "sent": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "drafts": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "trash": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "archive": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "spam": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "provider"
  ],
  "additionalProperties": false
}

Responses

StatusDescriptionContent type
200Successapplication/json
201Successapplication/json
400Invalid requestapplication/json
401Authentication requiredapplication/json
403Permission deniedapplication/json
404Not foundapplication/json
409Conflictapplication/json
413Request body too largeapplication/json
422Unsupported capabilityapplication/json
429Too many attemptsapplication/json
503Provider unavailableapplication/json

200 response

{
  "type": "object",
  "properties": {
    "data": {
      "nullable": true
    }
  }
}

201 response

{
  "type": "object",
  "properties": {
    "data": {
      "nullable": true
    }
  }
}

Last updated