Fluxmail

Create an API key for the current member

Reference for POST /api/v1/me/api-keys.

POST /api/v1/me/api-keys

Reference for POST /api/v1/me/api-keys.

Authentication

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

Request

curl 'http://localhost:8977/api/v1/me/api-keys' \
  -X POST \
  -H "Authorization: Bearer $FLUXMAIL_SESSION" \
  -H "Content-Type: application/json" \
  --data '{
  "name": "string"
}'

Request body

Content type: application/json

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "permissionProfile": {
      "type": "string",
      "enum": [
        "read-only",
        "read-write",
        "full"
      ]
    },
    "capabilities": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "mail.read",
          "mail.drafts",
          "mail.organize",
          "mail.trash",
          "mail.delete",
          "mail.send",
          "admin.accounts",
          "admin.members",
          "admin.api_keys",
          "admin.license",
          "admin.audit"
        ]
      },
      "minItems": 1,
      "maxItems": 11
    },
    "supplementalCapabilities": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "admin.accounts",
          "admin.members",
          "admin.api_keys",
          "admin.license",
          "admin.audit"
        ]
      },
      "maxItems": 5
    },
    "accountIds": {
      "type": "array",
      "nullable": true,
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "name"
  ],
  "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
429Too many attemptsapplication/json

200 response

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

201 response

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

Last updated