Reference
API reference
Every operation of the HonkIO REST API, one page per resource: parameters, request bodies, responses, the permission each one needs, and an example request.
Base URL
Every request goes to https://api.honkio.ca over HTTPS, and every path starts with /v1. Request bodies are JSON, sent with Content-Type: application/json, and so is every response body.
Authentication
Send an API key with every request, in either of these headers. A test key (mk_test_) runs the same checks as a live key without sending or charging anything. Authentication and API keys covers test mode and the permissions of each key.
| Header | Description |
|---|---|
| Authorization: Bearer mk_live_YOUR_KEY | Use |
| X-API-Key: mk_live_YOUR_KEY | Alternative to the Authorization header: send |
Only the price list (GET /v1/pricing) answers without a key.
Idempotency
Sending an SMS, a group broadcast or an email reads an Idempotency-Key header. Send a unique key with any request you might retry: a repeat with the same key returns the first response instead of sending, and charging, a second time.
Pagination
List operations page in one of three ways, depending on the resource: page and limit, limit and offset, or limit and a cursor. The parameters and response fields of each list operation show which one it uses.
Errors
An error answers with its HTTP status and the same JSON body on every route: a stable code, a message in the language of the request’s Accept-Language header, the message in English and in French, the status again, and on some errors a details value. Errors lists every code.
{
"code": "NOT_FOUND",
"message": "Resource not found.",
"messageEn": "Resource not found.",
"messageFr": "Ressource introuvable.",
"statusCode": 404
}Interactive explorer
To try a request from your browser, the interactive explorer runs every operation against the API with your own key. It is in English only.
Resources
One page per resource. Each operation lists its parameters, request body, responses and the permission it needs, with an example request.
- MessagesSend and receive SMS messages3 operations
- Phone numbersProvision and manage Canadian phone numbers8 operations
- AccountsAccount management and API keys18 operations
- Compliance / CASLCASL consent and opt-out management7 operations
- Compliance / DNCLCRTC Do Not Call List lookups (coming soon)2 operations
- Compliance / PIPEDAPrivacy compliance and right to erasure1 operation
- WebhooksRegister endpoints to receive event notifications11 operations
- VerifyPhone number verification (SMS OTP) with per-verification upcharge4 operations
- PricingCurrent per-send prices, so an integrator can quote a cost before sending1 operation
- ContactsManage contact phone numbers and metadata5 operations
- Contact groupsGroup contacts and send group broadcasts8 operations
- ListsAllow/deny contact lists assignable to API keys7 operations
- EmailsSend and read email13 operations
- Email domainsVerify sending domains for email6 operations
- Email suppressionsManage email suppression lists3 operations
- Email templatesStore email templates and publish versions to send by id or alias8 operations
HonkIO