Skip to main content
POST
FIXED · call In-call texting requires incall_sms_enabled on the agent, an SMS-capable business number and valid carrier credentials. An API-imported Twilio or Telnyx number sends in-call texts like any other number when these hold. Inbound sends from the dialled number to its caller. Outbound sends from the originating number to the person called. Respect opt-outs on both paths. Never substitute another tenant’s sender. NOT OFFERED → do this instead · number SMS does not automatically inherit the inbound phone profile. Put this business’s SMS instructions in sms_prompt and configure automatic replies for its number. YOU CAN CHANGE · number Choose sms_reply_enabled and sms_prompt for this number. Keep business-specific details separate when numbers share an agent. SCOPE · message A single text, an automatic conversation reply and a call-triggered text are separate sends. A single text appears in that number’s SMS thread and does not pause automatic replies. Keep each message’s sender, receipt and consent together. Read the compact AI rules Send one SMS using an explicit sender owned by the account and assigned to the requested agent. A 201 sent response means the send was accepted; it does not confirm delivery to the recipient.
Method: POST ·
Success: 201 ·
Scope: Owning account
The important part
  • This request can send a real text; there is no general replay guarantee.
  • Carrier acceptance does not confirm that the recipient read or received the message.

Authentication

Send Authorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential. Send Content-Type: application/json.

Request fields

Send a JSON object. The endpoint has no dry-run mode. Only send to an authorised recipient. Do not infer a sender from agent settings, and do not send API credentials to a browser. The response can gain receipt fields when that feature is enabled; older successful responses contain only status, to and from. The sent text appears in that number’s SMS inbox thread and does not pause automatic replies. An accepted message can still return 201 if later local history persistence fails. A receipt-path failure can include outcome, work_id, message_id and safe_to_retry both alongside the error and inside details. Do not infer not-sent from a generic 500 response. Contact-hours refusals use error.code outside_hours or needs_timezone (409), or contact_policy_unavailable (503). Details include outcome:not_sent, sent:false and charged:false. Advisory messages can instead start “Outside calling hours” or “Weekend where they are” and contain the next local window. refused_before_dispatch is a dispatch outcome marker, not an HTTP status or a replacement error.code. An unknown outcome can still mean something was sent. Compatibility change: suppressed single SMS now returns HTTP 409, error.type=conflict, error.code=do_not_contact. It previously returned HTTP 400 invalid_request. The message was not sent. Stop; never automatically retry a known opt-out. SMS campaigns keep per-recipient hold_reason:do_not_contact instead of returning a blanket 409.

Response fields

201 Created returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.

Example request

Raw HTTP base URL: https://api.nixflex.com/v1. Node and Python SDK base URL: https://api.nixflex.com. The SDK adds /v1. Keep NIXFLEX_API_KEY in your private process environment. The shell examples use Bash syntax. SDK and CLI examples require Node/CLI 0.11.0 or later and Python 0.4.0 or later. Set NXF_AGENT_ID, NXF_PHONE_NUMBER, NXF_TO_NUMBER to the intended account-owned identifiers or approved recipient before running. Running a successful example contacts the recipient; use only an approved test destination.

Example response

Illustrative 201 response. Identifiers and values are examples; some optional or compatibility fields are omitted.

Errors

Failures return an error object with code, message, doc_url and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.

Retry and idempotency

Never automatically retry an SMS write. Preserve the accepted message/work IDs where available. If a timeout, connection failure or sms_outcome_unknown occurs, inspect receipts/history before deliberately sending again. An error’s retry hint does not override the no-automatic-write-retry rule.

Authorizations

Authorization
string
header
required

KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A verified personal dashboard Bearer session may be used where the operation documents role-based access.

Body

application/json
agent_id
string
required

Owned agent ID.

Minimum string length: 1
from_number
string
required

Explicit owned, settled sender assigned to this agent. There is no agent-number fallback.

Minimum string length: 1
to
string
required

Recipient number. This field is to, not to_number.

Minimum string length: 1
message
string
required

Nonempty text. This route declares no fixed character cap; encoding, segmentation and connection limits still apply.

Minimum string length: 1
context
object

Optional JSON context saved with the accepted outbound message.

recipient_timezone
string

Optional recipient IANA time zone for contact checks.

recipient_country
string

Optional two-letter recipient country code.

Response

Created

status
string
required

Accepted send state; not a delivery receipt.

Allowed value: "sent"
to
string
required

Recipient.

from
string
required

Sender.

message_id
string | null

Optional accepted message identity when account receipts are enabled.

work_id
string | null

Optional work receipt identity.

persistence
string

Optional persistence state returned by the receipt path.

safe_to_retry
boolean

False when supplied; do not resend an accepted message.