User
Retrieve Additional User Data
Returns supplementary data for the token owner, such as the number of projects they have created.
Request
POST /api/permissions/user/info
Warning
Passing jwt, factor, and service_jwt in the request body is deprecated.
Use the corresponding HTTP headers instead.
jwt string required
User’s JWT token.
factor string conditionally required
User device factor. Required if
service_jwtis not provided.service_jwt string conditionally required
Service JWT. Required if
factoris not provided.
Response
Success
Retrieve and Edit User Schema
Retrieves or updates the permission schema for a specific user and application.
Access Requirements
To read or update the user schema, the request author must have the following permissions for the respective sections:
secret_data.meta.public.canReadorcanWrite— forpublic_datasecret_data.meta.private.canReadorcanWrite— forprivate_datasecret_data.meta.secret.canReadorcanWrite— forsecret_datasecret_data.meta.roles.canReadorcanWrite— forroles
Service accounts for the project associated with the application are also allowed.
If user_id is not provided or matches the
uid from the user’s JWT, the permissions are returned
without restriction.
Note
If application_id is missing from the
request but a service_jwt is provided, the
application ID will be extracted from the token.
When service_jwt is provided, expired user
JWTs are accepted, and factor validation is
skipped. To request without any user JWT, provide a
service token in
service_jwt or an access key in the
Authorization: Bearer header.
Even if a user has never logged into an application, their schema can be saved in advance.
Request
POST /api/permissions/meta/data
Warning
Passing jwt, factor, and service_jwt in the request body is deprecated.
Use the corresponding HTTP headers instead.
jwt string required
User’s JWT token. Expired tokens are accepted when
service_jwtis provided.factor string optional
User device factor. Required only when neither
service_jwtnor an access key is provided.service_jwt string optional
Service JWT. When provided, bypasses factor validation and allows expired user JWTs.
action string required
Action to perform. Allowed values:
"get","save".application_id string or integer required
ID of the application for which the user schema is being retrieved or edited.
data object required
user_id string required
ID of the user whose schema is being retrieved or edited.
type string optional
Schema format for
"get". Allowed values:"tree","list","list_short","roles". See Schema Types.
options object optional
Additional filters for the
"get"action.project_id string optional
Filters the response to include only root rules and rules for the given project.
hide_project_access boolean optional
If
true, excludes project access information and returns only root rules. Defaults tofalse.with_exp boolean optional
If
true, appends the TTL in seconds to each rule after a colon (e.g.,"login.can:7200"). A value of0means no expiration. Defaults tofalse.with_roles boolean optional
If
true, the responsedatafield includesrulesandroles. Defaults tofalse.with_apps_data boolean optional
If
true, the responsedatafield includesrules,projects, andapps. Defaults tofalse.
expired integer optional
Expiration timestamp in Unix epoch format. Used for the
"save"action.
POST /api/permissions/meta/data
Authorization: Bearer eyJhbGci...
Factor: ...
{
"action": "get",
"application_id": 50001,
"data": {
"user_id": "12345",
"type": "list_short"
},
"options": {
"project_id": "warthunder",
"with_exp": true
}
}
{
"action": "save",
"application_id": 50001,
"data": {
"user_id": "12345",
"roles": ["writer"],
"private_data": {
"canManageTags": {"value": true, "params": "internal,game"}
}
}
}
Response
Success
status string required
“OK”
data array or object required
The schema content. Format depends on the
typeparameter and theoptionsprovided. For the"save"action, returns the updated schema in"tree"format (see Schema Types).When neither
with_rolesnorwith_apps_datais enabled,datais an array of strings. When either option istrue,databecomes an object with the following fields:rules array of strings required
List of permissions assigned to the user. Present when
with_rolesorwith_apps_dataistrue.roles array of strings optional
List of roles assigned to the user. Present when
with_rolesistrue.projects object optional
Map of projects the user has access to, keyed by project ID. Present when
with_apps_dataistrue. Each value is an object with:apps object optional
Map of applications associated with the user’s project access, keyed by project ID. Present when
with_apps_dataistrue. Each value is an array of objects with:
user_id string required
The ID of the requested user.
expired integer required
Expiration timestamp in Unix epoch format.
0if not time-limited.
{
"status": "OK",
"data": ["login.can", "can_create_projects"],
"user_id": "12345",
"expired": 0
}
Schema Types
The type parameter controls the format of
the returned schema.
"tree"Permissions and data in a hierarchical structure. Includes
secret_dataand expiration times. Does not include project-specific access roles.Example
{ "status": "OK", "data": { "login": { "can": {"expired": 0, "value": true}, "cannot": {"expired": 0, "value": false} }, "private_data": { "can_create_apps": true, "can_create_projects": true }, "public_data": {}, "roles": [], "secret_data": { "application": { "canCreateJwt": {"value": true} } } }, "user_id": "...", "expired": 1700000000 }
"list"Flat array of permissions as dot-separated paths. Includes merged role-based permissions. Excludes expired and
secret_datapermissions.Example
{ "status": "OK", "data": [ "login.can", "private_data.can_create_projects", "private_data.can_create_apps", "private_data.projectAccess.openid.applications.50096.private_data.app.can_manage_app_api_keys", "private_data.projectAccess.openid.private_data.project.can_manage_services", "private_data.projectAccess.warthunder.private_data.project.can_grant_project_admins" ], "user_id": "...", "expired": 1700000000 }
"list_short"Flat list without visibility scope prefixes (
public_data,private_data). Project-specific rules use aprojectID/ruleformat (whereprojectIDmatchesproject_id). Excludessecret_data.Example
{ "status": "OK", "data": [ "login.can|param0,paramN", "can_create_projects", "can_create_apps", "openid/applications/50096/app.can_manage_app_api_keys", "openid/services/50096/srv.can_manage_service_users", "openid/project.can_manage_services", "warthunder/project.can_grant_project_admins" ], "user_id": "...", "expired": 1700000000 }
"list_short"withwith_apps_dataWhen
with_apps_dataistrue, the responsedatafield includesrules,projects, andapps.Example
{ "status": "OK", "data": { "apps": { "openid": [{"id": 50096, "name": "OpenID"}], "warthunder": [{"id": 2, "name": "Warthunder Site"}] }, "projects": { "openid": {"name": "OpenID clients"}, "warthunder": { "aliases": ["warthunder_pc", "warthunder_mobile"], "name": "Warthunder" } }, "rules": [ "login.can|param0,paramN", "can_create_projects", "openid/project.can_manage_services", "warthunder/project.can_grant_project_admins" ] }, "user_id": "...", "expired": 1700000000 }
"list"withwith_expWhen
with_expistrue, the TTL in seconds is appended to each permission after a colon.0means no expiration.Example
{ "status": "OK", "data": [ "login.can|param0,paramN:0", "can_create_projects:0", "openid/applications/50096/app.can_manage_app_api_keys:3600", "openid/project.can_manage_services:3600", "warthunder/project.can_grant_project_admins:3600" ], "user_id": "...", "expired": 1700000000 }
"list"withwith_rolesWhen
with_rolesistrue, the responsedatafield includesrulesandroles.Example
{ "status": "OK", "data": { "rules": [ "login.can|param0,paramN", "can_create_projects", "openid/project.can_manage_services", "warthunder/project.can_grant_project_admins" ], "roles": [ "default", "openid.applications.50096/app_developer", "openid/administrator", "warthunder/owner" ] }, "expired": 1700000000 }
"roles"Returns only the list of roles assigned to the user. Can be retrieved without a user JWT by providing a service JWT or service hash.
Example
{ "status": "OK", "data": [ "default", "openid.applications.50096/app_developer", "openid.services.50096/service_administrator", "openid/administrator", "warthunder/owner" ], "expired": 1700000000 }
Expiration and TTL for Roles
- expired integer optional
Unix timestamp when the role expires. If the current time exceeds this value, the role is excluded from the effective permissions.
- ttl integer optional
Number of seconds for which the role is valid from the moment the permissions list is generated. Takes precedence over
expiredif both are set.
If any role has a non-zero expired or
ttl, the response
expired field contains the earliest
calculated expiration time. If neither is set, the response
expired field is 0 (no time limit).
Edit User Schema
Additional Parameters for Permissions
For the "save" action, additional parameters can be specified in the params
field of any permission. Parameters are listed as a comma-separated string.
"canManageTags": {"value": true, "params": "internal,game"}
Assign Roles
Roles can be assigned as an array of role name strings, or as objects with
name, expired, and
ttl fields.
"roles": [
"writer",
{"name": "reader", "expired": 0, "ttl": 0}
]
Resource-Specific Roles
For schemas with multiple resources sharing the same permission set, define general roles and assign them per resource in the user’s project access record, rather than creating a separate role for each resource.
For example, instead of creating separate warthunder_reader and
crossout_reader roles, define a single reader role and assign it to the
user per project:
Role definition:
{"data": {"meta": {"canRead": {"expired": 0, "ttl": 0, "value": true}}}, "name": "reader"}
The user’s project access record then maps this role to specific projects,
applications, or services. The same reader role can be reused across any
number of resources without duplicating the role definition.