Integration API API reference
Cards
The RFID cards of the people the key can see. Cards are issued in MASK, not through the API. Needs cards:read.
List cards#
/integration/cardsScope: cards:readThe cards of the people of the key's institutions (or of one, or of one person), oldest first. 403 institution_not_allowed for an institutionId outside the key.
There are no card writes: cards are issued in the MASK web app. cardNumber is the card's identifier, as the MASK web app shows it; a person has at most one active card. status=all adds inactive and lost cards.
curl -s "$MASK/integration/cards?employeeId=24" -H "Authorization: Bearer $KEY"
{
"list": [
{"id": 28, "employeeId": 24, "cardNumber": "0D0C0B0A", "description": "Visitor badge 17", "status": "active", "createdAt": 1793813038}
],
"count": 1,
"page": 1,
"pageSize": 50,
"totalPages": 1
}
Parameters
employeeIdqueryintegerOnly this person's cards; a person the key cannot see gives an empty list
institutionIdqueryintegerOne of the key's institutions; omitted = all of them
statusquerystringactive | all (adds inactive and lost cards)
default "active"
pagequeryinteger1-based
default 1
pageSizequeryinteger1-200
default 50
Responses
Fields of Card page
countintegerlistarray of CardFields of Card
cardNumberstringThe card's identifier, as the MASK web app shows it
cardSerialstringcreatedAtintegerEpoch seconds, UTC
descriptionstringemployeeIdintegeridintegerstatusstringactive, inactive or lost; a person has at most one active card
updatedAtinteger
pageintegerpageSizeintegertotalPagesinteger
Errors this route can answer
- 400Bad Request
validation_failedidempotency_requiredevent_too_old - 401Unauthorized
invalid_api_keykey_expiredkey_revoked - 403Forbidden
ip_not_allowedscope_missinginstitution_not_allowednot_api_eventadmin_linked_employee - 429Too Many Requests
rate_limited - 500Internal Server Error
internal_error - 503Service Unavailable
unavailable
Each error has the same JSON body; see Errors for what every code means.