- Create a developer app and get your credentials
- Choose the right auth flow for your app
- Get an access token
- Send your first playback event
- Read now-playing state
- Refresh the access token when needed
Before you begin
You need:- A PunchPlay account
- A developer app from Get API key
- Your app’s
client_id - Your app’s
client_secretif you created a confidential client
1. Create a developer app
Sign in to Get API key, then create either:- A confidential client for server-backed apps that can safely store a secret
- A public client for native or browser-based apps that must not embed a secret
- register your redirect URIs if you plan to use OAuth
- choose the minimum
allowed_scopesyour app should ever request - save the secret immediately if you created a confidential client
2. Choose your auth flow
Use:- authorization code + PKCE for browser apps and websites
- device code for TV, desktop, CLI, and native-style clients
3A. Web and browser apps: authorization code + PKCE
Redirect the user to:code, exchange it for tokens:
3B. Native, desktop, and TV apps: device code
Request a device code:client_id only. Confidential clients send both client_id and client_secret.
Example response:
user_code or open verification_uri_complete for the user, then poll:
4. Send your first playback event
5. Read now-playing state
6. Refresh the access token when needed
Web and browser apps can refresh through the OAuth token endpoint:Common errors
authorization_pending: the user has not approved the device code yetinvalid_scope: the request asked for a scope outside the app policyinvalid_client: the provided app credentials are wronginsufficient_scope: the token cannot access the endpoint you called429: you are polling or sending events too aggressively
request_id in the body and X-PunchPlay-Request-Id in the headers. Log that value so you can send it to support.
Next steps
- Read Authentication for both auth flows, token lifecycle, and security guidance.
- Read Playback API for payload design, event ordering, and multi-episode behavior.
- Read Live Events to subscribe to playback changes in real time.