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.
Request
Section titled “Request”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organizationId | Path | string | Yes | The Organization ID of the API key. Any other ID returns 404. |
contextId | Path | string | Yes | The ID of a Sign-In Context of the Organization. Any other ID returns 404. |
macs | Body | string[] | Yes | The MAC addresses of the devices, 1 to 500, aa:bb:cc:dd:ee:ff, in upper or lower case, each once. |
Request example
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"] }'Response
Section titled “Response”200 with one result per device.
| Field | Type | Description |
|---|---|---|
results | object[] | One entry per device sent, in the order sent. |
results[].mac | string | The MAC address of the device, in lower case. |
results[].outcome | string | ENDED when the device had an active whitelisting, which was ended; NOT_ACTIVE when it had none. New values can be added within v2. |
results[].reason | null | Always null in this operation. |
Response example
{ "results": [ { "mac": "02:00:5e:10:ab:01", "outcome": "ENDED", "reason": null }, { "mac": "02:00:5e:10:ab:02", "outcome": "NOT_ACTIVE", "reason": null } ]}Errors
Section titled “Errors”| Status | errorCode | When |
|---|---|---|
400 | VALIDATION_FAILED | The 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. |
400 | VALIDATION_FAILED | A MAC address is listed twice, in any case: errors names the second one with the code DUPLICATE. Nothing is ended. |
404 | RESOURCE_NOT_FOUND | organizationId 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.