Skip to content

Authentication

For developers

Every API request carries an API key, created by one of your organisation’s administrators, as a bearer token.

GET /api/v1/card-holders HTTP/1.1
Host: app.cardoffice.nz
Authorization: Bearer idp_AbC123_x9Yz...
  1. Sign in as an administrator.

  2. Open Settings → Integrations and find API keys.

    Settings, Integrations: the Webhooks, API keys, SCIM provisioning and Agent enrolment tokens sections, each with its create button.

  3. Name the key after the system that will use it, choose the scopes it needs, and set how many days it lasts: at least 1, at most 730 (two years). Every key expires, so put the date in your calendar and replace the key before then.

  4. Copy the key straight away. It is shown once. CardOffice keeps only a one-way hash of it and cannot show it again.

Keys start with idp_. Treat them like passwords: keep them in a secret store, never in source code, configuration in a repository, or anything that runs in a browser.

A key can do only what its scopes allow. Give each key the fewest scopes that work.

Scope Allows
card_holders:read List and read card holders
card_holders:write Create and update card holders
photos:read Read a person’s current photo and the approved-photo change feed. Also adds the photo link to an identify answer
photos:write Request photo upload URLs and finalise uploads
photos:attest Photos uploaded with this key are treated as taken by staff, and approved without review. Only for a one-off load from a trusted archive. See below
orders:read List and read orders
orders:write Create, submit and cancel orders
cards:read List issued cards and read the card change feed
cards:verify Not used at present. Verification needs no key
cards:identify Identify a card from whatever a scanner read
scim:provision SCIM provisioning. Normally the only scope on a SCIM key. See SCIM

A request missing a required scope fails with 403 and the message Missing required scope: <scope>.

A key with photos:attest can put a photo onto someone’s card without any person looking at it. That is right for moving an archive of photos that were already checked, and wrong for anything else. Create a separate key for the load, give it an expiry of a few days, and revoke it when the load is done.

GET/meany key

Returns the key’s organisation, scopes and expiry. Call it when an integration starts, to confirm it has the scopes it needs, and alert someone well before expiresAt.

Terminal window
curl -sS "$CARDOFFICE_API/me" -H "Authorization: Bearer $CARDOFFICE_KEY"
{
"data": {
"organisation": { "id": "7e0d9c3a-2d8b-4e57-8f43-5c3a1b2d9e10", "name": "Acme Polytechnic" },
"key": {
"name": "Student system",
"prefix": "7e7fdf8d7345",
"scopes": ["card_holders:read", "cards:read"],
"expiresAt": "2028-02-01T02:14:09.311Z",
"createdAt": "2027-02-01T02:14:09.311Z"
}
}
}

prefix is the start of the key, as shown in the API keys list, so you can tell which key a system holds without revealing the key itself.

Every authentication failure returns the same 401 response. A missing header, a malformed key, a wrong key, a revoked key and an expired key look identical on purpose, so that someone probing the API learns nothing.

Requests that present a key which fails are limited to 60 a minute from one address. Beyond that the API answers 429 until the minute has passed.

An administrator can list the networks your organisation works from, under Settings → Security → IP allowlist. Once the list has an entry, it applies to API keys and SCIM tokens as well as to staff signing in. A request from an address outside the list is refused with the same 401 as a wrong key, even when the key itself is good, and it counts towards the limit on failing requests above.

Before you add the list, make sure it includes the address every integration calls from, such as your servers and your identity provider’s provisioning service. Leave the list empty to allow calls from any network.

Create the replacement key first, deploy it, then revoke the old one in the same API keys list. A revoked key stops working immediately. An expiry on every key makes rotation routine rather than an emergency.

See Building a secure integration for the rest of the checklist.

© 2026 Secure ID Ltd. All rights reserved.Documentation licence and terms