Texting and inbox

Read calls, voicemails, and texts in one history. Send from a business number, check delivery, and share reusable replies with your team.

The activity model

Messages use shared persistence (messages and message_send_attempts), rather than separate SMS and MMS tables. A message retains its identity across retries; each provider submission has its own potentially chargeable attempt. Sending supports SMS only. Incoming inMobile MMS attachments are persisted alongside messages and can be retrieved when Message attachments is enabled. Sending uses /business_numbers/:id/messages, retrieval uses /messages/:id, and explicit retries use /messages/:message_id/retries. The unused proof-of-concept /business_numbers/:id/sms_messages sending route is not exposed. The optional send body format defaults to sms; MMS is rejected before any provider request. Message activity uses type: "message" with a separate format: "sms". Future formats share the same message activity type.

List grouped previews with GET /api/v1/inbox, load a number's timeline with GET /api/v1/inbox/:phone_number/activity, and mark observed items seen with POST /api/v1/inbox/:phone_number/seen. The existing /api/v1/activity/unseen endpoint includes people with unseen incoming SMS when messaging is enabled.

Messages create or update the external phone number's contact touchpoint, advancing last_contact_at like calls and voicemails. Web and API inbox aggregation includes calls, voicemails, and Notes, plus messages when the company's messaging feature flag is enabled. Notes are written messages taken by the receptionist, not SMS, and remain available with messaging disabled. With messaging disabled, SMS is excluded from timelines, previews, unseen counts, and seen updates. Unknown activity types are skipped by the web renderer. The inbox API derives message ordering directly from message timestamps.

A conversation is a grouped view of activity for a company and external phone number. There is no conversation resource to create, no conversation ID, and no requirement to save a named contact before texting. Business-number filters narrow that view without changing the underlying records.

Use the existing contacts API for recipient details and the caller context API for integration panels. Every endpoint below accepts company API keys or OAuth tokens. Sending and retrying additionally require a current employee belonging to that company.

Properties

  • Name
    id
    Type
    string
    Description
    Stable public record ID. SMS IDs identify stored Phone.inc messages, not provider send attempts.
  • Name
    type
    Type
    string
    Description
    One of call, voicemail, note, or message. Notes use the separate Note model, not the SMS-specific fields below.
  • Name
    format
    Type
    string
    Description
    Message format, currently sms. Present only on message items; future formats use the same message activity type.
  • Name
    created_at
    Type
    string
    Description
    ISO 8601 UTC timestamp with microseconds. For incoming SMS this is when Phone.inc stored the message; received_at retains the provider timestamp.
  • Name
    business_number_id
    Type
    string
    Description
    Business number public ID for this activity.
  • Name
    business_number_name
    Type
    string | null
    Description
    Business number label.
  • Name
    seen_at
    Type
    string | null
    Description
    Shared team seen timestamp. Incoming texts start unseen.
  • Name
    direction
    Type
    string
    Description
    Inbound or outbound.
  • Name
    from / to
    Type
    string
    Description
    Phone numbers in E.164, except incoming SMS from may contain an alphanumeric sender ID such as CryoVital (up to 11 ASCII letters, digits, or spaces, including at least one letter). Sender IDs are preserved as received and cannot receive replies. Voicemail items include from only.
  • Name
    text
    Type
    string
    Description
    SMS body, encrypted at rest. Present on SMS items, not on call or voicemail items.
  • Name
    author
    Type
    object
    Description
    SMS author: type is customer, employee, or automation. Employee authors include their public id and name when the employee still exists. Automation includes name: "Auto-reply".
  • Name
    status
    Type
    string
    Description
    SMS status: queued, accepted, delivered, failed, unknown, or received. Acceptance is not delivery. unknown includes provider timeouts and unknown delivery reports.
  • Name
    sms_count / encoding
    Type
    integer | null / string | null
    Description
    Provider-reported SMS segment count and gsm7 or ucs2 encoding. inMobile delivery reports can refresh these values after the initial send response. Segment count alone does not confirm a charge. May be null before acceptance, when the response was lost, or for DIDWW sends, whose acceptance response does not report these values.
  • Name
    received_at / delivered_at
    Type
    string | null
    Description
    Provider receive timestamp for incoming SMS, or confirmed delivery timestamp for outgoing SMS.
  • Name
    failure_code
    Type
    string | null
    Description
    Sanitized SMS failure code, such as provider_rejected, sending_unavailable, or inmobile_-1. Not a raw provider error message.
  • Name
    attachments
    Type
    array
    Description
    Only on GET /messages/:id when Message attachments is enabled. Ordered attachment metadata: id (public UUID), status (pending or ready), filename, content_type, and byte_size. Pending files have null file metadata. An empty list means no attachments. Omitted entirely when the flag is off. Download links require the attachment endpoint; inbox previews and activity responses do not include this field.
  • Name
    can_retry
    Type
    boolean
    Description
    True only for a definitively failed outgoing message whose sender still supports sending.
  • Name
    summary / duration / state / missed / employee / has_transcription
    Type
    call fields
    Description
    Call summary, duration in seconds, state, missed flag, nullable employee reference, and whether transcription is available. Fetch the existing call endpoint for full transcription.
  • Name
    transcription / recording_url / listened / call_id
    Type
    voicemail fields
    Description
    Voicemail transcript, playback URL, listened flag, and linked call public ID when present. Voicemails also include duration in seconds when known.

