> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PFGroupsCreateRoleAsync

> Creates a new group role.

Creates a new group role.

## Syntax

```cpp theme={null}
HRESULT PFGroupsCreateRoleAsync(  
    PFEntityHandle entityHandle,  
    const PFGroupsCreateGroupRoleRequest* request,  
    XAsyncBlock* async  
)  
```

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

**`request`**   [PFGroupsCreateGroupRoleRequest\*](/services/playfab/api-references/c/pfgroupstypes/structs/pfgroupscreategrouprolerequest)

Populated request object.

**`async`**   XAsyncBlock\*<br />*Inout*

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on all platforms. 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. See also GroupDeleteRoleAsync. When the asynchronous task is complete, call [PFGroupsCreateRoleGetResultSize](/services/playfab/api-references/c/pfgroups/functions/pfgroupscreaterolegetresultsize) and [PFGroupsCreateRoleGetResult](/services/playfab/api-references/c/pfgroups/functions/pfgroupscreaterolegetresult) to get the result.

## Requirements

**Header:** PFGroups.h

## See also

[PFGroups members](/services/playfab/api-references/c/pfgroups/pfgroups_members)


## Related topics

- [PFGroupsCreateRoleGetResult](/services/playfab/api-references/c/pfgroups/functions/pfgroupscreaterolegetresult.md)
- [Services C API overview - PFGroups.h](/services/playfab/api-references/c/pfgroups/pfgroups_members.md)
- [PFGroupsUpdateRoleAsync](/services/playfab/api-references/c/pfgroups/functions/pfgroupsupdateroleasync.md)
- [PFGroupsDeleteRoleAsync](/services/playfab/api-references/c/pfgroups/functions/pfgroupsdeleteroleasync.md)
- [PFGroupsCreateGroupAsync](/services/playfab/api-references/c/pfgroups/functions/pfgroupscreategroupasync.md)
