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
}
]
Get all channels accessible to the current user
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
}
]
Show Channel Object
standard, group, or dmcurl -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
}
]