Azure Communication Services Advanced Messaging API

Advanced Messages API: send WhatsApp notification messages, list templates and download media. 3 operations, data-plane version 2024-08-30, served from the customer's Communication Services resource endpoint.

GitHub OpenAPI

Operations 5

POST /chat/threads/{chatThreadId}/messages Sends a message to a thread #
GET /chat/threads/{chatThreadId}/messages Gets a list of messages from a thread #
GET /chat/threads/{chatThreadId}/messages/{chatMessageId} Gets a message by id #
PATCH /chat/threads/{chatThreadId}/messages/{chatMessageId} Updates a message #
DELETE /chat/threads/{chatThreadId}/messages/{chatMessageId} Deletes a message #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-communication-services:microsoft-azure-communication-services-messages-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-communication-services-messages-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Azure Communication Chat Service Messages API
  description: Azure Communication Chat Service
  version: '2025-03-15'
security:
- Authorization: []
tags:
- name: Messages
paths:
  /chat/threads/{chatThreadId}/messages:
    post:
      tags:
      - Messages
      summary: Sends a message to a thread
      operationId: ChatThread_SendChatMessage
      parameters:
      - in: path
        name: chatThreadId
        description: The thread id to send the message to.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '201':
          description: Message sent, the `Location` header contains the URL for the newly sent message.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendChatMessageResult'
        '401':
          description: Unauthorized.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '403':
          description: Forbidden.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '429':
          description: Too many requests.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '503':
          description: Service unavailable.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendChatMessageRequest'
        description: Details of the message to send.
        required: true
    get:
      tags:
      - Messages
      summary: Gets a list of messages from a thread
      operationId: ChatThread_ListChatMessages
      parameters:
      - in: path
        name: chatThreadId
        description: The thread id of the message.
        required: true
        schema:
          type: string
      - in: query
        name: maxPageSize
        description: The maximum number of messages to be returned per page.
        schema:
          type: integer
          format: int32
      - in: query
        name: startTime
        description: 'The earliest point in time to get messages after. The timestamp should be in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.'
        schema:
          type: string
          format: date-time
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessagesCollection'
        '401':
          description: Unauthorized.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '403':
          description: Forbidden.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '429':
          description: Too many requests.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '503':
          description: Service unavailable.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
      x-ms-pageable:
        nextLinkName: nextLink
        itemName: value
  /chat/threads/{chatThreadId}/messages/{chatMessageId}:
    get:
      tags:
      - Messages
      summary: Gets a message by id
      operationId: ChatThread_GetChatMessage
      parameters:
      - in: path
        name: chatThreadId
        description: The thread id to which the message was sent.
        required: true
        schema:
          type: string
      - in: path
        name: chatMessageId
        description: The message id.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Request successful. The action returns a `Message` resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessage'
        '401':
          description: Unauthorized.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '403':
          description: Forbidden.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '429':
          description: Too many requests.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '503':
          description: Service unavailable.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
    patch:
      tags:
      - Messages
      summary: Updates a message
      operationId: ChatThread_UpdateChatMessage
      parameters:
      - in: path
        name: chatThreadId
        description: The thread id to which the message was sent.
        required: true
        schema:
          type: string
      - in: path
        name: chatMessageId
        description: The message id.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '204':
          description: Message is successfully updated.
        '401':
          description: Unauthorized.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '403':
          description: Forbidden.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '429':
          description: Too many requests.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '503':
          description: Service unavailable.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/UpdateChatMessageRequest'
        description: Details of the request to update the message.
        required: true
    delete:
      tags:
      - Messages
      summary: Deletes a message
      operationId: ChatThread_DeleteChatMessage
      parameters:
      - in: path
        name: chatThreadId
        description: The thread id to which the message was sent.
        required: true
        schema:
          type: string
      - in: path
        name: chatMessageId
        description: The message id.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '204':
          description: Request successful.
        '401':
          description: Unauthorized.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '403':
          description: Forbidden.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '429':
          description: Too many requests.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
        '503':
          description: Service unavailable.
          x-ms-error-response: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
