Create an APM agent key

Base URL
https://{kibana_url}
  • POST /api/apm/agent_keys
  • POST /s/{space_id}/api/apm/agent_keys
Auth

Create a new agent key for APM. The user creating an APM agent API key must have at least the manage_own_api_key cluster privilege and the APM application-level privileges that it wishes to grant. After it is created, you can copy the API key (Base64 encoded) and use it to to authorize requests from APM agents to the APM Server.

Path parameters

space_id string optional

An identifier for the space. If space_id is not provided in the URL, the default space is used. Refer to Spaces for more information.

Header parameters

elastic-api-version enum · default: 2023-10-31 required

The version of the API to use

Values: 2023-10-31
kbn-xsrf string required

A required header to protect against CSRF attacks

Request body

name string required

The name of the APM agent key.

privileges enum[] required

The APM agent key privileges. It can take one or more of the following values:

  • event:write, which is required for ingesting APM agent events. * config_agent:read, which is required for APM agents to read agent configuration remotely.
Values: event:write config_agent:read

Responses

Agent key created successfully

application/json
agentKey object

Agent key

api_key string required
encoded string required
expiration integer · format: int64
id string required
name string required

Bad Request response

application/json
error string

Error type

message string

Error message

statusCode number

Error status code

Unauthorized response

application/json
error string

Error type

message string

Error message

statusCode number

Error status code

Forbidden response

application/json
error string

Error type

message string

Error message

statusCode number

Error status code

Internal Server Error response

application/json
error string

Error type

message string

Error message

statusCode number

Error status code

Base URL
https://{kibana_url}