Zum Inhalt springen
Esc
↑↓navigieren↵öffnen⌘Jvorschau

Create a contact in an audience

POST/audiences/{audienceId}/contacts
Autorisierung
AuthorizationBearer-Token · headererforderlich

A BillionSend API key (bs_…).

Pfadparameter
audienceIdstring<uuid>erforderlich
Request-Body
erforderlichapplication/json
emailstring<email>erforderlich

Bare email address (no display name); unique per team

first_namestring

First name

last_namestring

Last name

unsubscribedboolean

Global opt-out from all marketing sends

propertiesobject

Flat map of custom properties (string or number values)

segmentsobject[]

Segments to add the contact to on creation

Eigenschaften anzeigen
Array von object
idstring<uuid>erforderlich
topicsobject[]

Initial per-topic subscription choices

Eigenschaften anzeigen
Array von object
idstring<uuid>erforderlich
subscriptionstringerforderlich
Erlaubt:opt_inopt_out
Antworten
200

Contact created in the audience

objectstringerforderlich
Erlaubt:contact
idstring<uuid>erforderlich
401

Missing, malformed, unknown or revoked API key

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
403

Plan limit reached

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
404

Not found

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
409

Contact already exists

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
422

Validation error

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
429

Over the rate limit (rate_limit_exceeded, with Retry-After)

statusCodenumbererforderlich
namestringerforderlich
messagestringerforderlich
Ausprobieren
Server
Autorisierung
Parameter
Bodyapplication/json
Anfrage
curl -X POST 'https://api.billionsend.com/audiences/497f6eca-6276-4993-bfeb-53cbbbba6f08/contacts' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "user@example.com",
  "first_name": "string",
  "last_name": "string",
  "unsubscribed": true,
  "properties": {
    "property1": null,
    "property2": null
  },
  "segments": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
    }
  ],
  "topics": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "subscription": "opt_in"
    }
  ]
}'
Antwort
{
  "object": "contact",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

War diese Seite hilfreich?