string
required
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Owner-facing provisioning and management of your genie’s email inbox
agent-mailboxes-self is the owner-facing surface for managing the email inbox attached to your own genie. Every action is scoped to the caller’s genie — you can only manage mailboxes you own.
get action (documented below) or the genies resource (get or all action), which includes a mailbox field in every full genie response."agent-mailboxes-self""get"Show properties
null if provisioning is still in progress.null."provisioned", "pending", "failed", "suspended", or "unavailable".null.null if not set.const mailbox = await ApiService.invoke("agent-mailboxes-self", "get", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
});
console.log(mailbox.email_address); // e.g. "support-bot@mail.helpgenie.ai"
console.log(mailbox.status); // e.g. "provisioned"
console.log(mailbox.escalation_address); // e.g. "oncall@example.com" or null
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "get",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000"
}
}'
{
"success": true,
"data": {
"id": "mbx-uuid-001",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"email_address": "support-bot@mail.helpgenie.ai",
"account_id": "acct-abc123",
"grant_id": null,
"status": "provisioned",
"last_error": null,
"test_mode": false,
"escalation_address": "oncall@example.com",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:30:00.000Z"
}
}
desiredLocalpart is provided and the genie already has a mailbox, the existing inbox is deprovisioned and a new one is created at the requested address.
"agent-mailboxes-self""provision"Show properties
@). Must be 2–40 characters, using only lowercase letters, digits, and hyphens. Cannot start or end with a hyphen. Omit to let the system choose an address automatically.When provided for a genie that already has a mailbox, the current mailbox is deprovisioned and a new one is created at the requested address.Show properties
null if provisioning is still in progress.null."provisioned", "pending", "failed", or "suspended".null.null if not set.desiredLocalpart is provided for a genie that already has a mailbox, the existing inbox is permanently deprovisioned before the new one is created. Any emails in the old inbox will be lost.// Provision with a custom address prefix
const mailbox = await ApiService.invoke("agent-mailboxes-self", "provision", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
desiredLocalpart: "support-bot",
});
// Provision with a system-chosen address
const mailbox = await ApiService.invoke("agent-mailboxes-self", "provision", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "provision",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"desiredLocalpart": "support-bot"
}
}'
{
"success": true,
"data": {
"id": "mbx-uuid-001",
"agent_id": "550e8400-e29b-41d4-a716-446655440000",
"email_address": "support-bot@mail.helpgenie.ai",
"account_id": "acct-abc123",
"grant_id": null,
"status": "provisioned",
"last_error": null,
"test_mode": false,
"escalation_address": null,
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-15T10:30:00.000Z"
}
}
action, escalation_address, or test_mode must be provided.
"agent-mailboxes-self""update"Show properties
"suspend" or "resume". Omit to leave the current status unchanged.null to clear the current value. Omit this key entirely to leave it unchanged.true, the mailbox processes emails in a sandboxed mode. Stored locally and synced to the mail service to keep both sides in agreement.// Suspend the mailbox
await ApiService.invoke("agent-mailboxes-self", "update", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
action: "suspend",
});
// Set an escalation address
await ApiService.invoke("agent-mailboxes-self", "update", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
escalation_address: "oncall@example.com",
});
// Resume and clear escalation at the same time
await ApiService.invoke("agent-mailboxes-self", "update", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
action: "resume",
escalation_address: null,
});
// Enable test mode
await ApiService.invoke("agent-mailboxes-self", "update", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
test_mode: true,
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "update",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"action": "suspend"
}
}'
{
"success": true,
"data": { "ok": true }
}
"agent-mailboxes-self""delete"404 from the mail system is treated as success. The genie itself is not affected.await ApiService.invoke("agent-mailboxes-self", "delete", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "delete",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000"
}
}'
{
"success": true,
"data": { "ok": true }
}
"agent-mailboxes-self""test"const result = await ApiService.invoke("agent-mailboxes-self", "test", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "test",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000"
}
}'
{
"success": true,
"data": { "queued": true }
}
"agent-mailboxes-self""conversations"Show properties
"open", "escalated", or "closed"."replied", "escalated", "ignored")."date_asc", "date_desc", "sender_asc", or "sender_desc".const response = await ApiService.invoke("agent-mailboxes-self", "conversations", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
state: "open",
limit: 20,
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "conversations",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"state": "open",
"limit": 20
}
}'
"agent-mailboxes-self""conversation-detail"const response = await ApiService.invoke("agent-mailboxes-self", "conversation-detail", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
conversationId: "mail-conv-abc123",
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "conversation-detail",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"conversationId": "mail-conv-abc123"
}
}'
"agent-mailboxes-self""reply"const result = await ApiService.invoke("agent-mailboxes-self", "reply", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
conversationId: "mail-conv-abc123",
body_text: "Thanks for reaching out — I'll look into this and follow up shortly.",
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "reply",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"conversationId": "mail-conv-abc123",
"body_text": "Thanks for reaching out — I'\''ll look into this and follow up shortly."
}
}'
status, email_address, or last_error must be provided.
"agent-mailboxes-self""sync"Show properties
await ApiService.invoke("agent-mailboxes-self", "sync", undefined, {
agentId: "550e8400-e29b-41d4-a716-446655440000",
status: "provisioned",
email_address: "support-bot@mail.helpgenie.ai",
last_error: null,
});
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "sync",
"data": {
"agentId": "550e8400-e29b-41d4-a716-446655440000",
"status": "provisioned",
"email_address": "support-bot@mail.helpgenie.ai",
"last_error": null
}
}'
FORBIDDEN error."agent-mailboxes-self""check-tenant-key"const result = await ApiService.invoke("agent-mailboxes-self", "check-tenant-key");
console.log(result.status); // e.g. "active"
console.log(result.revokedAt); // null if still valid
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "check-tenant-key"
}'
{
"success": true,
"data": {
"status": "active",
"revokedAt": null,
"tenantId": "tenant-abc123"
}
}
check-tenant-key reports that credentials are invalid or revoked.
FORBIDDEN error.check-tenant-key confirms the existing credentials are no longer valid."agent-mailboxes-self""reprovision-tenant-key"const result = await ApiService.invoke("agent-mailboxes-self", "reprovision-tenant-key");
console.log(result.tenantId);
curl -X POST https://api.helpgenie.ai/v1 \
-H "Authorization: Bearer hg_live_YOUR_ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"resource": "agent-mailboxes-self",
"action": "reprovision-tenant-key"
}'
{
"success": true,
"data": {
"tenantId": "tenant-abc123"
}
}
| Code | Status | Description |
|---|---|---|
UNAUTHORIZED | 401 | Caller does not own the specified genie |
FORBIDDEN | 403 | Admin-only action called by a non-admin |
NOT_FOUND | 404 | Genie, mailbox, or mail credentials not found |
VALIDATION_ERROR | 400 | Missing agentId, conversationId, or body_text; invalid desiredLocalpart; no update fields provided; invalid escalation_address; invalid test_mode type; or mailbox already exists when no rename is requested |
INVALID_ACTION | 400 | Unknown action |
INTERNAL_ERROR | 500 | Mail system error or local sync failure |
