Send an SMS
Sends an SMS to people in the school. Charged like a dashboard send.
POSThttps://api.klasstack.com/v1/messaging/sms
- messaging:write
- Billable
- Idempotency-Key required
- Test key: example response
Authorizations
AuthorizationstringheaderrequiredYour secret key as a bearer token, in the form Bearer ks_live_sk_... or Bearer ks_test_sk_.... Keep it on your server. A test key gets the documented example and touches no school data.
Headers
idempotency-keystringheaderrequiredA key of your own that makes this write safe to retry: the same key returns the first response instead of writing again.
Body
application/json
messagestringrecipientsobjectShow child attributesHide child attributes
studentIdsinteger[]guardianIdsinteger[]
Response
200, application/json
dataobjectrequiredShow child attributesHide child attributes
idnumberrequiredstatusstringrequiredpagesnumberrequiredSMS pages per recipient.
recipientCountnumberrequiredRecipients the message was accepted for.
skippedCountnumber or nullrequiredRecipients named but not sent to (no number on record, or a suppressed number). Null on a status read.
chargenumberrequiredThe in-app SMS charge held on the SERVICE wallet, in major units.
currencystringrequiredpendingCountnumberrequiredsentCountnumberrequireddeliveredCountnumberrequiredfailedCountnumberrequiredfailureReasonstring or nullrequiredcreatedOnstringrequired
metaobjectrequiredShow child attributesHide child attributes
request_idstringrequiredAlso returned in the X-Request-ID header.
paginationobjectShow child attributesHide child attributes
limitintegerrequiredRequired range: x <= 100
has_morebooleanrequirednext_cursorstring or nullrequiredSend this back as
cursorfor the next page. Opaque: never parse it.
Errors
- 400invalid_parameterA request parameter is invalid; `field` names it. A write sent without an Idempotency-Key is refused this way with `field` set to `Idempotency-Key`.
- 401invalid_api_keyNo key was presented, or the key is not valid.
- 402insufficient_balanceThe school's service wallet cannot cover this call.
- 403insufficient_scopeThe app does not hold the scope this endpoint needs.
- 404endpoint_not_exposedThis endpoint is not part of the API.
- 422channel_unavailableThe school cannot send on this channel right now. Nothing was sent to anyone.
- 429rate_limitedThe rate limit was reached. Retry after the Retry-After header says.
- 503platform_unavailableThe API is not available for this school right now.
What each code means, and what to do about it, is in the errors guide.
Webhook events
This call triggers no webhook event.