Get connected
Base URL: https://api.tascourier.com/api/v1
- Create a test service, account, and recipient in the owner control center.
- Create an API token with the scopes your connector needs.
- Call
GET /meto confirm your service ID and key permissions. - List accounts and recipients, then send one test message.
- Open it at sd.tascourier.com and poll its events.
API and portal use the same HTTPS port 443 through pfSense/HAProxy. The application remains on private port 80. No new public port is required.
Authentication & permissions
Like the portal-issued token pattern in Commio’s API reference, each integration receives its own revocable credentials. Courier is not wire-compatible with Commio.
HTTP Basic: username = API key ID; password = API token. These are not your recipient or administrator password.
Authorization: Basic BASE64(KEY_ID:API_TOKEN)
Alternatively: Authorization: Bearer KEY_ID.API_TOKEN.
Tokens are shown once, expire in 90 days, and may be restricted to selected accounts. Use separate tokens for each connector. Never embed integration tokens in an iOS, Android, or browser client. Never put credentials in a URL.
Scopes: accounts:read, accounts:write, recipients:read, messages:write, messages:read, events:read, branding:read.
Three distinct identities
| Identity | Meaning | Lookup |
|---|---|---|
| Service ID | The answering-service tenant | GET /me |
| Account ID / from | A customer or practice within that service | GET /services/{service_id}/accounts |
| Recipient ID / to | A user assigned to that account | GET /services/{service_id}/recipients |
Every recipient on a message must belong to its sending account. A service ID in a URL never grants access; the API key must authorize it. Directory responses are capped at 500 entries in this initial release.
Send a secure message
Requires messages:write and an Idempotency-Key header. Maximum request size: 64 KiB; message body: 16,000 characters; recipients: 1–100.
Request · message.json
{
"channel": "secure",
"from": "22222222-2222-4222-8222-222222222222",
"to": [
"33333333-3333-4333-8333-333333333333"
],
"content": {
"subject": "Test delivery",
"text": "This is a synthetic test message. Please mark it In Process, reply, and then mark it Completed."
},
"external_id": "test-0001",
"source": {
"system": "test",
"installation_id": "courier-lab"
},
"priority": "normal"
}The UUIDs here are placeholders. Replace them with real test IDs from your service. from is an account UUID, not a phone number. source.system identifies provenance; it does not enable a connector or WCTP transport.
cURL
curl --request POST \ "https://api.tascourier.com/api/v1/services/$COURIER_SERVICE_ID/messages" \ --user "$COURIER_KEY_ID:$COURIER_API_TOKEN" \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: test-message-0001' \ --data @message.json
202 Accepted
{
"data": {
"id": "44444444-4444-4444-8444-444444444444",
"service_id": "11111111-1111-4111-8111-111111111111",
"account_id": "22222222-2222-4222-8222-222222222222",
"status": "accepted",
"workflow_status": "unread",
"priority": "normal",
"accepted_at": "2026-09-12T00:00:00.000Z",
"external_id": "test-0001",
"source": {
"system": "test",
"installation_id": "courier-lab"
},
"deliveries": [
{
"recipient_id": "33333333-3333-4333-8333-333333333333",
"state": "unread",
"notification_status": "not_configured",
"viewed_at": null,
"updated_at": "2026-09-12T00:00:00.000Z"
}
]
},
"request_id": "55555555-5555-4555-8555-555555555555"
}Node.js example
// Load credentials from a secret store, never from browser JavaScript.
const response = await fetch(
process.env.COURIER_BASE_URL + '/services/' + process.env.COURIER_SERVICE_ID + '/messages',
{
method: 'POST',
headers: {
Authorization: 'Basic ' + Buffer.from(
process.env.COURIER_KEY_ID + ':' + process.env.COURIER_API_TOKEN
).toString('base64'),
'Content-Type': 'application/json',
'Idempotency-Key': 'test-message-0001'
},
body: JSON.stringify(message)
}
);
const result = await response.json();
if (response.status !== 202) throw new Error(result.error?.code);
// Save result.data.id. Do not log message content or credentials.Retry safely
Keep the same Idempotency-Key, source system, installation ID, external message ID, and body when retrying after a timeout. Identical replay returns the existing message with Idempotency-Replayed: true. Changed content with a reused identity returns 409. Identities are service-scoped and do not reset when API credentials rotate. Historical import is not implemented.
Read status and replies
Requires messages:read. Returns content plus a separate state for each recipient. Reading through the integration API does not mark a recipient’s message viewed.
| Field / state | Meaning |
|---|---|
status: accepted | Stored durably. Not proof of a notification or human receipt. |
notification_status: not_configured | No SMS, email, or mobile push is configured. |
unread → viewed | Recipient opened the message through the authenticated portal action. |
in_process → completed | Explicit recipient workflow actions. |
All recipients must complete their own copies for the overall workflow to be completed. One recipient does not silently complete everyone else’s delivery. Completed messages can be reopened.
Replies remain separate from completion. Recipient web users see their own replies; authorized integration keys can read all replies for the account’s message. Replies contain private content and must not be copied into diagnostic logs.
Poll lifecycle events
Requires events:read. Events carry message IDs, recipient IDs, timestamps, action type, and reply IDs—not message text.
{
"data": [
{
"id": "123",
"type": "message.replied",
"message_id": "44444444-4444-4444-8444-444444444444",
"recipient_id": "33333333-3333-4333-8333-333333333333",
"details": {
"reply_id": "66666666-6666-4666-8666-666666666666"
}
}
],
"pagination": {
"next_cursor": "123",
"has_more": false,
"limit": 100
}
}Process each event idempotently. Save pagination.next_cursor only after local work has succeeded. Keep cursors as decimal strings; gaps are normal. Poll again using that cursor. If has_more is true, drain the next page; otherwise use a short backoff. State and event changes commit in one transaction.
Outbound webhooks and webhook retries are planned, not active. This pull interface lets a Spectrum connector stay outbound-only behind its firewall.
Errors & limits
{
"error": {
"code": "insufficient_scope",
"message": "This API key requires messages:write."
},
"request_id": "55555555-5555-4555-8555-555555555555"
}| HTTP | Meaning / action |
|---|---|
| 400 / 415 / 422 | Correct the JSON, media type, field values, or missing idempotency header. |
| 401 / 403 | Check the API token, expiry, permissions, or browser session. |
| 404 | Not found or outside the credential’s service/account boundary. |
| 409 | Identifier conflict or invalid workflow transition; do not blindly retry. |
| 413 | Reduce the request below 64 KiB. |
| 429 | Obey Retry-After. Initial API ceiling: 240 requests/minute/key; a conservative shared-edge limit also applies. |
| 500 / timeout | Retry with backoff and the same idempotency identity. Keep the request ID for support. |
Unknown fields are rejected. Request bodies, API tokens, and passwords are not written to the application’s diagnostic logs. No cross-origin browser API permission is granted in this release.
What is working—and what comes next
Implemented: service/account isolation, scoped revocable tokens, persistent encrypted message bodies, duplicate suppression, web recipient login, inbox, per-recipient actions/replies, event polling, and owner administration.
Not yet implemented: Spectrum/TASTNG connector delivery, WCTP protocol transport, APNs/FCM, native apps, SMS/email notification providers, outbound callbacks, attachments, custom-domain verification/ACME automation, custom logo uploads, MFA/password reset, retention jobs, or production backup/restore automation.
GET /services/{service_id}/branding currently returns the service name and version 1 pine/lime default profile. Future custom-domain and branding support will build on this identity model.
Do not place live medical data in this environment. Encryption and authentication alone do not establish HIPAA compliance or production readiness.