Skip to content
Whitelistings

Create a whitelisting

Creates a whitelisting for one device in a Sign-In Context.

POST /organizations/{organizationId}/contexts/sign-in/{contextId}/whitelistings

Permission: Sign In › Sign In Modules › Whitelisting (Write). See API permissions.

The device must not already have an active whitelisting in the context. A device that has one returns 409 with the errorCode ALREADY_EXISTS and nothing is created, so repeating the call is safe. Update that whitelisting instead, or use Create whitelistings in a batch, which updates it.

ParameterInTypeRequiredDescription
organizationIdPathstringYesThe Organization ID of the API key. Any other ID returns 404.
contextIdPathstringYesThe ID of a Sign-In Context of the Organization. Any other ID returns 404.
macBodystringYesThe MAC address of the device, aa:bb:cc:dd:ee:ff, in upper or lower case.
nameBodystringYesA name that describes the device, 2 to 100 characters.
descriptionBodystringNoThe description, up to 200 characters.
tagsBodystring[]NoUp to 50 tags, each 2 to 30 characters. Stored in lower case.
validUntilBodystring (date)NoThe last day the whitelisting is valid, YYYY-MM-DD, today or later and before 2099-12-31. It ends at the end of that day in the time zone of the platform. Left out, the whitelisting does not expire.

The name, the description and the tags accept letters, digits, space and _ : ( ) & , . / " + -. See Validation rules.

Request example

cURL
curl -X POST "$API_BASE_URL/organizations/$ORGANIZATION_ID/contexts/sign-in/$CONTEXT_ID/whitelistings" \
-H "Authorization: Bearer $NCP_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mac": "02:00:5E:10:AB:01",
"name": "Lobby display",
"description": "Digital signage, main entrance",
"tags": ["Signage", "lobby"],
"validUntil": "2026-12-31"
}'

201 with the new whitelisting. The Location header is the path of Get a whitelisting for it.

FieldTypeDescription
whitelistingIdstringThe ID of the whitelisting.
macstringThe MAC address, in lower case.
namestringThe name.
descriptionstring or nullThe description, or null when there is none.
tagsstring[]The tags, in lower case, in no particular order.
createdAtstring (date-time)When the whitelisting was created.
expiresAtstring (date-time) or nullWhen the whitelisting ends. null when validUntil was left out.

Response example

201
{
"whitelistingId": "6aba6cb007a2eda4c7c79ade",
"mac": "02:00:5e:10:ab:01",
"name": "Lobby display",
"description": "Digital signage, main entrance",
"tags": ["lobby", "signage"],
"createdAt": "2026-09-28T13:33:36.341Z",
"expiresAt": "2026-12-31T22:59:59.999Z"
}

In this example expiresAt is the last millisecond of 31 December in the time zone of the platform, written in UTC.

StatuserrorCodeWhen
400VALIDATION_FAILEDA field is missing or breaks a validation rule. errors names each field, for example mac with the code INVALID_FORMAT, or validUntil with the code OUT_OF_RANGE when it is before today or not before 2099-12-31. Nothing is created.
404RESOURCE_NOT_FOUNDorganizationId is not the Organization of the API key, or contextId is not one of its Sign-In Contexts.
409ALREADY_EXISTSThe device already has an active whitelisting: The device already has an active whitelisting in this context, so nothing was created. Update that whitelisting instead, or use the batch create, which updates it.
409SIGN_IN_WHITELISTING_REFUSEDThe rules for whitelistings of the context refuse the device: The context refused the whitelisting. Nothing is created.

Errors common to all operations are in Errors.

Next