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

# PFSegmentsServerGetAllSegmentsAsync

> Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as ExportPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change.

Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as ExportPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change.

## Syntax

```cpp theme={null}
HRESULT PFSegmentsServerGetAllSegmentsAsync(  
    PFEntityHandle titleEntityHandle,  
    XAsyncBlock* async  
)  
```

### Parameters

**`titleEntityHandle`**   PFEntityHandle

PFEntityHandle for a title Entity obtained using PFAuthenticationGetEntityWithSecretKeyAsync.

**`async`**   XAsyncBlock\*\
*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. Request has no paramaters. See also ServerExportPlayersInSegmentAsync, ServerGetSegmentExportAsync. When the asynchronous task is complete, call [PFSegmentsServerGetAllSegmentsGetResultSize](https://docs.xbox.com/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetallsegmentsgetresultsize.md) and [PFSegmentsServerGetAllSegmentsGetResult](https://docs.xbox.com/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetallsegmentsgetresult.md) to get the result.

## Requirements

**Header:** PFSegments.h

## See also

[PFSegments members](https://docs.xbox.com/services/playfab/api-references/c/pfsegments/pfsegments_members.md)


## Related topics

- [PFSegmentsServerGetAllSegmentsGetResult](https://docs.xbox.com/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetallsegmentsgetresult.md)
- [Services C API overview - PFSegments.h](https://docs.xbox.com/services/playfab/api-references/c/pfsegments/pfsegments_members.md)
- [PFSegmentsServerGetPlayerSegmentsAsync](https://docs.xbox.com/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetplayersegmentsasync.md)
- [Get All Segments](https://docs.xbox.com/services/playfab/api-references/rest/server/play-stream/get-all-segments.md)
- [PFSegmentsServerGetAllSegmentsGetResultSize](https://docs.xbox.com/services/playfab/api-references/c/pfsegments/functions/pfsegmentsservergetallsegmentsgetresultsize.md)
