curl --request PATCH \
--url https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": {
"account_update": true,
"api_key_create": true,
"api_key_delete": true,
"api_key_read": true,
"api_key_update": true,
"app_connect": true,
"app_share_owner": true,
"calendar_event_create": true,
"calendar_event_delete": true,
"calendar_event_read": true,
"calendar_event_update": true,
"calendar_read": true,
"calendar_update": true,
"domain_create": true,
"domain_delete": true,
"domain_read": true,
"domain_update": true,
"draft_create": true,
"draft_delete": true,
"draft_read": true,
"draft_send": true,
"draft_update": true,
"inbox_create": true,
"inbox_delete": true,
"inbox_read": true,
"inbox_update": true,
"label_blocked_read": true,
"label_spam_read": true,
"label_trash_read": true,
"label_unauthenticated_read": true,
"list_entry_create": true,
"list_entry_delete": true,
"list_entry_read": true,
"message_delete": true,
"message_read": true,
"message_reply": true,
"message_send": true,
"message_update": true,
"metrics_read": true,
"pod_create": true,
"pod_delete": true,
"pod_read": true,
"pod_update": true,
"webhook_create": true,
"webhook_delete": true,
"webhook_read": true,
"webhook_update": true
}
}
'import requests
url = "https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}"
payload = {
"name": "<string>",
"permissions": {
"account_update": True,
"api_key_create": True,
"api_key_delete": True,
"api_key_read": True,
"api_key_update": True,
"app_connect": True,
"app_share_owner": True,
"calendar_event_create": True,
"calendar_event_delete": True,
"calendar_event_read": True,
"calendar_event_update": True,
"calendar_read": True,
"calendar_update": True,
"domain_create": True,
"domain_delete": True,
"domain_read": True,
"domain_update": True,
"draft_create": True,
"draft_delete": True,
"draft_read": True,
"draft_send": True,
"draft_update": True,
"inbox_create": True,
"inbox_delete": True,
"inbox_read": True,
"inbox_update": True,
"label_blocked_read": True,
"label_spam_read": True,
"label_trash_read": True,
"label_unauthenticated_read": True,
"list_entry_create": True,
"list_entry_delete": True,
"list_entry_read": True,
"message_delete": True,
"message_read": True,
"message_reply": True,
"message_send": True,
"message_update": True,
"metrics_read": True,
"pod_create": True,
"pod_delete": True,
"pod_read": True,
"pod_update": True,
"webhook_create": True,
"webhook_delete": True,
"webhook_read": True,
"webhook_update": True
}
}
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>',
permissions: {
account_update: true,
api_key_create: true,
api_key_delete: true,
api_key_read: true,
api_key_update: true,
app_connect: true,
app_share_owner: true,
calendar_event_create: true,
calendar_event_delete: true,
calendar_event_read: true,
calendar_event_update: true,
calendar_read: true,
calendar_update: true,
domain_create: true,
domain_delete: true,
domain_read: true,
domain_update: true,
draft_create: true,
draft_delete: true,
draft_read: true,
draft_send: true,
draft_update: true,
inbox_create: true,
inbox_delete: true,
inbox_read: true,
inbox_update: true,
label_blocked_read: true,
label_spam_read: true,
label_trash_read: true,
label_unauthenticated_read: true,
list_entry_create: true,
list_entry_delete: true,
list_entry_read: true,
message_delete: true,
message_read: true,
message_reply: true,
message_send: true,
message_update: true,
metrics_read: true,
pod_create: true,
pod_delete: true,
pod_read: true,
pod_update: true,
webhook_create: true,
webhook_delete: true,
webhook_read: true,
webhook_update: true
}
})
};
fetch('https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}', 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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}",
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>',
'permissions' => [
'account_update' => true,
'api_key_create' => true,
'api_key_delete' => true,
'api_key_read' => true,
'api_key_update' => true,
'app_connect' => true,
'app_share_owner' => true,
'calendar_event_create' => true,
'calendar_event_delete' => true,
'calendar_event_read' => true,
'calendar_event_update' => true,
'calendar_read' => true,
'calendar_update' => true,
'domain_create' => true,
'domain_delete' => true,
'domain_read' => true,
'domain_update' => true,
'draft_create' => true,
'draft_delete' => true,
'draft_read' => true,
'draft_send' => true,
'draft_update' => true,
'inbox_create' => true,
'inbox_delete' => true,
'inbox_read' => true,
'inbox_update' => true,
'label_blocked_read' => true,
'label_spam_read' => true,
'label_trash_read' => true,
'label_unauthenticated_read' => true,
'list_entry_create' => true,
'list_entry_delete' => true,
'list_entry_read' => true,
'message_delete' => true,
'message_read' => true,
'message_reply' => true,
'message_send' => true,
'message_update' => true,
'metrics_read' => true,
'pod_create' => true,
'pod_delete' => true,
'pod_read' => true,
'pod_update' => true,
'webhook_create' => true,
'webhook_delete' => true,
'webhook_read' => true,
'webhook_update' => true
]
]),
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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": {\n \"account_update\": true,\n \"api_key_create\": true,\n \"api_key_delete\": true,\n \"api_key_read\": true,\n \"api_key_update\": true,\n \"app_connect\": true,\n \"app_share_owner\": true,\n \"calendar_event_create\": true,\n \"calendar_event_delete\": true,\n \"calendar_event_read\": true,\n \"calendar_event_update\": true,\n \"calendar_read\": true,\n \"calendar_update\": true,\n \"domain_create\": true,\n \"domain_delete\": true,\n \"domain_read\": true,\n \"domain_update\": true,\n \"draft_create\": true,\n \"draft_delete\": true,\n \"draft_read\": true,\n \"draft_send\": true,\n \"draft_update\": true,\n \"inbox_create\": true,\n \"inbox_delete\": true,\n \"inbox_read\": true,\n \"inbox_update\": true,\n \"label_blocked_read\": true,\n \"label_spam_read\": true,\n \"label_trash_read\": true,\n \"label_unauthenticated_read\": true,\n \"list_entry_create\": true,\n \"list_entry_delete\": true,\n \"list_entry_read\": true,\n \"message_delete\": true,\n \"message_read\": true,\n \"message_reply\": true,\n \"message_send\": true,\n \"message_update\": true,\n \"metrics_read\": true,\n \"pod_create\": true,\n \"pod_delete\": true,\n \"pod_read\": true,\n \"pod_update\": true,\n \"webhook_create\": true,\n \"webhook_delete\": true,\n \"webhook_read\": true,\n \"webhook_update\": true\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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": {\n \"account_update\": true,\n \"api_key_create\": true,\n \"api_key_delete\": true,\n \"api_key_read\": true,\n \"api_key_update\": true,\n \"app_connect\": true,\n \"app_share_owner\": true,\n \"calendar_event_create\": true,\n \"calendar_event_delete\": true,\n \"calendar_event_read\": true,\n \"calendar_event_update\": true,\n \"calendar_read\": true,\n \"calendar_update\": true,\n \"domain_create\": true,\n \"domain_delete\": true,\n \"domain_read\": true,\n \"domain_update\": true,\n \"draft_create\": true,\n \"draft_delete\": true,\n \"draft_read\": true,\n \"draft_send\": true,\n \"draft_update\": true,\n \"inbox_create\": true,\n \"inbox_delete\": true,\n \"inbox_read\": true,\n \"inbox_update\": true,\n \"label_blocked_read\": true,\n \"label_spam_read\": true,\n \"label_trash_read\": true,\n \"label_unauthenticated_read\": true,\n \"list_entry_create\": true,\n \"list_entry_delete\": true,\n \"list_entry_read\": true,\n \"message_delete\": true,\n \"message_read\": true,\n \"message_reply\": true,\n \"message_send\": true,\n \"message_update\": true,\n \"metrics_read\": true,\n \"pod_create\": true,\n \"pod_delete\": true,\n \"pod_read\": true,\n \"pod_update\": true,\n \"webhook_create\": true,\n \"webhook_delete\": true,\n \"webhook_read\": true,\n \"webhook_update\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}")
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 \"permissions\": {\n \"account_update\": true,\n \"api_key_create\": true,\n \"api_key_delete\": true,\n \"api_key_read\": true,\n \"api_key_update\": true,\n \"app_connect\": true,\n \"app_share_owner\": true,\n \"calendar_event_create\": true,\n \"calendar_event_delete\": true,\n \"calendar_event_read\": true,\n \"calendar_event_update\": true,\n \"calendar_read\": true,\n \"calendar_update\": true,\n \"domain_create\": true,\n \"domain_delete\": true,\n \"domain_read\": true,\n \"domain_update\": true,\n \"draft_create\": true,\n \"draft_delete\": true,\n \"draft_read\": true,\n \"draft_send\": true,\n \"draft_update\": true,\n \"inbox_create\": true,\n \"inbox_delete\": true,\n \"inbox_read\": true,\n \"inbox_update\": true,\n \"label_blocked_read\": true,\n \"label_spam_read\": true,\n \"label_trash_read\": true,\n \"label_unauthenticated_read\": true,\n \"list_entry_create\": true,\n \"list_entry_delete\": true,\n \"list_entry_read\": true,\n \"message_delete\": true,\n \"message_read\": true,\n \"message_reply\": true,\n \"message_send\": true,\n \"message_update\": true,\n \"metrics_read\": true,\n \"pod_create\": true,\n \"pod_delete\": true,\n \"pod_read\": true,\n \"pod_update\": true,\n \"webhook_create\": true,\n \"webhook_delete\": true,\n \"webhook_read\": true,\n \"webhook_update\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"api_key_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"prefix": "<string>",
"type": "bearer",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"inbox_id": "<string>",
"permissions": {
"account_update": true,
"api_key_create": true,
"api_key_delete": true,
"api_key_read": true,
"api_key_update": true,
"app_connect": true,
"app_share_owner": true,
"calendar_event_create": true,
"calendar_event_delete": true,
"calendar_event_read": true,
"calendar_event_update": true,
"calendar_read": true,
"calendar_update": true,
"domain_create": true,
"domain_delete": true,
"domain_read": true,
"domain_update": true,
"draft_create": true,
"draft_delete": true,
"draft_read": true,
"draft_send": true,
"draft_update": true,
"inbox_create": true,
"inbox_delete": true,
"inbox_read": true,
"inbox_update": true,
"label_blocked_read": true,
"label_spam_read": true,
"label_trash_read": true,
"label_unauthenticated_read": true,
"list_entry_create": true,
"list_entry_delete": true,
"list_entry_read": true,
"message_delete": true,
"message_read": true,
"message_reply": true,
"message_send": true,
"message_update": true,
"metrics_read": true,
"pod_create": true,
"pod_delete": true,
"pod_read": true,
"pod_update": true,
"webhook_create": true,
"webhook_delete": true,
"webhook_read": true,
"webhook_update": true
},
"pod_id": "<string>",
"used_at": "2023-11-07T05:31:56Z"
}Inboxes - Delete API Key
curl --request PATCH \
--url https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"permissions": {
"account_update": true,
"api_key_create": true,
"api_key_delete": true,
"api_key_read": true,
"api_key_update": true,
"app_connect": true,
"app_share_owner": true,
"calendar_event_create": true,
"calendar_event_delete": true,
"calendar_event_read": true,
"calendar_event_update": true,
"calendar_read": true,
"calendar_update": true,
"domain_create": true,
"domain_delete": true,
"domain_read": true,
"domain_update": true,
"draft_create": true,
"draft_delete": true,
"draft_read": true,
"draft_send": true,
"draft_update": true,
"inbox_create": true,
"inbox_delete": true,
"inbox_read": true,
"inbox_update": true,
"label_blocked_read": true,
"label_spam_read": true,
"label_trash_read": true,
"label_unauthenticated_read": true,
"list_entry_create": true,
"list_entry_delete": true,
"list_entry_read": true,
"message_delete": true,
"message_read": true,
"message_reply": true,
"message_send": true,
"message_update": true,
"metrics_read": true,
"pod_create": true,
"pod_delete": true,
"pod_read": true,
"pod_update": true,
"webhook_create": true,
"webhook_delete": true,
"webhook_read": true,
"webhook_update": true
}
}
'import requests
url = "https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}"
payload = {
"name": "<string>",
"permissions": {
"account_update": True,
"api_key_create": True,
"api_key_delete": True,
"api_key_read": True,
"api_key_update": True,
"app_connect": True,
"app_share_owner": True,
"calendar_event_create": True,
"calendar_event_delete": True,
"calendar_event_read": True,
"calendar_event_update": True,
"calendar_read": True,
"calendar_update": True,
"domain_create": True,
"domain_delete": True,
"domain_read": True,
"domain_update": True,
"draft_create": True,
"draft_delete": True,
"draft_read": True,
"draft_send": True,
"draft_update": True,
"inbox_create": True,
"inbox_delete": True,
"inbox_read": True,
"inbox_update": True,
"label_blocked_read": True,
"label_spam_read": True,
"label_trash_read": True,
"label_unauthenticated_read": True,
"list_entry_create": True,
"list_entry_delete": True,
"list_entry_read": True,
"message_delete": True,
"message_read": True,
"message_reply": True,
"message_send": True,
"message_update": True,
"metrics_read": True,
"pod_create": True,
"pod_delete": True,
"pod_read": True,
"pod_update": True,
"webhook_create": True,
"webhook_delete": True,
"webhook_read": True,
"webhook_update": True
}
}
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>',
permissions: {
account_update: true,
api_key_create: true,
api_key_delete: true,
api_key_read: true,
api_key_update: true,
app_connect: true,
app_share_owner: true,
calendar_event_create: true,
calendar_event_delete: true,
calendar_event_read: true,
calendar_event_update: true,
calendar_read: true,
calendar_update: true,
domain_create: true,
domain_delete: true,
domain_read: true,
domain_update: true,
draft_create: true,
draft_delete: true,
draft_read: true,
draft_send: true,
draft_update: true,
inbox_create: true,
inbox_delete: true,
inbox_read: true,
inbox_update: true,
label_blocked_read: true,
label_spam_read: true,
label_trash_read: true,
label_unauthenticated_read: true,
list_entry_create: true,
list_entry_delete: true,
list_entry_read: true,
message_delete: true,
message_read: true,
message_reply: true,
message_send: true,
message_update: true,
metrics_read: true,
pod_create: true,
pod_delete: true,
pod_read: true,
pod_update: true,
webhook_create: true,
webhook_delete: true,
webhook_read: true,
webhook_update: true
}
})
};
fetch('https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}', 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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}",
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>',
'permissions' => [
'account_update' => true,
'api_key_create' => true,
'api_key_delete' => true,
'api_key_read' => true,
'api_key_update' => true,
'app_connect' => true,
'app_share_owner' => true,
'calendar_event_create' => true,
'calendar_event_delete' => true,
'calendar_event_read' => true,
'calendar_event_update' => true,
'calendar_read' => true,
'calendar_update' => true,
'domain_create' => true,
'domain_delete' => true,
'domain_read' => true,
'domain_update' => true,
'draft_create' => true,
'draft_delete' => true,
'draft_read' => true,
'draft_send' => true,
'draft_update' => true,
'inbox_create' => true,
'inbox_delete' => true,
'inbox_read' => true,
'inbox_update' => true,
'label_blocked_read' => true,
'label_spam_read' => true,
'label_trash_read' => true,
'label_unauthenticated_read' => true,
'list_entry_create' => true,
'list_entry_delete' => true,
'list_entry_read' => true,
'message_delete' => true,
'message_read' => true,
'message_reply' => true,
'message_send' => true,
'message_update' => true,
'metrics_read' => true,
'pod_create' => true,
'pod_delete' => true,
'pod_read' => true,
'pod_update' => true,
'webhook_create' => true,
'webhook_delete' => true,
'webhook_read' => true,
'webhook_update' => true
]
]),
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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"permissions\": {\n \"account_update\": true,\n \"api_key_create\": true,\n \"api_key_delete\": true,\n \"api_key_read\": true,\n \"api_key_update\": true,\n \"app_connect\": true,\n \"app_share_owner\": true,\n \"calendar_event_create\": true,\n \"calendar_event_delete\": true,\n \"calendar_event_read\": true,\n \"calendar_event_update\": true,\n \"calendar_read\": true,\n \"calendar_update\": true,\n \"domain_create\": true,\n \"domain_delete\": true,\n \"domain_read\": true,\n \"domain_update\": true,\n \"draft_create\": true,\n \"draft_delete\": true,\n \"draft_read\": true,\n \"draft_send\": true,\n \"draft_update\": true,\n \"inbox_create\": true,\n \"inbox_delete\": true,\n \"inbox_read\": true,\n \"inbox_update\": true,\n \"label_blocked_read\": true,\n \"label_spam_read\": true,\n \"label_trash_read\": true,\n \"label_unauthenticated_read\": true,\n \"list_entry_create\": true,\n \"list_entry_delete\": true,\n \"list_entry_read\": true,\n \"message_delete\": true,\n \"message_read\": true,\n \"message_reply\": true,\n \"message_send\": true,\n \"message_update\": true,\n \"metrics_read\": true,\n \"pod_create\": true,\n \"pod_delete\": true,\n \"pod_read\": true,\n \"pod_update\": true,\n \"webhook_create\": true,\n \"webhook_delete\": true,\n \"webhook_read\": true,\n \"webhook_update\": true\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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"permissions\": {\n \"account_update\": true,\n \"api_key_create\": true,\n \"api_key_delete\": true,\n \"api_key_read\": true,\n \"api_key_update\": true,\n \"app_connect\": true,\n \"app_share_owner\": true,\n \"calendar_event_create\": true,\n \"calendar_event_delete\": true,\n \"calendar_event_read\": true,\n \"calendar_event_update\": true,\n \"calendar_read\": true,\n \"calendar_update\": true,\n \"domain_create\": true,\n \"domain_delete\": true,\n \"domain_read\": true,\n \"domain_update\": true,\n \"draft_create\": true,\n \"draft_delete\": true,\n \"draft_read\": true,\n \"draft_send\": true,\n \"draft_update\": true,\n \"inbox_create\": true,\n \"inbox_delete\": true,\n \"inbox_read\": true,\n \"inbox_update\": true,\n \"label_blocked_read\": true,\n \"label_spam_read\": true,\n \"label_trash_read\": true,\n \"label_unauthenticated_read\": true,\n \"list_entry_create\": true,\n \"list_entry_delete\": true,\n \"list_entry_read\": true,\n \"message_delete\": true,\n \"message_read\": true,\n \"message_reply\": true,\n \"message_send\": true,\n \"message_update\": true,\n \"metrics_read\": true,\n \"pod_create\": true,\n \"pod_delete\": true,\n \"pod_read\": true,\n \"pod_update\": true,\n \"webhook_create\": true,\n \"webhook_delete\": true,\n \"webhook_read\": true,\n \"webhook_update\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}")
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 \"permissions\": {\n \"account_update\": true,\n \"api_key_create\": true,\n \"api_key_delete\": true,\n \"api_key_read\": true,\n \"api_key_update\": true,\n \"app_connect\": true,\n \"app_share_owner\": true,\n \"calendar_event_create\": true,\n \"calendar_event_delete\": true,\n \"calendar_event_read\": true,\n \"calendar_event_update\": true,\n \"calendar_read\": true,\n \"calendar_update\": true,\n \"domain_create\": true,\n \"domain_delete\": true,\n \"domain_read\": true,\n \"domain_update\": true,\n \"draft_create\": true,\n \"draft_delete\": true,\n \"draft_read\": true,\n \"draft_send\": true,\n \"draft_update\": true,\n \"inbox_create\": true,\n \"inbox_delete\": true,\n \"inbox_read\": true,\n \"inbox_update\": true,\n \"label_blocked_read\": true,\n \"label_spam_read\": true,\n \"label_trash_read\": true,\n \"label_unauthenticated_read\": true,\n \"list_entry_create\": true,\n \"list_entry_delete\": true,\n \"list_entry_read\": true,\n \"message_delete\": true,\n \"message_read\": true,\n \"message_reply\": true,\n \"message_send\": true,\n \"message_update\": true,\n \"metrics_read\": true,\n \"pod_create\": true,\n \"pod_delete\": true,\n \"pod_read\": true,\n \"pod_update\": true,\n \"webhook_create\": true,\n \"webhook_delete\": true,\n \"webhook_read\": true,\n \"webhook_update\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"api_key_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"prefix": "<string>",
"type": "bearer",
"updated_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"inbox_id": "<string>",
"permissions": {
"account_update": true,
"api_key_create": true,
"api_key_delete": true,
"api_key_read": true,
"api_key_update": true,
"app_connect": true,
"app_share_owner": true,
"calendar_event_create": true,
"calendar_event_delete": true,
"calendar_event_read": true,
"calendar_event_update": true,
"calendar_read": true,
"calendar_update": true,
"domain_create": true,
"domain_delete": true,
"domain_read": true,
"domain_update": true,
"draft_create": true,
"draft_delete": true,
"draft_read": true,
"draft_send": true,
"draft_update": true,
"inbox_create": true,
"inbox_delete": true,
"inbox_read": true,
"inbox_update": true,
"label_blocked_read": true,
"label_spam_read": true,
"label_trash_read": true,
"label_unauthenticated_read": true,
"list_entry_create": true,
"list_entry_delete": true,
"list_entry_read": true,
"message_delete": true,
"message_read": true,
"message_reply": true,
"message_send": true,
"message_update": true,
"metrics_read": true,
"pod_create": true,
"pod_delete": true,
"pod_read": true,
"pod_update": true,
"webhook_create": true,
"webhook_delete": true,
"webhook_read": true,
"webhook_update": true
},
"pod_id": "<string>",
"used_at": "2023-11-07T05:31:56Z"
}Request contract
- Method and path: PATCH /apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}
- api_key_id: path; required
- inbox_id: path; required
- Runtime facts: 18a04e28941fae19674c11246b677373368b6bd927b7c146220cec1f168f4639
{
"operationId": "patch_any_agentmail_apis_v1_agentmail_inboxes_inb_9e18e8",
"method": "PATCH",
"path": "/apis/v1/agentmail/inboxes/{inbox_id}/api-keys/{api_key_id}",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"in": "path",
"name": "api_key_id",
"required": true,
"schema": {
"description": "ID of api key.",
"title": "ApiKeyId",
"type": "string"
}
},
{
"in": "path",
"name": "inbox_id",
"required": true,
"schema": {
"description": "The ID of the inbox.",
"title": "InboxId",
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"description": "Rename a credential or change its permissions. Key material, type,\nscope, and expiry are immutable.",
"properties": {
"name": {
"description": "Name of api key.",
"title": "Name",
"type": "string"
},
"permissions": {
"description": "Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.",
"properties": {
"account_update": {
"description": "Update accounts: disable or re-enable an inbox's sign-in at an app. Reading accounts\nneeds only `inbox_read`.",
"type": "boolean"
},
"api_key_create": {
"description": "Create API keys.",
"type": "boolean"
},
"api_key_delete": {
"description": "Delete API keys.",
"type": "boolean"
},
"api_key_read": {
"description": "Read API keys.",
"type": "boolean"
},
"api_key_update": {
"description": "Update API keys.",
"type": "boolean"
},
"app_connect": {
"description": "Sign in to apps as an inbox: connect an app, authorize an inbox, and mint the\nsign-in keys. Omitted on a new bearer key means false, whatever else the key holds.",
"type": "boolean"
},
"app_share_owner": {
"description": "Share the organization owner's name and email with apps at sign-in. One permission\nfor both values.",
"type": "boolean"
},
"calendar_event_create": {
"description": "Create calendar events.",
"type": "boolean"
},
"calendar_event_delete": {
"description": "Delete calendar events.",
"type": "boolean"
},
"calendar_event_read": {
"description": "Read calendar events, and receive `calendar.event.*` webhook and WebSocket events.",
"type": "boolean"
},
"calendar_event_update": {
"description": "Update calendar events and respond to invitations.",
"type": "boolean"
},
"calendar_read": {
"description": "Read inbox calendar settings.",
"type": "boolean"
},
"calendar_update": {
"description": "Update inbox calendar settings.",
"type": "boolean"
},
"domain_create": {
"description": "Create domains.",
"type": "boolean"
},
"domain_delete": {
"description": "Delete domains.",
"type": "boolean"
},
"domain_read": {
"description": "Read domain details.",
"type": "boolean"
},
"domain_update": {
"description": "Update domains.",
"type": "boolean"
},
"draft_create": {
"description": "Create drafts.",
"type": "boolean"
},
"draft_delete": {
"description": "Delete drafts.",
"type": "boolean"
},
"draft_read": {
"description": "Read drafts.",
"type": "boolean"
},
"draft_send": {
"description": "Send drafts.",
"type": "boolean"
},
"draft_update": {
"description": "Update drafts.",
"type": "boolean"
},
"inbox_create": {
"description": "Create new inboxes.",
"type": "boolean"
},
"inbox_delete": {
"description": "Delete inboxes.",
"type": "boolean"
},
"inbox_read": {
"description": "Read inbox details.",
"type": "boolean"
},
"inbox_update": {
"description": "Update inbox settings.",
"type": "boolean"
},
"label_blocked_read": {
"description": "Access messages labeled blocked.",
"type": "boolean"
},
"label_spam_read": {
"description": "Access messages labeled spam.",
"type": "boolean"
},
"label_trash_read": {
"description": "Access messages labeled trash.",
"type": "boolean"
},
"label_unauthenticated_read": {
"description": "Access messages labeled unauthenticated.",
"type": "boolean"
},
"list_entry_create": {
"description": "Create list entries.",
"type": "boolean"
},
"list_entry_delete": {
"description": "Delete list entries.",
"type": "boolean"
},
"list_entry_read": {
"description": "Read list entries.",
"type": "boolean"
},
"message_delete": {
"description": "Delete messages. Also required to delete threads.",
"type": "boolean"
},
"message_read": {
"description": "Read messages. Also required to read threads.",
"type": "boolean"
},
"message_reply": {
"description": "Reply and reply-all when the request is signed with a registered public key. Bearer keys reply with `message_send`.",
"type": "boolean"
},
"message_send": {
"description": "Send messages.",
"type": "boolean"
},
"message_update": {
"description": "Update message labels. Also required to update threads.",
"type": "boolean"
},
"metrics_read": {
"description": "Read metrics.",
"type": "boolean"
},
"pod_create": {
"description": "Create pods.",
"type": "boolean"
},
"pod_delete": {
"description": "Delete pods.",
"type": "boolean"
},
"pod_read": {
"description": "Read pods.",
"type": "boolean"
},
"pod_update": {
"description": "Update pods.",
"type": "boolean"
},
"webhook_create": {
"description": "Create webhooks.",
"type": "boolean"
},
"webhook_delete": {
"description": "Delete webhooks.",
"type": "boolean"
},
"webhook_read": {
"description": "Read webhook configurations.",
"type": "boolean"
},
"webhook_update": {
"description": "Update webhooks.",
"type": "boolean"
}
},
"title": "ApiKeyPermissions",
"type": "object"
}
},
"title": "UpdateApiKeyRequest",
"type": "object"
}
}
}
},
"x-aisa-status": "enabled",
"x-aisa-pricing": {
"cost_contract": "explicit_zero",
"customer_pricing": "fixed_success",
"default_request_estimate_usd": 0.012,
"estimate_source": "profile_seed",
"evidence_source": "request_snapshot"
},
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Published reference price: $0.012 USD per successful request. Account-specific pricing and final settlement may differ. Published reference values are not an account-specific quote or a settled charge. For endpoints supporting X-AISA-Cost-Mode: quote, obtain a free quote for your exact request before execution; reconcile the settled cost with response metadata and Usage Logs. USD amounts use 1,000,000 integer micro-USD per dollar.- Default request reference estimate (USD): 0.012
- Cost contract: explicit_zero
- Settlement evidence source: request_snapshot
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Rename a credential or change its permissions. Key material, type, scope, and expiry are immutable.
Response
Response with status 200
- BearerApiKey
- PublicKeyCredential
An API key presented as a bearer token in the Authorization header.
ID of api key.
Time at which api key was created.
Name of api key.
Prefix of api key.
bearer Time at which api key was last updated.
Time at which api key expires. Omitted when it does not expire.
Inbox ID the api key is scoped to. If set, the key can only access resources within this inbox.
Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.
Show child attributes
Show child attributes
Pod ID the api key is scoped to. If set, the key can only access resources within this pod.
Time at which api key was last used.