Update or rotate a key
curl --request PUT \
--url https://api.dualmindlab.tech/api/admin/keys/{keyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"is_active": false
}
'import requests
url = "https://api.dualmindlab.tech/api/admin/keys/{keyId}"
payload = { "is_active": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_active: false})
};
fetch('https://api.dualmindlab.tech/api/admin/keys/{keyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_active: false})
};
fetch('https://api.dualmindlab.tech/api/admin/keys/{keyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dualmindlab.tech/api/admin/keys/{keyId}"
payload := strings.NewReader("{\n \"is_active\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}using RestSharp;
var options = new RestClientOptions("https://api.dualmindlab.tech/api/admin/keys/{keyId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"is_active\": false\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.put("https://api.dualmindlab.tech/api/admin/keys/{keyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"is_active\": false\n}")
.asString();{
"success": true,
"data": {
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_name": "groq",
"api_key": "<string>",
"display_mask": "...9f2c",
"is_active": true,
"failure_count": 0,
"total_calls": 1284,
"last_used_at": "2023-11-07T05:31:56Z",
"last_error_type": "<string>",
"last_error_category": "<string>",
"cooldown_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"success": false,
"error": "Role must be one of: admin, user"
}{
"success": false,
"error": "Role must be one of: admin, user"
}Update or rotate a key
Partial update: only the fields you send are written. Sending api_key replaces the key and its mask.
PUT
/
api
/
admin
/
keys
/
{keyId}
Update or rotate a key
curl --request PUT \
--url https://api.dualmindlab.tech/api/admin/keys/{keyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"is_active": false
}
'import requests
url = "https://api.dualmindlab.tech/api/admin/keys/{keyId}"
payload = { "is_active": False }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_active: false})
};
fetch('https://api.dualmindlab.tech/api/admin/keys/{keyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({is_active: false})
};
fetch('https://api.dualmindlab.tech/api/admin/keys/{keyId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dualmindlab.tech/api/admin/keys/{keyId}"
payload := strings.NewReader("{\n \"is_active\": false\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}using RestSharp;
var options = new RestClientOptions("https://api.dualmindlab.tech/api/admin/keys/{keyId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"is_active\": false\n}", false);
var response = await client.PutAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.put("https://api.dualmindlab.tech/api/admin/keys/{keyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"is_active\": false\n}")
.asString();{
"success": true,
"data": {
"key_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_name": "groq",
"api_key": "<string>",
"display_mask": "...9f2c",
"is_active": true,
"failure_count": 0,
"total_calls": 1284,
"last_used_at": "2023-11-07T05:31:56Z",
"last_error_type": "<string>",
"last_error_category": "<string>",
"cooldown_until": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"success": false,
"error": "Role must be one of: admin, user"
}{
"success": false,
"error": "Role must be one of: admin, user"
}AdminOnly
Bearer token, role admin
Authorizations
Supabase access token of an account with role = 'admin' in public.users.
Path Parameters
Key ID.
Last modified on October 18, 2026
Was this page helpful?
⌘I