Skip to content

Identify a card

For developers

A door, a desk, a printer or a check-in system holds a scanner. It reads a QR code, a barcode, a number or a chip, and needs to know whose it is. Send CardOffice exactly what the scanner read, and it answers with the person, the card that was judged, and one word for whether that card is usable now.

The endpoint only reads. It never changes a card or a person, and it records no visit. What to do about an expired or withdrawn card is your system’s decision; the answer only reports it.

POST/cards/identifyscope: cards:identify
Field Required Description
value Yes What the scanner read, as it read it. Up to 512 characters. A leading or trailing Enter, Tab or other control character is ignored
observedAt No When your own server received the scan, as an ISO 8601 timestamp with a time zone. Only for a scan you held and are retrying. See Held scans
identifierKind No "chip_serial" when value is a chip serial number read by a contactless reader. Only chip serials are then searched. See Chip serial numbers
Terminal window
curl -sS -X POST "$CARDOFFICE_API/cards/identify" \
-H "Authorization: Bearer $CARDOFFICE_KEY" \
-H "Content-Type: application/json" \
-d '{ "value": "https://app.cardoffice.nz/verify/7KQ2-M4XD-9F1B" }'

It is a POST, not a GET, because a scanned value can be a whole web address with its own query string, and because scanned values should not end up in the access logs of every proxy between you and CardOffice. The body can be up to 4 KB.

Send the value as the scanner gave it. CardOffice works out what it is, always within the organisation the key belongs to, and tries these in order:

The scanner read identifierKind in the answer
The QR code on a card or wallet pass, which carries the card’s verification address verification_code
A verification code on its own, such as 7KQ2-M4XD-9F1B, in any case, with or without hyphens verification_code
A card’s serial number, such as AC-000123 card_serial
An ID number: the person’s externalId external_id
A barcode number held in the person’s customFields as barcode, with or without the asterisks some barcode readers keep at each end door_barcode
A chip serial number read by a contactless reader chip_serial

Case is ignored throughout. A reader that types into the computer like a keyboard sends everything in capitals when Caps Lock is on, and the value still matches.

The answer is always 200 with a match, unless the request itself is wrong. A match on one person:

{
"data": {
"match": "one",
"identifierKind": "verification_code",
"holder": {
"id": "0b5e4c1a-6a53-4d3b-9d45-3f6f6b2c9a10",
"externalId": "S1024",
"firstName": "Emma",
"displayName": "Emma Hall",
"holderType": "student",
"department": "Nursing",
"campus": "City",
"status": "active"
},
"card": {
"id": "c2a4f0f6-1f1b-4b0a-9d7c-0d1b6e5e4a21",
"serialNumber": "AC-000123",
"status": "active",
"expiresAt": "2027-12-31"
},
"credentialState": "valid",
"photoUrl": null
}
}
match Meaning Also in data
one One person. identifierKind, holder, card, credentialState, photoUrl
none Nobody in your organisation. Nothing else.
many More than one person shares the value, which a barcode number can. identifierKind, and up to five candidates, each with holder, card and credentialState, for staff to choose between. No photos.
stale The value was a live code that changes every few seconds, and the one read is too old to trust, as a screenshot of one would be. identifierKind (app_live_qr) only. Nobody is named.

Cards and wallet passes never produce stale. Handle it anyway, by asking to see the live screen rather than a picture of it.

firstName and displayName use the person’s preferred name when they have one, because the answer is usually shown on a screen in front of a queue. holderType is one of student, staff, contractor, visitor, access or member.

photoUrl is a link to the person’s current approved photo, valid for five minutes. It is filled in only when the key also has the photos:read scope, and is null otherwise or when the person has no approved photo. The link needs no Authorization header, so show it and do not store or log it.

One word for whether the credential is usable now. The checks run in this order, so two systems never disagree about which reason wins:

credentialState Meaning
person_inactive The person is not active.
withdrawn The card was revoked, or reported lost, stolen or damaged.
not_yet_valid The person’s start date (validFrom) is still ahead, or the card has been made but not yet activated.
expired The card is marked expired, or its expiry date has passed in your organisation’s time zone. A card expiring today is valid until midnight.
valid Usable now.
The person was found by card is
A verification code or a card serial That card, even when the person holds a newer one.
A chip serial The card the chip was encoded as.
An ID number or a barcode number The person’s usable card (active and not past its expiry date), newest first. Without one, their most recently issued card.

A person found by ID number or barcode number who holds no card at all comes back with card null, and their own status, start date and expiry date decide credentialState.

  • People in another organisation. Their card answers none, exactly as a value nobody has ever seen does, so the endpoint cannot be used to learn that a card exists elsewhere.
  • Archived people, and people whose records were erased, by any identifier. A person who is inactive but not archived is found, with credentialState person_inactive.

When your system cannot reach CardOffice, it can hold a scan and send it again later. Send observedAt with the retry: the moment your server received the scan. The card is then judged for that moment, so a card that expired at midnight still answers valid for a scan made at ten to.

Take observedAt from your server’s clock, never from the scanning device. A time more than two minutes in the future, or more than 24 hours in the past, is not believed: a card is judged for now instead, and a live code answers stale.

Every contactless card has a chip serial number that any reader can read. When a card is encoded at an encoder station, CardOffice records its chip serial, and this endpoint can then find the card by it.

Readers write the same serial in different ways, and all of them are found:

  • hex, with or without 0x at the start and colons, hyphens or spaces between bytes, such as 04:A2:3F:9C or 04A23F9C
  • the bytes in either order, such as 9C3FA204
  • a decimal number, in either byte order, such as 2621415940

Serials are 4, 7 or 10 bytes long. Send "identifierKind": "chip_serial" when you know the value came from a chip: only chip serials are searched, so a serial can never be mistaken for an ID number. Without it, a value is tried as a chip serial last, after everything else in the table above.

A card encoded before its station recorded chip serials has none, and is found this way only once it is encoded again. When a person’s record is erased, the chip serials of their cards are removed with it.

Status When
400 bad_request The body is not valid JSON
401 unauthorized No key, or a key that is wrong, expired or revoked. See Authentication
403 forbidden The key lacks cards:identify
413 payload_too_large The body is over 4 KB
422 validation_failed value is missing, empty or over 512 characters, observedAt is not an ISO 8601 timestamp with a time zone, or identifierKind is anything but chip_serial
429 rate_limited Over this endpoint’s rate limit. Wait Retry-After seconds

A value that matches nobody is not an error. It is 200 with "match": "none".

Each key can make 600 identify calls a minute, counted apart from the 120 a minute that covers the rest of the API. A door working through a queue does not use up the same key’s allowance for anything else, and the reverse. The X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers on an identify response describe this endpoint’s own count.

Create a key with only cards:identify, and add photos:read only if the system shows the person’s photo. A key that identifies cards at a door has no reason to read or change anything else. See Authentication.

A system that keeps a copy of the names it has seen should subscribe to card_holder.erased and remove a person’s copy when it arrives.

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