Authentication
editAuthentication
editDelete API keys
editDelete or invalidate API keys.
Request
editDELETE /api/v1/users/auth/keys
Request body
edit(DeleteApiKeysRequest
) (required) The request to delete API keys
Responses
edit-
200
-
The API keys are deleted.
Request example
editcurl -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 keys
editRetrieves the metadata for all of the API keys that the user generated.
Request
editGET /api/v1/users/auth/keys
Responses
edit-
200
-
The metadata for the API keys is retrieved.
Request example
editcurl -XGET https://api.elastic-cloud.com/api/v1/users/auth/keys \ -H "Authorization: ApiKey $EC_API_KEY"
Create API key
editCreates a new API key.
Request
editPOST /api/v1/users/auth/keys
Request body
edit(CreateApiKeyRequest
) (required) The request to create the API key
Responses
edit-
201
-
The API key is created and returned in the body of the response.
-
400
-
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 example
editcurl -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", "role_assignments" : { "deployment" : [ { "all" : true, "application_roles" : [ "string" ], "deployment_ids" : [ "string" ], "organization_id" : "string", "role_id" : "string" } ], "organization" : [ { "organization_id" : "string", "role_id" : "string" } ], "platform" : [ { "role_id" : "string" } ], "project" : { "elasticsearch" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ], "observability" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ], "security" : [ { "all" : true, "application_roles" : [ "string" ], "organization_id" : "string", "project_ids" : [ "string" ], "role_id" : "string" } ] } } } '
Delete API key
editDelete or invalidate the API key.
Request
editDELETE /api/v1/users/auth/keys/{api_key_id}
Path parameters
editName | Type | Required | Description |
---|---|---|---|
|
|
Y |
The API Key ID. |
Responses
edit-
200
-
The API key is deleted.
-
404
-
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 example
editcurl -XDELETE https://api.elastic-cloud.com/api/v1/users/auth/keys/{api_key_id} \ -H "Authorization: ApiKey $EC_API_KEY"
Get API key
editRetrieves the metadata for an API key.
Request
editGET /api/v1/users/auth/keys/{api_key_id}
Path parameters
editName | Type | Required | Description |
---|---|---|---|
|
|
Y |
The API Key ID. |
Responses
edit-
200
-
The API key metadata is retrieved.
-
404
-
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 example
editcurl -XGET https://api.elastic-cloud.com/api/v1/users/auth/keys/{api_key_id} \ -H "Authorization: ApiKey $EC_API_KEY"