Skip to main content
POST
Create a segment

Authorizations

Authorization
string
header
required

Sign in with the existing Occtoo Studio identity and selected organization.

Path Parameters

cardId
string
required

Raw id of the card definition (e.g. products).

Body

application/json

Holds a new segment of a card definition.

id
string
required

Starts with a lowercase letter, then letters and digits. Immutable.

name
string
required

Name of the segment.

language
string
required

Language code where uses for localized card properties (e.g. en).

where
object
required

Entries the segment selects. A Fixed segment takes a text condition on id with in.

type
null | enum<string>

Query selects entries by where and keeps following them; Fixed holds the listed ids. Omitted means Query. Immutable.

Available options:
Query,
Fixed
description
null | string

Free-text note about the segment.

image
null | string

Image key, lowercase letters a-z only.

tags
null | string[]

Labels for grouping and filtering segments. Alphanumeric, no duplicates.

startTime
null | string<date-time>

In the future and rounded to the hour.

endTime
null | string<date-time>

After startTime and rounded to the hour.

Response

Created

Names a set of cards of one card definition, picked by a where filter or by a fixed list of card ids.

id
string
required

Raw id of the segment (e.g. summer26). Use with /v1/card-definitions/{cardId}/segments/{segmentId}.

segmentDefinitionId
string
required

Raw id of the segment definition the segment belongs to.

cardId
string
required

Raw id of the card definition whose cards the segment picks (e.g. products).

type
enum<string>
required

How the segment picks its cards. See SegmentType.

Available options:
Query,
Fixed
status
enum<string>
required

Lifecycle state of the segment. See SegmentStatus.

Available options:
Initializing,
Active,
Scheduled,
Archived
name
string
required

Name of the segment.

description
null | string
required

Free-text note about the segment.

language
string
required

Language code where uses for localized card properties (e.g. en).

image
null | string
required

Image key, lowercase letters a-z only. Null when not set.

tags
string[]
required

Labels for grouping and filtering segments. Alphanumeric, no duplicates.

where
null | object
required

Filter that picks the segment's cards, as stored. It can differ in form from what was sent, never in meaning.

startTime
null | string<date-time>
required

When the segment becomes active, on the hour (UTC). Null = active as soon as it's created.

endTime
null | string<date-time>
required

When the segment is archived, on the hour (UTC). Null = never archived on a schedule.

createdAt
string<date-time>
required

When the segment was created (UTC).

updatedAt
string<date-time>
required

When the segment last changed (UTC).