#AI copy
#Write message drafts
POST
/sms/generateWrites up to 5 draft texts from a short description.
Important.
Idempotency-Key isn't supported here, so a retry is a new charge.Body parameters
descriptionstringRequired- What the message should say. The only field accepted.
Returns
datastring[]- Usually 5 drafts.
Details
Rarely, an item is a stray line such as "Reply STOP to opt out.", so drop very short items. credits_remaininginteger- At the top level, not in
data.
Errors
| HTTP | Code | When |
|---|---|---|
| 200 | generation_refused | Breaks texting rules. Not refunded.DetailsBody has"success": false and "refused": true. |
| 400 | no code | description is missing or empty (Describe the message you want us to write.). |
| 400 | invalid_field | description is an object or array. |
| 400 | unknown_field | A field other than description. |
| 402 | no code | Balance too low (Insufficient balance. Add funds in Billing.). |
| 402 | BILLING_PAST_DUE | Payment failed, no balance. Also FRAUD_HOLD. |
| 403 | permission_denied | The key's user lacks send_sms. |
| 500 | generation_failed | Refunded. Retry. |