# Update activation

Update an activation.

Endpoint: PATCH /entities/segments/{segmentId}/syndications/{id}
Version: 1.0.0

## Path parameters:

  - `id` (integer, required)
    Activation to update

  - `segmentId` (integer, required)
    Segment associated with the Activation

## Request fields (application/vnd.treasuredata.v1+json):

  - `id` (string)

  - `type` (string)
    Enum: "syndication"

  - `attributes` (object)

  - `attributes.name` (string, required)

  - `attributes.description` (string)

  - `attributes.allColumns` (boolean)
    syndication all column flag  ('true' means  that you use all attribute data)

  - `attributes.columns` (array)
    Syndication column detail. Basic syntax is {"column": "alias_name", "source": {...}}. source accepts various definitions. See ColumnExpression/StringExpression for details. example value is using ColumnExpression without function property.
    Example: [{"column":"alias_name","source":{"column":"real_column_name"}}]

  - `attributes.columns.id` (string)

  - `attributes.columns.column` (string, required)

  - `attributes.columns.source` (any, required) — one of:
    - ColumnExpression:
      - `column` (string, required)
      - `customerGroup` (string,null)
      - `functions` (array,null) — one of:
        - variant 1:
          - `function` (string, required)
            Enum: "+", "-", "*", "/"
          - `arg` (number)
        - variant 2:
          - `function` (string, required)
            Enum: "replace"
          - `search` (string)
          - `replacement` (string,null)
        - variant 3:
          - `function` (string, required)
            Enum: "substr"
          - `start` (number)
          - `length` (number)
        - variant 4:
          - `function` (string, required)
            Enum: "regexp_extract"
          - `pattern` (string)
          - `group` (number)
        - variant 5:
          - `function` (string, required)
            Enum: "day_of_week", "from_iso8601_timestamp", "ln", "elapsed_days", "td_ip_to_least_specific_subdivision_name", "td_ip_to_country_name", "td_ip_to_city_name", "td_ip_to_connection_type", "td_ip_to_domain"
        - variant 6:
          - `function` (string, required)
            Enum: "cast_as_quantitative"
          - `default` (number, required)
        - variant 7:
          - `function` (string, required)
            Enum: "cast_as_categorical"
          - `default` (string, required)
        - variant 8:
          - `function` (string, required)
            Enum: "cast_as_categorical_array"
        - variant 9:
          - `function` (string, required)
            Enum: "if"
          - `op` (string)
            Enum: ">", "<", "<=", ">=", "=", "!=", "is", "is\\", "not"
          - `right_value` (number,null)
          - `then` (number)
          - `else` (number)
    - StringExpression:
      - `string` (string, required)
      - `parameters` (array) — one of:
        Values for the placeholders ($1, $2, $3, ...) in the string
        - variant 1:
          - `type` (string)
            Enum: "String"
          - `string` (string)
        - variant 2:
          - `type` (string)
            Enum: "Timestamp"
          - `format` (string)
        - variant 3:
          - `type` (string)
            Enum: "SegmentName", "SegmentId", "AudienceId", "FunnelName", "StageName"

  - `attributes.runAt` (string)

  - `attributes.cron` (string)

  - `attributes.timezone` (string)

  - `attributes.startAt` (string,null)
    cdp-api will fill some value for old syndications with ScheduleType is not NoneType. '%Y-%M-%DT%h:%m:%s' is expected.

  - `attributes.endOn` (string,null)

  - `attributes.repeatUnit` (string)
    Setting an activation repetition cycle such as "day" or "week".
    Enum: "none", "minute", "hour", "day", "week", "month", "once"

  - `attributes.repeatFrequency` (integer)
    Setting an activation repeat frequency.
Currently, it is set only when the repeat unit is "minute". If the repeat unit is "minute", the interval is set in minutes.

  - `attributes.repeatSubFrequency` (array)
    Parameter for more detailed frequency settings. Values are array of integers.
