Skip to main content

slackLists.create method

Usage info

Lists are only available to Slack workspaces on a paid plan.

This method is used to create a new standalone List owned by the acting user. The List will be created with only one text column if none of the optional parameters are specified.

When todo_mode is set to true, the list will be create with 3 additional fields used for task tracking:

  • Completed: a boolean column (column type todo_completed) for tracking whether or not an item is completed.
  • Assignee: a people column (column type todo_assignee) for storing who the assignee is for a given List item.
  • Due date: a date column (column type todo_due_date) for storing when the List item is due.

Schema definition

The schema is defined with the following structure, with ? denoting whether the field is optional:

[
{
"key": <string>, // the key of the column
"name": <string>, // the name of the column to be displayed in the List
"type": <string>, // the type of column. More details below
?"is_primary_column": <boolean>, // value to specify whether the column is the primary column. Only one column in the List can be the primary column, and it must be a text column
?"options": { // column options
?"choices": [ // used by select columns to specify options
{
"value": <string>, // the value for the option
"label": <string>, // the label of the option to be displayed in the List
"color": <string> // the color type. More details below
}
],
?"format": <string>, // used by some columns such as the select column to specify some options/formatting. More details below
?"precision": <integer>, // used by numeric columns to specify the number of decimal places
?"date_format": <string>, // used by date columns to specify the format of the date. More details below
?"emoji": <string>, // used by rating and vote columns. This is the emoji to be displayed e.g., ":smile:"
?"emoji_team_id": <string>, // used by rating columns, this is the team ID the emoji belongs to
?"max": <integer>, // used by rating columns to specify the maximum rate value
?"default_value_typed": { // default value for some columns
?"user": [ <string> ], // default user values (encoded user ids) for the people column
?"channel": [ <string> ], // default channel values (encoded channel ids) for the channel column
?"select": [ <string> ] // default select values for the select column. These values should be the same ones used in the choices value
},
?"show_member_name": boolean, // used by people, channel, and canvas columns to specify whether the entity name should be shown. Default is true
?"notify_users": boolean // used by people columns to specify whether the users should be notified when the column is updated
}
}
]

Schema-specific values

When the schema argument is provided, the following are some of the arguments that require specific values:

schema.type

  • text
  • message
  • number
  • select
  • date
  • user
  • attachment
  • checkbox
  • email
  • phone
  • channel
  • rating
  • created_by
  • last_edited_by
  • created_time
  • last_edited_time
  • vote
  • canvas
  • reference
  • link

schema.options.format

  • single_select: format used by select columns to select a single option
  • multi_select: format used by select columns to allow multiple selections
  • single_entity: format used by user and channel columns to allow only one entity in the cell
  • multi_entity: format used by user and channel columns to allow multiple entities in the cell

schema.options.date_format

  • default
  • DD/MM/YYYY
  • MM/DD/YYYY
  • YYYY/MM/DD
  • MMMM DD, YYYY
  • DD MMMM YYYY

schema.options.choices.color

  • indigo
  • _blue
  • cyan
  • pink
  • yellow
  • green
  • gray
  • red
  • purple
  • orange
  • brown

Sample requests data

{
"token": "...",
"name": "Team tasks",
"description_blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "text",
"text": "List description with rich text"
}
]
}
],
"schema": [
{
"type": "text",
"key": "task",
"name": "Task",
"is_primary": true
},
{
"type": "user",
"key": "user",
"name": "Assignee"
},
{
"type": "date",
"key": "due_date",
"name": "Due Date"
}, {
"type": "select",
"key": "status",
"name": "Status",
"options": [
{
"name": "Not Started",
"color": "red"
},
{
"name": "In Progress",
"color": "yellow"
},
{
"name": "Complete",
"color": "green"
}
]
},
]
}

Response