Body Required
-
tenantId string
Maximum length is
21
. -
The name of the role. It should be unique within the tenant.
Minimum length is
1
, maximum length is128
. -
Minimum length is
1
, maximum length is128
. -
type string
The type of the role. It cannot be changed after creation.
Values are
User
orMachineToMachine
. -
isDefault boolean
-
scopeIds array[string]
The initial API resource scopes assigned to the role.
Minimum length of each is
1
.
POST /api/roles
curl \
-X POST https://[tenant_id].logto.app/api/roles \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"tenantId":"string","name":"string","description":"string","type":"User","isDefault":true,"scopeIds":["string"]}'
Request examples
{
"tenantId": "string",
"name": "string",
"description": "string",
"type": "User",
"isDefault": true,
"scopeIds": [
"string"
]
}
Response examples (200)
{
"tenantId": "string",
"id": "string",
"name": "string",
"description": "string",
"type": "User",
"isDefault": true
}