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.

Operations 3

GET /messages/channels/{channelId}/templates #
POST /messages/notifications:send #
GET /messages/streams/{id} #

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. 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.0.3
info:
  title: CommunicationMessagesClient
  version: '2024-08-30'
  description: Azure Communication Messages Service
  x-typespec-generated:
  - emitter: '@azure-tools/typespec-autorest'
servers:
- url: '{endpoint}'
  variables:
    endpoint:
      default: https://{resource}.communication.azure.com
      description: The communication resource, for example https://my-resource.communication.azure.com
tags:
- name: Template
- name: Notifications
- name: Stream
paths:
  /messages/channels/{channelId}/templates:
    get:
      operationId: TemplateOperations_ListTemplates
      tags:
      - Template
      description: List all templates for given Azure Communication Services channel
      x-ms-examples:
        Gets a list of templates:
          $ref: ./examples/Template_ListTemplates.json
      x-ms-pageable:
        nextLinkName: nextLink
      parameters:
      - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
      - name: channelId
        in: path
        description: The registration ID of the channel.
        required: true
        schema:
          type: string
          format: uuid
      - name: maxpagesize
        in: query
        description: Number of objects to return per page.
        required: false
        schema:
          type: integer
          format: int32
      - $ref: '#/components/parameters/Azure.Core.ClientRequestIdHeader'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedMessageTemplateItem'
          headers:
            x-ms-client-request-id:
              description: An opaque, globally-unique, client-generated string identifier for the request.
              schema:
                type: string
                format: uuid
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
  /messages/notifications:send:
    post:
      operationId: NotificationMessagesOperations_Send
      tags:
      - Notifications
      description: Sends a notification message from Business to User.
      x-ms-examples:
        Sends a notification message - Template:
          $ref: ./examples/NotificationMessages_SendTemplate.json
        Sends a notification message - audio:
          $ref: ./examples/NotificationMessages_SendAudio.json
        Sends a notification message - document:
          $ref: ./examples/NotificationMessages_SendDocument.json
        Sends a notification message - image:
          $ref: ./examples/NotificationMessages_SendImage.json
        Sends a notification message - text:
          $ref: ./examples/NotificationMessages_SendText.json
        Sends a notification message - video:
          $ref: ./examples/NotificationMessages_SendVideo.json
      parameters:
      - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
      - $ref: '#/components/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId'
      - $ref: '#/components/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent'
      - $ref: '#/components/parameters/Azure.Core.ClientRequestIdHeader'
      - $ref: '#/components/parameters/NotificationMessagesSendRequestBody'
      responses:
        '202':
          description: The request has been accepted for processing, but processing has not yet completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendMessageResult'
          headers:
            Repeatability-Result:
              description: Indicates whether the repeatable request was accepted or rejected.
              schema:
                type: string
                enum:
                - accepted
                - rejected
            x-ms-client-request-id:
              description: An opaque, globally-unique, client-generated string identifier for the request.
              schema:
                type: string
                format: uuid
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
  /messages/streams/{id}:
    get:
      operationId: StreamOperations_GetMedia
      tags:
      - Stream
      description: Download the Media payload from a User to Business message.
      x-ms-examples:
        Download media:
          $ref: ./examples/Stream_GetMedia.json
      parameters:
      - $ref: '#/components/parameters/Azure.Core.Foundations.ApiVersionParameter'
      - name: id
        in: path
        description: The stream ID.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/Azure.Core.ClientRequestIdHeader'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/octet-stream:
              schema: &id001
                type: file
            application/json:
              schema: *id001
          headers:
            x-ms-client-request-id:
              description: An opaque, globally-unique, client-generated string identifier for the request.
              schema:
                type: string
                format: uuid
        default:
          description: An unexpected error response.
          content:
            application/octet-stream:
              schema: &id002
                $ref: '#/components/schemas/Azure.Core.Foundations.ErrorResponse'
            application/json:
              schema: *id002
          headers:
            x-ms-error-code:
              description: String error code indicating what went wrong.
              schema:
                type: string
