# Create activation

Create an activation (formerly syndication).

Endpoint: POST /entities/segments/{segmentId}/syndications
Version: 1.0.0

## Path parameters:

  - `segmentId` (integer, required)
    Segment to create 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)

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

  - `attributes.columns.source.customerGroup` (string)

  - `attributes.columns.source.functions` (array)

  - `attributes.columns.source.functions.function` (string, required)
    Enum: "+", "-", "*", "/"

  - `attributes.columns.source.functions.arg` (number)

  - `attributes.columns.source.functions.search` (string)

  - `attributes.columns.source.functions.replacement` (string)

  - `attributes.columns.source.functions.start` (number)

  - `attributes.columns.source.functions.length` (number)

  - `attributes.columns.source.functions.pattern` (string)

  - `attributes.columns.source.functions.group` (number)

  - `attributes.columns.source.functions.default` (number, required)

  - `attributes.columns.source.functions.op` (string)
    Enum: ">", "<", "<=", ">=", "=", "!=", "is", "is\\", "not"

  - `attributes.columns.source.functions.right_value` (number)

  - `attributes.columns.source.functions.then` (number)

  - `attributes.columns.source.functions.else` (number)

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

  - `attributes.columns.source.parameters` (array)
    Values for the placeholders ($1, $2, $3, ...) in the string

  - `attributes.columns.source.parameters.type` (string)
    Enum: "String"

  - `attributes.columns.source.parameters.string` (string)

  - `attributes.columns.source.parameters.format` (string)

  - `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.runAt` (string)

  - `attributes.cron` (string)

  - `attributes.timezone` (string)

  - `attributes.startAt` (string)
    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)

  - `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)

  - `attributes.emailRecipients` (array)

  - `attributes.activationTemplateId` (string)

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

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

  - `attributes.syndicationBehavior.joinRow` (integer)
    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: "All", "First", "Last", "Top-N"

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

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

  - `attributes.syndicationBehavior.orderBy.key` (string)

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

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

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

  - `data` (object, required)

  - `data.id` (string)

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

  - `data.attributes` (object)

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

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

  - `data.attributes.description` (string, 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.columns.id` (string)

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

  - `data.attributes.columns.source` (any, required)

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

  - `data.attributes.columns.source.customerGroup` (string)

  - `data.attributes.columns.source.functions` (array)

  - `data.attributes.columns.source.functions.function` (string, required)
    Enum: "+", "-", "*", "/"

  - `data.attributes.columns.source.functions.arg` (number)

  - `data.attributes.columns.source.functions.search` (string)

  - `data.attributes.columns.source.functions.replacement` (string)

  - `data.attributes.columns.source.functions.start` (number)

  - `data.attributes.columns.source.functions.length` (number)

  - `data.attributes.columns.source.functions.pattern` (string)

  - `data.attributes.columns.source.functions.group` (number)

  - `data.attributes.columns.source.functions.default` (number, required)

  - `data.attributes.columns.source.functions.op` (string)
    Enum: ">", "<", "<=", ">=", "=", "!=", "is", "is\\", "not"

  - `data.attributes.columns.source.functions.right_value` (number)

  - `data.attributes.columns.source.functions.then` (number)

  - `data.attributes.columns.source.functions.else` (number)

  - `data.attributes.columns.source.string` (string, required)

  - `data.attributes.columns.source.parameters` (array)
    Values for the placeholders ($1, $2, $3, ...) in the string

  - `data.attributes.columns.source.parameters.type` (string)
    Enum: "String"

  - `data.attributes.columns.source.parameters.string` (string)

  - `data.attributes.columns.source.parameters.format` (string)

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

  - `data.attributes.scheduleOption` (string)

  - `data.attributes.timezone` (string)

  - `data.attributes.startAt` (string)
    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)

  - `data.attributes.runStatus` (string)
    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: "none", "minute", "hour", "day", "week", "month", "once"

  - `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)

  - `data.attributes.valid` (boolean)

  - `data.attributes.notifyOn` (array)

  - `data.attributes.emailRecipients` (array)

  - `data.attributes.executions` (array)

  - `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.syndicationBehavior` (any)
    Deprecated. Use syndicationBehaviors instead.

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

  - `data.attributes.syndicationBehavior.joinRow` (integer)
    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: "All", "First", "Last", "Top-N"

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

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

  - `data.attributes.syndicationBehavior.orderBy.key` (string)

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

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

  - `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)

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

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

  - `included` (array, required)

  - `included.id` (string, required)

  - `included.type` (string, required)
    Enum: "user"

  - `included.attributes` (object, required)

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

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

