iMessage API
API-first iMessage for AI agents. Use the shared Inkbox iMessage router or attach a dedicated number, then read and send messages, use tapbacks, read receipts, typing indicators, and media, and subscribe to events via webhooks.
API base URL:
https://inkbox.ai/api/v1/imessageQuick start
Create an account and get your API key from the Inkbox console:
All API requests require authentication using an API key:
X-API-Key: YOUR_API_KEYThree things to know before your first call:
- iMessage is opt-in per identity. Set
imessage_enabled: truewhen creating or updating an identity. - The number type defines what the identity can do. An outbound number can start new conversations. An inbound number can reply in existing conversations. The shared service dynamically assigns a number when someone connects to your agent.
- Shared and inbound conversations start with the human. Recipients connect to a shared identity by texting
connect @your-handleto the router number. A dedicated outbound number can start a new conversation. - Group chats require a dedicated outbound number. Use the existing send endpoint with 2-8 E.164 recipients, then keep the returned
conversation_idas the canonical group key. Creation is asynchronous, and conversation reads reportgroup_creation_statusascreating,not_created, orready. Existing lists exclude groups unlessinclude_groups=true.
Dedicated numbers
Dedicated numbers belong to your organization and can be attached to an iMessage-enabled identity. The type field is the capability source:
| Type | Capability |
|---|---|
dedicated_outbound | Outbound: Can start new 1:1 conversations and group chats. |
dedicated_inbound | Inbound: Can reply in existing conversations. |
| Shared service | Shared: Dynamically assigned when someone connects to your agent. |
List dedicated numbers GET
GET /numbersReturns every dedicated iMessage number owned by the caller's organization, including numbers that are not attached to an identity.
Response (200)
| Field | Type | Description |
|---|---|---|
id | UUID | Dedicated-number identifier |
number | string | iMessage number in E.164 format |
type | string | dedicated_inbound or dedicated_outbound; this field defines the number's capabilities |
status | string | active; existing numbers may return paused as a read-only compatibility value. This field cannot be set through number or identity update requests. |
agent_identity_id | UUID | null | Attached identity ID, or null when unattached |
agent_handle | string | null | Attached identity handle, or null when unattached |
Claim a dedicated number POST
POST /numbersClaims one unattached dedicated number for the organization. Use an admin API key, or manage dedicated numbers from the Inkbox Console.
The request requires a stable key in the Idempotency-Key header:
Idempotency-Key: <unique stable key>Request body
type may be dedicated_inbound or dedicated_outbound.
Response (201)
Returns one unattached dedicated-number object with the same schema as the list endpoint:
Idempotency
- Retry the same logical claim with the same key to receive its original result.
- Reusing the key with different input returns
409. - Generate a new key only for a genuinely new claim.
Error responses
| Status | Description |
|---|---|
| 402 | Your organization's quota does not permit another number. Review billing in the Inkbox Console or contact support@inkbox.ai. |
| 403 | This operation requires an admin API key or the Inkbox Console. |
| 409 | The Idempotency-Key was already used with incompatible input. Use the original input, or use a new key for a genuinely new claim. |
| 422 | The request is invalid, including when Idempotency-Key is missing or type is not a supported dedicated-number type. |
| 503 | Inventory is temporarily unavailable. Honor Retry-After: brief contention may return 5 seconds, while depletion may return 3600 seconds. The response may say that a number is expected within 24 hours. |
Attach or detach an organization-owned number through PATCH /api/v1/identities/{agent_handle}. Detaching does not release the number; there is no customer-facing number-release endpoint.
Router
Messaging capability
Messages
Send message
POSTSend 1:1 iMessages or dedicated-outbound group messages
/api/v1/imessage/messagesList messages
GETList iMessages visible to the caller, newest first
/api/v1/imessage/messagesUpload media
POSTUpload a file and get a URL usable in media_urls
/api/v1/imessage/mediaDedicated outbound group chats use these same message and conversation routes; there is no separate group-send endpoint.
Conversations
List conversations
GETList conversation summaries with latest-message previews and unread counts
/api/v1/imessage/conversationsGet conversation
GETGet a single conversation by ID
/api/v1/imessage/conversations/{conversation_id}List connections
GETList recipients currently connected to an agent identity
/api/v1/imessage/assignmentsMark conversation read
POSTSend a read receipt and mark inbound messages read
/api/v1/imessage/mark-readSend typing indicator
POSTShow the typing bubble to the conversation's recipient
/api/v1/imessage/typingTapbacks
Contact rules
Per-identity allow and block rules interpreted against the identity's iMessage filter_mode (blacklist by default, whitelist on demand). Rules stay scoped to the agent identity whether it uses the shared service or a dedicated number. See the Contact rules reference and the iMessage guide for semantics.
List contact rules
GETList allow/block rules for an agent identity
/api/v1/imessage/identities/{agent_handle}/contact-rulesCreate contact rule
POSTAdd an allow or block rule (E.164 exact match)
/api/v1/imessage/identities/{agent_handle}/contact-rulesGet contact rule
GETFetch a single rule by ID
/api/v1/imessage/identities/{agent_handle}/contact-rules/{rule_id}Update contact rule
PATCHChange a rule's action (admin-only)
/api/v1/imessage/identities/{agent_handle}/contact-rules/{rule_id}Delete contact rule
DELETEDelete a rule (admin-only)
/api/v1/imessage/identities/{agent_handle}/contact-rules/{rule_id}List org iMessage contact rules
GETOrg-wide aggregate list across every identity (admin-only)
/api/v1/imessage/contact-rulesWebhooks
Inbound events (imessage.received, imessage.reaction_received) and outbound delivery-lifecycle events (imessage.sent, imessage.delivered, imessage.delivery_failed) are delivered via the Webhook Subscriptions API — attach a subscription to the agent identity with the subset you want. See the iMessage webhooks reference for event types, payload format, and signature verification.
Filtering by date
Date filtering applies to two list endpoints — List messages (GET /messages) and List conversations (GET /conversations). These accept three optional query parameters that filter results by when each record was created (created_at, stored in UTC); other iMessage list endpoints (such as list connections and list contact rules) do not support them. All three are optional and fully backwards-compatible — omit them and the endpoint behaves exactly as before, with no filtering applied.
| Parameter | Type | Default | Description |
|---|---|---|---|
start_datetime | string | — | Inclusive lower bound. A bare date (2026-07-01) starts at 00:00 of that day; a datetime with a Z or offset is used as an exact instant |
end_datetime | string | — | Upper bound, inclusive. A bare date (2026-07-06) covers the whole day; a datetime with a Z or offset is an exact instant, and records created at exactly that instant are included |
tz | string | UTC | IANA time zone (e.g. America/New_York) used to interpret zone-less values. Defaults to UTC |
- A bare date in
end_datetimeis inclusive of the entire day —end_datetime=2026-07-06returns records through the last moment of the 6th. - A datetime with an explicit
Zor offset (2026-07-06T15:30:00Z,2026-07-06T11:30:00-04:00) is an exact instant;tzis ignored for that value. - A naive datetime (
2026-07-01T12:00:00) is interpreted intz(UTC whentzis omitted). - Supply only one side for an open-ended range. Ordering, pagination, and all other filters are unchanged.
- Invalid input returns
422:start_datetimeafterend_datetime, an unparseable date, or an unknown time zone.
A bare-date range (interpreted in UTC):
?start_datetime=2026-07-01&end_datetime=2026-07-06Interpret those bare dates in a specific zone:
?start_datetime=2026-07-01&end_datetime=2026-07-06&tz=America/New_YorkFilter from an exact instant (tz ignored):
?start_datetime=2026-07-06T15:30:00Z