Inbox threads include phone_number, a nullable contact reference, last_activity_at, unseen_count, business_number_ids, reply_business_number_id, preview, and latest_item. The preview is limited to 160 characters. The latest-item metadata omits full text, summary, transcript, and recording URL; load activity for the full content. The suggested reply number is the latest item's number when it supports sending, otherwise null. Always select the sender explicitly for a send.

Thread unseen counts include incoming calls, voicemails, Notes, and incoming texts with no seen timestamp. Outgoing activity never contributes to unread counts, even if its seen timestamp is cleared. A voicemail and its linked missed call count as one item. The existing unseen activity API counts distinct people per business number rather than summing message counts. The unread endpoint includes Notes independently of messaging and incoming SMS when messaging is enabled. Partner tokens see only readable resource types and can acknowledge only writable ones; Notes require notes:read and, for seen updates, notes:write. The legacy /calls/seen endpoint remains calls-and-voicemails-only; use the inbox seen endpoint to acknowledge Notes and SMS. Clients should ignore unknown activity types and continue cursor pagination even when a page contains only unsupported items. A whole-thread seen acknowledgement applies to every writable activity type through its observation boundary, including items a client did not render.

Messaging capabilities

Read messaging from the business-number API:

{
  "messaging": {
    "sms": { "can_send": true, "can_receive": true },
    "mms": { "can_send": false, "can_receive": false }
  }
}

The company's messaging feature flag defaults to off and is managed by Phone.inc. Messaging endpoints (messages, retries, text snippets, and texting settings) return 404 while it is off. SMS is excluded from inbox previews, timelines, unseen counts, and seen updates. Sending requires this flag and provider capability, including queued sends, retries, and automatic replies. inMobile numbers need an associated inventory record marked SMS-capable. DIDWW numbers need a provisioned DID and a stored carrier feature snapshot containing p2p. Missing provider capability, an inactive number, a disallowed destination, or a plan without outbound messages makes messaging.sms.can_send false and rejects new sends with 422. Receive capability does not depend on the company messaging feature: authenticated carrier callbacks keep storing supported inbound messages and updating delivery state while messaging is off, so messages become visible when it is enabled. DIDWW directions are derived independently from carrier features; check can_send and can_receive separately. DIDWW numbers that can send support SMS sends, retries after definitive failures, and automatic replies through the same endpoints as inMobile. The number's existing provider handles voice and messaging. Inbound inMobile MMS attachments are stored, but the existing MMS send/receive capability flags remain false; they do not indicate attachment-history access.

