BehaviorPro API Documentation
Integrate BehaviorPro's text optimization into your applications using the REDUCE model
Quick Start
Get an API key - Go to your tab and create a new key. (Enterprise/Admin only)
Mark the section to optimize - Wrap the text you want optimized with <<OPTIMIZE>> and <</OPTIMIZE>> markers.
Send your request - Include the full text, your goal, and context variables.
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,
TeamTip: 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_hereKeep 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-reduceRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | Full text with <<OPTIMIZE>>...<</OPTIMIZE>> markers |
| goal | string | Yes | The behavioral goal (e.g., "Increase signups") |
| context | object | Yes | Key-value pairs with context variables (see below) |
Context Variables
Context variables help the AI select the right persuasion techniques. Include relevant data points:
| Category | Example Variables | Enables Techniques |
|---|---|---|
| Social data | reviews, testimonials, customer_count, ratings | Social Proof, Authority |
| Scarcity | beschikbare_plekken, deadline, voorraad | Loss Aversion, Costs of Inaction |
| Past behavior | sessies_gehad, eerdere_investering, tijd_besteed | Sunk-Cost Effect, Endowed Progress |
| Audience | doelgroep, kanaal, eerste_keer | All (for targeting) |
| Risk factors | garantie_mogelijk, nieuw_product, proefperiode | Risk 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 tekstPython
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
| Field | Type | Description |
|---|---|---|
| optimized_section | string | The optimized text (replace the marked section with this) |
| techniques_used | array | List 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 Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Missing required fields, invalid format, or missing markers |
| 401 | AUTH_ERROR | Invalid, missing, or deactivated API key |
| 429 | RATE_LIMIT | Rate limit exceeded (wait 60 seconds) |
| 500 | INTERNAL_ERROR | Server error during optimization |
About the REDUCE Model
The API uses the REDUCE model (Jonah Berger) to identify and remove mental barriers:
| Code | Barrier | Example Techniques |
|---|---|---|
| R | Reactance | Evoking Freedom, Self-Persuasion, Empathy |
| E | Endowment | Loss Aversion, Sunk-Cost Effect, Costs of Inaction |
| D | Distance | Endowed Progress, Self-Efficacy, Information Chunking |
| U | Uncertainty | Risk Reduction, Experiential Learning |
| C | Corroborating Evidence | Social Proof, Authority, Reasons Why |
Have a question?
Let us know and we'll get back to you!
