Skip to main content
POST
/
text
/
send
Send a one-time text
curl --request POST \
  --url https://collectwiseapi.com/text/send \
  --header 'Content-Type: application/json' \
  --header 'collectwise_key: <api-key>' \
  --data '
{
  "destination": "3313048434",
  "templateId": 100,
  "variables": {
    "Consumer Name": "Jane Doe",
    "Company Name": "Acme Recovery Group",
    "Website Payment": "https://pay.collectwise.com/acme",
    "Account Number": "ACME-0001",
    "Phone#": "800-555-0100"
  },
  "debtorId": "your-reference-number"
}
'
import requests

url = "https://collectwiseapi.com/text/send"

payload = {
"destination": "3313048434",
"templateId": 100,
"variables": {
"Consumer Name": "Jane Doe",
"Company Name": "Acme Recovery Group",
"Website Payment": "https://pay.collectwise.com/acme",
"Account Number": "ACME-0001",
"Phone#": "800-555-0100"
},
"debtorId": "your-reference-number"
}
headers = {
"collectwise_key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {collectwise_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
destination: '3313048434',
templateId: 100,
variables: {
'Consumer Name': 'Jane Doe',
'Company Name': 'Acme Recovery Group',
'Website Payment': 'https://pay.collectwise.com/acme',
'Account Number': 'ACME-0001',
'Phone#': '800-555-0100'
},
debtorId: 'your-reference-number'
})
};

fetch('https://collectwiseapi.com/text/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://collectwiseapi.com/text/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destination' => '3313048434',
'templateId' => 100,
'variables' => [
'Consumer Name' => 'Jane Doe',
'Company Name' => 'Acme Recovery Group',
'Website Payment' => 'https://pay.collectwise.com/acme',
'Account Number' => 'ACME-0001',
'Phone#' => '800-555-0100'
],
'debtorId' => 'your-reference-number'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"collectwise_key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://collectwiseapi.com/text/send"

payload := strings.NewReader("{\n \"destination\": \"3313048434\",\n \"templateId\": 100,\n \"variables\": {\n \"Consumer Name\": \"Jane Doe\",\n \"Company Name\": \"Acme Recovery Group\",\n \"Website Payment\": \"https://pay.collectwise.com/acme\",\n \"Account Number\": \"ACME-0001\",\n \"Phone#\": \"800-555-0100\"\n },\n \"debtorId\": \"your-reference-number\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("collectwise_key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://collectwiseapi.com/text/send")
.header("collectwise_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": \"3313048434\",\n \"templateId\": 100,\n \"variables\": {\n \"Consumer Name\": \"Jane Doe\",\n \"Company Name\": \"Acme Recovery Group\",\n \"Website Payment\": \"https://pay.collectwise.com/acme\",\n \"Account Number\": \"ACME-0001\",\n \"Phone#\": \"800-555-0100\"\n },\n \"debtorId\": \"your-reference-number\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://collectwiseapi.com/text/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["collectwise_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": \"3313048434\",\n \"templateId\": 100,\n \"variables\": {\n \"Consumer Name\": \"Jane Doe\",\n \"Company Name\": \"Acme Recovery Group\",\n \"Website Payment\": \"https://pay.collectwise.com/acme\",\n \"Account Number\": \"ACME-0001\",\n \"Phone#\": \"800-555-0100\"\n },\n \"debtorId\": \"your-reference-number\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "messageId": "1b1f0a9e-6f4e-4f4b-9a2e-1f2d3c4b5a69",
  "segments": {
    "encoding": "GSM-7",
    "segmentCount": 1,
    "characterCount": 142,
    "maxCharsPerSegment": 160
  }
}
{
"error": "Missing variables for placeholders: Consumer Name"
}
{
"error": "Template is not available for your account"
}
{
"error": "Template not found"
}
{
"error": "Too many requests"
}
{
"error": "Internal server error"
}
{
"error": "Failed to send message"
}

Authorizations

collectwise_key
string
header
required

Body

application/json
destination
string
required

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

templateId
integer
required

The template to send. Must belong to your organization's account.

variables
object
required

Values substituted into the template's {placeholder} tokens. Use {} if the template has none. If any placeholder is left unresolved, the request fails with 400 rather than texting a literal {token}.

debtorId
string
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.

Response

Message accepted and queued.

success
boolean
required
messageId
string
required

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

segments
object