API reference

Apps and keys

An app has two environments (sandbox, production). API keys are created and revoked here, with the portal session.

View this page as Markdown

Create an app (with its sandbox and production environments)#

POST/apps

Authentication
Portal session (Bearer ses_…)

Request body (JSON)

FieldTypeDescription
namestringrequiredName shown in the console (2 to 80 characters). Unique per app within your account.

Example

bash
curl -X POST "$INBOX_API/apps" \
  -H "Authorization: Bearer $INBOX_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My CRM"
  }'
Response · 201 Created
{
  "id": "8b2717b6-be9e-42c7-8889-6e3c6ea4cbe3",
  "name": "My CRM",
  "createdAt": "2026-11-12T08:33:45.324Z",
  "environments": [
    {
      "id": "7d3d2aa8-d312-48d7-894c-25b906dfa11a",
      "kind": "sandbox"
    },
    {
      "id": "badd0f25-05da-4716-8c28-f2fe1baba427",
      "kind": "production"
    }
  ]
}

List the account's apps#

GET/apps

Authentication
Portal session (Bearer ses_…)

Example

bash
curl "$INBOX_API/apps" \
  -H "Authorization: Bearer $INBOX_SESSION"
Response · 200 OK
[
  {
    "id": "8b2717b6-be9e-42c7-8889-6e3c6ea4cbe3",
    "name": "My CRM",
    "createdAt": "2026-11-12T08:33:45.324Z",
    "environments": [
      {
        "id": "7d3d2aa8-d312-48d7-894c-25b906dfa11a",
        "kind": "sandbox"
      },
      {
        "id": "badd0f25-05da-4716-8c28-f2fe1baba427",
        "kind": "production"
      }
    ]
  }
]

Generate an API key. The secret is shown only once.#

POST/apps/{appId}/keys

Authentication
Portal session (Bearer ses_…)

Parameters

NameLocationTypeDescription
appIdrequiredpathstringApp ID.

Request body (JSON)

FieldTypeDescription
namestringrequiredName shown in the console (2 to 80 characters). Unique per app within your account.
environmentstringrequiredKey environment: sandbox for testing, production for sending to real recipients.Values: sandbox, production
scopesstring[]requiredScopes of the key. A key can only do what it has been granted. Values: messages:send, messages:read, templates:manage, webhooks:manage, connections:read, connections:manage, usage:read.Values: messages:send, messages:read, templates:manage, webhooks:manage, connections:read, connections:manage, usage:read

Example

bash
curl -X POST "$INBOX_API/apps/APP_ID/keys" \
  -H "Authorization: Bearer $INBOX_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Local dev",
    "environment": "sandbox",
    "scopes": [
      "messages:send",
      "messages:read",
      "connections:manage",
      "connections:read",
      "templates:manage",
      "webhooks:manage",
      "usage:read"
    ]
  }'
Response · 201 Created
{
  "id": "5ef37bc9-8aac-43ef-81b1-6bb3bdb66e78",
  "name": "Local dev",
  "prefix": "pk_test_bwcA3X-A",
  "environment": "sandbox",
  "scopes": [
    "messages:send",
    "messages:read",
    "connections:manage",
    "connections:read",
    "templates:manage",
    "webhooks:manage",
    "usage:read"
  ],
  "lastUsedAt": null,
  "revokedAt": null,
  "createdAt": "2026-11-12T08:33:45.382Z",
  "secret": "pk_test_26f602c48c47ef280792fd3a506473688df70b80118"
}

List an app's keys (without the secret)#

GET/apps/{appId}/keys

Authentication
Portal session (Bearer ses_…)

Parameters

NameLocationTypeDescription
appIdrequiredpathstringApp ID.

Example

bash
curl "$INBOX_API/apps/APP_ID/keys" \
  -H "Authorization: Bearer $INBOX_SESSION"
Response · 200 OK
[
  {
    "id": "5ef37bc9-8aac-43ef-81b1-6bb3bdb66e78",
    "name": "Local dev",
    "prefix": "pk_test_bwcA3X-A",
    "environment": "sandbox",
    "scopes": [
      "messages:send",
      "messages:read",
      "connections:manage",
      "connections:read",
      "templates:manage",
      "webhooks:manage",
      "usage:read"
    ],
    "lastUsedAt": null,
    "revokedAt": null,
    "createdAt": "2026-11-12T08:33:45.382Z"
  }
]

Revoke an API key#

DELETE/apps/{appId}/keys/{keyId}

Authentication
Portal session (Bearer ses_…)

Parameters

NameLocationTypeDescription
keyIdrequiredpathstringAPI key ID.

Example

bash
curl -X DELETE "$INBOX_API/apps/APP_ID/keys/KEY_ID" \
  -H "Authorization: Bearer $INBOX_SESSION"
Response · 204 No Content
(no content)