Body
Required
The request to create the API key
-
API key description. Useful if there are multiple keys
-
The optional expiration for the API key, provided as a duration (ex: '1d', '3h')
-
The optional roles for the API key. Takes the role of the creator if not specified. 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"
]
}
]
}
}
}'