Unsupported or inactive senders cannot send, retry, or dispatch queued attempts. Existing history remains available when the company's messaging flag is enabled; delivery callbacks continue regardless of that flag. The message endpoints are format-neutral; stored inbound MMS retains the existing sms format and exposes files separately through the attachment API. Automatic replies remain SMS-only and are not sent to alphanumeric sender IDs. Incoming messages from these IDs are stored and available through the message endpoint, but do not create phone-number contacts. Phone-number conversation endpoints do not accept sender IDs. Messages from alphanumeric sender IDs do not contribute to inbox unseen counts or unread badges.

Delivery, retries, and live updates

Send with the existing Send an SMS endpoint. Use a new idempotency key for each intentional send and reuse that key after a transport interruption. Keys are scoped to the sender business number. Reusing a key with changed recipient, body, or employee returns 409.

Messages are persisted before the provider request. A send error after persistence includes the stable message id. Check that record before taking further action. There are no automatic provider-request retries. A process interrupted after claiming an attempt leaves its state unknown, not safely retryable.

inMobile incoming messages and delivery callbacks use signature verification. DIDWW incoming messages use a server-configured bearer token over HTTPS. Incoming provider message IDs are deduplicated permanently while their SMS record exists, independently of receipt retention. Provider timestamps do not control the arrival/seen boundary. Texts and settings are not governed by call-data retention; they remain until their owning number or company is removed.

The authenticated CallsChannel sends sms_update notifications containing id and phone_number, plus unseen_update notifications. Treat these as invalidations: refresh the inbox, activity, or message endpoint. Refresh on reconnect as well. No message body is broadcast. Mobile background notification registration and delivery are not part of this API.

Incoming callbacks persist texts only for active business numbers belonging to the callback's provider. DIDWW numbers also require sms_in in their stored carrier features. Authenticated callbacks for unknown, inactive, or mismatched-provider numbers are archived and acknowledged without creating a message or reserving a receipt.

Canonical inMobile webhooks are /webhooks/inmobile/messages for incoming messages and /webhooks/inmobile/delivery_reports for outgoing delivery reports. The existing /webhooks/inmobile/sms and /webhooks/inmobile/sms_statuses URLs remain direct aliases, so existing provider configuration and preview callback URLs keep working.

DIDWW SMS directions come from the number’s stored carrier features: p2p supports outbound P2P SMS and sms_in supports inbound SMS. There are no separate per-number enablement switches. Company messaging, plan, active-number, and destination-country restrictions still apply to sending. A2P support does not imply outbound P2P support.

Phone.inc records these features during purchase provisioning, port completion, and temporary-number restoration. DID replacements update the feature snapshot with the DID; a missing DID group blocks the swap. Moving to an inventory provider clears DIDWW-specific feature data. A one-time migration fetches missing snapshots for existing active, unreleased DIDWW numbers with a carrier DID ID. It preserves all known snapshots, including an empty feature list. Numbers without stored carrier features report both SMS directions as unavailable until their features are populated. The stored features are not client-writable. Number search marks a DIDWW number SMS-capable only when its DID group supports both sms_in and p2p.

Operators can preview the backfill using the new revision’s backend code and the target environment’s DIDWW credentials and API mode:

bin/rails didww:backfill_features_dry_run

The dry run performs the same read-only DIDWW lookups and reports proposed updates. It does not write database records or mark the migration as applied. Apply through the normal database migration process after reviewing the output. Both modes log carrier errors (including 404s), missing group features, and mismatched DIDs, then continue with the next number. Failed numbers remain unchanged and are included in the summary error count; the migration can finish and be marked applied with outstanding lookup errors. Applied rows are committed individually. After resolving the errors, rerun the dry-run task to review remaining missing snapshots; retrying writes requires explicitly rerunning the backfill. Database write failures still stop the migration. Concurrent changes to the DID, phone number, provider, lifecycle, or snapshot are not overwritten. The backfill never changes carrier routing, and rollback does not clear snapshots.

