curl -X POST https://api.bodhveda.com/preferences \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"channel": "digest",
"topic": "none",
"event": "sent",
"medium": "email",
"name": "Daily digest",
"description": "Receive a daily summary of activity.",
"default_enabled": true
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const pref = await bodhveda.preferences.create({
channel: "digest",
topic: "none",
event: "sent",
medium: "email",
name: "Daily digest",
description: "Receive a daily summary of activity.",
default_enabled: true,
});import (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
pref, _ := client.Preferences.Create(ctx, &bodhveda.CreateProjectPreferenceRequest{
Channel: "digest",
Topic: "none",
Event: "sent",
Medium: bodhveda.MediumEmail,
Name: "Daily digest",
Description: "Receive a daily summary of activity.",
DefaultEnabled: true,
}){
"message": "Project preference created",
"data": {
"id": 12,
"project_id": 1,
"target": {
"channel": "digest",
"topic": "none",
"event": "sent"
},
"medium": "email",
"default_enabled": true,
"label": "Daily digest",
"created_at": "2025-11-07T05:31:56Z",
"updated_at": "2025-11-07T05:31:56Z"
}
}{
"error": "<string>",
"details": "<string>"
}Create a catalog entry
Create a single catalog entry. Strict: an entry for the same (channel, topic, event, medium) returns 409. Use PATCH /preferences/{preference_id} to change an existing entry, or PUT /preferences to set a whole catalog.
curl -X POST https://api.bodhveda.com/preferences \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"channel": "digest",
"topic": "none",
"event": "sent",
"medium": "email",
"name": "Daily digest",
"description": "Receive a daily summary of activity.",
"default_enabled": true
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const pref = await bodhveda.preferences.create({
channel: "digest",
topic: "none",
event: "sent",
medium: "email",
name: "Daily digest",
description: "Receive a daily summary of activity.",
default_enabled: true,
});import (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
pref, _ := client.Preferences.Create(ctx, &bodhveda.CreateProjectPreferenceRequest{
Channel: "digest",
Topic: "none",
Event: "sent",
Medium: bodhveda.MediumEmail,
Name: "Daily digest",
Description: "Receive a daily summary of activity.",
DefaultEnabled: true,
}){
"message": "Project preference created",
"data": {
"id": 12,
"project_id": 1,
"target": {
"channel": "digest",
"topic": "none",
"event": "sent"
},
"medium": "email",
"default_enabled": true,
"label": "Daily digest",
"created_at": "2025-11-07T05:31:56Z",
"updated_at": "2025-11-07T05:31:56Z"
}
}{
"error": "<string>",
"details": "<string>"
}(channel, topic, event, medium) already exists returns 409. To change an existing entry use update; to declaratively set a whole catalog use bulk upsert.Authorizations
Bearer authentication header of the form Bearer bv_xxxxxxxxx, where bv_xxxxxxxxx is your API Key with Full access scope.
Body
Broad category (e.g. "digest").
Subcategory. any matches all topics under the channel/event; none is the base channel/event.
Event that triggers the notification (e.g. "sent").
Human-readable name for the catalog entry (e.g. "Weekly digest").
The project-level default for recipients who have set no preference of their own.
The medium this catalog entry gates. Defaults to in_app.
in_app, email Optional longer blurb shown alongside the name on a settings screen. Omitted or blank stores none.
Whether recipients may opt out. A mandatory entry is cataloged (so sends pass the target gate) but its recipient toggle is refused with a 400, and any rule a recipient already had is ignored. For transactional notifications — password resets, security alerts, a one-shot welcome. default_enabled still applies, so setting it false stops the notification: mandatory removes the recipient's choice, not yours. Defaults to false.
Response
Catalog entry created.