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

# PFEventPipelineCreateTelemetryPipelineHandleWithKey

> Creates an event pipeline to upload Telemetry events using a Telemetry Key.

Creates an event pipeline to upload Telemetry events using a Telemetry Key.

## Syntax

```cpp theme={null}
HRESULT PFEventPipelineCreateTelemetryPipelineHandleWithKey(  
    PFEventPipelineTelemetryKeyConfig* eventPipelineTelemetryKeyConfig,  
    XTaskQueueHandle queue,  
    PFEventPipelineBatchUploadSucceededEventHandler* eventPipelineBatchUploadedEventHandler,  
    PFEventPipelineBatchUploadFailedEventHandler* eventPipelineBatchFailedEventHandler,  
    void* handlerContext,  
    PFEventPipelineHandle* eventPipelineHandle  
)  
```

### Parameters

**`eventPipelineTelemetryKeyConfig`**   [PFEventPipelineTelemetryKeyConfig\*](https://docs.xbox.com/services/playfab/api-references/c/pfeventpipeline/structs/pfeventpipelinetelemetrykeyconfig.md)

The Configuration to use if telemetry key logging will be used.

**`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

- [Event Pipeline Tutorial](https://docs.xbox.com/services/playfab/sdks/c/event-pipeline/eventpipeline-tutorial.md)
- [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)
- [PFEventPipelineCreateTelemetryPipelineHandleWithEntity](https://docs.xbox.com/services/playfab/api-references/c/pfeventpipeline/functions/pfeventpipelinecreatetelemetrypipelinehandlewithentity.md)
- [PFEventPipelineTelemetryKeyConfig](https://docs.xbox.com/services/playfab/api-references/c/pfeventpipeline/structs/pfeventpipelinetelemetrykeyconfig.md)
