Skip to content
Whitelisting

Batch-add whitelistings

Create many whitelist entries in a single call; optional auto-tagging.

POST /v1/org/{organizationId}/contexts/sign-in/{contextId}/modules/whitelistings/batch/add

Bulk-create whitelist entries. Entries that already exist (same MAC) are skipped and returned in existingWhitelistingMacs. Entries that fail validation are returned in faultyRequests for inspection.

ParameterInTypeRequiredDescription
organizationIdPathstringYesOrganization ID.
contextIdPathstringYesSign-In Context ID.
x-auth-tokenHeaderstringYesContext API key.
whitelistingsBodyobject[]YesArray of whitelist entries to create.
whitelistings[].macstringYesMAC, AA:BB:CC:DD:EE:FF or AA-BB-CC-DD-EE-FF.
whitelistings[].namestringOptional. If supplied, 2–100 characters. Allowed: alphanumeric plus å ä ö Å Ä Ö ( ) & - , . / " + and space.
whitelistings[].descriptionstring0–200 characters.
whitelistings[].tagsobject[]Tag array. Same shape as the single-entry endpoint.
autoGenerateTagsBodybooleanWhen true, each entry’s description is split on spaces and every resulting token is added as a (lowercased) tag on that created entry. (default: false)
autoGenerateDateTagBodybooleanWhen true, each created entry gets a tag carrying the current date and time (timestamp) — useful when you rotate batches daily. (default: false)

Request example

cURL
curl -X POST "$API_BASE_URL/v1/org/$ORG_ID/contexts/sign-in/$CTX_ID/modules/whitelistings/batch/add" \
-H "x-auth-token: $NETGRAPH_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"whitelistings": [
{ "mac": "AA:BB:CC:00:00:01", "name": "Printer A" },
{ "mac": "AA:BB:CC:00:00:02", "name": "Printer B" }
],
"autoGenerateTags": true,
"autoGenerateDateTag": true
}'
FieldTypeDescription
createdWhitelistingMacsstring[]MACs that were newly created.
existingWhitelistingMacsstring[]MACs that were already in the whitelist and were therefore skipped.
faultyRequestsobject[]Entries that failed validation. Each entry matches the input shape so you can re-submit after fixing the data.
updatedLoginsintegerNumber of existing guest sessions updated as a side-effect of the batch (e.g. moved to a whitelist-authorized state).

Response example

200
{
"createdWhitelistingMacs": ["AA:BB:CC:00:00:01", "AA:BB:CC:00:00:02"],
"existingWhitelistingMacs": [],
"faultyRequests": [],
"updatedLogins": 0
}

Next