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
-
The API keys are deleted.
-
449
-
Elevated permissions are required. (code:
root.unauthorized.rbac.elevated_permissions_required
)Headers
-
x-cloud-error-codes
(string
; allowed values: [root.unauthorized.rbac.elevated_permissions_required
]) - The error codes associated with the response
-
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
-
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
-
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
-
-
449
-
Elevated permissions are required. (code:
root.unauthorized.rbac.elevated_permissions_required
)Headers
-
x-cloud-error-codes
(string
; allowed values: [root.unauthorized.rbac.elevated_permissions_required
]) - 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" } '
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 |
---|---|---|---|
|
|
Y |
The API Key ID. |
Responsesedit
-
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
-
-
449
-
Elevated permissions are required. (code:
root.unauthorized.rbac.elevated_permissions_required
)Headers
-
x-cloud-error-codes
(string
; allowed values: [root.unauthorized.rbac.elevated_permissions_required
]) - 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 |
---|---|---|---|
|
|
Y |
The API Key ID. |
Responsesedit
-
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 exampleedit
curl -XGET https://api.elastic-cloud.com/api/v1/users/auth/keys/{api_key_id} \ -H "Authorization: ApiKey $EC_API_KEY"