v2

latestOpenAPI 3.1.0CC-BY-SA 2.02026-07-2617789528.6 KB
API account management

Create an API account

Create a new API account from provided parameters. If a token need to be generated, it will be presented only once in the answer.

post/apiaccounts

Request body

idstring

An optional ID for that account. It needs to match [a-zA-Z0-9_-]+

namestring

Human readable name of the API account

descriptionstring

One line API account description

status'enabled' | 'disabled'

Status of that API account

generateTokenboolean

Optionally specify if the token need to be generated (default true)

expirationPolicy'never' | 'datetime'

Optionally specify the expiration policy of the API account. Default: never

expirationDatestring rfc3339

Optional expiration date of the API account

authorizationType'rw' | 'ro' | 'acl'

Authorization type for that account: - ro: read-only (GET) access to all APIs - rw: read (GET) and write (other verbs) access to all APIs - acl: access control list based permission for API (need api-authorization plugin)

Example request

{
  "id": "oidc-provided-opaque-id-5154cbb63a18",
  "name": "Audit directives",
  "description": "Read-only account for directive audit",
  "status": "enabled",
  "expirationPolicy": "never",
  "expirationDate": "2025-05-10T23:59:59Z",
  "acl": [
    {
      "path": "directives/1ebee8c7-c898-4ee5-9470-139bfd80c442",
      "actions": [
        "get"
      ]
    }
  ]
}

Response

Information about request

result'success' | 'error' required

Result of the request

idstring uuid required

ID of the created account

action'createAccount' required

The id of the action

Example response

{
  "data": {
    "accounts": [
      {
        "id": "91252ea2-feb2-412d-8599-c6945fee02c4",
        "name": "Audit directives",
        "description": "Read-only account for directive audit",
        "status": "enabled",
        "expirationPolicy": "never",
        "expirationDate": "2025-05-10T23:59:59Z",
        "tokenState": "missing",
        "token": "t1-ca5a50899d25cd3ff148350843a9d435",
        "tokenGenerationDate": "2025-02-12T10:55:00Z",
        "acl": [
          {
            "path": "directives/1ebee8c7-c898-4ee5-9470-139bfd80c442",
            "verb": "get"
          }
        ]
      }
    ]
  }
}