curl -X GET "https://your-domain.com/api/channels" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
import requests
response = requests.get(
"https://your-domain.com/api/channels",
headers={"Authorization": "Bearer YOUR_TOKEN"}
)
channels = response.json()
print(f"Found {len(channels)} channels")
[
{
"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
}
]
{
"detail": "Channels are not enabled"
}
Channels
List Channels
Get all channels accessible to the current user
GET
/
api
/
channels
curl -X GET "https://your-domain.com/api/channels" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
import requests
response = requests.get(
"https://your-domain.com/api/channels",
headers={"Authorization": "Bearer YOUR_TOKEN"}
)
channels = response.json()
print(f"Found {len(channels)} channels")
[
{
"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
}
]
{
"detail": "Channels are not enabled"
}
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.array
Array of channel objects
Show Channel Object
Show Channel Object
string
required
Unique channel identifier
string
required
ID of the user who created the channel
string
Channel type:
standard, group, or dmstring
required
Channel name (empty for DM channels)
string
Channel description
boolean
Whether the channel is private (for group channels)
object
Additional channel data
object
Channel metadata
array
Access control grants for the channel
array
Array of user IDs (for DM channels only)
array
Array of user objects with status (for DM channels only)
integer
Timestamp of the last message (epoch time in nanoseconds)
integer
Number of unread messages for the current user
integer
required
Timestamp when the channel was created (epoch time in nanoseconds)
integer
required
Timestamp when the channel was last updated (epoch time in nanoseconds)
string
ID of the user who last updated the channel
curl -X GET "https://your-domain.com/api/channels" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json"
import requests
response = requests.get(
"https://your-domain.com/api/channels",
headers={"Authorization": "Bearer YOUR_TOKEN"}
)
channels = response.json()
print(f"Found {len(channels)} channels")
[
{
"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
}
]
{
"detail": "Channels are not enabled"
}