Groups - Create Role

Creates a new group role.

POST https://titleId.playfabapi.com/Group/CreateRole

Request Header

Name Required Type Description
X-EntityToken True

string

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Request Body

Name Required Type Description
Group True

EntityKey

The identifier of the group

RoleId True

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 and are restricted to a-Z, A-Z, 0-9, '(', ')', '_', '-' and '.'.

RoleName True

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

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Responses

Name Type Description
200 OK

CreateGroupRoleResponse

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-EntityToken

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

CreateGroupRoleRequest

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.

CreateGroupRoleResponse
EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

CreateGroupRoleRequest

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.

Name Type Description
CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Group

EntityKey

The identifier of the group

RoleId

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 and are restricted to a-Z, A-Z, 0-9, '(', ')', '_', '-' and '.'.

RoleName

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

CreateGroupRoleResponse

Name Type Description
ProfileVersion

number

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

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

Name Type Description
Id

string

Unique ID of the entity.

Type

string

Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types

Error Codes

Name Code
DuplicateRoleId 1360
RoleNameNotAvailable 1367