Credential
The APIs here are designed for managing PIN codes, NFC cards, and other related credentials.
Generate PIN Code
This API enables you to generate a PIN code. A PIN code can be assigned to a visitor or user, and once assigned, they can use it to unlock doors.
Request URL: /api/v1/developer/credentials/pin_codes
Permission Key: view:credential
Method: POST
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Response Body
| Parameter | Required | Type | Description | Related API | Purpose |
| data | T | String | PIN code | /api/v1/developer/users; /api/v1/developer/visitors | Assign the PIN code to the created user or visitor. |
Request Sample: Shell/cURL
The request body should be a JSON object containing the following fields:
curl --location --request POST '{host}/api/v1/developer/credentials/pin_codes'
-H 'Authorization: Bearer wHFmHR*****kD6wHg'
-H 'Content-Type: application/json'
--data ''
--insecureResponse Sample
{
"code": "SUCCESS",
"data": "67203419",
"msg": "success"
}Enroll NFC Card
Wake up a UA reader and create a session to enroll an NFC card.
Request URL: /api/v1/developer/credentials/nfc_cards/sessions
Permission Key: edit:credential
Method: POST
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Body
| Parameter | Required | Type | Description | How to Get It? |
| device_id | T | String | Identity ID of the device. | Get it from the API /api/v1/developer/devices. |
| reset_ua_card | F | Boolean | This option allows you to reset an NFC card already enrolled at another site. |
Response Body
| Parameter | Required | Type | Description | Related API | Purpose |
| session_id | T | String | The session for enrolling an NFC card. | #6.3 /api/v1/developer/credentials/nfc_cards/sections/{session_id} | NFC card polling result. |
Request Sample
curl '{host}/api/v1/developer/credentials/nfc_cards sessions'
-H 'Authorization: Bearer wHFmHR*****kD6wHg'
-H 'accept: application/json'
-H 'content-type: application/json'
--data-raw '{"device_id": "0418d6a2bb7a", "reset_ua_card": false}'
--insecureResponse Sample
{
"code": "SUCCESS",
"msg": "success",
"data": {
"session_id": "e8a97c52-6676-4c48-8589-bd518afc4094"
}
}Fetch NFC Card Enrollment Status
This API enables you to poll a UA reader to fetch the NFC card enrollment status and the generated card tokens.
Request URL: /api/v1/developer/credentials/nfc_cards/sessions/:id
Permission Key: edit:credential
Method: GET
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Body
| Parameter | Required | Type | Description | Related API | How to Get It? |
| id | T | String | The ID of the session #6.2. | /api/v1/developer/users; /api/v1/developer/visitors | Get session id from the API #6.2 |
Response Body
| Parameter | Required | Type | Description | Related API | Purpose |
| token | T | String | Unique NFC card token. | /api/v1/developer/users; /api/v1/developer/visitors | The generated card token is used to bind to a user or visitor. |
| card_id | T | String | Display ID of the NFC card. |
GET /api/v1/developer/credentials/nfc_cards/sections/e8a97c52-6676-4c48-8589-bd518afc4094Response Sample
{
"code": "SUCCESS",
"msg": "success",
"data": {
"card_id": "014A3151",
"token": "821f90b262e90c5c0fbcdf3d6d2f3b94cc015d6e8104ab4fb96e4c8b8e90cb7"
}
}Remove a Session Created for NFC Card Enrollment
This API enables you to remove a session created for enrolling an NFC card.
Request URL: /api/v1/developer/credentials/nfc_cards/sessions/:id
Permission Key: edit:credential
Method: DELETE
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Body
| Parameter | Required | Type | Description | Related API | How to Get It? |
| id | T | String | The ID of the session #6.2. | /api/v1/developer/users; /api/v1/developer/visitors | Get session id from the API #6.2 |
Request Sample
DELETE /api/v1/developer/credentials/nfc_cards/sessions/e8a97c52-6676-4c48-8589-bd518afc4094{
"code": "SUCCESS",
"msg": "success",
"data": "success"
}Flowchart for NFC Card Enrollment
enroll-nfc-card
NFC Card Schemas
| Parameter | Type | Description |
| token | String | Identity token of the NFC card. |
| display_id | String | Display ID of the NFC card. |
| status | String | Status of the NFC card. enum status {assigned, pending, disable, deleted, loss} |
| alias | String | Preferred name of the NFC card. |
| card_type | String | Type of the NFC card. |
| user_id | String | Owner ID of the NFC card. |
| user_type | String | Type of the owner. enum user_type {USER,VISITOR} |
| user | Object | Owner of the NFC card. |
| user.id | String | Identity ID of the user. |
| user.first_name | String | First name of the user. |
| user.last_name | String | Last name of the user. |
| user.name | String | Full name of the user. |
Fetch NFC Card
This API allows you to fetch NFC card details.
Request URL: /api/v1/developer/credentials/nfc_cards/tokens/:token
Permission Key: view:credential
Method: GET
UniFi Access Requirement: Version 1.22.16 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Path
| Parameter | Required | Type | Description | Example | How to Get It? |
| token | T | String | Token of the NFC card. | 821f90b262e90c5c0fbcdfd3d6d2f3b94cc015d6e8104ab4fb96e4c8b8e90cb7 | Get it from the API #6.3 #6.8 |
Response Body
Schemas: NFC Card Schemas
Response Sample
{
"code": "SUCCESS",
"data": {
"alias": "",
"card_type": "ua_card",
"display_id": "100005",
"note": "100005",
"status": "assigned",
"token": "f77d69b08eaf5eb5d647ac1a0a73580f1b27494b345f40f54fa022a8741fa15c",
"user": {
"avatar": "",
"first_name": "H",
"id": "e0051e08-c4d5-43db-87c8-a9b19cb66513",
"last_name": "L",
"name": "H L"
},
"user_id": "e0051e08-c4d5-43db-87c8-a9b19cb66513",
"user_type": "USER"
},
"msg": "success"
}Request Sample
The request body should be a JSON object containing the following fields:
curl -XGET
'{host}/api/v1/developer/credentials/nfc_cards/tokens/f77d69b08eaf5eb5d647ac1a0a73580f1b27
494b345f40f54fa022a8741fa15c'
-H 'Authorization: Bearer wHFmHR*****KD6wHg'
-H 'accept: application/json'
-H 'content-type: application/json'
--insecureFetch All NFC Cards
This API allows you to fetch all NFC cards.
Request URL: /api/v1/developer/credentials/nfc_cards/tokens
Permission Key: view:credential
Method: GET
UniFi Access Requirement: Version 1.22.16 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Query Parameters
| Parameter | Required | Type | Description | Example |
| page_num | F | String | Current page number in the pagination. | 1 |
| page_size | F | String | Number of users per page. | 25 |
Response Body
Schemas: NFC Card Schemas
Response Sample
{
"code": "SUCCESS",
"data": [
{
"alias": "",
"card_type": "ua_card",
"display_id": "100004",
"note": "100004",
"status": "assigned",
"token": "9e24cdfafebeb63e58fd02c5f67732b478948e5793d31124239597d9a86b30dc4",
"user": {
"avatar": "",
"first_name": "H",
"id": "e0051e08-c4d5-43db-87c8-a9b19cb66513",
"last_name": "L",
"name": "H L"
},
"user_id": "e0051e08-c4d5-43db-87c8-a9b19cb66513",
"user_type": "USER"
},
{
"alias": "F77D69B03",
"card_type": "ua_card",
"display_id": "100005",
"note": "100005",
"status": "assigned",
"token": "f77d69b08eaf5eb5d647ac1a0a73580f1b27494b345f40f54fa022a8741fa15c",
"user": {
"avatar": "",
"first_name": "H2",
"id": "34dc90a7-409f-4bf8-a5a8-1c59535a21b9",
"last_name": "L",
"name": "H2 L"
},
"user_id": "34dc90a7-409f-4bf8-a5a8-1c59535a21b9",
"user_type": "VISITOR"
}
],
"msg": "success",
"pagination": {
"page_num": 1,
"page_size": 2,
"total": 2
}
}Request Sample
The request body should be a JSON object containing the following fields:
curl -XGET '{host}/api/v1/developer/credentials/nfc_cards/tokens?page_num=1&page_size=12' \
-H 'Authorization: Bearer wHFmHR*****kD6wHg' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
--insecureDelete NFC Card
This API allows you to delete an NFC card.
Request URL: /api/v1/developer/credentials/nfc_cards/tokens/:token
Permission Key: edit:credential
Method: DELETE
UniFi Access Requirement: Version 1.22.16 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Path
| Parameter | Required | Type | Description | Example | How to Get It? |
| token | T | String | Token of the NFC card. | 821f90b262e90c5c0fbcdf3d6d2f3b94cc015d6e8104ab4fb96e4c8b8e90cb7 | Get it from the API #6.3 #6.8 |
Response Sample
{
"code": "SUCCESS",
"data": "success",
"msg": "success"
}Request Sample
The request body should be a JSON object containing the following fields:
curl -XDELETE
'{host}/api/v1/developer/credentials/nfc_cards/tokens/f77d69b08eaf5eb5d647ac1a0a73580f1b27
494b345f40f54fa022a8741fa15c'
-H 'Authorization: Bearer wHFmHR*****KD6wHg'
-H 'accept: application/json'
-H 'content-type: application/json'
--insecureUpdate NFC Card
This API allows you to update an NFC card.
Request URL: /api/v1/developer/credentials/nfc_cards/tokens/:token
Permission Key: edit:credential
Method: PUT
UniFi Access Requirement: Version 3.1.30 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Path
| Parameter | Required | Type | Description | Example | How to Get It? |
| token | T | String | Token of the NFC card. | 821f90b262e90c5c0fbcdfd3d6d2f3b94cc015d6e8104ab4fb96e4c8b8e90cb7 | Get it from the API #6.3 #6.8 |
Request Body
| Parameter | Required | Type | Description | Related API | How to Get It? |
| alias | F | String | Alias of the NFC card. |
Response Sample
{
"code": "SUCCESS",
"data": "success",
"msg": "success"
}Request Sample
The request body should be a JSON object containing the following fields:
curl -XPUT \
'{host}/api/v1/developer/credentials/nfc_cards/tokens/f77d69b08eaf5eb5d647ac1a0a73580f1b27494b345f40f54fa022a8741fa15c' \
-H 'Authorization: Bearer wHFmHR*****kD6wHg' \
-H 'accept: application/json' \
-H 'content-type: application/json' \
--data '{
"alias": "New Alias"
}' \
--insecureTouch Pass Schemas
| Parameter | Type | Description |
| activated_at | Object | Timestamp when the credential is activated. |
| card_id | String | Identifier of the card. |
| card_name | String | Display name of the card. |
| expired_at | Object | Timestamp when the credential expires. |
| id | String | Unique identifier of the credential record. |
| last_activity | String | Timestamp of the last activity or usage. |
| status | String | enum status {ACTIVE, PENDING, SUSPENDED, INACTIVE, EXPIRED} Status of the Touch Pass. |
| user_avatar | String | URL to the user's avatar image. |
| user_email | String | Email address of the user. |
| user_id | String | Unique identifier of the user. |
| user_name | String | Full name of the user. |
| user_status | String | enum user_status {ACTIVE, PENDING, UNLINK} Status of the user account. |
| bundles | Array[Object] | List of mobile credential bundles assigned to the user. |
| bundles[].bundle_id | String | Unique identifier of the mobile credential bundle. |
| bundles[].bundle_status | String | enum bundle_status {ACTIVE, SUSPENDED} Status of the bundle. |
| bundles[].device_id | String | Identifier of the device linked to the bundle. |
| bundles[].device_name | String | Display name of the linked device. |
| bundles[].device_type | Integer | Code representing the device type. |
| bundles[].source | String | enum source {google, apple} Source platform of the mobile credential. |
Fetch the Touch Pass List
This API allows you to fetch a list of Touch Passes, filtered by status.
Request URL: /api/v1/developer/credentials/touch_passes
Permission Key: view:credential
Method: GET
UniFi Access Requirement: Version 3.2.20 or later
Note: If user_status is UNLINK , it indicates the associated user is no longer linked (i.e., the user is
considered lost or removed from the system).
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Query Parameters
| Parameter | Required | Type | Description | Example |
| page_num | F | String | Current page number in the pagination. | 1 |
| page_size | F | String | Number of Touch Passes per page. | 10 |
| status | F | String | enum status {ACTIVE, PENDING, SUSPENDED, INACTIVE} Filter results by pass status. | PENDING |
Response Body
Schemas: Touch Pass Schemas
Response Sample
{
"code": "SUCCESS",
"data": [
{
"bundles": [],
"card_id": "F8AD-3A41-787D-4D30",
"card_name": "",
"id": "31fa3c4e-4a42-4021-a3f9-6ae08610cf32",
"last_activity": "2025-04-03T07:29:13+01:00",
"status": "PENDING",
"user_avatar": "https://****.svc.ui.com/186b07b1-fa13-49b5-8954-399d1b9c5285",
"user_email": "example@ui.com",
"user_id": "472cabd2-0634-4e85-9e8d-5a73b500516a",
"user_name": "Example Name",
"user_status": "ACTIVE"
},
{
"bundles": [],
"card_id": "057B-D703-0C6D-4AC9",
"card_name": "",
"id": "0e297aea-2b66-434c-a3bc-4f26314ed509",
"last_activity": "2025-04-03T07:29:13+01:00",
"status": "PENDING",
"user_avatar": "https://****.svc.ui.com/9c11e195-ad37-4d79-955d-4c07645aeeda",
"user_email": "example@ui.com",
"user_id": "2b96d25e-f4be-4383-9b90-73741a985ef1",
"user_name": "test name",
"user_status": "ACTIVE"
},
{
"bundles": [],
"card_id": "DDEA-906E-DBAF-49A1",
"card_name": "",
"id": "ff6abef9-ca97-4aa6-b6a8-e07c6896d541",
"last_activity": "2025-04-03T07:29:13+01:00",
"status": "PENDING",
"user_avatar": "https://****.svc.ui.com/e1392d90-9973-4e40-AA83-02edb8ef1a73",
"user_email": "example@ui.com",
"user_id": "c16941d1-a4c0-429e-8960-9cf126b96878",
"user_name": "Example Name",
"user_status": "ACTIVE"
}
],
"msg": "success",
"pagination": {
"page_num": 1,
"page_size": 3,
"total": 3
}
}Request Sample
curl --location --request GET
'https://192.168.1.1:12445/api/v1/developer/credentials/touch_passes?
page_num=1&page_size=10&status=PENDING'
--header 'Authorization: Bearer wHFmHR*****kD6wHg'
--header 'Content-Type: application/json' \
--insecureSearch Touch Pass
This API allows you to search for Touch Passes using filter conditions, such as card ID.
Request URL: /api/v1/developer/credentials/touch_passes/search
Permission Key: view:credential
Method: GET
UniFi Access Requirement: Version 3.2.20 or later
Note: If user_status is UNLINK , it indicates the associated user is no longer linked (i.e., the user is considered lost or removed from the system).
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Query Parameters
| Parameter | Required | Type | Description | Example |
| condition | T | String | Search condition (e.g., card_id, user_name) | 057B, Example Name |
Response Body
Schemas: Touch Pass Schemas
Response Sample
{
"code": "SUCCESS",
"data": [
{
"bundles": [],
"card_id": "057B-D703-0C6D-4AC9",
"card_name": "",
"id": "0e297aea-2b66-434c-a3bc-4f26314ed509",
"last_activity": "2025-04-03T07:29:13+01:00",
"status": "PENDING",
"user_avatar": "https://******.svc.u1.com/9c11e195-ad37-4d79-955d-4c07645aeeda",
"user_email": "example@ui.com",
"user_id": "2b96d25e-f4be-4383-9b90-73741a985ef1",
"user_name": "Test Name",
"user_status": "ACTIVE"
}
],
"msg": "success"
}Request Sample
curl --location --request GET
'https://192.168.1.1:12445/api/v1/developer/credentials/touch_passes/search?condition=057B'
\--header 'Authorization: Bearer wHFmHR*****kD6wHg' \
--header 'Content-Type: application/json' \
--insecureFetch All Assignable Touch Passes
This API allows you to fetch all suspended or inactive Touch Passes that can be reassigned.
Request URL: /api/v1/developer/credentials/touch_passes/assignable
Permission Key: view:credential
Method: GET
UniFi Access Requirement: Version 3.2.20 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Response Body
| Parameter | Type | Description |
| id | String | Unique identifier of the Touch Pass. |
| card_id | String | Card ID associated with the Touch Pass. |
| card_name | String | Optional name of the card. |
| last_activity | String | Timestamp of the last recorded activity. |
| status | String | enum status {SUSPENDED, INACTIVE} Status of the Touch Pass. |
| user_id | String | Unique identifier of the user (empty if unassigned). |
| user_name | String | Full name of the user (empty if unassigned). |
| user_email | String | Email of the user (empty if unassigned). |
| user_status | String | Status of the user (empty if unassigned). |
| user_avatar | String | URL to the user's avatar (empty if unassigned). |
| bundles | Array | Reserved for future use (currently always empty). |
Response Sample
{
"code": "SUCCESS",
"data": [
{
"bundles": [],
"card_id": "0007-130C-4845-4A01",
"card_name": "",
"id": "2d75e424-6171-4e86-900b-AA696fb05893",
"last_activity": "2025-04-09T13:40:28+08:00",
"status": "INACTIVE",
"user_avatar": "",
"user_email": "",
"user_id": "",
"user_name": "",
"user_status": ""
},
{
"bundles": [],
"card_id": "70A3-2FAD-181B-4CC9",
"card_name": "",
"id": "c83b69ff-1992-4e7f-9287-1e6a161adeea",
"last_activity": "2025-04-09T13:40:28+08:00",
"status": "INACTIVE",
"user_avatar": "",
"user_email": "",
"user_id": "",
"user_name": "",
"user_status": ""
}
],
"msg": "success"
}Request Sample
The request body should be a JSON object containing the following fields:
curl --location --request GET
'https://192.168.1.1:12445/api/v1/developer/credentials/touch_passes/assignable' \
--header 'Authorization: Bearer wHFmHR*****kD6wHg' \
--header 'Content-Type: application/json' \
--insecureUpdate Touch Pass
This API allows you to update a Touch Pass's card name, modify its status ( ACTIVE / SUSPENDED ), and unbundle devices ( bundle_status: DISABLED ).
Request URL: /api/v1/developer/credentials/touch_passes/:id
Permission Key: edit:credential
Method: PUT
UniFi Access Requirement: Version 3.2.20 or later
Note: If user_status is UNLINK , it indicates the associated user is no longer linked (i.e., the user is considered lost or removed from the system).
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Path
| Parameter | Required | Type | Description | Example | How to Get It? |
| id | T | String | ID of the Touch Pass to update. | 1d64d2b8-a8b0-4c73-9d49-4922ad0cab9 | Get it from API /api/v1/developer/credentials/touch_passes/search |
Request Body
| Parameter | Required | Type | Description | How to Get It? |
| card_name | F | String | Card name or alias. | |
| status | F | String | enum status {ACTIVE, SUSPENDED} Card status. | |
| bundles | F | Arrayobject | List of bundles to disable (remove). Each bundle object is required. | Get it from API /api/v1/developer/credentials/touch_passes/search |
| bundles[].bundle_id | T | String | ID of the bundle to be disabled. | |
| bundles[].bundle_status | T | String | enum bundle_status {DISABLED} Support for unbundled devices. |
Response Body
| Parameter | Type | Description |
| activated_at | Object | Timestamp when the credential is activated. |
| card_id | String | Identifier of the card. |
| card_name | String | Display name of the card. |
| expired_at | Object | Timestamp when the credential expires. |
| id | String | Unique identifier of the credential record. |
| last_activity | String | Timestamp of the last activity or usage. |
| status | String | enum status {ACTIVE, PENDING, SUSPENDED, INACTIVE, EXPIRED} Status of the Touch Pass. |
| user_avatar | String | URL to the user's avatar image. |
| user_email | String | Email address of the user. |
| user_id | String | Unique identifier of the user. |
| user_name | String | Full name of the user. |
| user_status | String | enum user_status {ACTIVE, PENDING, UNLINK} Status of the user account. |
| bundles | Array[Object] | List of mobile credential bundles assigned to the user. |
| bundles[].bundle_id | String | Unique identifier of the mobile credential bundle. |
| bundles[].bundle_status | String | enum bundle_status {ACTIVE, SUSPENDED} Status of the bundle. |
| bundles[].device_id | String | Identifier of the device linked to the bundle. |
| bundles[].device_name | String | Display name of the linked device. |
| bundles[].device_type | Integer | Code representing the device type. |
| bundles[].source | String | enum source {google, apple} Source platform of the mobile credential. |
Response Sample
{
"code": "SUCCESS",
"data": {
"activated_at": {},
"bundles": [],
"card_id": "7880-C192-AF0E-4306",
"card_name": "test",
"expired_at": {},
"id": "1d64d2b8-a8b0-4c73-9d49-4922ad0cacb9",
"last_activity": "2025-04-09T17:58:18+08:00",
"status": "SUSPENDED",
"user_avatar": "",
"user_email": "example@ui.com",
"user_id": "1f57be2b-f721-4ea3-b1d1-626815b468f0",
"user_name": "Test Name",
"user_status": "ACTIVE"
},
"msg": "success"
}Request Sample
Update Card Name & Update Touch Pass Status
Update Card Name & Status
curl --location --request PUT \
'https://192.168.1.1:12445/api/v1/developer/credentials/touch_passes/1d64d2b8-a8b0-4c73-9d49-4922ad0cab9' \
--header 'Authorization: Bearer wHFmHR*****kD6wHg' \
--header 'Content-Type: application/json' \
--data '{
"card_name": "test",
"status": "SUSPENDED"
}'Unbundle Devices
curl --location --request PUT \
'https://192.168.1.1:12445/api/v1/developer/credentials/touch_passes/1d64d2b8-a8b0-4c73-9d49-4922ad0cacb9' \
--header 'Authorization: Bearer wHFmHR*****kD6wHg' \
--header 'Content-Type: application/json' \
--data '{
"bundles": [
{
"bundle_id": "DAPLODe22212d0-a70e-4649-ae19-c0e745d65335",
"bundle_status": "DISABLED"
}
]
}'Fetch Touch Pass Details
This API retrieves detailed information about a specific Touch Pass using its ID.
Request URL: /api/v1/developer/credentials/touch_passes/:id
Permission Key: view:credential
Method: GET
UniFi Access Requirement: Version 3.2.20 or later
Note: If user_status is UNLINK , it indicates the associated user is no longer linked (i.e., the user is considered lost or removed from the system).
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
| Parameter | Required | Type | Description | Example | How to Get It? |
| id | T | String | ID of the Touch Pass. | c83b69ff-1992-4e7f-9287-1e6a161adeea | Get it from API /api/v1/developer/credentials/touch_passes/search |
Response Sample
{
"code": "SUCCESS",
"data": {
"activated_at": {},
"bundles": [
{
"bundle_id": "caf6bd5b-6b8d-409a-b500-977a0f02b181",
"bundle_status": "ACTIVE",
"device_id": "device-id-1",
"device_name": "Test Android",
"device_type": 20,
"source": "google"
}
],
"card_id": "70A3-2FAD-181B-4CC9",
"card_name": "",
"expired_at": {},
"id": "c83b69ff-1992-4e7f-9287-1e6a161adeea",
"last_activity": "2025-04-09T17:49:20+08:00",
"status": "ACTIVE",
"user_avatar": "",
"user_email": "example@ui.com",
"user_id": "3e763e5d-6804-437d-ae8d-3fee74119b80",
"user_name": "Example Name",
"user_status": "ACTIVE"
},
"msg": "success"
}Request Sample
curl --location --request GET \
'https://192.168.1.1:12445/api/v1/developer/credentials/touch_passes/c83b69ff-1992-4e7f-9287-1e6a161adeea' \
--header 'Authorization: Bearer wHFmHR*****kD6wHg' \
--header 'Content-Type: application/json'Purchase Touch Passes
This API allows you to purchase new Touch Passes. Ensure a valid payment method is configured in the Access web application before using this API.
Request URL: /api/v1/developer/credentials/touch_passes
Permission Key: edit:credential
Method: POST
UniFi Access Requirement: Version 3.2.20 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Body
| Parameter | Required | Type | Description | How to Get It? |
| count | T | Int | Total number of Touch Passes to be purchased. | Manual input |
Response Body
| Parameter | Type | Description |
| id | String | ID of the newly purchased Touch Pass. |
| card_id | String | Card ID assigned to the pass. |
| card_name | String | Card alias or name. Initially empty. |
| status | String | Initial Touch Pass status after purchase (INACTIVE). |
| last_activity | String | Timestamp of the last activity or usage. |
| bundles | Array | Empty array by default. |
| user_id | String | Empty string; Touch Pass is not yet assigned to any user. |
| user_name | String | Empty string; Touch Pass is not yet assigned to any user. |
| user_email | String | Empty string; Touch Pass is not yet assigned to any user. |
| user_avatar | String | Empty string. |
| user_status | String | Empty string. |
Response Sample
{
"code": "SUCCESS",
"data": {
"bundles": [],
"card_id": "F8AD-3A41-787D-4D30",
"card_name": "",
"id": "31fa3c4e-4a42-4021-a3f9-6ae08610cf32",
"last_activity": "2025-04-03T10:28:42+01:00",
"status": "INACTIVE",
"user_avatar": "",
"user_email": "",
"user_id": "",
"user_name": "",
"user_status": ""
},
"msg": "success"
}Request Sample
curl --location 'https://192.168.1.1:12445/api/v1/developer/credentials/touch_passes' \
--header 'Authorization: Bearer wHFmHR*****kD6wHg' \
--header 'Content-Type: application/json' \
--data '{ "count": 2 }'Download QR Code Image
This API allows you to download a QR code image by its ID.
Request URL: /api/v1/developer/credentials/qr_codes/download/:visitor_id
Permission Key: view:credential
Method: GET
UniFi Access Requirement: Version 3.3.10 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Path
| Parameter | Required | Type | Description | How to Get It? |
| visitor_id | T | String | ID of the visitor to be downloaded. | Get it from the API /api/v1/developer/visitors |
Request Sample: Shell/cURL
curl --location --request GET
'https://192.168.1.1:12445/api/v1/developer/credentials/qr_codes/download/15a90692-6f3b-4e1c-9886-bcd15e9c3f2d' \
--header 'Authorization: Bearer s4KgshBaoXTwXwFAHLPwDw' \
--header 'Content-Type: application/json' \
--output visitor_qr_code.png \
--insecureImport Third-Party NFC Cards
This API allows you to import third-party NFC card IDs by uploading a CSV file into the Access system.
Request URL: /api/v1/developer/credentials/nfc_cards/import
Permission Key: edit:credential
Method: POST
UniFi Access Requirement: Version 3.3.10 or later
Request Header
| Parameter | Required | Type | Description |
| Authorization | T | String | Token required for authentication and access control. |
Request Body
| Parameter | Required | Type | Description |
| file | T | File | A CSV file containing NFC IDs or optional aliases. |
CSV Format
068E2836, alias1
068E2839, alias2
068E2838, alias3NOTE: 068E2836 is an example NFC ID of a third-party card. NFC IDs are represented in uppercase hexadecimal. The alias field must be unique. Duplicate aliases will cause the import to fail. If the returned token is empty, it means the import has failed for that record.
Request Sample: Shell/cURL
curl --location 'https://192.168.1.1:12445/api/v1/developer/credentials/nfc_cards/import' \
--header 'Authorization: Bearer NvrB7qunKOFi/HcIjUMF0w' \
--form 'file=@"/Documents/ufcs.csv'"Response Sample
{
"code": "SUCCESS",
"data": [
{
"alias": "alias1",
"nfc_id": "068E2836",
"token": "e0d473463b421f472f81baf0dbec7c066a5cca48bde4f7d40199d8aa15f9fc21"
},
{
"alias": "alias2",
"nfc_id": "068E2839",
"token": "6d29a729b99fdf5c1e1138deafc4c29a7c8567d10e1b298300a33b7d1dd4f05c"
},
{
"alias": "alias3",
"nfc_id": "068E2838",
"token": "082ff5a1d22c7488da657185d213979c987418416d8b99cd471346407d265130"
}
],
"msg": "success"
}