Send a one-time text

Changed on

Sends one SMS to one phone number, either from a pre-approved template (templateId + variables) or as free-form text (message). Send exactly one of templateId or message; a body with both, or with neither, is a 400. A 200 means the message was accepted and queued, not yet delivered, so use the returned messageId with the status endpoint. Sandbox API keys are rejected.

post/text/send

Request

  • Base URL
    https://collectwiseapi.com
  • URL
    https://collectwiseapi.com/text/send
  • Auth
    API key in header collectwise_key

Headers

x-cw-timestampstring

Required together with x-cw-signature when signing is enabled for this key or organization. POST /security/verify also requires signing whenever a usable secret exists. Canonical Unix seconds, within ±300 seconds. See API Access for CW1 signing.

x-cw-signaturestring

CW1 HMAC-SHA256 signature: v1= followed by 64 lowercase hex digits. Use the decoded 32-byte signing secret and exact request bytes. See API Access.

Request body

destinationstring required

US phone number. 3313048434, 13313048434, and +1 (331) 304-8434 are all accepted.

templateIdinteger

The template to send. Must belong to your organization's account. Mutually exclusive with message; send exactly one of the two.

variablesobject

Values substituted into the template's {placeholder} tokens. Required with templateId; use {} if the template has none. If any placeholder is left unresolved, the request fails with 400 rather than texting a literal {token}. Rejected if sent alongside message.

messagestring

Free-form message body, sent verbatim with no template and no placeholder substitution. Mutually exclusive with templateId. Requires free-form texting to be enabled for your organization, otherwise 403.

debtorIdstring required

Your reference for this recipient (e.g. your account or reference number). Forwarded as-is; replies and the message record are tracked against it.

campaignIdstring

Optional. Overrides your organization's default campaign for this send.

Response

Message accepted and queued.

successboolean required
messageIdstring required

Delivery-tracking ID. Use it with the status endpoint.

Changes

    • breaking

      the response property became optional for the status

    • info

      added the new optional header request parameter x-cw-signature

    • info

      added the new optional header request parameter x-cw-timestamp

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      the request property became optional

    • info

      the request property became optional