Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Read the current administrator's scope and permissions

Generated from the checked-in source. Do not edit this reference by hand.

GET /api/v1/session

Revalidates the bearer credential on every request. Returns installation authority or the operator’s current organization/workspace scope and role. Permissions are UI hints; every management operation independently enforces authorization. Responses contain no credentials and use Cache-Control no-store.

Operation: getAdminSessionIdentity.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"adminBearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X GET "$NIU_ORIGIN/api/v1/session" \
-H "Authorization: Bearer $NIU_ADMIN_TOKEN"

No path, query, or header parameters are declared.

No request body is declared.

Current identity and effective role permissions.

Content type: application/json.

JSON
{
"type": "object",
"required": [
"data"
],
"properties": {
"data": {
"type": "object",
"required": [
"kind",
"operator",
"permissions",
"provider_memberships"
],
"properties": {
"kind": {
"type": "string",
"enum": [
"installation",
"operator"
]
},
"provider_memberships": {
"type": "array",
"description": "Explicit active Provider grants only; installation identity returns an empty array.",
"items": {
"type": "object",
"required": [
"id",
"name",
"role"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"role": {
"type": "string",
"enum": [
"viewer",
"manager"
]
}
}
}
},
"operator": {
"type": [
"object",
"null"
],
"required": [
"id",
"role",
"organization_id",
"project_id"
],
"properties": {
"id": {
"type": "string",
"format": "uuid"
},
"role": {
"type": "string",
"enum": [
"owner",
"admin",
"viewer"
]
},
"organization_id": {
"type": "string",
"format": "uuid"
},
"project_id": {
"type": [
"string",
"null"
],
"format": "uuid"
}
}
},
"permissions": {
"type": "object",
"required": [
"read",
"write",
"manage_operators",
"platform_admin"
],
"properties": {
"read": {
"type": "boolean"
},
"write": {
"type": "boolean"
},
"manage_operators": {
"type": "boolean"
},
"platform_admin": {
"type": "boolean",
"description": "Explicit platform administration capability; does not expand customer workspace scope."
}
}
}
}
}
}
}

Missing, invalid, expired or revoked administrator credential.

Operator storage is unavailable.

Revalidates the bearer credential on every request. Returns installation authority or the operator’s current organization/workspace scope and role. Permissions are UI hints; every management operation independently enforces authorization. Responses contain no credentials and use Cache-Control no-store.