Skip to content
Whitelistings

End whitelistings in a batch

Ends the active whitelistings of up to 500 devices in one request.

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

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

The response has one result per device, in the order sent.

  • The whitelistings end now. A device without an active whitelisting gets the outcome NOT_ACTIVE, and nothing is done for it.
  • Repeating the call is safe. Sending the same request again ends nothing more and gives every device the outcome NOT_ACTIVE.
  • An ended whitelisting cannot be changed. To whitelist a device again, create a new whitelisting.
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.
macsBodystring[]YesThe MAC addresses of the devices, 1 to 500, aa:bb:cc:dd:ee:ff, in upper or lower case, each once.

Request example

cURL
curl -X POST "$API_BASE_URL/organizations/$ORGANIZATION_ID/contexts/sign-in/$CONTEXT_ID/whitelistings/batch-revoke" \
-H "Authorization: Bearer $NCP_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"macs": ["02:00:5e:10:ab:01", "02:00:5e:10:ab:02"]
}'

200 with one result per device.

FieldTypeDescription
resultsobject[]One entry per device sent, in the order sent.
results[].macstringThe MAC address of the device, in lower case.
results[].outcomestringENDED when the device had an active whitelisting, which was ended; NOT_ACTIVE when it had none. New values can be added within v2.
results[].reasonnullAlways null in this operation.

Response example

200
{
"results": [
{ "mac": "02:00:5e:10:ab:01", "outcome": "ENDED", "reason": null },
{ "mac": "02:00:5e:10:ab:02", "outcome": "NOT_ACTIVE", "reason": null }
]
}
StatuserrorCodeWhen
400VALIDATION_FAILEDThe list is empty or has more than 500 items, or an item is not a MAC address in the colon format. errors names each item. Nothing is ended.
400VALIDATION_FAILEDA MAC address is listed twice, in any case: errors names the second one with the code DUPLICATE. Nothing is ended.
404RESOURCE_NOT_FOUNDorganizationId is not the Organization of the API key, or contextId is not one of its Sign-In Contexts.

Errors common to all operations are in Errors.