components:
  schemas:
    CommonMicrosoftTeamsAppIdentifierModel:
      description: A Microsoft Teams application.
      type: object
      required:
      - appId
      properties:
        appId:
          type: string
          description: The Id of the Microsoft Teams application.
        cloud:
          $ref: '#/components/schemas/CommunicationCloudEnvironmentModel'
          description: The cloud that the Microsoft Teams application belongs to. By default 'public' if missing.
    CommonCommunicationIdentifierModel:
      description: 'Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model is polymorphic: Apart from kind and rawId, at most one further property may be set which must match the kind enum value.'
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/CommunicationIdentifierModelKind'
          description: The identifier kind. Only required in responses.
        rawId:
          type: string
          description: Raw Id of the identifier. Optional in requests, required in responses.
        communicationUser:
          $ref: '#/components/schemas/CommunicationUserIdentifierModel'
          description: The communication user.
        phoneNumber:
          $ref: '#/components/schemas/PhoneNumberIdentifierModel'
          description: The phone number.
        microsoftTeamsUser:
          $ref: '#/components/schemas/MicrosoftTeamsUserIdentifierModel'
          description: The Microsoft Teams user.
        microsoftTeamsApp:
          $ref: '#/components/schemas/MicrosoftTeamsAppIdentifierModel'
          description: The Microsoft Teams application.
        teamsExtensionUser:
          $ref: '#/components/schemas/TeamsExtensionUserIdentifierModel'
          description: The Microsoft Teams Extension user.
    ChatMessage:
      description: Chat message.
      required:
      - createdOn
      - id
      - sequenceId
      - type
      - version
      type: object
      properties:
        id:
          description: The id of the chat message. This id is server generated.
          type: string
          example: '123456789'
        type:
          $ref: '#/components/schemas/ChatMessageType'
        sequenceId:
          description: Sequence of the chat message in the conversation.
          type: string
        version:
          description: Version of the chat message.
          type: string
        content:
          $ref: '#/components/schemas/ChatMessageContent'
        senderDisplayName:
          description: The display name of the chat message sender. This property is used to populate sender name for push notifications.
          type: string
          example: Jane
        createdOn:
          format: date-time
          description: 'The timestamp when the chat message arrived at the server. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.'
          type: string
          example: '2020-10-30T10:50:50Z'
        senderCommunicationIdentifier:
          $ref: '#/components/schemas/CommunicationIdentifierModel'
        deletedOn:
          format: date-time
          description: 'The timestamp (if applicable) when the message was deleted. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.'
          type: string
          example: '2020-10-30T10:50:50Z'
        editedOn:
          format: date-time
          description: 'The last timestamp (if applicable) when the message was edited. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.'
          type: string
          example: '2020-10-30T10:50:50Z'
        metadata:
          description: Message metadata.
          type: object
          additionalProperties:
            type: string
    CommonCommunicationErrorResponse:
      description: The Communication Services error.
      type: object
      required:
      - error
      properties:
        error:
          description: The Communication Services error.
          $ref: '#/components/schemas/CommunicationError'
    ChatMessageType:
      description: The chat message type.
      enum:
      - text
      - html
      - topicUpdated
      - participantAdded
      - participantRemoved
      type: string
      x-ms-enum:
        name: ChatMessageType
        modelAsString: true
      example: html
    CommunicationError:
      $ref: '#/components/schemas/CommonCommunicationError'
    CommonCommunicationError:
      description: The Communication Services error.
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          description: The error code.
        message:
          type: string
          description: The error message.
        target:
          type: string
          readOnly: true
          description: The error target.
        details:
          type: array
          items:
            $ref: '#/components/schemas/CommunicationError'
          readOnly: true
          description: Further details about specific errors that led to this error.
        innererror:
          x-ms-client-name: innerError
          readOnly: true
          $ref: '#/components/schemas/CommunicationError'
          description: The inner error if any.
    CommonCommunicationUserIdentifierModel:
      description: A user that got created with an Azure Communication Services resource.
      type: object
      required:
      - id
      properties:
        id:
          type: string
          description: The Id of the communication user.
    CommunicationCloudEnvironmentModel:
      description: The cloud that the identifier belongs to.
      type: string
      enum:
      - public
      - dod
      - gcch
      x-ms-enum:
        name: CommunicationCloudEnvironmentModel
        modelAsString: true
    UpdateChatMessageRequest:
      description: Request payload for updating a chat message.
      type: object
      properties:
        content:
          description: Chat message content.
          type: string
          example: Let's go for lunch together.
        metadata:
          description: Message metadata.
          type: object
          additionalProperties:
            type: string
    ChatAttachment:
      description: An attachment in a chat message.
      required:
      - id
      - attachmentType
      type: object
      properties:
        id:
          description: Id of the attachment
          type: string
          example: A27C7079-626F-4D23-8BEE-582F2C376B5A
        attachmentType:
          $ref: '#/components/schemas/ChatAttachmentType'
        name:
          description: The name of the attachment content.
          type: string
          example: SomeImage.png
        url:
          description: The URL where the attachment can be downloaded
          type: string
          format: uri
          example: https://{geoChatGW}/threads/{chatThreadId}/images/{imageId}/views/original
        previewUrl:
          description: The URL where the preview of attachment can be downloaded
          type: string
          format: uri
          example: https://{geoChatGW}/threads/{chatThreadId}/images/{imageId}/views/small
    ChatParticipant:
      description: A participant of the chat thread.
      required:
      - communicationIdentifier
      type: object
      properties:
        communicationIdentifier:
          $ref: '#/components/schemas/CommunicationIdentifierModel'
        displayName:
          description: Display name for the chat participant.
          type: string
          example: Bob
        shareHistoryTime:
          format: date-time
          description: 'Time from which the chat history is shared with the participant. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.'
          type: string
          example: '2020-10-30T10:50:50Z'
        metadata:
          description: Contextual metadata for the chat participant. The metadata consists of name/value pairs. The total size of all metadata pairs can be up to 1KB in size.
          type: object
          additionalProperties:
            type: string
    CommunicationIdentifierModel:
      $ref: '#/components/schemas/CommonCommunicationIdentifierModel'
    CommunicationErrorResponse:
      $ref: '#/components/schemas/CommonCommunicationErrorResponse'
    ChatMessagesCollection:
      description: Collection of chat messages for a particular chat thread.
      required:
      - value
      type: object
      properties:
        value:
          description: Collection of chat messages.
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
        nextLink:
          description: If there are more chat messages that can be retrieved, the next link will be populated.
          type: string
          readOnly: true
    MicrosoftTeamsUserIdentifierModel:
      $ref: '#/components/schemas/CommonMicrosoftTeamsUserIdentifierModel'
    ChatMessageContent:
      description: Content of a chat message.
      type: object
      properties:
        message:
          description: Chat message content for messages of types text or html.
          type: string
          example: <p>Come one guys, lets go for lunch together.</p><img id="f508ce15-e878-431f-b871-f530cac5331d">
        topic:
          description: Chat message content for messages of type topicUpdated.
          type: string
          example: Lunch Chat thread
        participants:
          description: Chat message content for messages of types participantAdded or participantRemoved.
          type: array
          items:
            $ref: '#/components/schemas/ChatParticipant'
        attachments:
          description: List of attachments for this message
          type: array
          items:
            $ref: '#/components/schemas/ChatAttachment'
        initiatorCommunicationIdentifier:
          $ref: '#/components/schemas/CommunicationIdentifierModel'
    MicrosoftTeamsAppIdentifierModel:
      $ref: '#/components/schemas/CommonMicrosoftTeamsAppIdentifierModel'
    CommonMicrosoftTeamsUserIdentifierModel:
      description: A Microsoft Teams user.
      type: object
      required:
      - userId
      properties:
        userId:
          type: string
          description: The Id of the Microsoft Teams user. If not anonymous, this is the Entra ID object Id of the user.
        isAnonymous:
          type: boolean
          description: True if the Microsoft Teams user is anonymous. By default false if missing.
        cloud:
          $ref: '#/components/schemas/CommunicationCloudEnvironmentModel'
          description: The cloud that the Microsoft Teams user belongs to. By default 'public' if missing.
    ChatAttachmentType:
      description: The type of attachment.
      enum:
      - image
      - file
      type: string
      x-ms-enum:
        name: ChatAttachmentType
        modelAsString: true
    SendChatMessageResult:
      description: Result of the send message operation.
      required:
      - id
      type: object
      properties:
        id:
          description: A server-generated message id.
          type: string
          example: '123456789'
    SendChatMessageRequest:
      description: Details of the message to send.
      required:
      - content
      type: object
      properties:
        content:
          description: Chat message content.
          type: string
          example: Come one guys, lets go for lunch together.
        senderDisplayName:
          description: The display name of the chat message sender. This property is used to populate sender name for push notifications.
          type: string
          example: Bob Admin
        type:
          $ref: '#/components/schemas/ChatMessageType'
        metadata:
          description: Message metadata.
          type: object
          additionalProperties:
            type: string
    CommunicationUserIdentifierModel:
      $ref: '#/components/schemas/CommonCommunicationUserIdentifierModel'
  parameters:
    ApiVersionParameter:
      in: query
      name: api-version
      description: Version of API to invoke.
      required: true
      x-ms-parameter-location: method
      schema:
        type: string
  securitySchemes:
    Authorization:
      type: apiKey
      name: Authorization
      in: header
      description: An ACS (Azure Communication Services) user access token.
x-ms-parameterized-host:
  hostTemplate: '{endpoint}'
  useSchemePrefix: false
  parameters:
  - $ref: '#/components/parameters/Endpoint'