跳到内容
Esc
↑↓导航↵打开⌘J预览

Create a contact

POST/contacts
授权
AuthorizationBearer 令牌 · header必填

A BillionSend API key (bs_…).

请求体
必填application/json
emailstring<email>必填

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

显示属性
object 数组
idstring<uuid>必填
topicsobject[]

Initial per-topic subscription choices

显示属性
object 数组
idstring<uuid>必填
subscriptionstring必填
允许值:opt_inopt_out
响应
200

Contact created

objectstring必填
允许值:contact
idstring<uuid>必填
401

Missing, malformed, unknown or revoked API key

statusCodenumber必填
namestring必填
messagestring必填
403

Plan limit reached

statusCodenumber必填
namestring必填
messagestring必填
404

Unknown segment or topic

statusCodenumber必填
namestring必填
messagestring必填
409

Contact already exists

statusCodenumber必填
namestring必填
messagestring必填
422

Validation error

statusCodenumber必填
namestring必填
messagestring必填
429

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

statusCodenumber必填
namestring必填
messagestring必填
试一试
服务器
授权
请求体application/json
请求
curl -X POST 'https://api.billionsend.com/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"
    }
  ]
}'
响应
{
  "object": "contact",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

这个页面有帮助吗?