create_direct_channel
Creates or retrieves a direct message channel between two users. Obtain the channel ID to send private messages.
Instructions
Create a direct message channel between two users.
Returns an existing DM channel if one already exists between the users. Use this to get a channel ID for sending private messages. Then use post_message with the returned channel_id to send messages.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id_1 | Yes | 26-character user identifier (e.g., 'o5w8h47pdfbzjc4d8w7dhnhren') | |
| user_id_2 | Yes | 26-character user identifier (e.g., 'o5w8h47pdfbzjc4d8w7dhnhren') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique channel identifier | |
| name | Yes | URL-friendly channel name | |
| type | Yes | Channel type: O=public, P=private, D=direct, G=group | |
| header | Yes | Channel header text | |
| purpose | Yes | Channel purpose description | |
| team_id | Yes | Team this channel belongs to | |
| create_at | Yes | Creation timestamp in milliseconds | |
| delete_at | Yes | Deletion timestamp (0 if not deleted) | |
| update_at | Yes | Last update timestamp in milliseconds | |
| creator_id | Yes | User ID who created the channel | |
| display_name | Yes | Human-readable channel name | |
| last_post_at | Yes | Timestamp of last post | |
| total_msg_count | Yes | Total message count |