Skip to content

Card holders

For developers

A card holder is a person who needs a card. Send only the fields your cards and processes use; see Keep what you send to a minimum.

Field Type Notes
id uuid Assigned by CardOffice
externalId string, max 64 Your identifier for the person, such as a student number. Unique within the organisation
firstName string, required, max 120
lastName string, required, max 120
preferredName string, max 120 Used on cards and verification when set
holderType enum, required student, staff, contractor, visitor, access, member
department string, max 160
campus string, max 120
email string Where photo links, photo decisions and digital IDs are sent
phone string, max 40
expiryDate YYYY-MM-DD When the card stops being valid
validFrom YYYY-MM-DD or null The first day the person’s card is valid, such as the start of a contract. Before it, their card does not verify. Must not be after expiryDate
status enum, default active active, inactive, archived
notes string, max 2000 Accepted on write
customFields object Key/value data your card designs use, such as a year level. Not for sensitive information. Three keys are reserved: cardaxNumber (the door number), barcode and issueNumber, which the sync feeds carry under their own names
currentPhotoId uuid or null Read-only. The approved photo, if any
version integer Read-only. Increases with every change
createdAt, updatedAt timestamp Read-only

GET/card-holdersscope: card_holders:read
Query parameter Description
page, pageSize Pagination. pageSize maximum 200
q Search, matched the way the portal’s search box matches. See How q matches
status active, inactive or archived
department Exact match

Results are ordered by last name, then first name. With since instead of page, the same endpoint becomes the card holders changed feed: everyone in the order they last changed, archived people included.

q finds the same people the search box in the portal finds. Case does not matter. A person is returned when any of these is true:

  • Every word of q is a whole word of their names, ID number, email address or department, in any order. hall emma finds Emma Hall, and nursing finds everyone in the Nursing department.
  • q is part of their first name and last name written together, or of their preferred name and last name. emma ha finds Emma Hall, so a first name and the start of a family name is enough.
  • q is part of their externalId or email address.
  • q is exactly the door number or the barcode held in their customFields.
  • q is the start of a number plate recorded for a member, typed in any case and with or without spaces. This needs at least three characters.

q does not look up card serial numbers or verification codes. To find the person a card belongs to, use Identify a card. When you need exactly one person by your own identifier, use the external ID lookup instead.

Terminal window
curl -sS "$CARDOFFICE_API/card-holders?status=active&department=Nursing&pageSize=50" \
-H "Authorization: Bearer $CARDOFFICE_KEY"
{
"data": [
{
"id": "0b5e4c1a-6a53-4d3b-9d45-3f6f6b2c9a10",
"externalId": "S1024",
"firstName": "Emma",
"lastName": "Hall",
"preferredName": null,
"holderType": "student",
"department": "Nursing",
"campus": null,
"email": "emma.hall@example.ac.nz",
"phone": null,
"expiryDate": "2027-12-31",
"validFrom": null,
"status": "active",
"currentPhotoId": null,
"customFields": {},
"version": 1,
"createdAt": "2027-02-01T02:14:09.311Z",
"updatedAt": "2027-02-01T02:14:09.311Z"
}
],
"meta": { "page": 1, "pageSize": 50, "total": 1 }
}
POST/card-holdersscope: card_holders:write

Send the fields above. firstName, lastName and holderType are required. Returns 201 with the new id.

Terminal window
curl -sS -X POST "$CARDOFFICE_API/card-holders" \
-H "Authorization: Bearer $CARDOFFICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"externalId": "S1024",
"firstName": "Emma",
"lastName": "Hall",
"holderType": "student",
"expiryDate": "2027-12-31",
"customFields": { "course": "BN-NURS" }
}'
{ "data": { "id": "0b5e4c1a-6a53-4d3b-9d45-3f6f6b2c9a10" } }
Status When
400 validation_failed validFrom is after expiryDate
409 conflict A holder with the same externalId already exists
422 validation_failed A field failed validation
GET/card-holders/{id}scope: card_holders:read

Returns the card holder object, or 404.

GET/card-holders/by-external-id/{externalId}scope: card_holders:read

An exact match on your identifier, without the partial matching of q. Use it whenever you must be certain you have the right person, such as when matching photo files named by student number. URL-encode the value. Returns the card holder object without validFrom, or 404. Read the person by id when you need their start date.

GET/card-holders/{id}/photoscope: photos:read

A short-lived link to the person’s current approved photo, the same image that is printed on their card. For systems that keep a photo of their own, such as a door access system’s cardholder image.

{
"data": {
"photoId": "5d1f0a52-7e0b-4f7e-8d6e-2a9c1f0e6b33",
"cardHolderId": "0b5e4c1a-6a53-4d3b-9d45-3f6f6b2c9a10",
"approvedAt": "2027-02-01T04:10:00.000Z",
"downloadUrl": "https://storage.example/...signed..."
}
}

Download the file straight away: the link works for at least five minutes and then expires. It needs no Authorization header, so do not store or log it. Returns 404 if the person has no approved photo. If your system keeps the photo, protect it as you would in CardOffice, and replace it when the photo changes. The photo.approved webhook tells you when, or photo.uploaded with status: "approved" for a photo approved without review.

PATCH/card-holders/{id}scope: card_holders:write

Send only the fields to change. Returns the updated card holder object.

Terminal window
curl -sS -X PATCH "$CARDOFFICE_API/card-holders/$ID" \
-H "Authorization: Bearer $CARDOFFICE_KEY" \
-H "Content-Type: application/json" \
-d '{ "department": "Midwifery", "expiryDate": "2028-12-31" }'

An empty body returns 400. Each change is recorded in the audit log against the API key that made it.

validFrom is checked against expiryDate after the change: if you send one of them, it is compared with the value already stored for the other. A start date after the expiry date returns 400 validation_failed and changes nothing.

Setting status to inactive stops the person’s card from verifying straight away, and cancels any card still waiting to be printed for them. It does not revoke the cards or digital IDs they already hold: if the person comes back, setting them active again makes the same card verify again. To cancel a card for good, such as one that was lost or stolen, staff report or revoke it in the portal.

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