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

# Services C API overview - PFEntity.h

> Services C API overview - PFEntity.h

## Functions

| Function | Description |
| - | - |
| [PFEntityCloseHandle](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityclosehandle.md) | Closes a PFEntityHandle. |
| [PFEntityDuplicateHandle](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityduplicatehandle.md) | Duplicates a PFEntityHandle. |
| [PFEntityGetAPIEndpoint](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetapiendpoint.md) | Gets the API endpoint for the PFServiceConfig associated with an entity handle. |
| [PFEntityGetAPIEndpointSize](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetapiendpointsize.md) | Gets the size of the buffer needed to hold the API endpoint string from an entity handle. |
| [PFEntityGetEntityKey](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitykey.md) | Get the PFEntityKey for an entity. |
| [PFEntityGetEntityKeySize](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitykeysize.md) | Get the size in bytes needed to store the PFEntityKey for an Entity. |
| [PFEntityGetEntityTokenAsync](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitytokenasync.md) | Get the cached PFEntityToken for an Entity. |
| [PFEntityGetEntityTokenResult](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitytokenresult.md) | Gets the result of a successful PFEntityGetEntityTokenAsync call. |
| [PFEntityGetEntityTokenResultSize](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitytokenresultsize.md) | Get the size in bytes needed to store the result of a PFEntityGetEntityTokenAsync call. |
| [PFEntityGetSecretKey](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetsecretkey.md) | Gets the PlayFab secretKey associated with a title Entity. Will fail with E\_PF\_NOSECRETKEY if there is no Secret Key associated with the provided Entity. |
| [PFEntityGetSecretKeySize](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetsecretkeysize.md) | Gets the size of the buffer needed to hold the PlayFab secretKey. Will fail with E\_PF\_NOSECRETKEY if there is no Secret Key associated with the provided Entity. |
| [PFEntityGetTitleId](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygettitleid.md) | Gets the titleId for the PFServiceConfig associated with an entity handle. |
| [PFEntityGetTitleIdSize](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygettitleidsize.md) | Gets the size of the buffer needed to hold the titleId string from an entity handle. |
| [PFEntityIsTitlePlayer](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityistitleplayer.md) | Convenience method to check if an Entity is a Title Player. This is equivalent to calling PFEntityGetEntityKey and comparing entityKey.type to PFTitlePlayerEntityType. |
| [PFEntityRegisterTokenExpiredEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityregistertokenexpiredeventhandler.md) | Register a handler for EntityToken expired events. |
| [PFEntityRegisterTokenRefreshedEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityregistertokenrefreshedeventhandler.md) | Register a handler for EntityToken refreshed events. |
| [PFEntityTokenExpiredEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitytokenexpiredeventhandler.md) | EntityToken expired event handler. Needed to reauthenticate players in scenarios where the SDK is unable to automatically refresh the cached EntityToken. |
| [PFEntityTokenRefreshedEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitytokenrefreshedeventhandler.md) | A handler invoked every time an Entity is automatically re-authenticated, thus obtaining a new EntityToken. An entity will be automatically re-authenticated prior to its EntityToken expiring. |
| [PFEntityUnregisterTokenExpiredEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityunregistertokenexpiredeventhandler.md) | Unregisters a previously registered callback. |
| [PFEntityUnregisterTokenRefreshedEventHandler](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentityunregistertokenrefreshedeventhandler.md) | Unregisters a previously registered PFEntityTokenRefreshedCallback. |

## Structures

| Structure | Description |
| - | - |
| [PFEntityToken](https://docs.xbox.com/services/playfab/api-references/c/pfentity/structs/pfentitytoken.md) | PlayFab EntityToken and its expiration time. Used to authenticate PlayFab service calls. |


## Related topics

- [PFEntityGetEntityKey](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitykey.md)
- [PFEntityToken](https://docs.xbox.com/services/playfab/api-references/c/pfentity/structs/pfentitytoken.md)
- [PFEntityGetEntityKeySize](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitykeysize.md)
- [PFEntityGetEntityTokenAsync](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitytokenasync.md)
- [PFEntityGetEntityTokenResult](https://docs.xbox.com/services/playfab/api-references/c/pfentity/functions/pfentitygetentitytokenresult.md)
