Developers

API documentation

A small JSON-over-HTTPS API for sending SMS to Australian mobiles, checking delivery and reading your balance.

Version 1 · Base URL https://harboursms.com

Introduction

All endpoints live under /v1. Send request bodies as JSON with Content-Type: application/json; every response is JSON. Amounts are in Australian dollars (AUD).

Sending is prepaid: the full cost of a send is deducted from your balance when you submit it. Any message that cannot be handed to the network (for example if our upstream gateway is unavailable, or you cancel a scheduled send in the portal) is refunded to your balance automatically.

Authentication

Create an API key in the portal under Settings → API key. The key starts with hsk_ and is shown only once — store it securely. Generating a new key immediately disables the old one.

Send the key as a bearer token on every request:

Authorization: Bearer hsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

A missing header returns 401 missing_api_key, an unknown key 401 invalid_api_key, and a suspended account 403 account_suspended.

Phone numbers

Only Australian mobile numbers are accepted. Any of these forms work, and spaces, dashes, dots and brackets are ignored:

FormatExample
Local0412 345 678
International+61412345678
International, no plus61412345678

Numbers are normalised to 614xxxxxxxx, which is the form used in responses. Duplicates in one request are sent once. Numbers that are not valid Australian mobiles are skipped and counted in invalid; numbers on your opt-out list are skipped and counted in blocked. Neither is charged.

Message length & cost

Long messages are split into parts (segments) and each part is charged. The limit per part depends on the characters used:

EncodingSingle SMSEach part when longer
GSM-7 (standard Latin letters, digits, common punctuation)160 characters153 characters
Unicode (any other character, e.g. emoji, 中文, curly quotes)70 characters67 characters

In GSM-7 the characters ^ { } \ [ ] ~ | € count as two. A message may be at most 1,000 characters (GSM-7 units, or characters for Unicode). Cost = recipients × segments × your price per segment.

Send SMS

POST/v1/sms

Sends one message to up to 10,000 recipients, now or at a scheduled time.

Request body

FieldTypeDescription
toarray of strings, requiredRecipient mobile numbers (max 10,000 after removing duplicates). A single string separated by commas, spaces or new lines also works.
messagestring, requiredThe text to send, up to 1,000 characters.
sendAtstring, optionalISO 8601 date-time to schedule the send, e.g. 2026-12-01T09:00:00+11:00. Must be within 90 days. A time less than a minute away sends immediately.
referencestring, optionalYour own label for this send (up to 120 characters). It appears as the campaign name in the portal.

Example

curl https://harboursms.com/v1/sms \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": ["0412 345 678", "+61498765432"],
    "message": "Hi Sam, your appointment is tomorrow at 10am. Reply STOP to opt out. – Bondi Dental",
    "reference": "reminders-2026-12-01"
  }'

Response

{
  "id": 1042,
  "status": "queued",
  "recipients": 2,
  "segments": 1,
  "cost": 0.11,
  "invalid": 0,
  "blocked": 0
}
FieldDescription
idSend ID (a number). Use it with GET /v1/sms/:id.
statusqueued (sending now) or scheduled (when sendAt is in the future).
recipientsNumber of valid, non-blocked recipients that will be messaged.
segmentsParts per message.
costAmount deducted from your balance, in AUD.
invalidCount of numbers skipped because they are not valid Australian mobiles.
blockedCount of numbers skipped because they are on your opt-out list.

Get send status

GET/v1/sms/:id

Returns the send and the status of each number (up to 10,000). Poll this endpoint to track delivery; a send that does not belong to your account returns 404 not_found.

curl https://harboursms.com/v1/sms/1042 -H "Authorization: Bearer YOUR_API_KEY"

{
  "id": 1042,
  "status": "done",
  "recipients": 2,
  "segments": 1,
  "cost": 0.11,
  "created_at": "2026-12-01T09:00:02.000Z",
  "messages": [
    { "number": "61412345678", "status": "delivered", "reason": "", "done_at": "2026-12-01T09:00:09.000Z" },
    { "number": "61498765432", "status": "failed", "reason": "rejected by carrier", "done_at": "2026-12-01T09:00:03.000Z" }
  ]
}

Send status: scheduled, sending, done (at least one message went out), failed (none did) or cancelled. Times are UTC. cost reflects any refunds.

Message status

StatusMeaning
queuedWaiting to be sent (or waiting for its scheduled time).
sentHanded to the network; waiting for a delivery report.
deliveredThe carrier confirmed delivery to the handset.
failedNot delivered. reason says why. Messages that never left our platform are refunded.
blockedNot sent because the number opted out. (Opted-out numbers are normally removed at send time and counted in blocked, so this is rare.)

done_at is when the message reached a final status (delivered, failed or blocked); it is null before then.

Get balance

GET/v1/balance
curl https://harboursms.com/v1/balance -H "Authorization: Bearer YOUR_API_KEY"

{ "balance": 48.25, "currency": "AUD" }

Errors

Errors return a non-2xx HTTP status and a JSON body of the form {"error": "code"}. Some errors include extra fields to help you recover.

CodeHTTPMeaning
missing_api_key401No Authorization: Bearer header.
invalid_api_key401The key is wrong or has been replaced.
account_suspended403Your account is suspended. Contact support.
insufficient_balance400Your balance does not cover the send. Includes cost. Nothing was sent or charged.
no_valid_numbers400No sendable recipients. Includes invalid and blocked counts.
empty_message400message is missing or blank.
message_too_long400message is over 1,000 characters.
too_many_numbers400More than 10,000 recipients. Includes max. Split the list into several requests.
bad_send_time400sendAt is not a valid date-time or is more than 90 days away.
not_found404No send with that ID on your account.
Need help integrating? Talk to us, or create a free account to get test credits.