Skip to main content
POST

Authorizations

Authorization
string
header
required

An API key created in Settings → API keys (bp_live_… or bp_test_…).

Body

application/json

One of three shapes, told apart by the fields present — template, describe, or a definition.

name
string

Required with a definition. Optional with a template (its name by default) or a description (drafted otherwise). The slug is derived from it, so the same name always maps to the same decision.

Maximum string length: 120
slug
string

Explicit identifier; derived from the name by default.

Maximum string length: 64
Pattern: ^[a-z0-9]+(-[a-z0-9]+)*$
description
string
publish
boolean
default:true

Publish version 1 right away.

template
string

Key of a catalogue template (see GET /templates).

locale
enum<string>
default:en

Locale of the template.

Available options:
en,
fr
describe
string

What the decision should do, in plain words. The options and the question are drafted by the LLM in the language of the description; type may be imposed.

Maximum string length: 2000
type
enum<string>

Required with a definition, optional with describe.

Available options:
route,
score,
classify
instructions
string

Definition — the closed question asked about the input.

context
object

Definition — what the input contains and, optionally, its declared fields.

options
(string | object)[]

Route decisions — 2 to 255 options. Also accepted as one comma- or line-separated string.

An option, a level or a label. A plain string is both the key and the description.

levels
(string | object)[]

Score decisions — 2 to 10 levels, lowest first.

An option, a level or a label. A plain string is both the key and the description.

labels
(string | object)[]

Classify decisions — 1 to 50 labels.

An option, a level or a label. A plain string is both the key and the description.

Response

A decision with this slug already existed and is returned as is.

slug
string
required
name
string
required
type
enum<string>
required
Available options:
route,
score,
classify
created
boolean
required

false when a decision with this slug already existed and is returned untouched.

status
enum<string>
required
Available options:
live,
draft
live_version
integer | null
required
url
string<uri>
required

The decision in the app.

description
string
options
string[]

Route decisions — option keys.

levels
string[]

Score decisions — level labels, lowest first.

labels
string[]

Classify decisions — label keys.

publish_error
enum<string>

Present when version 1 could not be published.

Available options:
plan_limit
message
string

Present when the decision is not live — what to do next.

upgrade_url
string<uri>