curl --request POST \
--url https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys"
payload = {}
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({})
};
fetch('https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys', 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",
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([
]),
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"
payload := strings.NewReader("{}")
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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys")
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 = "{}"
response = http.request(request)
puts response.read_body{
"api_key": "<string>",
"api_key_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"prefix": "<string>",
"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>"
}List And Create Inbox API Keys
curl --request POST \
--url https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys"
payload = {}
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({})
};
fetch('https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys', 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",
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([
]),
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"
payload := strings.NewReader("{}")
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.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys")
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 = "{}"
response = http.request(request)
puts response.read_body{
"api_key": "<string>",
"api_key_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"prefix": "<string>",
"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>"
}Request contract
- Method and path: POST /apis/v1/agentmail/inboxes/{inbox_id}/api-keys
- Availability: enabled
- Request URL template: https://api.aisa.one/apis/v1/agentmail/inboxes/{inbox_id}/api-keys
- inbox_id: path; required
- Runtime facts: 18a04e28941fae19674c11246b677373368b6bd927b7c146220cec1f168f4639
{
"operationId": "post_any_agentmail_apis_v1_agentmail_inboxes_inbo_5d0d22",
"method": "POST",
"path": "/apis/v1/agentmail/inboxes/{inbox_id}/api-keys",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"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": "A body with `public_key` registers a public-key credential; any other\nbody mints a bearer key.",
"oneOf": [
{
"description": "`expires_at` must be in the future and is immutable once the key exists.\nOmitted, the new key inherits the authenticating key's expiry, and never\nexpires only when that key never does. A key cannot create one that\noutlives it: an `expires_at` later than the authenticating key's own\nreturns `403`.",
"properties": {
"expires_at": {
"description": "Time at which api key expires. Omitted when it does not expire.",
"format": "date-time",
"title": "ExpiresAt",
"type": "string"
},
"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": "CreateBearerApiKeyRequest",
"type": "object"
},
{
"description": "Registers a public P-256 JWK at the route's scope. `type` and\n`api_key_id` are server-owned. `name` defaults to\n`AgentID key {first eight fingerprint characters}`; `permissions`\ndefaults to the registering key's, and only grants it holds may be\ntrue; `expires_at` defaults to the registering key's expiry and is\nindependent of that key afterward.",
"properties": {
"client_id": {
"description": "Caller-chosen alias for a public key, unique within the organization and\nreusable after deletion. Accepted in place of `api_key_id` on get, update,\nand delete. Registration is idempotent on it: the same alias returns the\nexisting key, a conflicting one returns `409`. URL-safe; no slash or `@`.",
"title": "PublicKeyClientId",
"type": "string"
},
"expires_at": {
"description": "Time at which api key expires. Omitted when it does not expire.",
"format": "date-time",
"title": "ExpiresAt",
"type": "string"
},
"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"
},
"public_key": {
"description": "A public P-256 JWK. The object accepts exactly `kty`, `crv`, `x`, and `y`.\nPrivate key material such as `d`, embedded key IDs, and all other members\nare rejected. The server also rejects coordinates that are not a point on\nP-256.",
"properties": {
"crv": {
"enum": [
"P-256"
],
"type": "string"
},
"kty": {
"enum": [
"EC"
],
"type": "string"
},
"x": {
"description": "A 32-byte P-256 coordinate encoded as unpadded base64url.",
"maxLength": 43,
"minLength": 43,
"pattern": "^[A-Za-z0-9_-]{43}$",
"title": "PublicJwkCoordinate",
"type": "string"
},
"y": {
"description": "A 32-byte P-256 coordinate encoded as unpadded base64url.",
"maxLength": 43,
"minLength": 43,
"pattern": "^[A-Za-z0-9_-]{43}$",
"title": "PublicJwkCoordinate",
"type": "string"
}
},
"required": [
"kty",
"crv",
"x",
"y"
],
"title": "PublicJwk",
"type": "object"
}
},
"required": [
"public_key"
],
"title": "CreatePublicKeyRequest",
"type": "object"
}
],
"title": "CreateApiKeyRequest"
}
}
}
},
"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.
Path Parameters
The ID of the inbox.
Body
- CreateBearerApiKeyRequest
- CreatePublicKeyRequest
expires_at must be in the future and is immutable once the key exists.
Omitted, the new key inherits the authenticating key's expiry, and never
expires only when that key never does. A key cannot create one that
outlives it: an expires_at later than the authenticating key's own
returns 403.
Time at which api key expires. Omitted when it does not expire.
Name of api key.
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
Response
Response with status 200
- CreateApiKeyResponse
- PublicKeyCredential
The secret-bearing bearer key, or the registered public key without any secret.
API key.
ID of api key.
Time at which api key was created.
Name of api key.
Prefix of api key.
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.