Microsoft Teams Messages API

Operations for sending and receiving chat messages.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

microsoft-teams-messages-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Microsoft Graph Teams Apps Messages API
  description: Core REST API for accessing Microsoft Teams data including teams, channels, messages, tabs, apps, calls, and online meetings through Microsoft Graph.
  version: 1.0.0
  contact:
    name: Microsoft Graph Support
    url: https://developer.microsoft.com/graph/support
  license:
    name: Microsoft API Terms of Use
    url: https://learn.microsoft.com/en-us/legal/microsoft-apis/terms-of-use
  x-generated-from: documentation
  x-last-validated: '2026-04-18'
servers:
- url: https://graph.microsoft.com/v1.0
  description: Microsoft Graph v1.0 production endpoint
security:
- oauth2:
  - Team.ReadBasic.All
  - Channel.ReadBasic.All
  - ChatMessage.Read
tags:
- name: Messages
  description: Operations for sending and receiving chat messages.
paths:
  /teams/{team-id}/channels/{channel-id}/messages:
    get:
      operationId: listChannelMessages
      summary: Microsoft Teams List Channel Messages
      description: Retrieve messages from a channel.
      tags:
      - Messages
      parameters:
      - name: team-id
        in: path
        required: true
        description: The unique identifier of the team.
        schema:
          type: string
      - name: channel-id
        in: path
        required: true
        description: The unique identifier of the channel.
        schema:
          type: string
      - name: $top
        in: query
        required: false
        description: Maximum number of messages to return.
        schema:
          type: integer
          default: 20
      responses:
        '200':
          description: Messages returned successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessageCollection'
              examples:
                ListChannelMessages200Example:
                  summary: Default listChannelMessages 200 response
                  x-microcks-default: true
                  value:
                    value:
                    - id: msg-001
                      createdDateTime: '2026-04-18T10:30:00Z'
                      messageType: message
                      importance: normal
                      subject: Project Update
                      body:
                        contentType: html
                        content: <p>Here is the latest update.</p>
                      from:
                        user:
                          id: user-123
                          displayName: Jane Smith
        '401':
          description: Unauthorized.
        '404':
          description: Channel not found.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: sendChannelMessage
      summary: Microsoft Teams Send Channel Message
      description: Send a message to a channel.
      tags:
      - Messages
      parameters:
      - name: team-id
        in: path
        required: true
        description: The unique identifier of the team.
        schema:
          type: string
      - name: channel-id
        in: path
        required: true
        description: The unique identifier of the channel.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMessage'
            examples:
              SendChannelMessageRequestExample:
                summary: Default sendChannelMessage request
                x-microcks-default: true
                value:
                  body:
                    contentType: html
                    content: <p>Hello team! Here is an update.</p>
      responses:
        '201':
          description: Message sent successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessage'
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    ChatMessage:
      type: object
      description: Represents a message in a channel or chat.
      properties:
        id:
          type: string
          description: Unique identifier for the message.
          example: msg-001
        createdDateTime:
          type: string
          format: date-time
          description: When the message was created.
          example: '2026-04-18T10:30:00Z'
        lastModifiedDateTime:
          type: string
          format: date-time
          description: When the message was last modified.
          example: '2026-04-18T10:30:00Z'
        messageType:
          type: string
          description: The type of message.
          enum:
          - message
          - chatEvent
          - typing
          - unknownFutureValue
          - systemEventMessage
          example: message
        importance:
          type: string
          enum:
          - normal
          - high
          - urgent
          description: Message importance.
          example: normal
        subject:
          type: string
          description: Subject of the message.
          example: Project Update
        body:
          type: object
          properties:
            contentType:
              type: string
              enum:
              - text
              - html
              example: html
            content:
              type: string
              example: <p>Here is the latest update on the project.</p>
        from:
          type: object
          properties:
            user:
              type: object
              properties:
                id:
                  type: string
                  example: user-123
                displayName:
                  type: string
                  example: Jane Smith
    ChatMessageCollection:
      type: object
      description: Collection of chat messages.
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth 2.0 authorization using Microsoft Identity Platform
      flows:
        authorizationCode:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
          tokenUrl: https://login.microsoftonline.com/common/oauth2/v2.0/token
          scopes:
            Team.ReadBasic.All: Read teams basic info
            Team.Create: Create teams
            Channel.ReadBasic.All: Read channel basic info
            Channel.Create: Create channels
            ChannelMessage.Read.All: Read channel messages
            ChatMessage.Read: Read chat messages
            ChatMessage.Send: Send chat messages
            Calls.Initiate.All: Initiate calls
            Calls.JoinGroupCall.All: Join group calls
            OnlineMeetings.ReadWrite.All: Create and manage online meetings