Carrier support does not verify trunk configuration. Operators must configure inbound SMS routing in the DIDWW portal; an unassigned SMS IN trunk is a provisioning error, not a separate disabled state. The published DIDWW v3 API does not expose SMS trunk provisioning.

Outbound P2P SMS requires a verified DIDWW account and an HTTP OUT trunk whose source rules permit the DID. Configure DIDWW_SMS_USERNAME and DIDWW_SMS_PASSWORD, using the EU (AMS) endpoint (https://eu.sms-out.didww.com/outbound_messages). Outbound HTTP trunks do not use the inbound DID-to-trunk assignment. See DIDWW’s SMS service guide for the account verification requirement. DIDWW sends start as accepted after submission. Processing callbacks can report a failure or the fragment count, but only a delivery receipt confirms delivery. Provider timeouts remain unknown and cannot be retried automatically.

DIDWW outbound callbacks use POST /webhooks/didww/delivery_reports. Set a separate, randomly generated DIDWW_SMS_DELIVERY_WEBHOOK_TOKEN in each environment, then configure the HTTP OUT trunk’s Callback URL as https://<environment-host>/webhooks/didww/delivery_reports?token=<token>. Treat the full URL as a secret: do not share it in tickets or public logs. Rails filters the token from request logs; raw Rack tracing is disabled for this endpoint to avoid recording the query credential. Configure any external access logs to omit or redact the query string. This URL-based credential is specific to HTTP OUT callbacks, whose documented trunk settings do not offer custom authorization headers; it is separate from the HTTP IN bearer token below.

DIDWW sends JSON:API bodies with Content-Type: application/vnd.api+json. Both callback types correlate to the provider message ID stored on the individual send attempt:

  • outbound_message_callbacks: Success keeps the attempt accepted, never delivered. fragments_sent updates sms_count; price records the total carrier charge for all fragments on that send attempt, without multiplying by the fragment count. Routing error and Failed mark a definitive failure with a sanitized didww_<code_id> failure code.
  • dlr_event: DELIVERED, DELIVRD, DLVRD, DELIVERD, or DELIV marks delivery and sets delivered_at from time_start. DIDWW support confirms that carrier status spellings vary and that documented values are examples, not an exhaustive enum. Phone.inc accepts these exact confirmed spellings without fuzzy matching. FAILED and EXPIRED mark definitive failures. Unrecognized DLR statuses emit a structured WARN log containing the callback type, provider message ID, and JSON-escaped status, without the callback token, message content, or full payload. They remain unknown unless the attempt already has a final delivered or failed state, which is preserved. Warnings are emitted even for attempts already in a final state. Valid callbacks with unrecognized statuses are still acknowledged with 200; unknown status alone does not make a send retryable.

DIDWW carrier cost is stored internally as carrier_cost and carrier_cost_currency on each send attempt, separately from customer pricing. The callback does not include a currency field; Phone.inc records USD because DIDWW lists all rates in USD. Amounts use decimal storage with eight fractional digits. A missing or null price leaves cost unknown; an explicit zero records a known zero charge. Negative, nonnumeric, overprecision, or out-of-range prices reject the processing callback with 400 without changing the attempt. Duplicate callbacks never add another charge. If callbacks report different totals, the highest reported total is retained so a lower late callback cannot erase a charge. Delivery updates preserve cost, and a processing callback arriving after delivery can still populate it. Retries have separate cost records. Existing DIDWW attempts remain unknown unless a processing callback supplies a price. There is no historical cost backfill. inMobile reports provide charging metadata, not a monetary cost. Carrier costs are not included in customer API or MCP message responses.

Contact DIDWW support to enable DLR event notifications; setting the Callback URL alone does not enable them. See DIDWW’s callback documentation. Duplicate callbacks are safe. A delivered attempt cannot be downgraded by a late callback, and late processing success cannot clear a definitive failure. Callbacks still update existing attempts when messaging or outbound sending is disabled. An unknown provider ID returns 503 so DIDWW can retry if the callback arrived before the send response was saved; callbacks cannot be correlated if the send response was lost entirely. Missing server credentials also return 503, invalid credentials return 401, malformed callbacks return 400, and bodies above 16 KiB return 413.

DIDWW inbound SMS uses POST /webhooks/didww/messages. Phone.inc operators must configure an HTTP IN trunk and assign that trunk or its SMS trunk group to each inbound-capable DID in the DIDWW portal. There is no separate receive-enablement flag. Set a separate, randomly generated DIDWW_SMS_WEBHOOK_TOKEN in each environment and configure the trunk's Authorization header as Bearer <token>. Do not put the token in the request URL. Missing server configuration or missing inbound carrier support in the stored feature snapshot returns 503; invalid credentials return 401.

Configure the HTTP IN trunk body as JSON using DIDWW's variables:

{
  "message_id": "{SMS_UUID}",
  "from": "{SMS_SRC_ADDR}",
  "to": "{SMS_DST_ADDR}",
  "text_base64": "{SMS_TEXT_BASE64_ENCODED}",
  "received_at": "{SMS_TIME}"
}

Use Content-Type: application/json and the base64 text variable so quotes, line breaks, and Unicode do not corrupt the payload. received_at is DIDWW's HTTP-date timestamp. The DIDWW receiver accepts up to 64 KiB of UTF-8 text, matching DIDWW's documented transport limit; its request body is limited to 100,000 bytes. Outbound text is limited to 10,000 characters for every provider. Stored inbound messages have no application-level text-length limit; inMobile inbound text is not restricted by the outbound limit. DIDWW reassembles concatenated SMS before forwarding it. Successful delivery returns 200 with no body; malformed payloads return 400 and oversized requests return 413. DIDWW retries non-2xx deliveries for up to one hour. Duplicate message UUIDs are acknowledged without duplicating messages, notifications, or automatic replies.

For delivery callbacks, configure the server-owned INMOBILE_SMS_STATUS_CALLBACK_URL to your public /webhooks/inmobile/sms_statuses URL and configure InMobile signing keys through INMOBILE_WEBHOOK_PUBLIC_KEYS. The URL is attached to outgoing provider requests; clients cannot override it. Without a callback configuration, accepted messages cannot advance to confirmed delivery through this integration.

inMobile's status reports can include chargeInfo. Phone.inc stores isCharged as an internal, nullable carrier_charged flag on the send attempt: null means no explicit charging flag has been received, false means the provider says it will not charge, and true means it says it will charge. Supplied smsCount and encoding refresh the existing sms_count and encoding values. Absent or null chargeInfo preserves existing metadata; partial objects update only supplied fields. Supplied fields must have valid types and values, otherwise the entire report batch returns 400 without partial updates.

Charging is independent of delivery: failed messages can still be charged, and later billing metadata is processed even when delivery is already final. Once an attempt is reported charged, a later uncharged report cannot erase that flag or its segment/encoding metadata. Repeated identical reports do not add segments or rewrite unchanged state. Reports affect only the matching outbound inMobile attempt, so retries retain separate metadata. inMobile does not report a monetary amount or currency here; carrier_cost and carrier_cost_currency remain unknown rather than being estimated or set to zero. The charging flag is not exposed through customer API or MCP responses, and raw reports are not archived. Existing attempts are not backfilled, and DIDWW cost handling is unchanged.


GET/v1/inbox

List the inbox

Returns one thread per external phone number, newest activity first. Optional business_number_id restricts history to that number. query matches contact name, company name, or phone number (up to 128 characters); it does not search message bodies. unseen=true returns only threads with unseen timeline items. limit defaults to 50 and is clamped to 1–100. Pass next_cursor as cursor to load more. A cursor is bound to the company, business-number filter, query, and unseen filter; malformed or mismatched cursors return 422.

Request

GET
/v1/inbox
curl --get https://app.phone.inc/api/v1/inbox \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  --data-urlencode 'limit=50'

Response

{
  "threads": [
    {
      "phone_number": "+4523909778",
      "contact": null,
      "last_activity_at": "2026-10-06T10:41:00.000000Z",
      "unseen_count": 1,
      "business_number_ids": [
        "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01"
      ],
      "reply_business_number_id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
      "preview": "Is the basket included?",
      "latest_item": {
        "id": "019daef1-085e-73f0-85f6-a71e2d8dd2cc",
        "type": "message",
        "format": "sms",
        "business_number_id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
        "direction": "inbound",
        "status": "received"
      }
    }
  ],
  "next_cursor": null
}

GET/v1/inbox/:phone_number/activity

List activity

The phone_number path parameter identifies the external person. National-format numbers are normalized using the company's country; E.164 is recommended; URL-encode the leading + as %2B. Optional business_number_id filters the history. limit defaults to 50 and is clamped to 1–100. Items are newest first; render them in reverse order for a chat timeline. Pass next_cursor as cursor for older items. Stable tie-breaking prevents duplicate items when timestamps match. A voicemail replaces its linked call's timeline item. An unknown number returns an empty list and does not create a contact. The response includes the normalized E.164 phone_number and nullable contact reference for the conversation header; use that normalized number when sending from a national-number draft. Reading does not change seen state. Save observed_at for the mark-seen request. Cursor pages preserve that original observation timestamp, so paging through older history does not mark newer arrivals seen. Pass observed_at unchanged as a string when marking seen; converting it through a client date type can lose microsecond precision.

Request

GET
/v1/inbox/:phone_number/activity
curl --get https://app.phone.inc/api/v1/inbox/%2B4523909778/activity \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  --data-urlencode 'limit=50'

Response

{
  "phone_number": "+4523909778",
  "contact": null,
  "items": [],
  "next_cursor": null,
  "observed_at": "2026-10-06T10:41:00.000000Z"
}

POST/v1/inbox/:phone_number/seen

Mark activity seen

Marks incoming calls, voicemails, Notes, and texts from this number seen through the observed_at timestamp returned by List activity, subject to resource write permissions. Optional business_number_id restricts the change to one business number; omitting it applies across the company. through is required, must be ISO 8601, and must not be in the future. Later arrivals remain unseen, including texts whose provider timestamp predates your observation. Seen state is shared by the team, not per employee. Voicemail listened state is unchanged. Returns 204 No Content.

Request

POST
/v1/inbox/:phone_number/seen
curl -X POST https://app.phone.inc/api/v1/inbox/%2B4523909778/seen \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"through":"2026-10-06T10:41:00.000000Z"}'

GET/v1/messages/{id}

Retrieve a text

Returns a persisted message by its public id, including its current delivery status. With the company's Message attachments flag enabled (default off, managed by Phone.inc), this response also includes an attachments array of metadata ordered as received. Use Retrieve an attachment for download links. With the flag off, the field is omitted. Inbound attachment persistence continues regardless of the flag; enabling it exposes already-stored files. Attachment-only messages may have empty text. Unknown or foreign-company IDs return 404. Use this after a network interruption or a send response with an id; do not create another send just to check whether the first succeeded.

Request

GET
/v1/messages/{id}
curl https://app.phone.inc/api/v1/messages/019daef1-085e-73f0-85f6-a71e2d8dd2cc \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response

{
  "id": "019daef1-085e-73f0-85f6-a71e2d8dd2cc",
  "type": "message",
  "format": "sms",
  "created_at": "2026-10-06T10:41:00.000000Z",
  "business_number_id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
  "business_number_name": "Sales",
  "seen_at": "2026-10-06T10:41:00.000000Z",
  "direction": "outbound",
  "from": "+4592450113",
  "to": "+4523909778",
  "text": "Your appointment is confirmed.",
  "author": {
    "type": "employee",
    "id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
    "name": "Lea"
  },
  "status": "accepted",
  "sms_count": 1,
  "encoding": "gsm7",
  "delivered_at": null,
  "received_at": null,
  "failure_code": null,
  "can_retry": false
}

GET/v1/messages/:message_id/attachments/:id

Retrieve an attachment

Retrieve metadata and a short-lived download link for a stored inbound attachment. Use the message's public ID and an attachment public ID from GET /api/v1/messages/:id. Both Messaging and Message attachments must be enabled for the company. Missing authentication returns 401; disabled flags, unknown IDs, another company's message, or an attachment belonging to another message return 404.

The JSON response includes id, status, filename, content_type, byte_size, download_url, and expires_at. Status is pending until the background download has been stored; pending files have null metadata, download URL, and expiry. Poll this endpoint to check again. A failed background download remains pending; no provider error or source URL is exposed.

A ready file has a storage download URL valid for five minutes and an ISO 8601 UTC expires_at. Follow that URL without sending your Phone.inc API key. The download uses attachment disposition rather than inline display. The URL is a temporary bearer credential: anyone holding it can download the file until expiry. Do not log or share it. Obtain a fresh URL through this authenticated endpoint after expiry. Disabling either feature flag blocks new URLs but does not revoke already-issued URLs before expiry. Responses use Cache-Control: private, no-store.

Request

GET
/v1/messages/:message_id/attachments/:id
curl https://app.phone.inc/api/v1/messages/$MESSAGE_ID/attachments/$ATTACHMENT_ID \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response

{
  "id": "019daef1-085e-73f0-85f6-a71e2d8dd2cd",
  "status": "ready",
  "filename": "attachment-1",
  "content_type": "image/jpeg",
  "byte_size": 154230,
  "download_url": "https://storage.example/attachment?signature=temporary",
  "expires_at": "2026-10-26T11:05:00Z"
}

POST/v1/messages/{id}/retries

Retry a failed text

Explicitly retries a definitively failed text with the same sender and body, keeping its message id and recording a new send attempt. This is a real, chargeable SMS. An employee belonging to the company is required. Supply a new idempotency_key (1–128 characters), or the Idempotency-Key header. Repeating the same retry key replays the attempt without sending again. unknown, accepted, delivered, and inbound messages cannot start a retry (409). The sender must still support sending. A different key represents a new retry, not a replay. A missing/invalid retry key returns 409. Send and retry attempts share a limit of 30 per business number in a rolling minute; exceeding it returns 429 with Retry-After: 60.

Success returns 202 Accepted. API keys and legacy or first-party OAuth tokens receive the message activity object. Partner OAuth tokens require messages:send; sending does not require messages:read. Without messages:read, the retry response contains only id and status, with no stored text, addresses, author, or other activity metadata. With messages:read, partners receive the message activity object, subject to their other field permissions. The MCP retry_message tool returns the same response body.

For a send-only partner, the response is:

{
  "id": "019daef1-085e-73f0-85f6-a71e2d8dd2cc",
  "status": "accepted"
}

Request

POST
/v1/messages/{id}/retries
curl -X POST https://app.phone.inc/api/v1/messages/019daef1-085e-73f0-85f6-a71e2d8dd2cc/retries \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"idempotency_key":"retry-appointment-1"}'

Response

{
  "id": "019daef1-085e-73f0-85f6-a71e2d8dd2cc",
  "type": "message",
  "format": "sms",
  "status": "accepted",
  "can_retry": false
}

GET/v1/text_snippets

List snippets

Returns company-shared snippets ordered by position, then creation order. Selecting a snippet only inserts editable text into your local draft. It never sends an SMS.

Request

GET
/v1/text_snippets
curl https://app.phone.inc/api/v1/text_snippets \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response

[
  {
    "id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
    "title": "On my way",
    "text": "I'm on my way, with you in about 15 minutes.",
    "position": 0,
    "created_at": "2026-10-06T10:41:00.000000Z",
    "updated_at": "2026-10-06T10:41:00.000000Z"
  }
]

POST/v1/text_snippets

Create a snippet

Required title contains 1–128 characters and text contains 1–10,000 characters; whitespace-only values are rejected. Optional position is a nonnegative integer, default 0. Returns the saved snippet with 201 Created.

Request

POST
/v1/text_snippets
curl -X POST https://app.phone.inc/api/v1/text_snippets \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"On my way","text":"I'"'"'m on my way, with you in about 15 minutes.","position":0}'

Response

{
  "id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
  "title": "On my way",
  "text": "I'm on my way, with you in about 15 minutes.",
  "position": 0,
  "created_at": "2026-10-06T10:41:00.000000Z",
  "updated_at": "2026-10-06T10:41:00.000000Z"
}

GET/v1/text_snippets/{id}

Retrieve a snippet

Returns a company-shared snippet by public id. Unknown and foreign-company IDs return 404.

Request

GET
/v1/text_snippets/{id}
curl https://app.phone.inc/api/v1/text_snippets/0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01 \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response

{
  "id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
  "title": "On my way",
  "text": "I'm on my way, with you in about 15 minutes.",
  "position": 0,
  "created_at": "2026-10-06T10:41:00.000000Z",
  "updated_at": "2026-10-06T10:41:00.000000Z"
}

PATCH/v1/text_snippets/{id}

Update a snippet

Accepts any combination of title, text, and position, using the same validation as creation. Other fields are ignored. Changes are shared with the company.

Request

PATCH
/v1/text_snippets/{id}
curl -X PATCH https://app.phone.inc/api/v1/text_snippets/0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01 \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"I'"'"'ll be there in 10 minutes."}'

Response

{
  "id": "0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01",
  "title": "On my way",
  "text": "I'll be there in 10 minutes.",
  "position": 0,
  "created_at": "2026-10-06T10:41:00.000000Z",
  "updated_at": "2026-10-06T10:42:00.000000Z"
}

DELETE/v1/text_snippets/{id}

Delete a snippet

Deletes a company-shared snippet. Previously sent texts are unaffected. Returns 204 No Content.

Request

DELETE
/v1/text_snippets/{id}
curl -X DELETE https://app.phone.inc/api/v1/text_snippets/0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01 \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

GET/v1/business_numbers/{business_number_id}/texting_settings

Retrieve texting settings

Returns the business number's outside-hours auto-reply settings. A number without saved settings returns these defaults without creating a settings record. Hours and timezone come from the business number's existing configuration.

Request

GET
/v1/business_numbers/{business_number_id}/texting_settings
curl https://app.phone.inc/api/v1/business_numbers/0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01/texting_settings \
  -H "X-Api-Key: $PHONE_INC_API_KEY"

Response

{
  "auto_reply_enabled": false,
  "auto_reply_text": null,
  "auto_reply_cooldown_minutes": 1440
}

PATCH/v1/business_numbers/{business_number_id}/texting_settings

Update texting settings

Requires a current employee belonging to the company. Accepts auto_reply_enabled (boolean), auto_reply_text (up to 10,000 characters; required and nonblank when enabled), and auto_reply_cooldown_minutes (integer 60–43,200, default 1,440). Enabling this may send real, chargeable texts without an app open, but only while the number supports SMS sending. On an incoming text outside the number's business hours, a background job sends the reply from that same number. The job skips sending if business hours have reopened. The cooldown applies per external number and business number, and also prevents loops on duplicate incoming callbacks. Automated messages use author.type=automation; they appear in the normal history. Failed or uncertain automatic sends are not blindly retried. Shared sending limits still apply.

Request

PATCH
/v1/business_numbers/{business_number_id}/texting_settings
curl -X PATCH https://app.phone.inc/api/v1/business_numbers/0193f4a9-7c34-7c00-9e3d-2b2b8a7f1c01/texting_settings \
  -H "X-Api-Key: $PHONE_INC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"auto_reply_enabled":true,"auto_reply_text":"We'"'"'re closed now. We'"'"'ll reply when we reopen.","auto_reply_cooldown_minutes":1440}'

Response

{
  "auto_reply_enabled": true,
  "auto_reply_text": "We're closed now. We'll reply when we reopen.",
  "auto_reply_cooldown_minutes": 1440
}