Skip to main content
POST
/
segments
Create a segment
curl --request POST \
  --url https://api.qonversion.io/v4/segments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Premium Users",
  "conditions": [
    {
      "metric": "environment",
      "comparator": "eq",
      "value": "prod",
      "negate": false
    }
  ]
}
'
{
  "object": "segment",
  "id": "premium-users",
  "url": "/v4/segments/premium-users",
  "name": "Premium Users",
  "is_system": true,
  "conditions": [
    {
      "metric": "environment",
      "comparator": "eq",
      "value": "prod",
      "negate": false
    }
  ],
  "created_at": "2025-09-15T12:30:00Z",
  "updated_at": "2025-11-03T10:26:40Z"
}

Documentation Index

Fetch the complete documentation index at: https://documentation.qonversion.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication using the project Secret Key (prefixed with sk_, or test_sk_ for sandbox). All v4 public endpoints require the Secret Key — see Authentication. Never expose the Secret Key in client-side code.

Headers

Idempotency-Key
string

Idempotency key for safe retries.

Body

application/json
name
string
required

Segment name (max 256 characters).

Example:

"Premium Users"

conditions
object[]

Targeting rules. Every rule must match (logical AND). Optional; omit to create a segment with no rules.

Example:
[
  {
    "metric": "environment",
    "comparator": "eq",
    "value": "prod",
    "negate": false
  }
]

Response

Segment created

object
string
required
Example:

"segment"

id
string
required

Segment identifier.

Example:

"premium-users"

url
string
required

Canonical API path.

Example:

"/v4/segments/premium-users"

name
string
required

Display name.

Example:

"Premium Users"

is_system
boolean
required

Whether this is a predefined system segment (read-only).

conditions
object[]
required

Targeting rules. Every rule must match for a user to fall into the segment (logical AND). Omit on update to leave existing conditions untouched; pass an empty array to clear.

created_at
string<date-time>
required

ISO 8601 creation timestamp.

Example:

"2025-09-15T12:30:00Z"

updated_at
string<date-time>
required

ISO 8601 last update timestamp.

Example:

"2025-11-03T10:26:40Z"