Documentation

CreateRole

Creates a new group role.

Request Details

Creates a new role within an existing group, with no members. Both the role ID and role name must be unique within the group, but the name can be the same as the ID. The role ID is set at creation and cannot be changed. Returns information about the role that was created.

CreateGroupRoleRequest
Request Properties
Group (required) EntityKey

The identifier of the group

RoleId (required) String

The ID of the role. This must be unique within the group and cannot be changed. Role IDs must be between 1 and 64 characters long.

RoleName (required) String

The name of the role. This must be unique within the group and can be changed later. Role names must be between 1 and 100 characters long

POST https://{{TitleID}}.playfabapi.com/Group/CreateRole
    Content-Type: application/json
{
  "RoleId": "example",
  "RoleName": "Example Role",
  "Group": {
    "Id": "ABC1234ABC"
  }
}
        

Response Details

CreateGroupRoleResponse
Result Properties
ProfileVersion (required) int32

The current version of the group profile, can be used for concurrency control during updates.

RoleId String

ID for the role

RoleName String

The name of the role

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "RoleName": "Example Role",
    "RoleId": "ABC123DEF",
    "ProfileVersion": 17
  }
}

Authentication

EntityToken

Possible Error Codes

Name Code
DuplicateRoleId 1360
NotAuthenticated 1074
NotAuthorized 1089
RoleNameNotAvailable 1367