Detach a provider credential
curl --request DELETE \
--url https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}', 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/gateways/{id}/credentials/{credentialId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"gateway_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"is_active": true,
"locked_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"settings": {
"spend_limit": "<string>",
"spend_window": "daily",
"rate_limit_per_min": 2,
"logging_enabled": true,
"log_bodies": true,
"guardrail_mode": "off",
"allowed_models": [
"<string>"
]
},
"credential_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"credential_bindings": [
{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_slug": "<string>",
"model_id": "<string>",
"priority": 123
}
],
"provisioned_by": {
"type": "oauth",
"installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"client_id": "<string>",
"status": "<string>"
}
}
}{
"ok": false,
"error": {
"code": "bad_request",
"message": "Request validation failed",
"details": [
"Check the submitted values."
]
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "unauthorized",
"message": "Authentication is required"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "forbidden",
"message": "not_authorized"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "conflict",
"message": "idempotency_key_reused_with_different_params"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "rate_limited",
"message": "Too many requests"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "internal_error",
"message": "Internal server error"
},
"requestId": "req_example"
}Gateways
Detach a provider credential
Without modelId, removes every model binding for the provider credential from one gateway. With the optional modelId query parameter, removes only that exact model binding. The credential itself is not revoked. Requires gateways:detach-credential.
DELETE
/
gateways
/
{id}
/
credentials
/
{credentialId}
Detach a provider credential
curl --request DELETE \
--url https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}', 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/gateways/{id}/credentials/{credentialId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
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://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}"
req, _ := http.NewRequest("DELETE", 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.delete("https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.airctrl.dev/v1/gateways/{id}/credentials/{credentialId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"gateway_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"is_active": true,
"locked_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"settings": {
"spend_limit": "<string>",
"spend_window": "daily",
"rate_limit_per_min": 2,
"logging_enabled": true,
"log_bodies": true,
"guardrail_mode": "off",
"allowed_models": [
"<string>"
]
},
"credential_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"credential_bindings": [
{
"credential_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_slug": "<string>",
"model_id": "<string>",
"priority": 123
}
],
"provisioned_by": {
"type": "oauth",
"installation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"application_name": "<string>",
"client_id": "<string>",
"status": "<string>"
}
}
}{
"ok": false,
"error": {
"code": "bad_request",
"message": "Request validation failed",
"details": [
"Check the submitted values."
]
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "unauthorized",
"message": "Authentication is required"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "forbidden",
"message": "not_authorized"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "conflict",
"message": "idempotency_key_reused_with_different_params"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "rate_limited",
"message": "Too many requests"
},
"requestId": "req_example"
}{
"ok": false,
"error": {
"code": "internal_error",
"message": "Internal server error"
},
"requestId": "req_example"
}Authorizations
Human personal access token (sk-actrl-pat-...).
Headers
Stable key for safely retrying this write. Reuse the same key only with the same request body; results are retained for 24 hours and conflicting reuse returns 409.