Skip to main content

Text Channel Messaging

This page explains how channel messaging works for integrations: how to discover channels, the difference between posting to a channel and sending a direct message, the markdown subset messages support, the participant permission rule, and the response each call returns. For a quick orientation and copy-paste examples, start with the Channels introduction.

Listing channels

The list channels endpoint returns the channels your token can see, with optional filters:

  • q — case-insensitive search over channel name, description, and participant name/email.
  • typecategory, text, voice, inbox, classroom, meeting, or whatsapp.
  • kindgroup or dm.
  • participantId — channels that include a specific user or team.
  • limit / offset — page through results (limit 1–200, default 100).

Each channel includes its id, name, type, kind, participant user/team ids, and timestamps — enough to discover the channelId you need to post to.

Sending a channel message

POST to the channel's send-message endpoint with the channelId in the path and a message body (markdown, up to 10,000 characters):

curl -X POST "https://api.copera.ai/public/v1/chat/channel/{channelId}/send-message" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "message": "Deploy to production finished ✅" }'

A successful send returns 204 No Content.

Messages support a subset of markdown — headings, bold/italic, ordered and unordered lists, inline and block code, blockquotes, horizontal rules, and links.

note

An integration can only post to channels it is a participant of. Add your integration to the target channel first.

Sending a direct message

POST to the direct-message endpoint with the recipient's userId and a message (up to 10,000 characters). Copera creates or reuses the DM channel for you:

curl -X POST "https://api.copera.ai/public/v1/chat/direct-message/send-message" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "userId": "<member id>", "message": "Your report is ready." }'

The DM is queued and the response (202 Accepted) returns the resolved channelId. To find a recipient's userId, use the Workspace members endpoint with a q search.

Authentication

Channel endpoints accept a full Personal Access Token (cp_pat_) or an integration API key (cp_key_) with the access_channels scope. See Authentication for token types.

Reference