Xeonr Developer Docs
API SpecificationPRIVATEApplications

Create Role

POST
/xeonr.auth.private.v1.ApplicationsService/CreateRole

Creates a new role for an application. Roles can be assigned to users and scopes.

Required scopes: admin, private

Authorization

BearerAuth
AuthorizationBearer <token>

JWT access token for internal API access. Requires 'private' scope for most endpoints, 'admin' scope for administrative operations.

In: header

Header Parameters

Connect-Protocol-Version*number

Define the version of the Connect protocol

Value in1
Connect-Timeout-Ms?number

Define the timeout, in ms

Request Body

application/json

applicationId?string
Length1 <= length <= 64
role?
[key: string]?never

Response Body

application/json

application/json

curl -X POST "https://auth.xeonr.io/xeonr.auth.private.v1.ApplicationsService/CreateRole" \  -H "Connect-Protocol-Version: 1" \  -H "Content-Type: application/json" \  -d '{}'
{
  "application": {
    "applicationId": "app_prod_myapp",
    "name": "My Application",
    "slug": "my-application",
    "websiteUrl": "https://myapp.example.com",
    "createdAt": "2023-01-15T01:30:15.01Z",
    "updatedAt": "2023-01-15T01:30:15.01Z",
    "enabledIdps": [
      "github",
      "discord"
    ],
    "scopes": [
      {
        "name": "read:users",
        "description": "Read access to user data",
        "isInternal": true,
        "isSensitive": true,
        "role": {
          "name": "admin"
        },
        "isDelegatable": true
      }
    ],
    "automaticEnrollment": true,
    "audience": [
      "https://api.example.com"
    ],
    "roles": [
      {
        "name": "admin"
      }
    ],
    "supportsScopedRequests": true,
    "applicationCustomConfig": {
      "jsonSchema": {
        "property1": {},
        "property2": {}
      },
      "uiSchema": {
        "property1": {},
        "property2": {}
      }
    },
    "public": true
  }
}
{
  "code": "not_found",
  "message": "string",
  "details": [
    {
      "type": "string",
      "value": "string",
      "debug": {}
    }
  ]
}