Get key details with API ID and key ID.
curl --request GET \
--url https://{tenant}/api/apis/{apiID}/keys/{keyID} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/apis/{apiID}/keys/{keyID}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/apis/{apiID}/keys/{keyID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}/api/apis/{apiID}/keys/{keyID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/api/apis/{apiID}/keys/{keyID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}/api/apis/{apiID}/keys/{keyID}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/apis/{apiID}/keys/{keyID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"api_model": {},
"data": {
"access_rights": {},
"alias": "portal-developer@example.org",
"allowance": 1000,
"apply_policies": [
"641c15dd0fffb800010197bf",
"615d2e528bf3980001c7c6c2"
],
"apply_policy_id": "641c15dd0fffb800010197bf",
"basic_auth_data": {
"hash_type": "bcrypt",
"password": "testuse1",
"user": "admin-user@example.org"
},
"certificate": "<string>",
"data_expires": 0,
"date_created": "2024-05-14T13:15:46.560506+03:00",
"enable_detailed_recording": true,
"expires": 1716895221,
"hmac_enabled": false,
"hmac_string": "<string>",
"id_extractor_deadline": 0,
"is_inactive": true,
"jwt_data": {
"secret": "<string>"
},
"key_id": "<string>",
"last_check": 0,
"last_updated": "1715681746",
"max_query_depth": 5,
"meta_data": "<unknown>",
"monitor": {
"trigger_limits": [
80,
60,
50
]
},
"oauth_client_id": "<string>",
"oauth_keys": {},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 1710302205,
"quota_remaining": 20000,
"quota_renewal_rate": -1,
"quota_renews": 1715681745,
"rate": 1000,
"session_lifetime": 0,
"smoothing": {
"delay": 2,
"enabled": true,
"step": 2,
"threshold": 2,
"trigger": 1
},
"tags": [
"edge",
"edge-eu"
],
"throttle_interval": 10,
"throttle_retry_limit": -1
},
"key_hash": "41c5cb1e",
"key_id": "5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5"
}{
"Message": "Attempted access to non-owned key.",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/apis/{apiID}/keys/{keyID}",
"Meta": null,
"Status": "Error"
}{
"Message": "Could not retrieve key detail.",
"Meta": null,
"Status": "Error"
}Keys
Get key details with API ID and key ID.
Fetches the key that grant access to the API with the ID and key ID .
GET
/
api
/
apis
/
{apiID}
/
keys
/
{keyID}
Get key details with API ID and key ID.
curl --request GET \
--url https://{tenant}/api/apis/{apiID}/keys/{keyID} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{tenant}/api/apis/{apiID}/keys/{keyID}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{tenant}/api/apis/{apiID}/keys/{keyID}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}/api/apis/{apiID}/keys/{keyID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/api/apis/{apiID}/keys/{keyID}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{tenant}/api/apis/{apiID}/keys/{keyID}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/api/apis/{apiID}/keys/{keyID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"api_model": {},
"data": {
"access_rights": {},
"alias": "portal-developer@example.org",
"allowance": 1000,
"apply_policies": [
"641c15dd0fffb800010197bf",
"615d2e528bf3980001c7c6c2"
],
"apply_policy_id": "641c15dd0fffb800010197bf",
"basic_auth_data": {
"hash_type": "bcrypt",
"password": "testuse1",
"user": "admin-user@example.org"
},
"certificate": "<string>",
"data_expires": 0,
"date_created": "2024-05-14T13:15:46.560506+03:00",
"enable_detailed_recording": true,
"expires": 1716895221,
"hmac_enabled": false,
"hmac_string": "<string>",
"id_extractor_deadline": 0,
"is_inactive": true,
"jwt_data": {
"secret": "<string>"
},
"key_id": "<string>",
"last_check": 0,
"last_updated": "1715681746",
"max_query_depth": 5,
"meta_data": "<unknown>",
"monitor": {
"trigger_limits": [
80,
60,
50
]
},
"oauth_client_id": "<string>",
"oauth_keys": {},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 1710302205,
"quota_remaining": 20000,
"quota_renewal_rate": -1,
"quota_renews": 1715681745,
"rate": 1000,
"session_lifetime": 0,
"smoothing": {
"delay": 2,
"enabled": true,
"step": 2,
"threshold": 2,
"trigger": 1
},
"tags": [
"edge",
"edge-eu"
],
"throttle_interval": 10,
"throttle_retry_limit": -1
},
"key_hash": "41c5cb1e",
"key_id": "5e9d9544a1dcd60001d0ed20e7f75f9e03534825b7aef9df749582e5"
}{
"Message": "Attempted access to non-owned key.",
"Meta": null,
"Status": "Error"
}{
"Message": "Not authorised",
"Meta": null,
"Status": "Error"
}{
"Message": "access denied: You do not have permission to access /api/apis/{apiID}/keys/{keyID}",
"Meta": null,
"Status": "Error"
}{
"Message": "Could not retrieve key detail.",
"Meta": null,
"Status": "Error"
}Authorizations
The Tyk Dashboard API Access Credentials
Path Parameters
ID of API the keys grant access to. Can either be the internal or external API ID.
The Key ID.
Query Parameters
If you are not sure if a key is hashed you can send this as true.
Available options:
true, false Use the hash of the key as input instead of the full key.Any none empty string will be interpreted as to say you want to use hash input.
Set to true if the passed key ID is a username.
Available options:
true, false Was this page helpful?
⌘I