Skip to content
Organization

List contexts

Lists the contexts of the Organization where the API key holds at least one API permission.

GET /organizations/{organizationId}/contexts

Permission: Organization (Read). See API permissions.

Returns one page of contexts, ordered by name. items is empty when the API key holds a permission in no context.

  • A context where the API key has None on every API is not listed. An API key that holds only the Organization permission receives an empty page.
  • A permission granted or removed in a context can take up to 45 seconds to show in the list. Operations on a context check the permissions of the API key on every request.
ParameterInTypeRequiredDescription
organizationIdPathstringYesThe Organization ID of the API key. Any other ID returns 404.
limitQueryintegerNoContexts per page, 1 to 100. Default 20.
cursorQuerystringNoThe nextCursor of the previous page. Leave it out for the first page.

Request example

cURL
curl "$API_BASE_URL/organizations/$ORGANIZATION_ID/contexts?limit=20" \
-H "Authorization: Bearer $NCP_API_TOKEN"

A page of contexts.

FieldTypeDescription
items[].contextIdstringThe context ID, {contextId} in the paths of the operations on the context.
items[].typestringThe kind of context. This version has one value, SIGN_IN: a Sign-In Context, which has the operations of the Sign In API. New values can be added within v2.
items[].namestringThe name of the context.

Response example

200
{
"items": [
{ "contextId": "20", "type": "SIGN_IN", "name": "Guest WiFi" },
{ "contextId": "31", "type": "SIGN_IN", "name": "Visitors" }
],
"nextCursor": null
}
StatuserrorCodeWhen
400VALIDATION_FAILEDlimit is outside 1 to 100, or cursor is not a cursor of this operation. errors names the parameter.
404RESOURCE_NOT_FOUNDorganizationId is not the Organization of the API key.

Errors common to all operations are in Errors.

Next