Currently, this parameter is only valid for repeat unit "week".
For multiple days of the week, each value should be 1 to 7.
1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday, 7: Sunday
    Example: [1,5,6]

  - `attributes.connectionId` (integer)

  - `attributes.connectorConfig` (object)

  - `attributes.notifyOn` (array)
    Enum: "onSuccess", "onFailure"

  - `attributes.emailRecipients` (array)

  - `attributes.activationTemplateId` (string)

  - `attributes.syndicationBehaviors` (array,null)
    Behavior activation configurations. Cannot be specified together with syndicationBehavior.

  - `attributes.syndicationBehaviors.columns` (array)
    Syndication column detail. Basic syntax is {"column": "alias_name", "source": {...}}. source accepts various definitions. See ColumnExpression/StringExpression for details. example value is using ColumnExpression without function property.
    Example: [{"column":"alias_name","source":{"column":"real_column_name"}}]

  - `attributes.syndicationBehaviors.behaviorTableName` (string)
    Behavior table name which contains behavior records
    Example: "purchase_history"

  - `attributes.syndicationBehaviors.joinRow` (integer,null)
    How much rows would be joined (value is N for Top-N join)
    Example: 3

  - `attributes.syndicationBehaviors.joinStrategy` (string)
    Label of what is the wanted record(s).
    Enum: "All", "First", "Last", "Top-N"

  - `attributes.syndicationBehaviors.formatting` (string)
    Enum: "rows", "cols"

  - `attributes.syndicationBehaviors.orderBy` (array)
    Example: [{"key":"purchased_at","order":"descending"},{"key":"price","order":"ascending"}]

  - `attributes.syndicationBehaviors.orderBy.key` (string)
    Example: "purchased_at"

  - `attributes.syndicationBehaviors.orderBy.order` (string)
    Enum: "ascending", "descending"

  - `attributes.scheduleType` (string)
    Deprecated. Old parameter for setting schedule type. See/Use RepeatUnit instead.
    Enum: "cron", "daily", "hourly", "minutes_interval", "monthly", "none", "weekly"

  - `attributes.scheduleOption` (string)
    Deprecated. Old parameter for setting schedule. See startAt instead.

  - `attributes.syndicationBehavior` (object,null)
    Deprecated. Use syndicationBehaviors instead. Cannot be specified together with syndicationBehaviors.

  - `attributes.syndicationBehavior.columns` (array)
    Syndication column detail. Basic syntax is {"column": "alias_name", "source": {...}}. source accepts various definitions. See ColumnExpression/StringExpression for details. example value is using ColumnExpression without function property.
    Example: [{"column":"alias_name","source":{"column":"real_column_name"}}]

  - `attributes.syndicationBehavior.behaviorTableName` (string)
    Behavior table name which contains behavior records
    Example: "purchase_history"

  - `attributes.syndicationBehavior.joinRow` (integer,null)
    How much rows would be joined (value is N for Top-N join)
    Example: 3

  - `attributes.syndicationBehavior.joinStrategy` (string)
    Label of what is the wanted record(s).
    Enum: same as `attributes.syndicationBehaviors.joinStrategy` (4 values)

  - `attributes.syndicationBehavior.formatting` (string)
    Enum: same as `attributes.syndicationBehaviors.formatting` (2 values)

  - `attributes.syndicationBehavior.orderBy` (array)
    Example: [{"key":"purchased_at","order":"descending"},{"key":"price","order":"ascending"}]

  - `attributes.syndicationBehavior.orderBy.key` (string)
    Example: "purchased_at"

  - `attributes.syndicationBehavior.orderBy.order` (string)
    Enum: same as `attributes.syndicationBehaviors.orderBy.order` (2 values)

## Response 200 fields (application/vnd.treasuredata.v1+json):

  - `data` (object, required)

  - `data.id` (string)

  - `data.type` (string)
    Enum: same as `type` (1 values)

  - `data.attributes` (object)

  - `data.attributes.audienceId` (string, required)

  - `data.attributes.name` (string, required)

  - `data.attributes.description` (string,null, required)

  - `data.attributes.allColumns` (boolean)
    syndication all column flag  ('true' means that you use all attribute data)

  - `data.attributes.columns` (array, required)
    Syndication column detail. Basic syntax is {"column": "alias_name", "source": {...}}. source accepts various definitions. See ColumnExpression/StringExpression for details. example value is using ColumnExpression without function property.
    Example: [{"column":"alias_name","source":{"column":"real_column_name"}}]

  - `data.attributes.timezone` (string)

  - `data.attributes.startAt` (string,null)
    cdp-api will fill some value for old syndications with ScheduleType is not NoneType. '%Y-%M-%DT%h:%m:%s' is expected.

  - `data.attributes.endOn` (string,null)

  - `data.attributes.runStatus` (string,null)
    Tag should be shown in "Run Status". If the workflow never run before and future schedule is set, 'scheduled' will be shown.
    Enum: "scheduled", "success", "error", "canceling", "canceled", "running", "waiting"

  - `data.attributes.repeatUnit` (string)
    Setting an activation repetition cycle such as "day" or "week".
    Enum: same as `attributes.repeatUnit` (7 values)

  - `data.attributes.repeatFrequency` (integer)
    Setting an activation repeat frequency.
