Skip to content
Dashboard

Zapier Integration

Connect Brainpercent to 6,000+ apps using Zapier's "Webhooks by Zapier" action with exact field-by-field configuration.

Overview

Zapier doesn't have a native Brainpercent app yet. Instead, use the "Webhooks by Zapier" premium action to call any Brainpercent API endpoint directly. This guide shows the exact settings for every field in Zapier's interface.

Zapier plan required: "Webhooks by Zapier" is a premium app. Multi-step Zaps with Delay and Paths also require a paid plan (Starter or higher).

Prerequisites

  • A Zapier account on a paid plan (Starter, Professional, or Team)
  • A Brainpercent API key with read and write permissions
  • Your API key starts with bp_

Setting Up "Webhooks by Zapier"

Step 1: Add the Action

In your Zap editor, click the + button to add an action step. Search for "Webhooks by Zapier" and select it. Choose "Custom Request" as the Action Event (not "POST" or "GET" — Custom Request gives you full control over all fields).

Step 2: Configure Every Field

Here are the exact values for each field in the Custom Request configuration panel:

Zapier FieldValue to Enter
MethodPOST
URLhttps://brainpercent.app/api/v1/articles/generate
Data Pass-Through?No (we send a custom JSON body)
DataThe raw JSON body (see below)
UnflattenNo
Basic AuthLeave blank (we use header auth)
HeadersTwo key-value pairs (see below)

Step 3: Headers (Key-Value Pairs)

In the Headers section, click "+ Add Header" to add each row:

KeyValue
AuthorizationBearer bp_your_api_key_here
Content-Typeapplication/json

Pro tip: Store your API key as a Zapier "Custom Value" or "Secret" so you can reuse it across multiple Zaps without copying it each time.

Step 4: Data (JSON Body)

In the "Data" field, paste this exact JSON. You can use Zapier template variables from previous trigger steps (shown with {{curly braces}}).

{
  "topic": "Your Article Topic Here",
  "keywords": ["keyword1", "keyword2"],
  "tone": "professional",
  "length": "long"
}

Step 5: Test the Action

Click "Test step". Zapier shows the raw API response. You should see:

{
  "success": true,
  "data": {
    "article_id": "a1b2c3d4-e5f6-...",
    "status": "generating",
    "credits_charged": 40
  }
}

Multi-Step Zap: Full Content Pipeline

Generate an article, wait for it to complete, then auto-generate social media content. This requires 5 Zapier steps:

Flow: Trigger → Generate Article → Delay 5 min → Check Status → Generate Social

Step 1: Trigger

Choose any trigger — "RSS by Zapier → New Item in Feed", "Schedule by Zapier → Every Day", or "Google Sheets → New Row".

Step 2: Webhooks by Zapier — Generate Article

Configure exactly as shown in the setup section above. Use trigger data for the topic:

{
  "topic": "{{1. Title}}",
  "keywords": ["{{1. Category}}"],
  "tone": "professional",
  "length": "medium"
}

Step 3: Delay by Zapier — Wait for Generation

Zapier FieldValue
Action EventDelay For
Time Delayed For (Value)5
Time Delayed For (Unit)minutes

Article generation typically takes 1–3 minutes. A 5-minute delay provides a safe buffer. Zapier's Delay step pauses the Zap execution — it does not count against your task quota.

Step 4: Webhooks by Zapier — Check Article Status

FieldValue
MethodGET
URLhttps://brainpercent.app/api/v1/articles/{{2. data__article_id}}/status
HeadersSame Authorization header as Step 2

Note: Zapier flattens nested JSON keys with double underscores. The data.article_id from Step 2 becomes {{2. data__article_id}} in the Zapier variable picker.

Step 5: Webhooks by Zapier — Generate Social Content

FieldValue
MethodPOST
URLhttps://brainpercent.app/api/v1/social/generate
HeadersSame as Step 2
{
  "source_url": "https://brainpercent.app/articles/{{4. data__slug}}",
  "platforms": ["twitter", "linkedin"],
  "tone": "professional"
}

Parsing Responses with "Code by Zapier"

While Zapier auto-parses JSON from the Webhooks step, sometimes you need to transform data. Add a "Code by Zapier" step (JavaScript) after your webhook to extract specific fields:

Code Step Configuration

Zapier FieldValue
Action EventRun Javascript
Input Data — KeyrawResponse
Input Data — ValueMap the full response body from the Webhooks step
// Code by Zapier — Run Javascript
// inputData.rawResponse contains the API response

const response = JSON.parse(inputData.rawResponse);

if (response.success) {
  output = [{
    articleId: response.data.article_id || response.data.id,
    status: response.data.status,
    slug: response.data.slug || '',
    creditsUsed: response.data.credits_charged || 0,
  }];
} else {
  output = [{
    error: response.error?.code || 'UNKNOWN',
    message: response.error?.message || 'Request failed',
  }];
}

Error Handling with Zapier Paths

Use Paths by Zapier (conditional logic) after the Webhooks step to handle success and failure:

Path Configuration

PathRuleAction
Path A: Success{{Webhook. success}} (Text) Exactly matches trueContinue to next step (Delay, status check, etc.)
Path B: Failure{{Webhook. success}} (Text) Does not exactly match trueSend Slack/Email notification with error details

Handling Rate Limits (429)

In the Custom Request settings, check the "Continue On Error" checkbox (under "Show Advanced Options"). This prevents the Zap from halting on 429 responses. Then use a Path step to check the HTTP status code and add a Delay before retrying.

Example Zaps

RSS Feed → Article Generation

1

Trigger: RSS by Zapier → New Item in Feed

2

Action: Webhooks by Zapier → Custom Request (POST /articles/generate)

3

Delay: Delay by Zapier → 5 minutes

4

Status: Webhooks by Zapier → Custom Request (GET /articles/:id/status)

5

Social: Webhooks by Zapier → Custom Request (POST /social/generate)

Google Sheets → Bulk Article Generation

1

Trigger: Google Sheets → New Spreadsheet Row

2

Action: Webhooks by Zapier → Custom Request with sheet columns as variables

{
  "topic": "{{1. Column A - Topic}}",
  "keywords": ["{{1. Column B - Keyword 1}}", "{{1. Column C - Keyword 2}}"],
  "tone": "{{1. Column D - Tone}}",
  "length": "{{1. Column E - Length}}"
}

Daily Schedule → Social Content

1

Trigger: Schedule by Zapier → Every Day at 9:00 AM

2

Fetch: Webhooks → GET /articles?status=published&limit=1&sort=created_at&order=desc

3

Generate: Webhooks → POST /social/generate with article slug from step 2

Tips & Best Practices

  • Store your API key as a Zapier "Custom Value" or in Zapier's Secret Manager for reuse across Zaps
  • Always use "Custom Request" (not "POST") to get full control over headers and body
  • Enable "Continue On Error" in advanced settings to handle 4xx/5xx without halting
  • Use "Formatter by Zapier" to split comma-separated keywords into arrays
  • Use Paths after webhook steps for success/failure branching
  • Monitor credit balance weekly with a scheduled GET /user/credits Zap
  • Zapier uses double underscores for nested JSON: data__article_id