Sendbird Channels API

Operations for managing group and open channels.

OpenAPI Specification

sendbird-channels-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Sendbird Platform Channels API
  description: The Sendbird Platform API provides server-side access to manage users, channels, messages, and moderation for in-app chat applications built on Sendbird. Supports group channels, open channels, direct messages, push notifications, and webhooks for real-time communication features.
  version: 3.0.0
  termsOfService: https://sendbird.com/terms-of-service/
  contact:
    name: Sendbird Support
    url: https://sendbird.com/contact-us/
  license:
    name: Proprietary
    url: https://sendbird.com/terms-of-service/
servers:
- url: https://api-{application_id}.sendbird.com/v3
  description: Sendbird Platform API (replace {application_id} with your app ID)
  variables:
    application_id:
      default: YOUR_APP_ID
      description: Your Sendbird application ID
security:
- apiTokenAuth: []
tags:
- name: Channels
  description: Operations for managing group and open channels.
paths:
  /group_channels:
    get:
      operationId: listGroupChannels
      summary: List Group Channels
      description: Retrieves a list of group channels in the Sendbird application.
      tags:
      - Channels
      parameters:
      - name: token
        in: query
        description: Pagination token.
        schema:
          type: string
      - name: limit
        in: query
        description: Maximum number of channels to return.
        schema:
          type: integer
          default: 10
          maximum: 100
      - name: channel_url
        in: query
        description: Filter by specific channel URL.
        schema:
          type: string
      - name: members_include_in
        in: query
        description: Filter channels that include specific user IDs.
        schema:
          type: string
      responses:
        '200':
          description: A list of group channels.
          content:
            application/json:
              schema:
                type: object
                properties:
                  channels:
                    type: array
                    items:
                      $ref: '#/components/schemas/GroupChannel'
                  next:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createGroupChannel
      summary: Create a Group Channel
      description: Creates a new group channel for messaging between users.
      tags:
      - Channels
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user_ids:
                  type: array
                  items:
                    type: string
                  description: List of user IDs to add to the channel.
                name:
                  type: string
                  description: Name of the group channel.
                channel_url:
                  type: string
                  description: Custom URL for the channel.
                cover_url:
                  type: string
                  description: URL for the channel cover image.
                is_distinct:
                  type: boolean
                  description: Whether to create a distinct channel for the user set.
                  default: false
                data:
                  type: string
                  description: Custom data string for the channel.
      responses:
        '200':
          description: Group channel created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupChannel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /group_channels/{channel_url}:
    get:
      operationId: getGroupChannel
      summary: Get a Group Channel
      description: Retrieves details of a specific group channel.
      tags:
      - Channels
      parameters:
      - $ref: '#/components/parameters/channel_url'
      responses:
        '200':
          description: Group channel details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupChannel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteGroupChannel
      summary: Delete a Group Channel
      description: Deletes a specific group channel.
      tags:
      - Channels
      parameters:
      - $ref: '#/components/parameters/channel_url'
      responses:
        '200':
          description: Group channel deleted successfully.
          content:
            application/json:
              schema:
                type: object
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    User:
      type: object
      properties:
        user_id:
          type: string
          description: Unique identifier of the user.
        nickname:
          type: string
          description: Display nickname.
        profile_url:
          type: string
          description: Profile image URL.
        is_online:
          type: boolean
          description: Whether the user is currently online.
        is_active:
          type: boolean
          description: Whether the user account is active.
        last_seen_at:
          type: integer
          description: Unix timestamp of last activity.
        access_token:
          type: string
          description: Access token for the user (returned when issue_access_token is true).
        metadata:
          type: object
          description: Custom metadata.
          additionalProperties:
            type: string
        created_at:
          type: integer
          description: Unix timestamp when the user was created.
    GroupChannel:
      type: object
      properties:
        channel_url:
          type: string
          description: Unique URL of the channel.
        name:
          type: string
          description: Name of the channel.
        cover_url:
          type: string
          description: Cover image URL.
        member_count:
          type: integer
          description: Number of members in the channel.
        joined_member_count:
          type: integer
          description: Number of joined members.
        unread_message_count:
          type: integer
          description: Number of unread messages.
        last_message:
          $ref: '#/components/schemas/Message'
        is_distinct:
          type: boolean
          description: Whether this is a distinct channel.
        created_at:
          type: integer
          description: Unix timestamp when the channel was created.
        data:
          type: string
          description: Custom data string.
    Error:
      type: object
      properties:
        error:
          type: boolean
          description: Indicates an error occurred.
        code:
          type: integer
          description: Sendbird error code.
        message:
          type: string
          description: Human-readable error message.
    Message:
      type: object
      properties:
        message_id:
          type: integer
          description: Unique ID of the message.
        type:
          type: string
          description: Message type.
          enum:
          - MESG
          - FILE
          - ADMM
        message:
          type: string
          description: Text content of the message.
        user:
          $ref: '#/components/schemas/User'
        channel_url:
          type: string
          description: URL of the channel containing this message.
        created_at:
          type: integer
          description: Unix timestamp when the message was created.
        updated_at:
          type: integer
          description: Unix timestamp when the message was last updated.
        custom_type:
          type: string
          description: Custom type for message categorization.
        data:
          type: string
          description: Custom data string.
        mention_type:
          type: string
          description: Mention type.
        mentioned_users:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: Mentioned users.
  parameters:
    channel_url:
      name: channel_url
      in: path
      required: true
      description: URL of the channel.
      schema:
        type: string
  responses:
    NotFound:
      description: Not found. The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized. API token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiTokenAuth:
      type: apiKey
      in: header
      name: Api-Token
      description: Sendbird API token obtained from the Sendbird Dashboard.