Authenticationedit

Delete API keysedit

Delete or invalidate API keys.

Requestedit

DELETE /api/v1/users/auth/keys

Request bodyedit

(DeleteApiKeysRequest) (required) The request to delete API keys

Responsesedit

200

(EmptyResponse)

The API keys are deleted.

Request exampleedit

curl -XDELETE https://api.elastic-cloud.com/api/v1/users/auth/keys \
-H "Authorization: ApiKey $EC_API_KEY" \
-H 'Content-Type: application/json' \
-d '
{
   "keys" : [
      "string"
   ]
}
'

Get all API keysedit

Retrieves the metadata for all of the API keys that the user generated.

Requestedit

GET /api/v1/users/auth/keys

Responsesedit

200

(ApiKeysResponse)

The metadata for the API keys is retrieved.

Request exampleedit

curl -XGET https://api.elastic-cloud.com/api/v1/users/auth/keys \
-H "Authorization: ApiKey $EC_API_KEY"

Create API keyedit

Creates a new API key.

Requestedit

POST /api/v1/users/auth/keys

Request bodyedit

(CreateApiKeyRequest) (required) The request to create the API key

Responsesedit

201

(ApiKeyResponse)

The API key is created and returned in the body of the response.

400

(BasicFailedReply)

The request is invalid. Specify a different request, then try again. (code: api_keys.invalid_input)

Headers

x-cloud-error-codes (string; allowed values: [api_keys.invalid_input])
The error codes associated with the response

Request exampleedit

curl -XPOST https://api.elastic-cloud.com/api/v1/users/auth/keys \
-H "Authorization: ApiKey $EC_API_KEY" \
-H 'Content-Type: application/json' \
-d '
{
   "description" : "string",
   "expiration" : "string"
}
'

Delete API keyedit

Delete or invalidate the API key.

Requestedit

DELETE /api/v1/users/auth/keys/{api_key_id}

Path parametersedit

Name Type Required Description

api_key_id

string

Y

The API Key ID.

Responsesedit

200

(EmptyResponse)

The API key is deleted.

404

(BasicFailedReply)

The {api_key_id} can't be found. (code: api_keys.key_not_found)

Headers

x-cloud-error-codes (string; allowed values: [api_keys.key_not_found])
The error codes associated with the response

Request exampleedit

curl -XDELETE https://api.elastic-cloud.com/api/v1/users/auth/keys/{api_key_id} \
-H "Authorization: ApiKey $EC_API_KEY"

Get API keyedit

Retrieves the metadata for an API key.

Requestedit

GET /api/v1/users/auth/keys/{api_key_id}

Path parametersedit

Name Type Required Description

api_key_id

string

Y

The API Key ID.

Responsesedit

200

(ApiKeyResponse)

The API key metadata is retrieved.

404

(BasicFailedReply)

The {api_key_id} can't be found. (code: api_keys.key_not_found)

Headers

x-cloud-error-codes (string; allowed values: [api_keys.key_not_found])
The error codes associated with the response

Request exampleedit

curl -XGET https://api.elastic-cloud.com/api/v1/users/auth/keys/{api_key_id} \
-H "Authorization: ApiKey $EC_API_KEY"