Skip to content

Update segment

Request

Update a segment.

Path
idinteger, (int64)required

Segment to update

Bodyapplication/vnd.treasuredata.v1+json
idstring[1-9][0-9]*
typestring
Enum:"segment-batch""segment-realtime""segment-funnel-stage"
attributesobject
relationshipsobject
curl -i -X PATCH \
  'https://api-cdp.treasuredata.com/entities/segments/{id}' \
  -H 'Content-Type: application/vnd.treasuredata.v1+json' \
  -d '{
    "id": "string",
    "type": "segment-batch",
    "attributes": {
      "name": "string",
      "description": "string",
      "rule": {
        "conditions": [
          {
            "conditions": [
              {
                "exclude": true,
                "id": "string",
                "type": "FunnelStageReference"
              }
            ],
            "description": "string",
            "expr": "string",
            "type": "Or"
          }
        ],
        "expr": "string",
        "limit": {
          "number": 0,
          "orderColumns": [
            {
              "column": "string",
              "order": "ascending",
              "type": "Column"
            }
          ],
          "type": "Count"
        },
        "type": "Or"
      },
      "funnel_stage": {
        "funnel_id": 0,
        "stage_id": 0
      },
      "segmentInsightDashboardId": 0
    },
    "relationships": {
      "parentFolder": {
        "data": {
          "id": "string",
          "type": "folder-segment"
        }
      }
    }
  }'

Responses

Update a segment

Bodyapplication/vnd.treasuredata.v1+json
dataBatchSegmentJsonApiResource (object) or RealtimeSegmentJsonApiResource (object) or FunnelStageSegmentJsonApiResource (object)required
One of:
includedArray of objects(UserJsonApiResource)required
Response
{ "data": { "id": "string", "type": "segment-batch", "attributes": { … }, "relationships": { … } }, "included": [ { … } ] }