Mandraki Mandraki
Get started

Channels

List channels, send messages, and read message history through the Mandraki Bot API.

Overview

The Channels endpoints let you list channels in your organization, send messages to channels as a bot, and read message history. Messages sent via the Bot API appear in the channel as coming from the service account’s bot identity.

Base path: /orgs/{orgId}/bot/channels

List Channels

Retrieve active (non-archived) channels, optionally filtered by team.

GET /orgs/{orgId}/bot/channels

Required scope: channels:read

Query Parameters

ParameterTypeDefaultDescription
teamIdUUID—Filter channels by team
limitinteger50Maximum number of channels to return

Results are sorted alphabetically by channel name.

Example Request

curl -X GET "https://app.mandraki.cloud/api/v1/orgs/{orgId}/bot/channels?teamId={teamId}&limit=20" \
  -H "Authorization: Bearer mak_..."

Example Response

{
  "channels": [
    {
      "id": "channel-uuid-1",
      "name": "general",
      "slug": "general",
      "isPrivate": false,
      "teamId": "team-uuid",
      "createdAt": "2026-01-10T09:00:00.000Z",
      "_count": {
        "members": 24
      }
    },
    {
      "id": "channel-uuid-2",
      "name": "engineering",
      "slug": "engineering",
      "isPrivate": false,
      "teamId": "team-uuid",
      "createdAt": "2026-01-10T09:05:00.000Z",
      "_count": {
        "members": 12
      }
    }
  ]
}

Send Message

Post a message to a channel. The message appears as sent by the service account’s bot identity.

POST /orgs/{orgId}/bot/channels/{channelId}/messages

Required scope: messages:write

Request Body

FieldTypeRequiredDescription
contentstringYesMessage text content

Example Request

curl -X POST "https://app.mandraki.cloud/api/v1/orgs/{orgId}/bot/channels/{channelId}/messages" \
  -H "Authorization: Bearer mak_..." \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Build #142 deployed successfully to production."
  }'

Example Response

Returns 201 Created with the created message:

{
  "id": "message-uuid",
  "channelId": "channel-uuid",
  "senderId": "service-account-uuid",
  "content": "Build #142 deployed successfully to production.",
  "createdAt": "2026-03-27T12:00:00.000Z"
}

Error: Missing Content

{
  "error": "content is required"
}

Read Message History

Retrieve messages from a channel with cursor-based pagination.

GET /orgs/{orgId}/bot/channels/{channelId}/messages

Required scope: channels:history or channels:read

Either scope is sufficient. E2EE-encrypted messages will have their content field set to null.

Query Parameters

ParameterTypeDefaultDescription
limitinteger50Number of messages to return
beforestring—Cursor for pagination (message ID or timestamp)

Example Request

curl -X GET "https://app.mandraki.cloud/api/v1/orgs/{orgId}/bot/channels/{channelId}/messages?limit=20" \
  -H "Authorization: Bearer mak_..."

Example Response

{
  "messages": [
    {
      "id": "message-uuid-1",
      "channelId": "channel-uuid",
      "senderId": "user-uuid",
      "senderName": "Alice",
      "content": "Has anyone reviewed the PR?",
      "createdAt": "2026-03-27T11:45:00.000Z",
      "updatedAt": null
    },
    {
      "id": "message-uuid-2",
      "channelId": "channel-uuid",
      "senderId": "user-uuid-2",
      "senderName": "Bob",
      "content": "I'll take a look now.",
      "createdAt": "2026-03-27T11:47:00.000Z",
      "updatedAt": null
    }
  ]
}

Pagination

To fetch older messages, pass the ID of the last message as the before parameter:

curl -X GET "https://app.mandraki.cloud/api/v1/orgs/{orgId}/bot/channels/{channelId}/messages?before=message-uuid-2&limit=50" \
  -H "Authorization: Bearer mak_..."