Rotate the runtime gateway token for one protection
curl --request POST \
--url https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token', 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://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-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"
"net/http"
"io"
)
func main() {
url := "https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"protectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalResourceId": "<string>",
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"serviceAccount": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"active": true
},
"providerCredential": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerSlug": "<string>",
"label": "<string>"
},
"gateway": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"models": [
"<string>"
],
"settings": {
"spendLimit": 1,
"spendWindow": "daily",
"rateLimitPerMin": 2,
"loggingEnabled": true,
"logBodies": true,
"guardrailMode": "off"
}
},
"gatewayToken": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prefix": "<string>"
},
"state": "active",
"accessRevokedAt": "2023-11-07T05:31:56Z",
"connectionSuspendedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"replayed": true
}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}OAuth
Rotate the runtime gateway token for one protection
POST
/
oauth
/
protections
/
{protectionId}
/
rotate-runtime-token
Rotate the runtime gateway token for one protection
curl --request POST \
--url https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token', 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://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-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"
"net/http"
"io"
)
func main() {
url := "https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.airctrl.dev/v1/oauth/protections/{protectionId}/rotate-runtime-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"protectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalResourceId": "<string>",
"project": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"serviceAccount": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"active": true
},
"providerCredential": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"providerSlug": "<string>",
"label": "<string>"
},
"gateway": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"models": [
"<string>"
],
"settings": {
"spendLimit": 1,
"spendWindow": "daily",
"rateLimitPerMin": 2,
"loggingEnabled": true,
"logBodies": true,
"guardrailMode": "off"
}
},
"gatewayToken": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"prefix": "<string>"
},
"state": "active",
"accessRevokedAt": "2023-11-07T05:31:56Z",
"connectionSuspendedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"replayed": true
}
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"message": "<string>",
"error_description": "<string>",
"requestId": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Scopes
protections:manage
Revoke, reactivate or rotate secrets only for protections created by this OAuth connection.
Headers
Stable operation key used to replay the same one-time token plaintext safely.
Required string length:
16 - 200Path Parameters
AIRCTRL protection ID returned for one external resource.