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>, // Key of the column.
"name": <string>, // Name of the column to be displayed in the List.
"type": <string>, // Type of the column.
?"is_primary_column": <boolean>, // 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.
// In addition, you cannot reassign a different column to be the new primary column, even
// if the new column is also a text column. If you want a new text column to be the primary
// one, it is recommended to export the List to CSV, modify the order, and then create a
// new List from the new CSV with the columns reordered.
?"options": { // Column options.
?"choices": [ // Used by select columns to specify options.
{
"value": <string>, // Value for the option.
"label": <string>, // Label of the option to be displayed in the List.
"color": <string> // Color type.
}
],
?"format": <string>, // Used by some columns (such as the select column) to specify
// some options/formatting.
?"precision": <integer>, // Used by numeric columns to specify number of decimal places.
?"date_format": <string>, // Used by date columns to specify the format of the date.
?"emoji": <string>, // The emoji to be displayed e.g., ":smile:". Used by rating and
// vote columns.
?"emoji_team_id": <string>, // The team ID the emoji belongs to. Used by rating columns.
?"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.
// When defining a select column, you can add up to 100 options.
// However, you can only add up to 50 for a single cell.
},
?"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
- 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
Minimal
{
"token": "***",
"name": "My List"
}
With rich text description
{
"token": "***",
"name": "My List",
"description_blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "List of favorite shows"
}
]
}
]
}
]
}
With schema (all supported column types)
{
"token": "***",
"name": "All Column Types",
"schema": [
{
"key": "title",
"name": "Title",
"type": "text",
"is_primary_column": true
},
{
"key": "rich_text_notes",
"name": "Notes",
"type": "rich_text"
},
{
"key": "message_link",
"name": "Message",
"type": "message"
},
{
"key": "ranking",
"name": "Ranking",
"type": "number",
"options": {
"precision": 2
}
},
{
"key": "status",
"name": "Status",
"type": "select",
"options": {
"format": "single_select",
"choices": [
{
"value": "not_started",
"label": "Not Started",
"color": "red"
},
{
"value": "in_progress",
"label": "In Progress",
"color": "yellow"
},
{
"value": "completed",
"label": "Completed",
"color": "green"
}
]
}
},
{
"key": "labels",
"name": "Labels",
"type": "multi_select",
"options": {
"format": "multi_select",
"choices": [
{
"value": "p0",
"label": "P0",
"color": "red"
},
{
"value": "p1",
"label": "P1",
"color": "yellow"
},
{
"value": "p2",
"label": "P2",
"color": "green"
}
]
}
},
{
"key": "date",
"name": "Date",
"type": "date"
},
{
"key": "owner",
"name": "Owner",
"type": "user",
"options": {
"format": "single_entity"
}
},
{
"key": "attachments",
"name": "Attachments",
"type": "attachment"
},
{
"key": "ready",
"name": "Ready?",
"type": "checkbox"
},
{
"key": "email",
"name": "Email",
"type": "email"
},
{
"key": "phone",
"name": "Phone",
"type": "phone"
},
{
"key": "channel",
"name": "Channel",
"type": "channel"
},
{
"key": "rating",
"name": "Rating",
"type": "rating",
"options": {
"emoji": ":star:",
"max": 5
}
},
{
"key": "vote",
"name": "Vote",
"type": "vote"
},
{
"key": "assignee",
"name": "Assignee",
"type": "assignee"
},
{
"key": "due_date",
"name": "Due Date",
"type": "due_date"
},
{
"key": "completed",
"name": "Completed",
"type": "completed"
},
{
"key": "canvas",
"name": "Canvas",
"type": "canvas"
},
{
"key": "link",
"name": "Link",
"type": "link"
}
]
}
Copy from an existing List (no records)
{
"token": "***",
"name": "Copied List Without Records",
"include_copied_list_records": false,
"copy_from_list_id": "F012ABCD3EF"
}
Copy from an existing List (include records)
{
"token": "***",
"name": "Copied List with Records",
"include_copied_list_records": true,
"copy_from_list_id": "F012ABCD3EF"
}
Todo mode
{
"token": "***",
"name": "My Todos",
"todo_mode": true
}
Description and schema
{
"token": "***",
"name": "Favorite Shows",
"description_blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "The Rise and Fall of Sanctuary Moon"
}
]
}
]
}
],
"schema": [
{
"key": "title",
"name": "Title",
"type": "text",
"is_primary_column": true
}
]
}
Schema and todo mode
{
"token": "***",
"name": "Shows",
"todo_mode": true,
"schema": [
{
"key": "title",
"name": "Title",
"type": "text",
"is_primary_column": true
}
]
}