For more information about registering an OAuth client, contact beehiiv Support.
For integrations looking to integrate more seamlessly with beehiiv, the beehiiv API supports the standard OAuth2 authorization code flow.
OAuth2 endpoints are served under the /oauth namespace on the app domain (for example, https://app.beehiiv.com/oauth/...).
This guide will walk you through the steps to implement the OAuth2 authorization code flow for your integration.
Send users to GET /oauth/authorize with:
client_idredirect_uriresponse_type=codescope (space-delimited)state (recommended for CSRF protection)code_challenge and code_challenge_method (recommended for public clients)Example:
After login and consent, beehiiv redirects to your redirect_uri with:
codestate (if provided)Call POST /oauth/token with application/x-www-form-urlencoded body:
grant_type=authorization_codecoderedirect_uriclient_idclient_secret (confidential clients)code_verifier (when using PKCE)The response contains access_token, token_type, expires_in, and refresh_token (when available).
Use POST /oauth/token with:
grant_type=refresh_tokenrefresh_tokenclient_idclient_secret (confidential clients)POST /oauth/revoke revokes access or refresh tokens.POST /oauth/introspect checks token activity and metadata.GET /oauth/token/info returns metadata for the current bearer token.Each scope maps to a resource type (for example, posts:* scopes apply to posts endpoints).
Scope permission levels map to endpoint actions:
:read permits read actions (for example, GET requests).:write is required for mutating actions (for example, POST, PUT, and DELETE requests).Default scope:
identify:readOptional scopes:
automations:read, automations:writecustom_fields:read, custom_fields:writesubscriptions:read, subscriptions:writepolls:read, polls:writeposts:read, posts:writepublications:read, publications:writereferral_program:read, referral_program:writesegments:read, segments:writetiers:read, tiers:writewebhooks:read, webhooks:write