Create enrollment token

POST /platform/configuration/security/enrollment-tokens

Creates an enrollment token.

Body Required

Request parameters for the enrollment token

  • roles array[string]

    The additional services for which this enrollment token applies (empty if not specified, ie system services only)

  • persistent boolean Required

    Whether this token can subsequently to its grant be revoked from the UI

  • validity_in_seconds integer(int32)

    The time in seconds for which this token is valid (defaults to 1 hour). Currently this can only be set for ephemeral (persistent: false) tokens.

Responses

  • A token has been generated that can be used to start new servers with the requested roles

    Hide response attributes Show response attributes object
    • token string Required

      The requested token

    • token_id string

      An identifier for the requested token (if persistent) that can be used in listing and deletion

  • The token request format was invalid, details in the error (code: 'enrollment_tokens.invalid_token_request')

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

  • No signing key is available to generate a token (code: 'enrollment_tokens.signing_key_not_found')

    Hide response attribute Show response attribute object
    • errors array[object] Required

      A list of errors that occurred in the failing request

      Hide errors attributes Show errors attributes object
      • code string Required

        A structured code representing the error type that occurred

      • message string Required

        A human readable message describing the error that occurred

      • fields array[string]

        If the error can be tied to a specific field or fields in the user request, this lists those fields

POST /platform/configuration/security/enrollment-tokens
curl \
 -X POST https://{{hostname}}/api/v1/platform/configuration/security/enrollment-tokens \
 -d '{"roles":["string"],"persistent":true,"validity_in_seconds":42}'
Request examples
{
  "roles": [
    "string"
  ],
  "persistent": true,
  "validity_in_seconds": 42
}
Response examples (200)
{
  "token": "string",
  "token_id": "string"
}
Response examples (400)
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}
Response examples (403)
{
  "errors": [
    {
      "code": "string",
      "message": "string",
      "fields": [
        "string"
      ]
    }
  ]
}