components:
  schemas:
    AudioNotificationContent:
      type: object
      description: A request to send an audio notification.
      properties:
        mediaUri:
          type: string
          format: uri
          description: A media url for the file. Required if the type is one of the supported media types, e.g. image
      required:
      - mediaUri
      allOf:
      - $ref: '#/components/schemas/NotificationContent'
      x-ms-discriminator-value: audio
    Azure.Core.Foundations.Error:
      type: object
      description: The error object.
      properties:
        code:
          type: string
          description: One of a server-defined set of error codes.
        message:
          type: string
          description: A human-readable representation of the error.
        target:
          type: string
          description: The target of the error.
        details:
          type: array
          description: An array of details about specific errors that led to this reported error.
          items:
            $ref: '#/components/schemas/Azure.Core.Foundations.Error'
        innererror:
          $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
          description: An object containing more specific information than the current object about the error.
      required:
      - code
      - message
    Azure.Core.Foundations.ErrorResponse:
      type: object
      description: A response containing error details.
      properties:
        error:
          $ref: '#/components/schemas/Azure.Core.Foundations.Error'
          description: The error object.
      required:
      - error
    Azure.Core.Foundations.InnerError:
      type: object
      description: An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.
      properties:
        code:
          type: string
          description: One of a server-defined set of error codes.
        innererror:
          $ref: '#/components/schemas/Azure.Core.Foundations.InnerError'
          description: Inner error.
    Azure.Core.uuid:
      type: string
      format: uuid
      description: Universally Unique Identifier
    CommunicationMessageKind:
      type: string
      description: The type of message.
      enum:
      - text
      - image
      - image_v0
      - document
      - video
      - audio
      - template
      x-ms-enum:
        name: CommunicationMessageKind
        modelAsString: true
        values:
        - name: text
          value: text
          description: Text message type.
        - name: image
          value: image
          description: Image message type.
        - name: image_v0
          value: image_v0
          description: Image message type. Legacy image type for `MediaNotificationContent` which is being deprecated
        - name: document
          value: document
          description: Document message type.
        - name: video
          value: video
          description: Video message type.
        - name: audio
          value: audio
          description: Audio message type.
        - name: template
          value: template
          description: Template message type.
    CommunicationMessagesChannel:
      type: string
      description: The type of the communication messages channel.
      enum:
      - whatsApp
      x-ms-enum:
        name: CommunicationMessagesChannel
        modelAsString: true
        values:
        - name: whatsApp
          value: whatsApp
          description: The WhatsApp communication messages channel type.
    DocumentNotificationContent:
      type: object
      description: A request to send a document notification.
      properties:
        caption:
          type: string
          description: Optional text content.
        fileName:
          type: string
          description: Optional name for the file.
        mediaUri:
          type: string
          format: uri
          description: A media url for the file. Required if the type is one of the supported media types, e.g. image
      required:
      - mediaUri
      allOf:
      - $ref: '#/components/schemas/NotificationContent'
      x-ms-discriminator-value: document
    ImageNotificationContent:
      type: object
      description: A request to send an image notification.
      properties:
        caption:
          type: string
          description: Optional text content.
        mediaUri:
          type: string
          format: uri
          description: A media url for the file. Required if the type is one of the supported media types, e.g. image
      required:
      - mediaUri
      allOf:
      - $ref: '#/components/schemas/NotificationContent'
      x-ms-discriminator-value: image
    MediaNotificationContent:
      type: object
      description: '@deprecated A request to send an image notification.'
      properties:
        content:
          type: string
          description: Optional text content.
        mediaUri:
          type: string
          format: uri
          description: A media url for the file. Required if the type is one of the supported media types, e.g. image
      required:
      - mediaUri
      allOf:
      - $ref: '#/components/schemas/NotificationContent'
      x-ms-discriminator-value: image_v0
    MessageReceipt:
      type: object
      description: Receipt of the sending one message.
      properties:
        messageId:
          type: string
          description: The message id.
        to:
          type: string
          description: The native external platform user identifier of the recipient.
      required:
      - messageId
      - to
    MessageTemplate:
      type: object
      description: The template object used to create templates.
      properties:
        name:
          type: string
          description: Name of the template.
        language:
          type: string
          description: The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter
            country code, e.g., 'en' or 'en_US'.
        values:
          type: array
          description: The template values.
          items:
            $ref: '#/components/schemas/MessageTemplateValue'
        bindings:
          $ref: '#/components/schemas/MessageTemplateBindings'
          description: The binding object to link values to the template specific locations
      required:
      - name
      - language
    MessageTemplateBindings:
      type: object
      description: The binding object to link values to the template specific locations
      properties:
        kind:
          $ref: '#/components/schemas/MessageTemplateBindingsKind'
          description: The type discriminator describing a template bindings type.
      discriminator: kind
      required:
      - kind
    MessageTemplateBindingsKind:
      type: string
      description: The type of the message template.
      enum:
      - whatsApp
      x-ms-enum:
        name: MessageTemplateBindingsKind
        modelAsString: true
        values:
        - name: whatsApp
          value: whatsApp
          description: The WhatsApp template type.
    MessageTemplateDocument:
      type: object
      description: The message template's document value information.
      properties:
        url:
          type: string
          format: uri
          description: The (public) URL of the media.
        caption:
          type: string
          description: The [optional] caption of the media object.
        fileName:
          type: string
          description: The [optional] filename of the media file.
      required:
      - url
      allOf:
      - $ref: '#/components/schemas/MessageTemplateValue'
      x-ms-discriminator-value: document
    MessageTemplateImage:
      type: object
      description: The message template's image value information.
      properties:
        url:
          type: string
          format: uri
          description: The (public) URL of the media.
        caption:
          type: string
          description: The [optional] caption of the media object.
        fileName:
          type: string
          description: The [optional] filename of the media file.
      required:
      - url
      allOf:
      - $ref: '#/components/schemas/MessageTemplateValue'
      x-ms-discriminator-value: image
    MessageTemplateItem:
      type: object
      description: The message template as returned from the service.
      properties:
        name:
          type: string
          description: The template's name.
          readOnly: true
        language:
          type: string
          description: The template's language, in the ISO 639 format, consist of a two-letter language code followed by an optional two-letter
            country code, e.g., 'en' or 'en_US'.
        status:
          $ref: '#/components/schemas/MessageTemplateStatus'
          description: The aggregated template status.
        kind:
          $ref: '#/components/schemas/CommunicationMessagesChannel'
          description: The type discriminator describing a template type.
      discriminator: kind
      required:
      - name
      - language
      - status
      - kind
    MessageTemplateLocation:
      type: object
      description: The message template's location value information.
      properties:
        locationName:
          type: string
          description: The [Optional] name of the location.
        address:
          type: string
          description: The [Optional] address of the location.
        latitude:
          type: number
          format: double
          description: The latitude of the location.
        longitude:
          type: number
          format: double
          description: The longitude of the location.
      required:
      - latitude
      - longitude
      allOf:
      - $ref: '#/components/schemas/MessageTemplateValue'
      x-ms-discriminator-value: location
    MessageTemplateQuickAction:
      type: object
      description: The message template's quick action value information.
      properties:
        text:
          type: string
          description: The [Optional] quick action text
        payload:
          type: string
          description: The [Optional] quick action payload
      allOf:
      - $ref: '#/components/schemas/MessageTemplateValue'
      x-ms-discriminator-value: quickAction
    MessageTemplateStatus:
      type: string
      description: The aggregated template status.
      enum:
      - approved
      - rejected
      - pending
      - paused
      x-ms-enum:
        name: MessageTemplateStatus
        modelAsString: true
        values:
        - name: approved
          value: approved
          description: Message template is approved.
        - name: rejected
          value: rejected
          description: Message template is rejected.
        - name: pending
          value: pending
          description: Message template is pending.
        - name: paused
          value: paused
          description: Message template is paused.
    MessageTemplateText:
      type: object
      description: The message template's text value information.
      properties:
        text:
          type: string
          description: The text value.
      required:
      - text
      allOf:
      - $ref: '#/components/schemas/MessageTemplateValue'
      x-ms-discriminator-value: text
    MessageTemplateValue:
      type: object
      description: The class describes a parameter of a template.
      properties:
        name:
          type: string
          description: Template binding reference name
        kind:
          $ref: '#/components/schemas/MessageTemplateValueKind'
          description: The type discriminator describing a template parameter type.
      discriminator: kind
      required:
      - name
      - kind
    MessageTemplateValueKind:
      type: string
      description: The type of the template parameter.
      enum:
      - text
      - image
      - document
      - video
      - location
      - quickAction
      x-ms-enum:
        name: MessageTemplateValueKind
        modelAsString: true
        values:
        - name: text
          value: text
          description: The text template parameter type.
        - name: image
          value: image
          description: The image template parameter type.
        - name: document
          value: document
          description: The document template parameter type.
        - name: video
          value: video
          description: The video template parameter type.
        - name: location
          value: location
          description: The location template parameter type.
        - name: quickAction
          value: quickAction
          description: The quick action template parameter type.
    MessageTemplateVideo:
      type: object
      description: The message template's video value information.
      properties:
        url:
          type: string
          format: uri
          description: The (public) URL of the media.
        caption:
          type: string
          description: The [optional] caption of the media object.
        fileName:
          type: string
          description: The [optional] filename of the media file.
      required:
      - url
      allOf:
      - $ref: '#/components/schemas/MessageTemplateValue'
      x-ms-discriminator-value: video
    NotificationContent:
      type: object
      description: Details of the message to send.
      properties:
        channelRegistrationId:
          $ref: '#/components/schemas/Azure.Core.uuid'
          description: The Channel Registration ID for the Business Identifier.
        to:
          type: array
          description: The native external platform user identifiers of the recipient.
          items:
            type: string
        kind:
          $ref: '#/components/schemas/CommunicationMessageKind'
          description: The type discriminator describing a message type.
      discriminator: kind
      required:
      - channelRegistrationId
      - to
      - kind
    PagedMessageTemplateItem:
      type: object
      description: Paged collection of MessageTemplateItem items
      properties:
        value:
          type: array
          description: The MessageTemplateItem items on this page
          items:
            $ref: '#/components/schemas/MessageTemplateItem'
        nextLink:
          type: string
          format: uri
          description: The link to the next page of items
      required:
      - value
    SendMessageResult:
      type: object
      description: Result of the send message operation.
      properties:
        receipts:
          type: array
          description: Receipts of the send message operation.
          items:
            $ref: '#/components/schemas/MessageReceipt'
      required:
      - receipts
    TemplateNotificationContent:
      type: object
      description: A request to send a template notification.
      properties:
        template:
          $ref: '#/components/schemas/MessageTemplate'
          description: The template object used to create templates.
      required:
      - template
      allOf:
      - $ref: '#/components/schemas/NotificationContent'
      x-ms-discriminator-value: template
    TextNotificationContent:
      type: object
      description: A request to send a text notification.
      properties:
        content:
          type: string
          description: Message content.
      required:
      - content
      allOf:
      - $ref: '#/components/schemas/NotificationContent'
      x-ms-discriminator-value: text
    VideoNotificationContent:
      type: object
      description: A request to send a video notification.
      properties:
        caption:
          type: string
          description: Optional text content.
        mediaUri:
          type: string
          format: uri
          description: A media url for the file. Required if the type is one of the supported media types, e.g. image
      required:
      - mediaUri
      allOf:
      - $ref: '#/components/schemas/NotificationContent'
      x-ms-discriminator-value: video
    WhatsAppMessageButtonSubType:
      type: string
      description: The WhatsApp button sub type.
      enum:
      - quickReply
      - url
      x-ms-enum:
        name: WhatsAppMessageButtonSubType
        modelAsString: true
        values:
        - name: quickReply
          value: quickReply
          description: The WhatsApp button sub type is quick reply.
        - name: url
          value: url
          description: The WhatsApp button sub type is url.
    WhatsAppMessageTemplateBindings:
      type: object
      description: The template bindings for WhatsApp
      properties:
        header:
          type: array
          description: The header template bindings
          items:
            $ref: '#/components/schemas/WhatsAppMessageTemplateBindingsComponent'
        body:
          type: array
          description: The body template bindings
          items:
            $ref: '#/components/schemas/WhatsAppMessageTemplateBindingsComponent'
        footer:
          type: array
          description: The footer template bindings
          items:
            $ref: '#/components/schemas/WhatsAppMessageTemplateBindingsComponent'
        buttons:
          type: array
          description: The button template bindings
          items:
            $ref: '#/components/schemas/WhatsAppMessageTemplateBindingsButton'
      allOf:
      - $ref: '#/components/schemas/MessageTemplateBindings'
      x-ms-discriminator-value: whatsApp
    WhatsAppMessageTemplateBindingsButton:
      type: object
      description: The template bindings component button for WhatsApp
      properties:
        subType:
          $ref: '#/components/schemas/WhatsAppMessageButtonSubType'
          description: The WhatsApp button sub type
        refValue:
          type: string
          description: The name of the referenced item in the template values.
      required:
      - subType
      - refValue
    WhatsAppMessageTemplateBindingsComponent:
      type: object
      description: The template bindings component for WhatsApp
      properties:
        refValue:
          type: string
          description: The name of the referenced item in the template values.
      required:
      - refValue
    WhatsAppMessageTemplateItem:
      type: object
      description: The WhatsApp-specific template response contract
      properties:
        content:
          description: WhatsApp platform's template content. This is the payload returned from WhatsApp API.
      allOf:
      - $ref: '#/components/schemas/MessageTemplateItem'
      x-ms-discriminator-value: whatsApp
  parameters:
    Azure.Core.ClientRequestIdHeader:
      name: x-ms-client-request-id
      in: header
      description: An opaque, globally-unique, client-generated string identifier for the request.
      required: false
      schema:
        type: string
        format: uuid
      x-ms-parameter-location: method
      x-ms-client-name: clientRequestId
    Azure.Core.Foundations.ApiVersionParameter:
      name: api-version
      in: query
      description: The API version to use for this operation.
      required: true
      schema:
        type: string
        minLength: 1
      x-ms-parameter-location: method
      x-ms-client-name: apiVersion
    Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent:
      name: Repeatability-First-Sent
      in: header
      description: Specifies the date and time at which the request was first created.
      required: false
      schema:
        type: string
        format: date-time
      x-ms-parameter-location: method
      x-ms-client-name: repeatabilityFirstSent
    Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId:
      name: Repeatability-Request-ID
      in: header
      description: An opaque, globally-unique, client-generated string identifier for the request.
      required: false
      schema:
        type: string
      x-ms-parameter-location: method
      x-ms-client-name: repeatabilityRequestId
    NotificationMessagesSendRequestBody:
      name: NotificationMessagesSendRequestBody
      in: query
      required: false
      schema:
        type: string
      description: Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves;
        the shape is unknown and is NOT a claim about the API.
      x-ae-placeholder: true
  securitySchemes:
    AadOauth2Auth:
      type: oauth2
      description: The Azure Active Directory OAuth2 Flow
      flows:
        authorizationCode:
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
          tokenUrl: https://login.microsoftonline.com/common/oauth2/token
          scopes:
            https://communication.azure.com/.default: ''
    ApiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
security:
- AadOauth2Auth:
  - https://communication.azure.com/.default
- ApiKeyAuth: []
x-converted-from:
  format: swagger 2.0
  source: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/communication/data-plane/Messages/stable/2024-08-30/communicationservicesmessages.json
  tool: apievangelist s2o.py (structural conversion, no content added)