Everything you do to an end user on their page in the portal, your own
systems can do through the API, under /end-users. The
full reference lists every call and
its fields. This page covers the rules they share.
Naming an end user
An end user is named by their end-user number, the one their page shows. A number that isn’t one of yours answers 404, the same as one that doesn’t exist.
Scopes
end-users:readlists and reads end users, their services, settings, notes, logins and representatives, and finds one from a caller’s details.end-users:createcreates them, one at a time or in an import.end-users:updatechanges them: details, addresses, settings, suspending and archiving, notes, logins, representatives and identity codes.end-users:sign-inmakes a link that signs one of their logins in to your end-user portal. Anything that gives or widens a way into that portal needs it as well asend-users:update: inviting a login, resending an invite, changing a login’s role and sending a password reset. Removing a login or revoking an invite only takes access away, soend-users:updateis enough.
A key acts for your whole account, so a partner’s limits in the portal don’t apply to it. Every change is in the audit log, naming the key.
Contacts withheld by a safety record
While a family violence safety record withholds an end user’s contacts, the
API withholds them exactly as the portal does: contactsMasked is true, and
their email, phone and addresses are null. A search never matches the
withheld email, and a change to a withheld contact is refused.
Addresses and the emergency record
Change addresses with PATCH /end-users/{endUser}/addresses, not with the
end user’s details. The service address is also what emergency services are
given for their numbers. ipnd in the answer says what happened to that
record:
ipnd |
When |
|---|---|
applied |
You sent the gnafId of an address from address search. |
referred |
The address was typed in. Confirm their emergency address yourself. |
unchanged |
Only the billing address changed. |
Importing many at once
POST /end-users/imports takes the same CSV file as the portal’s
import, as a file upload, or the same
columns as a JSON list of rows. It runs the same checks and duplicate
rules. Send an Idempotency-Key. It is required here, so a retry never
imports the rows twice.
validateOnly: truechecks the rows and makes nothing, as Check File does in the portal.sendWelcome: falseholds the welcome email to each new end user.- Up to 200 rows are imported at once, and the answer has each row’s
outcome:
created,skippedfor a duplicate, orfailedwith the reason. - More rows run in the background and answer
202. ReadGET /end-users/imports/{importId}until itsstatusisfinished. It isfailedif the run stopped part-way, or had not started an hour after it was sent. Its counts and rows are what it wrote. Sending the rows again, with a newIdempotency-Key, makes the rest and skips those already made.
GET /end-users/imports lists every import on your account, the ones made in
the portal too.
Sending an end user to their portal
POST /end-users/{endUser}/portal-sessions makes a link that signs one of the
end user’s logins in to your end-user portal and opens the page you choose:
their dashboard, their bills, one bill (with invoiceId), one service
(with assignmentId) or their support tickets. It is how you send them, for
example, to pay by card or direct debit, which only the end-user portal takes.
- The link works once, for five minutes, on your portal’s own domain. Opening it shows a Continue to your portal button, and only the button uses the link up. A mail scanner or link preview that opens it first leaves it working.
- It signs in as the login you name in
portalUser, which is required. Take the id from the end user’s logins. There is no default login. - With
returnUrl, they are sent there once signed in instead of to the page. It must be anhttpsaddress on your own website or your end-user portal’s domain. Any other is refused. - It replaces the password, never two-factor. A login with two-factor on is asked for its code before the page opens.
- An end user who can’t use the portal is refused with
403and the codeno_end_user_portal_access. That is when the portal is off, or they have no active login. - Each link is in the audit log, naming the key and the login.
Searching across your records
GET /search?q= finds a number, trunk, data service, order, end user, port,
emergency address, ticket or invoice from a phone number, email, name or
reference in one call, as the search at the top of the portal does. Each type
is searched only when the key holds that type’s read scope: an end user needs
end-users:read, an invoice billing:read. An end user whose contacts a
safety record withholds is found by name or number only, never by email or
phone.
Finding an end user from a caller’s details
POST /end-users/lookup takes what the caller tells you: their name, email,
phone, ABN or service address. It answers with one end user only when at
least three details match and only one end user fits. Every other case is
the same 404, so the call can’t be used to try details one at a time. It is
limited to 20 calls a minute for each key, and each call is audited with the
fields sent, never their values. For an end user whose contacts a safety
record withholds, their email, phone and service address never count, so the
lookup can’t confirm them: it answers the same 404 as for no one.
Checking who you are talking to
POST /end-users/{endUser}/verification-codes sends a six digit code to the
end user’s own mobile (sms) or email, with your reason. You never supply
the address: it goes to the contact on file. The SMS goes from your approved
SMS sender, and the email in your branding. Name the sender in smsFrom if
you have more than one. The answer shows where it went, masked.
Ask the caller to read the code back, and check it with
POST /end-users/{endUser}/verification-codes/{verificationId}/verify.
verified is true for the right code. A wrong code, a used or expired one,
or one with five wrong tries all answer the same verified: false.
- A code lasts 10 minutes. At most five go to one end user in an hour.
- A right code records
lastVerifiedAton the end user. Nothing else needs it: whether to ask for a code is your own process. - While a family violence safety record is active, the code goes only to the safe contact agreed on the record, and is refused when there is none for that channel.
- Each send and check is in the audit log with the reason, the key and the outcome, never the code.