Tokens
Rotate API Key
Revokes the old key and returns a new one with identical name, scopes, environment and expiry. Clerk session auth.
POST
/
tokens
/
rotate
Rotate API Key
curl --request POST \
--url https://api.useqrkit.com/v1/tokens/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key_id": "<string>"
}
'import requests
url = "https://api.useqrkit.com/v1/tokens/rotate"
payload = { "key_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key_id: '<string>'})
};
fetch('https://api.useqrkit.com/v1/tokens/rotate', 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.useqrkit.com/v1/tokens/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'key_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.useqrkit.com/v1/tokens/rotate"
payload := strings.NewReader("{\n \"key_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.useqrkit.com/v1/tokens/rotate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useqrkit.com/v1/tokens/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "key_aB3dE5fG7hI9jK1m",
"object": "api_key",
"name": "<string>",
"key_prefix": "qr_live_a1b2",
"scopes": [
"<string>"
],
"last_used_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"key": "<string>"
}{
"error": {
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}Authorizations
API key in the Authorization header: Bearer qr_live_… or Bearer qr_test_…. Token endpoints take a Clerk session JWT instead.
Body
application/json
Response
New API key (full key shown once)
Example:
"key_aB3dE5fG7hI9jK1m"
Example:
"api_key"
Example:
"qr_live_a1b2"
Available options:
live, test The full API key — shown only once.
Previous
List Webhook EndpointsReturns all webhook endpoints for the workspace, across all sources. The `secret` field is masked. Requires the `webhooks:read` scope.
Next
⌘I
Rotate API Key
curl --request POST \
--url https://api.useqrkit.com/v1/tokens/rotate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"key_id": "<string>"
}
'import requests
url = "https://api.useqrkit.com/v1/tokens/rotate"
payload = { "key_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({key_id: '<string>'})
};
fetch('https://api.useqrkit.com/v1/tokens/rotate', 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.useqrkit.com/v1/tokens/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'key_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.useqrkit.com/v1/tokens/rotate"
payload := strings.NewReader("{\n \"key_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.useqrkit.com/v1/tokens/rotate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"key_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useqrkit.com/v1/tokens/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"key_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "key_aB3dE5fG7hI9jK1m",
"object": "api_key",
"name": "<string>",
"key_prefix": "qr_live_a1b2",
"scopes": [
"<string>"
],
"last_used_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"key": "<string>"
}{
"error": {
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"message": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}
