Api key (http_api_key)
Send an authentication token in the
Authorization
header
to authenticate with the API.
https://api.elastic-cloud.com/api/v1
This RESTful API enables you to perform most of the operations available in the UI console through API calls.
You can create an API key to quickly and easily authenticate, then use the API to create and manage deployments, configure remote clusters, set up traffic filters, manage extensions, and much more.
Access the API from its base URL at api.elastic-cloud.com
.
For details about creating an API key, refer to Access and authentication.
To manage your serverless projects, use the Elastic Cloud Serverless API.
This documentation is derived from https://api.elastic-cloud.com/api/v1/api-docs-user/swagger.json. It is provided under license Attribution-NonCommercial-NoDerivatives 4.0 International.
This is version 1
of this API documentation.
Last update on Dec 12, 2024.
Send an authentication token in the
Authorization
header
to authenticate with the API.
The Elasticsearch Service API is built on REST. This means that:
RESTful API calls are stateless. Every request that you make happens in isolation from other calls and must include all the information necessary for Elasticsearch Service to fulfill the request. API requests return JSON output, which is a format that is machine-readable and works well for automation.
Calls to API endpoints require different request methods, depending on what they do. You use these four request methods to communicate with the Elasticsearch Service RESTful API:
API calls are rate limited in a timing window. The current remaining available calls quota is available through the following header fields, included in each API call response:
x-ratelimit-interval
- The time duration for the quota calculation.x-ratelimit-remaining
- The remaining number of API calls available.x-ratelimit-limit
- The total number of calls available in the duration x-ratelimit-interval
.Retrieve and update the current Elasticsearch Service account.
curl \
-X GET https://api.elastic-cloud.com/api/v1/account
{
"id": "string",
"trust": {
"trust_all": true
}
}
# Headers
x-cloud-error-codes: accounts.not_found
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
curl \
-X PUT https://api.elastic-cloud.com/api/v1/account \
-d '{"trust":{"trust_all":true}}'
{
"trust": {
"trust_all": true
}
}
{
"id": "string",
"trust": {
"trust_all": true
}
}
# Headers
x-cloud-error-codes: accounts.not_found
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
All changes in the specified object are applied to the current account according to the JSON Merge Patch processing rules. Omitting existing fields causes the same values to be reapplied. Specifying a null
value reverts the field to the default value, or removes the field when no default value exists.
curl \
-X PATCH https://api.elastic-cloud.com/api/v1/account \
-d '"string"'
string
{
"id": "string",
"trust": {
"trust_all": true
}
}
# Headers
x-cloud-error-codes: accounts.not_found
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
Manage your Elasticsearch Service API keys.
Retrieves the metadata for all of the API keys that the user generated.
curl \
-X GET https://api.elastic-cloud.com/api/v1/users/auth/keys
{
"keys": [
{
"id": "string",
"user_id": "string",
"organization_id": "string",
"description": "string",
"key": "string",
"creation_date": "2025-05-04T09:42:00+00:00",
"expiration_date": "2025-05-04T09:42:00+00:00",
"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"
]
}
]
}
}
}
]
}
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 roles that will be assigned to users once they accept the invitation. Currently unavailable in self-hosted ECE.
Additional properties are allowed.
curl \
-X POST https://api.elastic-cloud.com/api/v1/users/auth/keys \
-d '{"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"]}]}}}'
{
"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"
]
}
]
}
}
}
{
"id": "string",
"user_id": "string",
"organization_id": "string",
"description": "string",
"key": "string",
"creation_date": "2025-05-04T09:42:00+00:00",
"expiration_date": "2025-05-04T09:42:00+00:00",
"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"
]
}
]
}
}
}
# Headers
x-cloud-error-codes: api_keys.invalid_input
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
curl \
-X DELETE https://api.elastic-cloud.com/api/v1/users/auth/keys \
-d '{"keys":["string"]}'
{
"keys": [
"string"
]
}
{}
The API Key ID.
curl \
-X GET https://api.elastic-cloud.com/api/v1/users/auth/keys/{api_key_id}
{
"id": "string",
"user_id": "string",
"organization_id": "string",
"description": "string",
"key": "string",
"creation_date": "2025-05-04T09:42:00+00:00",
"expiration_date": "2025-05-04T09:42:00+00:00",
"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"
]
}
]
}
}
}
# Headers
x-cloud-error-codes: api_keys.key_not_found
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
The API Key ID.
curl \
-X DELETE https://api.elastic-cloud.com/api/v1/users/auth/keys/{api_key_id}
{}
# Headers
x-cloud-error-codes: api_keys.key_not_found
# Payload
{
"errors": [
{
"code": "string",
"message": "string",
"fields": [
"string"
]
}
]
}
Get an overview of your costs by organization ID.