curl --request PATCH \
--url https://api.dairo.app/v1/api-keys/{apiKeyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"allowedIps": [
"<string>"
],
"inboxIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.dairo.app/v1/api-keys/{apiKeyId}"
payload = {
"name": "<string>",
"allowedIps": ["<string>"],
"inboxIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
allowedIps: ['<string>'],
inboxIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.dairo.app/v1/api-keys/{apiKeyId}', 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.dairo.app/v1/api-keys/{apiKeyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'allowedIps' => [
'<string>'
],
'inboxIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.dairo.app/v1/api-keys/{apiKeyId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"allowedIps\": [\n \"<string>\"\n ],\n \"inboxIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.dairo.app/v1/api-keys/{apiKeyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"allowedIps\": [\n \"<string>\"\n ],\n \"inboxIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dairo.app/v1/api-keys/{apiKeyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"allowedIps\": [\n \"<string>\"\n ],\n \"inboxIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"prefix": "dairo_test_abc123",
"scopes": [
"<string>"
],
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"allowedIps": [
"<string>"
],
"inboxIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}Update an API key's name and/or IP allowlist
Update an API key’s name and/or IP allowlist
curl --request PATCH \
--url https://api.dairo.app/v1/api-keys/{apiKeyId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"allowedIps": [
"<string>"
],
"inboxIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.dairo.app/v1/api-keys/{apiKeyId}"
payload = {
"name": "<string>",
"allowedIps": ["<string>"],
"inboxIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
allowedIps: ['<string>'],
inboxIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.dairo.app/v1/api-keys/{apiKeyId}', 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.dairo.app/v1/api-keys/{apiKeyId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'allowedIps' => [
'<string>'
],
'inboxIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.dairo.app/v1/api-keys/{apiKeyId}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"allowedIps\": [\n \"<string>\"\n ],\n \"inboxIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.dairo.app/v1/api-keys/{apiKeyId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"allowedIps\": [\n \"<string>\"\n ],\n \"inboxIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dairo.app/v1/api-keys/{apiKeyId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"allowedIps\": [\n \"<string>\"\n ],\n \"inboxIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"prefix": "dairo_test_abc123",
"scopes": [
"<string>"
],
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"lastUsedAt": "2023-11-07T05:31:56Z",
"allowedIps": [
"<string>"
],
"inboxIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"type": "<string>",
"param": "<string>"
}
}Authorizations
Dairo API key, e.g. dairo_test_... or dairo_live_...
Path Parameters
Body
At least one of name, allowedIps or inboxIds is required. scopes is deliberately absent: scopes are immutable after mint, and revoking is DELETE on this same path. Sending either is a 400 rather than a silently-ignored no-op.
New display name. Omit to leave it unchanged; null is rejected with 400 rather than silently ignored.
Replaces the whole allowlist; it never merges. Omit the field to leave the current allowlist unchanged, or pass an empty array to clear it so the key may authenticate from any IP. Entries are IPv4/IPv6 addresses or CIDR ranges (up to 50); deny-by-default, so a correct secret from an unlisted IP is rejected with 403. Explicit null is rejected with 400 — unlike on create it does not mean any IP here, and it used to be a silently-ignored no-op.
Replaces the whole per-inbox restriction; it never merges. Omit to leave it unchanged, or pass an empty array to clear it so the key may send as any inbox. A restricted key may only ever narrow to a subset of its own inboxes — it cannot unpin itself or a sibling. Explicit null is rejected with 400: unlike on create it does not mean unrestricted here, it would change nothing.
Response
Success
"dairo_test_abc123"
active, revoked The key's IP allowlist (IPv4/IPv6 addresses or CIDR ranges), or null when the key authenticates from any IP.
The inbox ids (inboxes.id) this key may send as. Empty or null means the key is unrestricted and may send as any inbox in the project — the default, and what every key minted before this field existed has.