Skip to content

Get started

Authentication

Private keys for servers, the public key for browsers, and scopes.

Three ways to authenticate

MethodUsed forHow to send it
Private keyServer endpoints under /apiAuthorization: Klaviyo-API-Key pk_...
Public keyClient endpoints under /client, from browsers and apps?company_id=AbC123
App sessionThe Growth Dept Email app's own pagesSign-in cookie, X-Account, and X-CSRF-Token on writes

Private keys

A private key is pk_ followed by 34 lowercase hexadecimal characters. Send it on every request to a server endpoint:

http
GET /api/profiles HTTP/1.1
Host: email.growthdept.ai
Authorization: Klaviyo-API-Key pk_your_private_key
accept: application/vnd.api+json
revision: 2026-10-15

The key names its account, so there is no account parameter. We store a hash of the key and its last four characters, which is why the app shows a key only when you create it. Revoke a key in Settings, API keys; requests with it fail from then on.

What was sentAnswer
No Authorization header401 not_authenticated
A wrong or revoked key401 authentication_failed
Authorization: Bearer ... (an OAuth token)401: OAuth apps are not available yet
A key without a scope the endpoint needs403 permission_denied, naming the missing scopes

Scopes

Each key carries the scopes it was created with. A full-access key has every scope; a read-only key has every :read scope. Scopes are named <resource>:read and <resource>:write, and a :write scope also grants :read on the same resource. An endpoint lists the scopes it needs on its reference page, and a request needs all of them.

Resources with scopes:

accountsbrandscampaignscatalogsconversationscoupon-codescouponscustom-objectsdata-privacyeventsflowsformsimageslistsmetricsprofilespush-tokensreviewssegmentssender-configsubscriptionstagstemplatestracking-settingstranslationsusageweb-feedswebhooks

Public key and client endpoints

Every account has a six-character public key, also called the company id. It identifies the account to the client endpoints under /client, which a storefront or app can call from the visitor's browser: create or update a profile, send an event, subscribe someone to a list.

cURL
curl --request POST \
     --url 'https://email.growthdept.ai/client/events?company_id=AbC123' \
     --header 'content-type: application/vnd.api+json' \
     --header 'revision: 2026-10-15' \
     --data '{"data": {"type": "event", "attributes": {...}}}'
  • The public key is not a secret. It works only with the client endpoints and cannot call anything under /api.
  • Client endpoints answer any origin (CORS) and accept text/plain bodies, which browsers send without a preflight request.
  • No scopes apply. Rate limits count per account.
  • To stop other websites from using your public key, list your own under Settings, API keys, Manage permissions. A browser call from any other host then gets 403 permission_denied. Use *.example.com for every subdomain, and list example.com itself if it calls too. Calls that send no Origin or Referer are allowed unless you turn off empty domains; calls from mobile SDKs are always allowed.

App sessions

The app's own pages call the same endpoints you do, signed in as a person. They send the sign-in cookie, an X-Account header naming the account (its address, public key or id) and, on writes, an X-CSRF-Token header from the same origin. You do not need this method for an integration; it is listed so you know the app has no private back door.

A person's scopes come from their role in the organization. Viewers read everything. Members also write everything except data-privacy:write, webhooks:write and tracking-settings:write, which admins and owners have.