> ## 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.

# PFLeaderboardsCreateLeaderboardDefinitionAsync

> Reference for PFLeaderboardsCreateLeaderboardDefinitionAsync, a PlayFab Services C API function that creates a new leaderboard definition.

Creates a new leaderboard definition.

## Syntax

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

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

**`request`**   [PFLeaderboardsCreateLeaderboardDefinitionRequest\*](/services/playfab/api-references/c/pfleaderboardstypes/structs/pfleaderboardscreateleaderboarddefinitionrequest)

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 Windows, Linux, and macOS. See also LeaderboardDeleteLeaderboardDefinitionAsync. Call XAsyncGetStatus to get the status of the operation. If the service call is unsuccessful, the async result will be E\_PF\_API\_NOT\_ENABLED\_FOR\_TITLE, E\_PF\_DUPLICATE\_COLUMN\_NAME\_FOUND, E\_PF\_DUPLICATE\_LINKED\_STATISTIC\_COLUMN\_NAME\_FOUND, E\_PF\_ENTITY\_TYPE\_MISMATCH\_WITH\_STAT\_DEFINITION, E\_PF\_EXTERNAL\_ENTITY\_NOT\_ALLOWED\_FOR\_TIER, E\_PF\_INVALID\_BASE\_TIME\_FOR\_INTERVAL, E\_PF\_LEADERBOARD\_COUNT\_LIMIT\_EXCEEDED, E\_PF\_LEADERBOARD\_NAME\_CONFLICT, E\_PF\_LEADERBOARD\_SIZE\_LIMIT\_EXCEEDED, E\_PF\_LINKED\_STATISTIC\_COLUMN\_MISMATCH, E\_PF\_LINKED\_STATISTIC\_COLUMN\_NOT\_FOUND, E\_PF\_LINKED\_STATISTIC\_COLUMN\_REQUIRED, E\_PF\_LINKING\_STATS\_NOT\_ALLOWED\_FOR\_ENTITY\_TYPE, E\_PF\_MAX\_QUERYABLE\_VERSIONS\_EXCEEDED, E\_PF\_MAX\_QUERYABLE\_VERSIONS\_VALUE\_NOT\_ALLOWED\_FOR\_TIER, E\_PF\_MULTIPLE\_LINKED\_STATISTICS\_NOT\_ALLOWED, E\_PF\_PLAY\_FAB\_ERROR\_EVENT\_NOT\_SUPPORTED\_FOR\_ENTITY\_TYPE, E\_PF\_STAT\_DEFINITION\_ALREADY\_LINKED\_TO\_LEADERBOARD, E\_PF\_STATISTIC\_NOT\_FOUND, E\_PF\_VERSION\_CONFIGURATION\_IS\_REQUIRED or any of the global PlayFab Service errors. See doc page "Handling PlayFab Errors" for more details on error handling.

## Requirements

**Header:** PFLeaderboards.h

## See also

[PFLeaderboards members](/services/playfab/api-references/c/pfleaderboards/pfleaderboards_members)


## Related topics

- [Services C API overview - PFLeaderboards.h](/services/playfab/api-references/c/pfleaderboards/pfleaderboards_members.md)
- [PFLeaderboardsDeleteLeaderboardDefinitionAsync](/services/playfab/api-references/c/pfleaderboards/functions/pfleaderboardsdeleteleaderboarddefinitionasync.md)
- [PFLeaderboardsCreateLeaderboardDefinitionRequest](/services/playfab/api-references/c/pfleaderboardstypes/structs/pfleaderboardscreateleaderboarddefinitionrequest.md)
- [PFLeaderboardsUpdateLeaderboardDefinitionAsync](/services/playfab/api-references/c/pfleaderboards/functions/pfleaderboardsupdateleaderboarddefinitionasync.md)
- [PFLeaderboardsGetLeaderboardDefinitionAsync](/services/playfab/api-references/c/pfleaderboards/functions/pfleaderboardsgetleaderboarddefinitionasync.md)
