BehaviorPro API Documentation

Integrate BehaviorPro's text optimization into your applications using the REDUCE model

Quick Start

1

Get an API key - Go to your tab and create a new key. (Enterprise/Admin only)

2

Mark the section to optimize - Wrap the text you want optimized with <<OPTIMIZE>> and <</OPTIMIZE>> markers.

3

Send your request - Include the full text, your goal, and context variables.

4

Get optimized text - Receive the optimized section with techniques used.

API access is available for Enterprise and Admin accounts. or .

How Markers Work

Use <<OPTIMIZE>> and <</OPTIMIZE>> markers to indicate which part of your text should be optimized. The API uses the surrounding text as context but only rewrites the marked section.

Example Template

Beste {{naam}},

Bedankt voor uw interesse in onze diensten.

<<OPTIMIZE>>
We bieden u graag een kennismakingsgesprek aan.
<</OPTIMIZE>>

U kunt via onderstaande link een afspraak maken.

Met vriendelijke groet,
Team

Tip: The full text provides context (e.g., tone, greeting style), while only the marked section gets rewritten. This ensures consistency with your template.

Authentication

All API requests require authentication using an API key. Include your key in the request headers:

x-api-key: bp_your_api_key_here

// Or using Authorization header:
Authorization: Bearer bp_your_api_key_here

Keep your API key secure. Never expose it in client-side code or public repositories.

API Endpoint

POST /api-reduce

Optimize a marked section of text using the REDUCE behavioral model.

https://api.behaviorpro.nl/functions/v1/api-reduce

Request Body

ParameterTypeRequiredDescription
textstringYesFull text with <<OPTIMIZE>>...<</OPTIMIZE>> markers
goalstringYesThe behavioral goal (e.g., "Increase signups")
contextobjectYesKey-value pairs with context variables (see below)

Context Variables

Context variables help the AI select the right persuasion techniques. Include relevant data points:

CategoryExample VariablesEnables Techniques
Social datareviews, testimonials, customer_count, ratingsSocial Proof, Authority
Scarcitybeschikbare_plekken, deadline, voorraadLoss Aversion, Costs of Inaction
Past behaviorsessies_gehad, eerdere_investering, tijd_besteedSunk-Cost Effect, Endowed Progress
Audiencedoelgroep, kanaal, eerste_keerAll (for targeting)
Risk factorsgarantie_mogelijk, nieuw_product, proefperiodeRisk Reduction, Experiential Learning

Code Examples

cURL

curl -X POST https://api.behaviorpro.nl/functions/v1/api-reduce \
  -H "Content-Type: application/json" \
  -H "x-api-key: bp_your_api_key_here" \
  -d '{
    "text": "Beste klant, <<OPTIMIZE>>We willen u graag uitnodigen voor onze workshop.<</OPTIMIZE>> Met vriendelijke groet, Team",
    "goal": "Verhoog het aantal aanmeldingen voor de workshop",
    "context": {
      "doelgroep": "HR-managers",
      "kanaal": "email",
      "beschikbare_plekken": 5,
      "eerdere_deelnemers": 127
    }
  }'

JavaScript / Node.js

const response = await fetch(
  'https://api.behaviorpro.nl/functions/v1/api-reduce',
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': 'bp_your_api_key_here'
    },
    body: JSON.stringify({
      text: `Beste klant,

<<OPTIMIZE>>We willen u graag uitnodigen voor onze workshop.<</OPTIMIZE>>

Met vriendelijke groet,
Team`,
      goal: 'Verhoog het aantal aanmeldingen voor de workshop',
      context: {
        doelgroep: 'HR-managers',
        kanaal: 'email',
        beschikbare_plekken: 5,
        eerdere_deelnemers: 127
      }
    })
  }
);

const result = await response.json();
console.log(result.optimized_section);
// Output: de geoptimaliseerde tekst

Python

import requests

response = requests.post(
    'https://api.behaviorpro.nl/functions/v1/api-reduce',
    headers={
        'Content-Type': 'application/json',
        'x-api-key': 'bp_your_api_key_here'
    },
    json={
        'text': '''Beste klant,

<<OPTIMIZE>>We willen u graag uitnodigen voor onze workshop.<</OPTIMIZE>>

Met vriendelijke groet,
Team''',
        'goal': 'Verhoog het aantal aanmeldingen voor de workshop',
        'context': {
            'doelgroep': 'HR-managers',
            'kanaal': 'email',
            'beschikbare_plekken': 5,
            'eerdere_deelnemers': 127
        }
    }
)

result = response.json()
print(result['optimized_section'])

Response Format

Success Response (200)

{
  "optimized_section": "Sluit u aan bij de 127 HR-managers die al deelnamen! Nog maar 5 plekken beschikbaar voor onze praktijkgerichte workshop.",
  "techniques_used": [
    {
      "name": "Social Proof",
      "motivation": "REDUCE barrier C (Corroborating Evidence) identified. Context variable 'eerdere_deelnemers: 127' provides explicit social data. Applied by referencing the number of previous participants."
    },
    {
      "name": "Loss Aversion",
      "motivation": "REDUCE barrier E (Endowment) supported by 'beschikbare_plekken: 5'. Scarcity framing applied to highlight limited availability."
    }
  ]
}

Response Fields

FieldTypeDescription
optimized_sectionstringThe optimized text (replace the marked section with this)
techniques_usedarrayList of applied techniques with name and motivation

Error Response

{
  "error": "Text must contain <<OPTIMIZE>>...<</OPTIMIZE>> markers to indicate which section to optimize.",
  "code": "VALIDATION_ERROR",
  "example": "Your template text here... <<OPTIMIZE>>Section to optimize<</OPTIMIZE>> ...rest of template"
}

Rate Limits & Billing

Rate Limit

60 requests per minute per API key

Ψ-Token Billing

1 Ψ-token per API call

How billing works: Each API call consumes 1 Ψ-token from your account balance. Ψ-tokens are included in your subscription plan and can also be purchased as top-ups. You can continue making calls as long as you have Ψ-tokens remaining.

Error Codes

HTTP StatusCodeDescription
400VALIDATION_ERRORMissing required fields, invalid format, or missing markers
401AUTH_ERRORInvalid, missing, or deactivated API key
429RATE_LIMITRate limit exceeded (wait 60 seconds)
500INTERNAL_ERRORServer error during optimization

About the REDUCE Model

The API uses the REDUCE model (Jonah Berger) to identify and remove mental barriers:

CodeBarrierExample Techniques
RReactanceEvoking Freedom, Self-Persuasion, Empathy
EEndowmentLoss Aversion, Sunk-Cost Effect, Costs of Inaction
DDistanceEndowed Progress, Self-Efficacy, Information Chunking
UUncertaintyRisk Reduction, Experiential Learning
CCorroborating EvidenceSocial Proof, Authority, Reasons Why

Have a question?

Let us know and we'll get back to you!

to send us a question.