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

Create a segment

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

A BillionSend API key (bs_…).

请求体
必填application/json
namestring必填
最小长度 1
domain_idstring<uuid> | null

BillionSend extension: id of one of your domains. A broadcast to this segment must then be sent from that domain (422 otherwise), so an audience is never mailed under another brand or against another brand's opt-outs. null or omitted: a segment of the whole team, sendable from any domain. On update, null makes the segment a team-wide one again.

filterSegmentFilter | null
显示属性
matchstring必填
允许值:allany
conditionsobject[]必填
最多 50 项
显示属性
object 数组
fieldstring必填
opstring必填
valuestring | null必填
最大长度 500
响应
200

Segment created

objectstring必填
允许值:segment
idstring<uuid>必填
namestring必填
domain_idstring<uuid> | null必填

BillionSend extension: the domain the segment is bound to; null for a team-wide segment

filterSegmentFilter | null必填
显示属性
matchstring必填
允许值:allany
conditionsobject[]必填
最多 50 项
显示属性
object 数组
fieldstring必填
opstring必填
valuestring | null必填
最大长度 500
created_atstring必填
401

Missing, malformed, unknown or revoked API key

statusCodenumber必填
namestring必填
messagestring必填
403

A key held to one domain bound this to another domain, or unbound it

statusCodenumber必填
namestring必填
messagestring必填
422

Validation error, or a domain_id that is not one of your domains

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/segments' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "domain_id": "b2f7354f-b74d-4332-ab10-1a5e3c56466c",
  "filter": {
    "match": "all",
    "conditions": [
      {
        "field": "string",
        "op": "string",
        "value": "string"
      }
    ]
  }
}'
响应
{
  "object": "segment",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "domain_id": "b2f7354f-b74d-4332-ab10-1a5e3c56466c",
  "filter": {
    "match": "all",
    "conditions": [
      {
        "field": "string",
        "op": "string",
        "value": "string"
      }
    ]
  },
  "created_at": "string"
}

这个页面有帮助吗?