PUT
/
v1
/
segments
/
{segment}
cURL
curl --request PUT \
  --url https://api.comm.com/api/v1/segments/{segment} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "query": {
    "condition": "AND",
    "rules": [
      {
        "field": "clicked_count",
        "operator": "greater",
        "value": 0
      },
      {
        "field": "country_id",
        "operator": "equal",
        "value": 225
      },
      {
        "condition": "OR",
        "rules": [
          {
            "field": "leads_count",
            "operator": "equal",
            "value": 1
          },
          {
            "field": "sales_count",
            "operator": "equal",
            "value": 1
          }
        ]
      },
      {
        "field": "date_created",
        "operator": "equal",
        "value": "2023-07-05"
      }
    ]
  }
}'
{
  "data": {
    "id": "<string>",
    "type": "<string>",
    "name": "<string>",
    "query": "<string>",
    "is_active": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

segment
string<uuid>
required

The segment ID

Body

application/json

Response

200
application/json

SegmentResource

The response is of type object.