APIKeys API
The /apikeys
API endpoint
/apikeys
(GET)
The /apikeys
GET endpoint retrieves all API keys.
EXAMPLE
The following example demonstrates a request to the /apikeys
API, resulting in a JSON array containing all API keys.
curl http://127.0.0.1:8080/api/core/v2/apikeys -H "Authorization: Bearer $SENSU_TOKEN"
HTTP/1.1 200 OK
[
{
"metadata": {
"name": "83abef1e-e7d7-4beb-91fc-79ad90084d5b"
},
"username": "admin",
"created_at": 1570640363
}
]
API Specification
/apikeys (GET) | |
---|---|
description | Returns the list of API keys. |
example url | http://hostname:8080/api/core/v2/apikeys |
pagination | This endpoint supports pagination using the limit and continue query parameters. See the API overview for details. |
response type | Array |
response codes |
|
output |
|
/apikeys
(POST)
/apikeys (POST) | |
---|---|
description | Creates a new API key, a Sensu-generated UUID. The response will include HTTP 201 and a Location header that contains the relative path to the new API key. |
example URL | http://hostname:8080/api/core/v2/apikeys |
response codes |
|
request payload |
|
response payload |
|
The /apikeys/:apikey
API endpoint
/apikeys/:apikey
(GET)
The /apikeys/:apikey
GET endpoint retrieves the specified API key.
EXAMPLE
In the following example, querying the /apikeys/:apikey
API returns the requested :apikey
definition or an error if the key is not found.
curl http://127.0.0.1:8080/api/core/v2/apikeys/83abef1e-e7d7-4beb-91fc-79ad90084d5b -H "Authorization: Bearer $SENSU_TOKEN"
HTTP/1.1 200 OK
{
"metadata": {
"name": "83abef1e-e7d7-4beb-91fc-79ad90084d5b"
},
"username": "admin",
"created_at": 1570640363
}
API Specification
/apikeys/:apikey (GET) | |
---|---|
description | Returns the specified API key. |
example url | http://hostname:8080/api/core/v2/apikeys/83abef1e-e7d7-4beb-91fc-79ad90084d5b |
response type | Map |
response codes |
|
output |
|
/apikeys/:apikey
(DELETE)
API Specification
/apikeys/:apikey (DELETE) | |
---|---|
description | Revokes the specified API key. |
example URL | http://hostname:8080/api/core/v2/apikeys/83abef1e-e7d7-4beb-91fc-79ad90084d5b |
response codes |
|
output |
|