Klaviyo
Email and SMS campaigns, lists and customer profiles in Klaviyo, for example a consented form sign-up to a list or an event after an order.
Connection type: For the app and the agent. Credentials: Private API key.
How it works
The app and the agent never see the credentials. They call the Klaviyo API through the Bloklo gateway, for example fetch("/gw/<connection id>/lists"). The gateway appends the path to the address https://a.klaviyo.com/api, adds a Authorization header with the key from the connection and the headers revision: 2026-10-15, Accept: application/vnd.api+json, Content-Type: application/vnd.api+json, and passes the service's response back to the app.
- Reads (GET) go through at once. Writes (POST, PUT, PATCH, DELETE) go through at once only when the connection is set to Always allow; otherwise the gateway returns status 202 with an
approval_idand the write waits for approval in the panel (see Agent permissions). - The Test button sends
GET /lists/and checks that the service accepted the credentials.
JSON:API at https://a.klaviyo.com/api; version through the revision header (a date, the gateway adds 2026-10-15), header Authorization: Klaviyo-API-Key pk_.... Cursor pagination: page[cursor] from links.next, page[size] depends on the endpoint (lists: up to 10). List subscriptions and events are asynchronous (202 with no body).
Before you start
- An account with Klaviyo with permission to create API keys or tokens.
Where to get the credentials
- In Klaviyo, open Settings → API keys (Owner, Admin or Manager role required).
- Under Private API Keys, click Create Private API Key and enter a name.
- Choose Custom and grant scopes: Lists (Read and Write), Profiles (Write), Subscriptions (Write), Events (Write). A key's scopes cannot be changed later.
- Copy the key (it starts with
pk_).
Connecting in Bloklo
- Open Connectors in the sidebar and find Klaviyo.
- Click Connect and enter a connection name in Details.
- In Configure connection, fill in: Private API key.
- Click Connect. Bloklo saves the credentials encrypted and sends a test request; the message shows whether the service responded.
- Attach the connection to a project: Attach to a project… on the connection page, or describe the task in the project chat and pick the connection the agent suggests.
Form fields
- Private API key: Starts with pk_. Settings → API keys → Create Private API Key.
Never paste credentials into the chat with the agent. Enter them only in the connection form.
Example prompts
Prompts to type in the chat of a project with the connection attached:
- “Add a newsletter signup form that subscribes the person to a Klaviyo list with their consent.”
- “Send a ‘Placed Order’ event to Klaviyo after every purchase.”
API methods
The most commonly used Klaviyo API methods. The path goes after /gw/<connection id>; parts in braces, such as {id}, are replaced with values. The gateway treats every request other than GET as a write, including queries sent with POST (such as search or GraphQL), so they need approval unless the connection is set to Always allow. The full list of methods is in the provider's documentation.
| Method | Path | What it does | In the gateway |
|---|---|---|---|
GET | /lists | List lists | read |
POST | /profile-subscription-bulk-create-jobs | Subscribe profiles to a list with consent | write (approval) |
POST | /profile-import | Create or update a profile | write (approval) |
GET | /profiles | List profiles | read |
POST | /events | Record a customer event | write (approval) |
GET | /campaigns | List campaigns | read |
GET | /segments | List segments | read |
GET | /metrics | List metrics | read |
Service limits
Limit tiers (burst per 1 s / steady per 1 min): XS 1/s and 15/min, S 3/s and 60/min, M 10/s and 150/min, L 75/s and 700/min, XL 350/s and 3,500/min; limits are per account, private keys share one pool. GET /lists and list subscription: 75/s and 750/min; POST /events: 350/s and 3,500/min. Bulk subscription up to 1,000 profiles per request; an event up to 5 MB (up to 400 properties). 429 with a Retry-After header. Revisions are stable for a year. GET /campaigns and GET /metrics: 10/s and 150/min; GET /profiles: 75/s and 750/min, up to 100 profiles per page (with predictive_analytics 10/s and 150/min); POST /profile-import: 75/s and 750/min.
Agent actions and permissions
| Action | Type | What the agent uses it for |
|---|---|---|
| Read data | read | Fetches data from the service, such as a list of records, to build and check the app. Examples: list lists; list profiles; list campaigns. |
| Write data | write | Requests other than GET: creating, changing or deleting data in the service, and also queries sent with POST (such as search). Examples: subscribe profiles to a list with consent; create or update a profile; record a customer event. |
By default, reads run without asking and writes need approval in the chat. Change this on the connector page or in Settings → Agent permissions (see Agent permissions).
Troubleshooting
The connection test shows “Invalid key” (HTTP 401)
The service did not recognise the credentials: the value is wrong, expired, revoked or was copied with a space. Create a new key at the provider and enter it on the connection page under Change credentials. Empty fields stay unchanged.
The connection test shows “Invalid key” (HTTP 403)
The credentials are rejected or lack the needed permissions, or the service only accepts requests from selected IP addresses. Check the key, extend its permissions at the provider or add the Bloklo gateway IP address (shown in Settings → Privacy & security) to the allowlist.
The test returns another HTTP code
The Test button sends the service a read request that requires valid credentials. A code other than 401 and 403 usually means a temporary problem at the service or a restriction on the account at the provider; include the error code shown with the result in a problem report.
Limits and security
- One connection can make up to 1,000 requests per minute; the service's own limits also apply.
- Credentials are encrypted and not shown in the browser after saving; only the names of stored fields are visible.
- A published app works for every visitor: protect the data the connection gives access to with sign-in in the app.
Something unclear or out of date? Contact us