Skip to main content
POST
Create, change or delete a candidate segment

Authorizations

Authorization
string
header
required

Supabase JWT — Authorization: Bearer <token>.

Body

application/json
action
enum<string>
required

save: create (no segment_id) or change (segment_id) a segment; delete: delete it; add_members / remove_members: change the members of a static segment.

Available options:
save,
delete,
add_members,
remove_members
merchant_id
string<uuid>

Optional company to act in. Admins and sub-merchant operators only; other callers always use their token's company.

segment_id
string<uuid>

Segment id (profile_interview_segment.id). Required for every action except creating.

name
string

save: the name (1 to 120 characters). Required when creating; kept when left out on a change.

Maximum string length: 120
description
string | null

save: a description (at most 500 characters); null or empty clears it; kept when left out on a change.

Maximum string length: 500
kind
enum<string>

save: dynamic (members are the candidates matching the rules at any time) or static (a fixed list). Required when creating; cannot change.

Available options:
dynamic,
static
rules
object

save: the rules of a dynamic segment (an object, or the same JSON as a string), checked by the database (the candidate search of merchant-candidate-list takes the same rules: try them there first). When creating a static segment without candidate_ids, the candidates matching these rules now become its members (at most 5000).

candidate_ids
string<uuid>[]

Candidate ids (profile_interview.id). save, creating a static segment: its first members. add_members / remove_members: the candidates to add or remove (required).

Maximum array length: 1000

Response

Done.

action
enum<string>
required

The action done.

Available options:
save,
delete,
add_members,
remove_members
segment_id
string
required

Segment id (profile_interview_segment.id).

created
boolean

save: true when a new segment was created.

segment
object

save: the segment as saved.

added
integer

add_members: candidates added (members already in it are not counted).

removed
integer

remove_members: candidates removed.

deleted
boolean

delete: true.