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.
Request
Section titled “Request”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organizationId | Path | string | Yes | Organization ID. |
contextId | Path | string | Yes | Sign-In Context ID. |
x-auth-token | Header | string | Yes | Context API key. |
whitelistings | Body | object[] | Yes | Array of whitelist entries to create. |
whitelistings[].mac | string | Yes | MAC, AA:BB:CC:DD:EE:FF or AA-BB-CC-DD-EE-FF. | |
whitelistings[].name | string | Optional. If supplied, 2–100 characters. Allowed: alphanumeric plus å ä ö Å Ä Ö ( ) & - , . / " + and space. | ||
whitelistings[].description | string | 0–200 characters. | ||
whitelistings[].tags | object[] | Tag array. Same shape as the single-entry endpoint. | ||
autoGenerateTags | Body | boolean | When 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) | |
autoGenerateDateTag | Body | boolean | When 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 -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 }'Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
createdWhitelistingMacs | string[] | MACs that were newly created. |
existingWhitelistingMacs | string[] | MACs that were already in the whitelist and were therefore skipped. |
faultyRequests | object[] | Entries that failed validation. Each entry matches the input shape so you can re-submit after fixing the data. |
updatedLogins | integer | Number of existing guest sessions updated as a side-effect of the batch (e.g. moved to a whitelist-authorized state). |
Response example
{ "createdWhitelistingMacs": ["AA:BB:CC:00:00:01", "AA:BB:CC:00:00:02"], "existingWhitelistingMacs": [], "faultyRequests": [], "updatedLogins": 0}