Currently, it is set only when the repeat unit is "minute". If the repeat unit is "minute", the interval is set in minutes.

  - `data.attributes.repeatSubFrequency` (array)
    Parameter for more detailed frequency settings. Values are array of integers.
Currently, this parameter is only valid for repeat unit "week".
For multiple days of the week, each value should be 1 to 7.
1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday, 7: Sunday
    Example: [1,5,6]

  - `data.attributes.connectionId` (string)

  - `data.attributes.connectorConfig` (object,null)

  - `data.attributes.valid` (boolean)

  - `data.attributes.notifyOn` (array)
    Enum: same as `attributes.notifyOn` (2 values)

  - `data.attributes.emailRecipients` (array)

  - `data.attributes.executions` (array)

  - `data.attributes.executions.workflowId` (string, required)

  - `data.attributes.executions.workflowSessionId` (string, required)

  - `data.attributes.executions.createdAt` (string, required)

  - `data.attributes.executions.finishedAt` (string,null, required)

  - `data.attributes.executions.status` (string, required)
    Enum: "success", "canceled", "error", "canceling", "blocked", "queued", "running"

  - `data.attributes.executions.workflowAttemptId` (string, required)

  - `data.attributes.executions.syndicationId` (string)

  - `data.attributes.createdAt` (string, required)

  - `data.attributes.updatedAt` (string, required)

  - `data.attributes.nestedWorkflowProjectName` (string)

  - `data.attributes.nestedWorkflowName` (string)

  - `data.attributes.activationActionsEnabled` (boolean)

  - `data.attributes.lockEnabled` (boolean)

  - `data.attributes.activationTemplateId` (string)

  - `data.attributes.syndicationBehaviors` (array,null)
    Behavior activation configurations

  - `data.attributes.scheduleType` (string)
    Deprecated. Old parameter for setting schedule type. See/Use RepeatUnit instead.
    Enum: same as `attributes.scheduleType` (7 values)

  - `data.attributes.scheduleOption` (string)

  - `data.attributes.syndicationBehavior` (object,null)
    Deprecated. Use syndicationBehaviors instead.

  - `data.attributes.syndicationBehavior.columns` (array)
    Syndication column detail. Basic syntax is {"column": "alias_name", "source": {...}}. source accepts various definitions. See ColumnExpression/StringExpression for details. example value is using ColumnExpression without function property.
    Example: [{"column":"alias_name","source":{"column":"real_column_name"}}]

  - `data.attributes.syndicationBehavior.behaviorTableName` (string)
    Behavior table name which contains behavior records
    Example: "purchase_history"

  - `data.attributes.syndicationBehavior.joinRow` (integer,null)
    How much rows would be joined (value is N for Top-N join)
    Example: 3

  - `data.attributes.syndicationBehavior.joinStrategy` (string)
    Label of what is the wanted record(s).
    Enum: same as `attributes.syndicationBehaviors.joinStrategy` (4 values)

  - `data.attributes.syndicationBehavior.formatting` (string)
    Enum: same as `attributes.syndicationBehaviors.formatting` (2 values)

  - `data.attributes.syndicationBehavior.orderBy` (array)
    Example: [{"key":"purchased_at","order":"descending"},{"key":"price","order":"ascending"}]

  - `data.attributes.syndicationBehavior.orderBy.key` (string)
    Example: "purchased_at"

  - `data.attributes.syndicationBehavior.orderBy.order` (string)
    Enum: same as `attributes.syndicationBehaviors.orderBy.order` (2 values)

  - `data.relationships` (object)

  - `data.relationships.segment` (object)

  - `data.relationships.segment.data` (object)

  - `data.relationships.segment.data.id` (string, required)

  - `data.relationships.segment.data.type` (string, required)
    Enum: "segment-batch"

  - `data.relationships.createdBy` (object)

  - `data.relationships.createdBy.data` (object,null)

  - `data.relationships.createdBy.data.id` (string, required)

  - `data.relationships.createdBy.data.type` (string, required)
    Enum: "user"

  - `data.relationships.updatedBy` (object)

  - `included` (array, required)

  - `included.id` (string, required)

  - `included.type` (string, required)
    Enum: same as `data.relationships.createdBy.data.type` (1 values)

  - `included.attributes` (object, required)

  - `included.attributes.tdUserId` (string, required)

  - `included.attributes.name` (string, required)


