cURL
curl -X PUT https://api.bodhveda.com/recipients/recipient_123/contacts \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"medium": "email",
"address": "alice@example.com"
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const contact = await bodhveda.recipients.contacts.setPrimary("recipient_123", {
medium: "email",
address: "alice@example.com",
});import (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
contact, _ := client.Recipients.Contacts.SetPrimary(ctx, "recipient_123", &bodhveda.SetPrimaryContactRequest{
Medium: bodhveda.MediumEmail,
Address: "alice@example.com",
}){
"message": "Primary contact set",
"data": {
"id": 1,
"medium": "email",
"address": "alice@example.com",
"is_primary": true,
"verified_at": null,
"created_at": "2025-11-07T05:31:56Z",
"updated_at": "2025-11-07T05:31:56Z"
}
}{
"error": "<string>",
"details": "<string>"
}Contacts
Set the primary contact
Idempotently ensure an address is the recipient’s primary contact for a medium — create it if absent, update the existing primary in place if the address differs (which resets verified_at), or no-op if it already matches. Returns the resulting primary contact (200) either way, so a “keep the primary email current” sync is a single call.
💡 Sync this server-side so the address never rides a browser request.
PUT
/
recipients
/
{recipient_id}
/
contacts
cURL
curl -X PUT https://api.bodhveda.com/recipients/recipient_123/contacts \
-H "Authorization: Bearer bv_xxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"medium": "email",
"address": "alice@example.com"
}'import { Bodhveda } from "@bodhveda/js";
const bodhveda = new Bodhveda("bv_xxxxxxxxx");
const contact = await bodhveda.recipients.contacts.setPrimary("recipient_123", {
medium: "email",
address: "alice@example.com",
});import (
"context"
bodhveda "github.com/MudgalLabs/bodhveda/sdk/go"
)
ctx := context.Background()
client := bodhveda.NewClient("bv_xxxxxxxxx", nil)
contact, _ := client.Recipients.Contacts.SetPrimary(ctx, "recipient_123", &bodhveda.SetPrimaryContactRequest{
Medium: bodhveda.MediumEmail,
Address: "alice@example.com",
}){
"message": "Primary contact set",
"data": {
"id": 1,
"medium": "email",
"address": "alice@example.com",
"is_primary": true,
"verified_at": null,
"created_at": "2025-11-07T05:31:56Z",
"updated_at": "2025-11-07T05:31:56Z"
}
}{
"error": "<string>",
"details": "<string>"
}Idempotently ensure an address is the recipient’s primary contact for a medium. Unlike add contact (which is strict and
409s on conflict), this is a create-or-update: it creates the primary if absent, updates the existing primary in place if the address differs (which resets verified_at), or no-ops if it already matches — always 200.
💡 This is the one call a server-side sync needs to keep a recipient’s primary email current — no list-then-diff. Sync it server-side so the address never rides a browser request.Authorizations
Bearer authentication header of the form Bearer bv_xxxxxxxxx, where bv_xxxxxxxxx is your API Key with Full access or Recipient acess scope.
Path Parameters
The unique identifier of the recipient.
Body
application/json
Response
The resulting primary contact.