curl --request POST \
--url https://auth.cognite.com/api/v1/orgs/{org}/principals/byids \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": "5yAFQRAATb7vtWGp4gvbJD3wE7VS81CGuQ7EZT"
}
],
"ignoreUnknownIds": false
}
'{
"items": [
{
"id": "5yAFQRAATb7vtWGp4gvbJD3wE7VS81CGuQ7EZT",
"type": "SERVICE_ACCOUNT",
"name": "My service account",
"createdBy": {
"orgId": "my-org",
"userId": "-user-string-id-aBc123"
},
"createdTime": 1730204346000,
"lastUpdatedTime": 1730204346000,
"pictureUrl": "<string>",
"externalId": "my.known.id",
"description": "This is a service account used by data pipeline A-xxx"
}
]
}Retrieve principals in an organization by ID or external ID.
Service accounts can be retrieved by ID or external ID. Users can be retrieved by ID.
Requires the caller to be logged into the target organization, or to be an admin in any of its the ancestor organizations.
curl --request POST \
--url https://auth.cognite.com/api/v1/orgs/{org}/principals/byids \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": "5yAFQRAATb7vtWGp4gvbJD3wE7VS81CGuQ7EZT"
}
],
"ignoreUnknownIds": false
}
'{
"items": [
{
"id": "5yAFQRAATb7vtWGp4gvbJD3wE7VS81CGuQ7EZT",
"type": "SERVICE_ACCOUNT",
"name": "My service account",
"createdBy": {
"orgId": "my-org",
"userId": "-user-string-id-aBc123"
},
"createdTime": 1730204346000,
"lastUpdatedTime": 1730204346000,
"pictureUrl": "<string>",
"externalId": "my.known.id",
"description": "This is a service account used by data pipeline A-xxx"
}
]
}ID of an organization The ID of an organization
3 - 64^([a-z][a-z0-9-]{1,62}[a-z0-9])$"my-org"
A request to retrieve principals by reference.
For now, only service accounts can have an external ID.
1 - 100 elementsEither a principal ID, or a principal external ID
Show child attributes
If true, IDs that do not match existing principals will be ignored.
If false, the request will fail if any of the IDs do not match existing principals.
This is the default behavior.
A list of principals.
A principal
Show child attributes
Was this page helpful?