POST
/
businesses
/
{id}
/
segments
Create a segment
curl --request POST \
  --url https://api.pocketflows.com/businesses/{id}/segments \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "static_customers": [
    "<string>"
  ],
  "customers": [
    "<string>"
  ],
  "filter": "<string>"
}'
{
  "id": "<string>",
  "name": "<string>",
  "filter": "<string>",
  "static_customers": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

id
string
required

The ID of the business

Body

application/json
name
string
required

The name of the segment

static_customers
string[]

A list of customer IDs to always include in this segment

customers
string[]

A list of customer IDs to include in this segment

filter
string | null

The filter for this segment

Response

200 - application/json

The created Segment object

id
string
required

The ID of the segment

name
string
required

The name of the segment

filter
string | null
required

The filter for this segment

static_customers
string[]
required

The customers that are always included in this segment