Get all api keys
GET /api_keys
Returns all API keys created by the create api key endpoint.
All returned keys are redacted. Thus, the endpoint never returns the actual key value. The endpoint, however, returns meta data of each key like the time it was created and its current status.
The result may be inconistent as in not update-to-date as results may be cached for a short period of time.
Authentication
The target organization for this request will be determined by the supplied access token.
As a prerequisite you need to create an account and follow the onboarding process to also create an organization and an API key.
See also: Authentication.
Examples
curl -X GET http://api.discue.io/v1/api_keys \
-H 'Accept: application/json' \
-H 'X-API-KEY: API_KEY'
const headers = {
'Accept':'application/json',
'X-API-KEY':'API_KEY'
}
const response = await fetch('http://api.discue.io/v1/api_keys', {
method: 'GET', headers
})
const body = await response.json()
import requests
headers = {
'Accept': 'application/json',
'X-API-KEY': 'API_KEY'
}
r = requests.get('http://api.discue.io/v1/api_keys', headers = headers)
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-API-KEY": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://api.discue.io/v1/api_keys", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| pretty | query | boolean | ❌ | Return the response pretty printed |
Responses
200 Response
{
"api_keys": [
{
"id": "string",
"name": "string",
"created_at": 1644616838173,
"updated_at": 1644616838173,
"last_used_at": 1644616838173,
"key": "ep1",
"status": "disabled",
"scopes": [
{
"resource": "queues",
"access": "write",
"targets": [
"_A36cABAOqhBdNeZeXB0l"
]
}
]
}
],
"_links": {
"self": {
"href": "https://api.discue.io/queues/180994c-b6b2-4d0e-b7ad-414716e83386/messages/8476f9ea-e457-4fed-8fbd-347a96237a96"
}
}
}
400 Response
{
"title": "Bad Request",
"status": 400
}
401 Response
{
"title": "Unauthorized",
"status": 401
}
402 Response
{
"title": "Payment Required",
"status": 402
}
403 Response
{
"title": "Forbidden",
"status": 403
}
404 Response
{
"title": "Not Found",
"status": 404
}
405 Response
{
"title": "Method Not Allowed",
"status": 405
}
406 Response
{
"title": "Not Acceptable",
"status": 406
}
409 Response
{
"title": "Conflict",
"status": 409
}
415 Response
{
"title": "Unsupported Media Type",
"status": 415
}
422 Response
{
"title": "Unprocessable Entity",
"status": 422
}
423 Response
{
"title": "Locked",
"status": 423
}
429 Response
{
"title": "Too Many Requests",
"status": 429
}
500 Response
{
"title": "Internal Server Error",
"status": 500
}
501 Response
{
"title": "Not Implemented",
"status": 501
}
503 Response
{
"title": "Service Unavailable",
"status": 503
}
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Ok | GetApiKeysResponse |
| 400 | Bad Request | Bad Request | Inline |
| 401 | Unauthorized | Unauthorized | Inline |
| 402 | Payment Required | Payment Required | Inline |
| 403 | Forbidden | Forbidden | Inline |
| 404 | Not Found | Not Found | Inline |
| 405 | Method Not Allowed | Method Not Allowed | Inline |
| 406 | Not Acceptable | Not Acceptable | Inline |
| 409 | Conflict | Conflict | Inline |
| 415 | Unsupported Media Type | Unsupported Media Type | Inline |
| 422 | Unprocessable Entity | Unprocessable Entity | Inline |
| 423 | Locked | Locked | Inline |
| 429 | Too Many Requests | Too Many Requests | Inline |
| 500 | Internal Server Error | Internal Server Error | Inline |
| 501 | Not Implemented | Not Implemented | Inline |
| 503 | Service Unavailable | Service Unavailable | Inline |