Skip to main content
GET
/
api
/
channels
curl -X GET "https://your-domain.com/api/channels" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
[
  {
    "id": "ch_abc123",
    "user_id": "user_123",
    "type": "standard",
    "name": "general",
    "description": "General discussion",
    "is_private": false,
    "data": {},
    "meta": {},
    "access_grants": [
      {
        "principal_type": "user",
        "principal_id": "*",
        "permission": "read"
      }
    ],
    "last_message_at": 1709567890123456789,
    "unread_count": 3,
    "created_at": 1709500000000000000,
    "updated_at": 1709567890123456789,
    "updated_by": "user_456"
  },
  {
    "id": "ch_dm789",
    "user_id": "user_123",
    "type": "dm",
    "name": "",
    "description": null,
    "is_private": null,
    "data": {},
    "meta": {},
    "access_grants": [],
    "user_ids": ["user_123", "user_456"],
    "users": [
      {
        "id": "user_123",
        "name": "Alice",
        "is_active": true
      },
      {
        "id": "user_456",
        "name": "Bob",
        "is_active": true
      }
    ],
    "last_message_at": 1709567890123456789,
    "unread_count": 0,
    "created_at": 1709500000000000000,
    "updated_at": 1709567890123456789
  }
]
Retrieves a list of all channels that the authenticated user has access to, including DM channels, group channels, and standard channels.

Authentication

Requires a valid user session. Channels must be enabled in the system configuration.

Response

Returns an array of channel objects with metadata.
channels
array
Array of channel objects
curl -X GET "https://your-domain.com/api/channels" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
[
  {
    "id": "ch_abc123",
    "user_id": "user_123",
    "type": "standard",
    "name": "general",
    "description": "General discussion",
    "is_private": false,
    "data": {},
    "meta": {},
    "access_grants": [
      {
        "principal_type": "user",
        "principal_id": "*",
        "permission": "read"
      }
    ],
    "last_message_at": 1709567890123456789,
    "unread_count": 3,
    "created_at": 1709500000000000000,
    "updated_at": 1709567890123456789,
    "updated_by": "user_456"
  },
  {
    "id": "ch_dm789",
    "user_id": "user_123",
    "type": "dm",
    "name": "",
    "description": null,
    "is_private": null,
    "data": {},
    "meta": {},
    "access_grants": [],
    "user_ids": ["user_123", "user_456"],
    "users": [
      {
        "id": "user_123",
        "name": "Alice",
        "is_active": true
      },
      {
        "id": "user_456",
        "name": "Bob",
        "is_active": true
      }
    ],
    "last_message_at": 1709567890123456789,
    "unread_count": 0,
    "created_at": 1709500000000000000,
    "updated_at": 1709567890123456789
  }
]

Build docs developers (and LLMs) love