cURL
curl -X POST https://api.bodhveda.com/recipients/batch \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"recipients": [
{ "id": "recipient_123", "name": "Alice Johnson" },
{ "id": "recipient_456", "name": "Bob Smith" }
]
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const res = await bodhveda.recipients.createBatch({
recipients: [
{ id: "recipient_123", name: "Alice Johnson" },
{ id: "recipient_456", name: "Bob Smith" },
],
});
// res.created, res.updated, res.failedimport (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
alice, bob := "Alice Johnson", "Bob Smith"
res, _ := client.Recipients.CreateBatch(ctx, &bodhveda.CreateRecipientsBatchRequest{
Recipients: []bodhveda.CreateRecipientRequest{
{ID: "recipient_123", Name: &alice},
{ID: "recipient_456", Name: &bob},
},
})
// res.Created, res.Updated, res.Failed{
"data": {
"created": [
{
"id": "recipient_123"
}
],
"updated": [
{
"id": "recipient_456"
}
],
"failed": [
{
"id": "",
"batch_index": 2,
"errors": [
{
"message": "ID is required",
"description": "ID cannot be empty",
"property_path": "id",
"invalid_value": ""
}
]
}
]
}
}Recipients
Batch create recipients
Create up to 100 recipients at once.
POST
/
recipients
/
batch
cURL
curl -X POST https://api.bodhveda.com/recipients/batch \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"recipients": [
{ "id": "recipient_123", "name": "Alice Johnson" },
{ "id": "recipient_456", "name": "Bob Smith" }
]
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const res = await bodhveda.recipients.createBatch({
recipients: [
{ id: "recipient_123", name: "Alice Johnson" },
{ id: "recipient_456", name: "Bob Smith" },
],
});
// res.created, res.updated, res.failedimport (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
alice, bob := "Alice Johnson", "Bob Smith"
res, _ := client.Recipients.CreateBatch(ctx, &bodhveda.CreateRecipientsBatchRequest{
Recipients: []bodhveda.CreateRecipientRequest{
{ID: "recipient_123", Name: &alice},
{ID: "recipient_456", Name: &bob},
},
})
// res.Created, res.Updated, res.Failed{
"data": {
"created": [
{
"id": "recipient_123"
}
],
"updated": [
{
"id": "recipient_456"
}
],
"failed": [
{
"id": "",
"batch_index": 2,
"errors": [
{
"message": "ID is required",
"description": "ID cannot be empty",
"property_path": "id",
"invalid_value": ""
}
]
}
]
}
}Instead of creating one recipient per HTTP request, Bodhveda provides a batching endpoint that lets you create up to 1000 recipients in a single API call.