Skip to content

Enumerate Principals

← HTTP API reference
View source specification ↗
GET /principals

Lists principals owned by the authenticated caller by default. Supplying an owner selects that owner's principals, subject to the caller's principal-read permissions. Supplying an ID selects a single principal, subject to the same permission check. The default page size is 10 and the maximum page size is 100.

Requires a signed user/session or the existing authenticated client flow. The anonymous DCR delegated device profile cannot invoke this operation.

Required scope

Any authenticated access token

Query parameters

ownerstring

Owner whose principals to list. Defaults to the authenticated caller when ID is not supplied. A different owner requires principal-read permission for each returned principal.

idstring

Exact principal identifier to retrieve. The result is included only when the caller has principal-read permission.

expandarray<string>

Expansion tokens that request related or computed fields for each result. When omitted, the response contains only the default, shallower set of fields for each result.

nextTokenstring

Opaque token for the next page of results. Pass the continuation token returned by the previous response, unchanged. Omit it to start from the first page.

maxResultsinteger

Maximum number of results to return in one page. Defaults to 100. Values from 1 through 100 are accepted.

minimum: 1

maximum: 100

Default: 100

Returns

200

Principals retrieved successfully

Fields

resultsarray<Principal>Required
paginationContextPaginationContext
errorsarray<Error>

Partial query errors collected while returning available results.

Errors

400 BAD_REQUEST

Invalid owner, ID, page size, or pagination token

Check the request fields and any validation details, then correct the payload.

401 UNAUTHORIZED

Authentication is required

Obtain a valid access token, then retry.

500 INTERNAL

Internal server error

Retry with backoff only when the operation is safe to repeat. Include the error code when reporting persistent failures.