curl --request PUT \
--url https://{tenant}/tyk/org/keys/{keyID} \
--header 'Content-Type: application/json' \
--header 'X-Tyk-Authorization: <api-key>' \
--data '
{
"access_rights": {
"itachi-api": {
"allowed_urls": [
{
"methods": [
"GET"
],
"url": "/users"
}
],
"api_id": "8ddd91f3cda9453442c477b06c4e2da4",
"api_name": "Itachi api",
"limit": {
"per": 60,
"quota_max": 10000,
"quota_remaining": 10000,
"quota_renewal_rate": 3600,
"rate": 1000,
"throttle_interval": 10,
"throttle_retry_limit": 10
},
"versions": [
"Default"
]
}
},
"alias": "portal-key",
"allowance": 1000,
"apply_policies": [
"5ead7120575961000181867e"
],
"date_created": "2024-08-09T14:40:34.87614+03:00",
"enable_detailed_recording": true,
"last_updated": "1723203634",
"meta_data": {
"new-update-key-sample": "update-key-sample",
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5",
"update": "sample policy update",
"user_type": "mobile_user"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 10000,
"quota_renewal_rate": 3600,
"quota_renews": 1723207234,
"rate": 1000,
"tags": [
"security",
"edge",
"edge-eu",
"update-sample-tag"
],
"throttle_interval": 10,
"throttle_retry_limit": 10
}
'import requests
url = "https://{tenant}/tyk/org/keys/{keyID}"
payload = {
"access_rights": { "itachi-api": {
"allowed_urls": [
{
"methods": ["GET"],
"url": "/users"
}
],
"api_id": "8ddd91f3cda9453442c477b06c4e2da4",
"api_name": "Itachi api",
"limit": {
"per": 60,
"quota_max": 10000,
"quota_remaining": 10000,
"quota_renewal_rate": 3600,
"rate": 1000,
"throttle_interval": 10,
"throttle_retry_limit": 10
},
"versions": ["Default"]
} },
"alias": "portal-key",
"allowance": 1000,
"apply_policies": ["5ead7120575961000181867e"],
"date_created": "2024-08-09T14:40:34.87614+03:00",
"enable_detailed_recording": True,
"last_updated": "1723203634",
"meta_data": {
"new-update-key-sample": "update-key-sample",
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5",
"update": "sample policy update",
"user_type": "mobile_user"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 10000,
"quota_renewal_rate": 3600,
"quota_renews": 1723207234,
"rate": 1000,
"tags": ["security", "edge", "edge-eu", "update-sample-tag"],
"throttle_interval": 10,
"throttle_retry_limit": 10
}
headers = {
"X-Tyk-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Tyk-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_rights: {
'itachi-api': {
allowed_urls: [{methods: ['GET'], url: '/users'}],
api_id: '8ddd91f3cda9453442c477b06c4e2da4',
api_name: 'Itachi api',
limit: {
per: 60,
quota_max: 10000,
quota_remaining: 10000,
quota_renewal_rate: 3600,
rate: 1000,
throttle_interval: 10,
throttle_retry_limit: 10
},
versions: ['Default']
}
},
alias: 'portal-key',
allowance: 1000,
apply_policies: ['5ead7120575961000181867e'],
date_created: '2024-08-09T14:40:34.87614+03:00',
enable_detailed_recording: true,
last_updated: '1723203634',
meta_data: {
'new-update-key-sample': 'update-key-sample',
tyk_developer_id: '62b3fb9a1d5e4f00017226f5',
update: 'sample policy update',
user_type: 'mobile_user'
},
org_id: '5e9d9544a1dcd60001d0ed20',
per: 60,
quota_max: 10000,
quota_renewal_rate: 3600,
quota_renews: 1723207234,
rate: 1000,
tags: ['security', 'edge', 'edge-eu', 'update-sample-tag'],
throttle_interval: 10,
throttle_retry_limit: 10
})
};
fetch('https://{tenant}/tyk/org/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}/tyk/org/keys/{keyID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'access_rights' => [
'itachi-api' => [
'allowed_urls' => [
[
'methods' => [
'GET'
],
'url' => '/users'
]
],
'api_id' => '8ddd91f3cda9453442c477b06c4e2da4',
'api_name' => 'Itachi api',
'limit' => [
'per' => 60,
'quota_max' => 10000,
'quota_remaining' => 10000,
'quota_renewal_rate' => 3600,
'rate' => 1000,
'throttle_interval' => 10,
'throttle_retry_limit' => 10
],
'versions' => [
'Default'
]
]
],
'alias' => 'portal-key',
'allowance' => 1000,
'apply_policies' => [
'5ead7120575961000181867e'
],
'date_created' => '2024-08-09T14:40:34.87614+03:00',
'enable_detailed_recording' => true,
'last_updated' => '1723203634',
'meta_data' => [
'new-update-key-sample' => 'update-key-sample',
'tyk_developer_id' => '62b3fb9a1d5e4f00017226f5',
'update' => 'sample policy update',
'user_type' => 'mobile_user'
],
'org_id' => '5e9d9544a1dcd60001d0ed20',
'per' => 60,
'quota_max' => 10000,
'quota_renewal_rate' => 3600,
'quota_renews' => 1723207234,
'rate' => 1000,
'tags' => [
'security',
'edge',
'edge-eu',
'update-sample-tag'
],
'throttle_interval' => 10,
'throttle_retry_limit' => 10
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Tyk-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/tyk/org/keys/{keyID}"
payload := strings.NewReader("{\n \"access_rights\": {\n \"itachi-api\": {\n \"allowed_urls\": [\n {\n \"methods\": [\n \"GET\"\n ],\n \"url\": \"/users\"\n }\n ],\n \"api_id\": \"8ddd91f3cda9453442c477b06c4e2da4\",\n \"api_name\": \"Itachi api\",\n \"limit\": {\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_remaining\": 10000,\n \"quota_renewal_rate\": 3600,\n \"rate\": 1000,\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n },\n \"versions\": [\n \"Default\"\n ]\n }\n },\n \"alias\": \"portal-key\",\n \"allowance\": 1000,\n \"apply_policies\": [\n \"5ead7120575961000181867e\"\n ],\n \"date_created\": \"2024-08-09T14:40:34.87614+03:00\",\n \"enable_detailed_recording\": true,\n \"last_updated\": \"1723203634\",\n \"meta_data\": {\n \"new-update-key-sample\": \"update-key-sample\",\n \"tyk_developer_id\": \"62b3fb9a1d5e4f00017226f5\",\n \"update\": \"sample policy update\",\n \"user_type\": \"mobile_user\"\n },\n \"org_id\": \"5e9d9544a1dcd60001d0ed20\",\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_renewal_rate\": 3600,\n \"quota_renews\": 1723207234,\n \"rate\": 1000,\n \"tags\": [\n \"security\",\n \"edge\",\n \"edge-eu\",\n \"update-sample-tag\"\n ],\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tyk-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{tenant}/tyk/org/keys/{keyID}")
.header("X-Tyk-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"access_rights\": {\n \"itachi-api\": {\n \"allowed_urls\": [\n {\n \"methods\": [\n \"GET\"\n ],\n \"url\": \"/users\"\n }\n ],\n \"api_id\": \"8ddd91f3cda9453442c477b06c4e2da4\",\n \"api_name\": \"Itachi api\",\n \"limit\": {\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_remaining\": 10000,\n \"quota_renewal_rate\": 3600,\n \"rate\": 1000,\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n },\n \"versions\": [\n \"Default\"\n ]\n }\n },\n \"alias\": \"portal-key\",\n \"allowance\": 1000,\n \"apply_policies\": [\n \"5ead7120575961000181867e\"\n ],\n \"date_created\": \"2024-08-09T14:40:34.87614+03:00\",\n \"enable_detailed_recording\": true,\n \"last_updated\": \"1723203634\",\n \"meta_data\": {\n \"new-update-key-sample\": \"update-key-sample\",\n \"tyk_developer_id\": \"62b3fb9a1d5e4f00017226f5\",\n \"update\": \"sample policy update\",\n \"user_type\": \"mobile_user\"\n },\n \"org_id\": \"5e9d9544a1dcd60001d0ed20\",\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_renewal_rate\": 3600,\n \"quota_renews\": 1723207234,\n \"rate\": 1000,\n \"tags\": [\n \"security\",\n \"edge\",\n \"edge-eu\",\n \"update-sample-tag\"\n ],\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/tyk/org/keys/{keyID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tyk-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access_rights\": {\n \"itachi-api\": {\n \"allowed_urls\": [\n {\n \"methods\": [\n \"GET\"\n ],\n \"url\": \"/users\"\n }\n ],\n \"api_id\": \"8ddd91f3cda9453442c477b06c4e2da4\",\n \"api_name\": \"Itachi api\",\n \"limit\": {\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_remaining\": 10000,\n \"quota_renewal_rate\": 3600,\n \"rate\": 1000,\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n },\n \"versions\": [\n \"Default\"\n ]\n }\n },\n \"alias\": \"portal-key\",\n \"allowance\": 1000,\n \"apply_policies\": [\n \"5ead7120575961000181867e\"\n ],\n \"date_created\": \"2024-08-09T14:40:34.87614+03:00\",\n \"enable_detailed_recording\": true,\n \"last_updated\": \"1723203634\",\n \"meta_data\": {\n \"new-update-key-sample\": \"update-key-sample\",\n \"tyk_developer_id\": \"62b3fb9a1d5e4f00017226f5\",\n \"update\": \"sample policy update\",\n \"user_type\": \"mobile_user\"\n },\n \"org_id\": \"5e9d9544a1dcd60001d0ed20\",\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_renewal_rate\": 3600,\n \"quota_renews\": 1723207234,\n \"rate\": 1000,\n \"tags\": [\n \"security\",\n \"edge\",\n \"edge-eu\",\n \"update-sample-tag\"\n ],\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"action": "modified",
"key": "b13d928b9972bd18",
"key_hash": "<string>",
"status": "ok"
}{
"message": "Request malformed",
"status": "error"
}{
"message": "Attempted administrative access with invalid or missing key!",
"status": "error"
}{
"message": "No such organisation found in Active API list",
"status": "error"
}{
"message": "Error writing to key store ",
"status": "error"
}Update Organisation Key
This work similar to Keys API except that Key ID is always equals Organisation ID
For Gateway v2.6.0 onwards, you can now set rate limits at the organisation level by using the following fields - allowance and rate. These are the number of allowed requests for the specified per value, and need to be set to the same value. If you don’t want to have organisation level rate limiting, set rate or per to zero, or don’t add them to your request.
curl --request PUT \
--url https://{tenant}/tyk/org/keys/{keyID} \
--header 'Content-Type: application/json' \
--header 'X-Tyk-Authorization: <api-key>' \
--data '
{
"access_rights": {
"itachi-api": {
"allowed_urls": [
{
"methods": [
"GET"
],
"url": "/users"
}
],
"api_id": "8ddd91f3cda9453442c477b06c4e2da4",
"api_name": "Itachi api",
"limit": {
"per": 60,
"quota_max": 10000,
"quota_remaining": 10000,
"quota_renewal_rate": 3600,
"rate": 1000,
"throttle_interval": 10,
"throttle_retry_limit": 10
},
"versions": [
"Default"
]
}
},
"alias": "portal-key",
"allowance": 1000,
"apply_policies": [
"5ead7120575961000181867e"
],
"date_created": "2024-08-09T14:40:34.87614+03:00",
"enable_detailed_recording": true,
"last_updated": "1723203634",
"meta_data": {
"new-update-key-sample": "update-key-sample",
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5",
"update": "sample policy update",
"user_type": "mobile_user"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 10000,
"quota_renewal_rate": 3600,
"quota_renews": 1723207234,
"rate": 1000,
"tags": [
"security",
"edge",
"edge-eu",
"update-sample-tag"
],
"throttle_interval": 10,
"throttle_retry_limit": 10
}
'import requests
url = "https://{tenant}/tyk/org/keys/{keyID}"
payload = {
"access_rights": { "itachi-api": {
"allowed_urls": [
{
"methods": ["GET"],
"url": "/users"
}
],
"api_id": "8ddd91f3cda9453442c477b06c4e2da4",
"api_name": "Itachi api",
"limit": {
"per": 60,
"quota_max": 10000,
"quota_remaining": 10000,
"quota_renewal_rate": 3600,
"rate": 1000,
"throttle_interval": 10,
"throttle_retry_limit": 10
},
"versions": ["Default"]
} },
"alias": "portal-key",
"allowance": 1000,
"apply_policies": ["5ead7120575961000181867e"],
"date_created": "2024-08-09T14:40:34.87614+03:00",
"enable_detailed_recording": True,
"last_updated": "1723203634",
"meta_data": {
"new-update-key-sample": "update-key-sample",
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5",
"update": "sample policy update",
"user_type": "mobile_user"
},
"org_id": "5e9d9544a1dcd60001d0ed20",
"per": 60,
"quota_max": 10000,
"quota_renewal_rate": 3600,
"quota_renews": 1723207234,
"rate": 1000,
"tags": ["security", "edge", "edge-eu", "update-sample-tag"],
"throttle_interval": 10,
"throttle_retry_limit": 10
}
headers = {
"X-Tyk-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Tyk-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
access_rights: {
'itachi-api': {
allowed_urls: [{methods: ['GET'], url: '/users'}],
api_id: '8ddd91f3cda9453442c477b06c4e2da4',
api_name: 'Itachi api',
limit: {
per: 60,
quota_max: 10000,
quota_remaining: 10000,
quota_renewal_rate: 3600,
rate: 1000,
throttle_interval: 10,
throttle_retry_limit: 10
},
versions: ['Default']
}
},
alias: 'portal-key',
allowance: 1000,
apply_policies: ['5ead7120575961000181867e'],
date_created: '2024-08-09T14:40:34.87614+03:00',
enable_detailed_recording: true,
last_updated: '1723203634',
meta_data: {
'new-update-key-sample': 'update-key-sample',
tyk_developer_id: '62b3fb9a1d5e4f00017226f5',
update: 'sample policy update',
user_type: 'mobile_user'
},
org_id: '5e9d9544a1dcd60001d0ed20',
per: 60,
quota_max: 10000,
quota_renewal_rate: 3600,
quota_renews: 1723207234,
rate: 1000,
tags: ['security', 'edge', 'edge-eu', 'update-sample-tag'],
throttle_interval: 10,
throttle_retry_limit: 10
})
};
fetch('https://{tenant}/tyk/org/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}/tyk/org/keys/{keyID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'access_rights' => [
'itachi-api' => [
'allowed_urls' => [
[
'methods' => [
'GET'
],
'url' => '/users'
]
],
'api_id' => '8ddd91f3cda9453442c477b06c4e2da4',
'api_name' => 'Itachi api',
'limit' => [
'per' => 60,
'quota_max' => 10000,
'quota_remaining' => 10000,
'quota_renewal_rate' => 3600,
'rate' => 1000,
'throttle_interval' => 10,
'throttle_retry_limit' => 10
],
'versions' => [
'Default'
]
]
],
'alias' => 'portal-key',
'allowance' => 1000,
'apply_policies' => [
'5ead7120575961000181867e'
],
'date_created' => '2024-08-09T14:40:34.87614+03:00',
'enable_detailed_recording' => true,
'last_updated' => '1723203634',
'meta_data' => [
'new-update-key-sample' => 'update-key-sample',
'tyk_developer_id' => '62b3fb9a1d5e4f00017226f5',
'update' => 'sample policy update',
'user_type' => 'mobile_user'
],
'org_id' => '5e9d9544a1dcd60001d0ed20',
'per' => 60,
'quota_max' => 10000,
'quota_renewal_rate' => 3600,
'quota_renews' => 1723207234,
'rate' => 1000,
'tags' => [
'security',
'edge',
'edge-eu',
'update-sample-tag'
],
'throttle_interval' => 10,
'throttle_retry_limit' => 10
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Tyk-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}/tyk/org/keys/{keyID}"
payload := strings.NewReader("{\n \"access_rights\": {\n \"itachi-api\": {\n \"allowed_urls\": [\n {\n \"methods\": [\n \"GET\"\n ],\n \"url\": \"/users\"\n }\n ],\n \"api_id\": \"8ddd91f3cda9453442c477b06c4e2da4\",\n \"api_name\": \"Itachi api\",\n \"limit\": {\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_remaining\": 10000,\n \"quota_renewal_rate\": 3600,\n \"rate\": 1000,\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n },\n \"versions\": [\n \"Default\"\n ]\n }\n },\n \"alias\": \"portal-key\",\n \"allowance\": 1000,\n \"apply_policies\": [\n \"5ead7120575961000181867e\"\n ],\n \"date_created\": \"2024-08-09T14:40:34.87614+03:00\",\n \"enable_detailed_recording\": true,\n \"last_updated\": \"1723203634\",\n \"meta_data\": {\n \"new-update-key-sample\": \"update-key-sample\",\n \"tyk_developer_id\": \"62b3fb9a1d5e4f00017226f5\",\n \"update\": \"sample policy update\",\n \"user_type\": \"mobile_user\"\n },\n \"org_id\": \"5e9d9544a1dcd60001d0ed20\",\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_renewal_rate\": 3600,\n \"quota_renews\": 1723207234,\n \"rate\": 1000,\n \"tags\": [\n \"security\",\n \"edge\",\n \"edge-eu\",\n \"update-sample-tag\"\n ],\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Tyk-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{tenant}/tyk/org/keys/{keyID}")
.header("X-Tyk-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"access_rights\": {\n \"itachi-api\": {\n \"allowed_urls\": [\n {\n \"methods\": [\n \"GET\"\n ],\n \"url\": \"/users\"\n }\n ],\n \"api_id\": \"8ddd91f3cda9453442c477b06c4e2da4\",\n \"api_name\": \"Itachi api\",\n \"limit\": {\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_remaining\": 10000,\n \"quota_renewal_rate\": 3600,\n \"rate\": 1000,\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n },\n \"versions\": [\n \"Default\"\n ]\n }\n },\n \"alias\": \"portal-key\",\n \"allowance\": 1000,\n \"apply_policies\": [\n \"5ead7120575961000181867e\"\n ],\n \"date_created\": \"2024-08-09T14:40:34.87614+03:00\",\n \"enable_detailed_recording\": true,\n \"last_updated\": \"1723203634\",\n \"meta_data\": {\n \"new-update-key-sample\": \"update-key-sample\",\n \"tyk_developer_id\": \"62b3fb9a1d5e4f00017226f5\",\n \"update\": \"sample policy update\",\n \"user_type\": \"mobile_user\"\n },\n \"org_id\": \"5e9d9544a1dcd60001d0ed20\",\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_renewal_rate\": 3600,\n \"quota_renews\": 1723207234,\n \"rate\": 1000,\n \"tags\": [\n \"security\",\n \"edge\",\n \"edge-eu\",\n \"update-sample-tag\"\n ],\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}/tyk/org/keys/{keyID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Tyk-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"access_rights\": {\n \"itachi-api\": {\n \"allowed_urls\": [\n {\n \"methods\": [\n \"GET\"\n ],\n \"url\": \"/users\"\n }\n ],\n \"api_id\": \"8ddd91f3cda9453442c477b06c4e2da4\",\n \"api_name\": \"Itachi api\",\n \"limit\": {\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_remaining\": 10000,\n \"quota_renewal_rate\": 3600,\n \"rate\": 1000,\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n },\n \"versions\": [\n \"Default\"\n ]\n }\n },\n \"alias\": \"portal-key\",\n \"allowance\": 1000,\n \"apply_policies\": [\n \"5ead7120575961000181867e\"\n ],\n \"date_created\": \"2024-08-09T14:40:34.87614+03:00\",\n \"enable_detailed_recording\": true,\n \"last_updated\": \"1723203634\",\n \"meta_data\": {\n \"new-update-key-sample\": \"update-key-sample\",\n \"tyk_developer_id\": \"62b3fb9a1d5e4f00017226f5\",\n \"update\": \"sample policy update\",\n \"user_type\": \"mobile_user\"\n },\n \"org_id\": \"5e9d9544a1dcd60001d0ed20\",\n \"per\": 60,\n \"quota_max\": 10000,\n \"quota_renewal_rate\": 3600,\n \"quota_renews\": 1723207234,\n \"rate\": 1000,\n \"tags\": [\n \"security\",\n \"edge\",\n \"edge-eu\",\n \"update-sample-tag\"\n ],\n \"throttle_interval\": 10,\n \"throttle_retry_limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"action": "modified",
"key": "b13d928b9972bd18",
"key_hash": "<string>",
"status": "ok"
}{
"message": "Request malformed",
"status": "error"
}{
"message": "Attempted administrative access with invalid or missing key!",
"status": "error"
}{
"message": "No such organisation found in Active API list",
"status": "error"
}{
"message": "Error writing to key store ",
"status": "error"
}Authorizations
Api key
Path Parameters
The Key ID
Query Parameters
Adding the reset_quota parameter and setting it to 1, will cause Tyk reset the organisations quota in the live quota manager, it is recommended to use this mechanism to reset organisation-level access if a monthly subscription is in place.
1 Body
Show child attributes
Show child attributes
"portal-developer@example.org"
1000
["641c15dd0fffb800010197bf"]
deprecated use apply_policies going forward instead to send a list of policies ids
"641c15dd0fffb800010197bf"
Show child attributes
Show child attributes
0
"2024-03-13T03:56:46.568042549Z"
deprecated use enable_detailed_recording going forward instead
false
true
false
1712895619
false
false
Show child attributes
Show child attributes
0
"1710302206"
-1
Show child attributes
Show child attributes
{
"tyk_developer_id": "62b3fb9a1d5e4f00017226f5"
}
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"5e9d9544a1dcd60001d0ed20"
5
20000
20000
31556952
1710302205
1
0
Show child attributes
Show child attributes
["edge", "edge-eu"]
10
1000
Was this page helpful?