Body
Required
The request to create the API key
-
description
string Required API key description. Useful if there are multiple keys
-
expiration
string The optional expiration for the API key, provided as a duration (ex: '1d', '3h')
-
role_assignments
object The roles that will be assigned to users once they accept the invitation. Currently unavailable in self-hosted ECE.
POST
/users/auth/keys
curl \
--request POST 'https://{{hostname}}/api/v1/users/auth/keys' \
--user "username:password" \
--header "Content-Type: application/json" \
--data '{"description":"string","expiration":"string","role_assignments":{"platform":[{"role_id":"string"}],"organization":[{"role_id":"string","organization_id":"string"}],"deployment":[{"role_id":"string","organization_id":"string","all":true,"deployment_ids":["string"],"application_roles":["string"]}],"project":{"elasticsearch":[{"role_id":"string","organization_id":"string","all":true,"project_ids":["string"],"application_roles":["string"]}],"observability":[{"role_id":"string","organization_id":"string","all":true,"project_ids":["string"],"application_roles":["string"]}],"security":[{"role_id":"string","organization_id":"string","all":true,"project_ids":["string"],"application_roles":["string"]}]}}}'