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

# PFEventPipelineCreatePlayStreamPipelineHandle

> Creates an event pipeline to upload PlayStream events using an Entity.

Creates an event pipeline to upload PlayStream events using an Entity.

## Syntax

```cpp theme={null}
HRESULT PFEventPipelineCreatePlayStreamPipelineHandle(  
    PFEntityHandle entityHandle,  
    XTaskQueueHandle queue,  
    PFEventPipelineBatchUploadSucceededEventHandler* eventPipelineBatchUploadedEventHandler,  
    PFEventPipelineBatchUploadFailedEventHandler* eventPipelineBatchFailedEventHandler,  
    void* handlerContext,  
    PFEventPipelineHandle* eventPipelineHandle  
)  
```

### Parameters

**`entityHandle`**   PFEntityHandle

The Entity whose token will be used to make the PlayFab service requests in the background.

**`queue`**   XTaskQueueHandle\
*optional*

The async queue where background work will be scheduled and where event callbacks will be invoked.

**`eventPipelineBatchUploadedEventHandler`**   PFEventPipelineBatchUploadSucceededEventHandler\*\
*optional*

Optional handler that will be invoked when a batch of events is uploaded.

**`eventPipelineBatchFailedEventHandler`**   PFEventPipelineBatchUploadFailedEventHandler\*\
*optional*

Optional handler that will be invoked when uploading a batch of events fails.

**`handlerContext`**   void\*\
*optional*

Optional pointer to data used by the event handlers.

**`eventPipelineHandle`**   PFEventPipelineHandle\*\
*output*

Handle to the created pipeline. Needs to be closed with PFEventPipelineCloseHandle when it isn't needed.

### Return value

Type: HRESULT

Result code for this API operation. Possible values are S\_OK, E\_INVALIDARG, E\_PF\_NOT\_INITIALIZED or E\_FAIL.

## Requirements

**Header:** PFEventPipeline.h

## See also

[PFEventPipeline members](https://docs.xbox.com/services/playfab/api-references/c/pfeventpipeline/pfeventpipeline_members.md)


## Related topics

- [Services C API overview - PFEventPipeline.h](https://docs.xbox.com/services/playfab/api-references/c/pfeventpipeline/pfeventpipeline_members.md)
- [PlayFab Services SDK - Event Pipeline](https://docs.xbox.com/services/playfab/sdks/c/event-pipeline/eventpipeline.md)
- [PFEventPipelineCreateTelemetryPipelineHandleWithKey](https://docs.xbox.com/services/playfab/api-references/c/pfeventpipeline/functions/pfeventpipelinecreatetelemetrypipelinehandlewithkey.md)
- [PFEventPipelineCreateTelemetryPipelineHandleWithEntity](https://docs.xbox.com/services/playfab/api-references/c/pfeventpipeline/functions/pfeventpipelinecreatetelemetrypipelinehandlewithentity.md)
- [PlayStream event capabilities](https://docs.xbox.com/services/playfab/data-analytics/ingest-data/playstream-event-capabilities.md)
