Skip to main content
POST

Authorizations

collectwise_key
string
header
required

Active, unexpired API key belonging to an active organization. Optional organization/key signing and organization IP restrictions also apply; see API Access.

Headers

x-cw-timestamp
string

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.

Pattern: ^(0|[1-9][0-9]*)$
x-cw-signature
string

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.

Pattern: ^v1=[0-9a-f]{64}$

Body

application/json
message
string

A raw message to measure. Provide this OR templateId.

templateId
integer

A template to render and measure. Provide this OR message.

variables
object

Values substituted into the template's placeholders (when using templateId).

Response

Segment usage for the message.

encoding
enum<string>
required

Encoding the message is sent with. Any non-GSM-7 character (emoji, smart quotes, most CJK) forces the whole message to UCS-2.

Available options:
GSM-7,
UCS-2
characterCount
integer
required

Number of characters in the message.

segmentCount
integer
required

Number of SMS segments the message will use.

maxCharsPerSegment
integer
required

Max characters per segment for the chosen encoding (160 GSM-7, 70 UCS-2).

gsm7Length
integer

Length in GSM-7 units (extended characters such as { } [ ] ~ \ | ^ € cost 2).

messageSizeBits
integer

Total message size in bits.