Skip to main content
POST
/
segments
Create segment
curl --request POST \
  --url https://api.wacht.dev/segments \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Premium Users",
  "type": "user"
}
'
{
  "id": "1234567890123456789",
  "deployment_id": "9876543210987654321",
  "name": "Premium Users",
  "type": "user",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "deleted_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication (format: Bearer {api_key})

Body

application/json
name
string
required

Segment name

Example:

"Premium Users"

type
enum<string>
required

Entity type for this segment

Available options:
user,
organization,
workspace
Example:

"user"

Response

Segment created

id
string

Segment ID

Example:

"1234567890123456789"

deployment_id
string

Deployment ID

Example:

"9876543210987654321"

name
string

Segment name

Example:

"Premium Users"

type
enum<string>

Entity type

Available options:
user,
organization,
workspace
Example:

"user"

created_at
string<date-time>

Creation timestamp

Example:

"2024-01-15T10:30:00Z"

updated_at
string<date-time>

Last update timestamp

Example:

"2024-01-15T10:30:00Z"

deleted_at
string<date-time> | null

Deletion timestamp