Authorizations
A valid API key generated in Topsort's UI.
Body
application/json
List of segments to update.
Response
Successful Response
List of segments.
curl --request PUT \
  --url https://api.topsort.com/public/v1/segment-service/segments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "segments": [
    {
      "name": "<string>",
      "description": "<string>",
      "config": {
        "type": "<string>",
        "definition": {
          "behaviors": [
            {
              "logic": "and",
              "action_type": "impressions",
              "time_window": {
                "value": 45
              },
              "frequency": {
                "value": 1,
                "operator": "gt"
              },
              "parameters": [
                {
                  "entity_type": "vendor",
                  "entity_list": [
                    "<string>"
                  ]
                }
              ]
            }
          ]
        }
      },
      "id": "<string>"
    }
  ]
}'{
  "segments": [
    {
      "name": "<string>",
      "description": "<string>",
      "config": {
        "type": "<string>",
        "definition": {
          "behaviors": [
            {
              "logic": "and",
              "action_type": "impressions",
              "time_window": {
                "value": 45
              },
              "frequency": {
                "value": 1,
                "operator": "gt"
              },
              "parameters": [
                {
                  "entity_type": "vendor",
                  "entity_list": [
                    "<string>"
                  ]
                }
              ]
            }
          ]
        }
      },
      "id": "<string>",
      "total": 123
    }
  ]
}Upsert segments with the provided information.
curl --request PUT \
  --url https://api.topsort.com/public/v1/segment-service/segments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "segments": [
    {
      "name": "<string>",
      "description": "<string>",
      "config": {
        "type": "<string>",
        "definition": {
          "behaviors": [
            {
              "logic": "and",
              "action_type": "impressions",
              "time_window": {
                "value": 45
              },
              "frequency": {
                "value": 1,
                "operator": "gt"
              },
              "parameters": [
                {
                  "entity_type": "vendor",
                  "entity_list": [
                    "<string>"
                  ]
                }
              ]
            }
          ]
        }
      },
      "id": "<string>"
    }
  ]
}'{
  "segments": [
    {
      "name": "<string>",
      "description": "<string>",
      "config": {
        "type": "<string>",
        "definition": {
          "behaviors": [
            {
              "logic": "and",
              "action_type": "impressions",
              "time_window": {
                "value": 45
              },
              "frequency": {
                "value": 1,
                "operator": "gt"
              },
              "parameters": [
                {
                  "entity_type": "vendor",
                  "entity_list": [
                    "<string>"
                  ]
                }
              ]
            }
          ]
        }
      },
      "id": "<string>",
      "total": 123
    }
  ]
}A valid API key generated in Topsort's UI.
List of segments to update.
Show child attributes
Successful Response
List of segments.
Show child attributes
Was this page helpful?