Microsoft Azure Tenant Action Groups API

The Microsoft Azure Tenant Action Groups API allows users to programmatically manage and configure action groups within their Azure tenant. Action groups are collections of notification preferences and actions that can be triggered in response to alerts and events in Azure Monitor. With this API, users can create, update, and delete action groups, as well as configure the specific notifications and actions to be taken when a particular event occurs.

OpenAPI Specification

azure-tenant-action-groups-api-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  title: Microsoft Azure Azure Tenant Action Groups API
  x-ms-code-generation-settings:
    name: MonitorManagementClient
  version: 2023-05-01-preview
host: management.azure.com
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
security:
  - azure_auth:
      - user_impersonation
securityDefinitions:
  azure_auth:
    type: oauth2
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    flow: implicit
    description: Azure Active Directory OAuth2 Flow
    scopes:
      user_impersonation: impersonate your user account
paths:
  ? /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}
  : put:
      description: Create a new tenant action group or update an existing one.
      operationId: microsoftAzureTenantactiongroupsCreateorupdate
      x-ms-examples:
        Create or update a tenant action group:
          $ref: ./examples/createOrUpdateTenantActionGroup.json
      parameters:
        - $ref: '#/parameters/ManagementGroupIdParameter'
        - $ref: '#/parameters/ActionGroupNameParameter'
        - $ref: '#/parameters/TenantIdParameter'
        - name: actionGroup
          in: body
          required: true
          schema:
            $ref: '#/definitions/TenantActionGroupResource'
          description: The tenant action group to create or use for the update.
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
      responses:
        '200':
          description: An existing tenant action group was successfully updated.
          schema:
            $ref: '#/definitions/TenantActionGroupResource'
        '201':
          description: A new tenant action group was successfully created.
          schema:
            $ref: '#/definitions/TenantActionGroupResource'
        default:
          description: >-
            An error occurred and the tenant action group could not be created
            or updated.
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: >-
        Microsoft Azure Put Providers Microsoft Management Managementgroups Managementgroupid Providers Microsoft Insights Tenantactiongroups Tenantactiongroupname
      tags:
        - Providers
    get:
      description: Get a tenant action group.
      operationId: microsoftAzureTenantactiongroupsGet
      x-ms-examples:
        Get an action group:
          $ref: ./examples/getTenantActionGroup.json
      parameters:
        - $ref: '#/parameters/ManagementGroupIdParameter'
        - $ref: '#/parameters/ActionGroupNameParameter'
        - $ref: '#/parameters/TenantIdParameter'
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
      responses:
        '200':
          description: The request succeeded.
          schema:
            $ref: '#/definitions/TenantActionGroupResource'
        default:
          description: >-
            An error occurred and the tenant action group could not be
            retrieved. 404: The tenant action group does not exist.
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: >-
        Microsoft Azure Get Providers Microsoft Management Managementgroups Managementgroupid Providers Microsoft Insights Tenantactiongroups Tenantactiongroupname
      tags:
        - Providers
    delete:
      description: Delete a tenant action group.
      operationId: microsoftAzureTenantactiongroupsDelete
      x-ms-examples:
        Delete a tenant action group:
          $ref: ./examples/deleteTenantActionGroup.json
      parameters:
        - $ref: '#/parameters/ManagementGroupIdParameter'
        - $ref: '#/parameters/ActionGroupNameParameter'
        - $ref: '#/parameters/TenantIdParameter'
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
      responses:
        '200':
          description: The tenant action group was successfully deleted.
        '204':
          description: >-
            The tenant action group does not exist. It may have already been
            deleted.
        default:
          description: An error occurred and the tenant action group could not be deleted.
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: >-
        Microsoft Azure Delete Providers Microsoft Management Managementgroups Managementgroupid Providers Microsoft Insights Tenantactiongroups Tenantactiongroupname
      tags:
        - Providers
    patch:
      description: >-
        Updates an existing tenant action group's tags. To update other fields
        use the CreateOrUpdate method.
      operationId: microsoftAzureTenantactiongroupsUpdate
      parameters:
        - $ref: '#/parameters/ManagementGroupIdParameter'
        - $ref: '#/parameters/ActionGroupNameParameter'
        - $ref: '#/parameters/TenantIdParameter'
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
        - name: tenantActionGroupPatch
          in: body
          required: true
          schema:
            $ref: '#/definitions/ActionGroupPatchBody'
          description: Parameters supplied to the operation.
      responses:
        '200':
          description: An existing tenant action group was successfully updated.
          schema:
            $ref: '#/definitions/TenantActionGroupResource'
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: '#/definitions/ErrorResponse'
      x-ms-examples:
        Patch a tenant action group:
          $ref: ./examples/patchTenantActionGroup.json
      summary: >-
        Microsoft Azure Patch Providers Microsoft Management Managementgroups Managementgroupid Providers Microsoft Insights Tenantactiongroups Tenantactiongroupname
      tags:
        - Providers
  /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups:
    get:
      description: Get a list of all tenant action groups in a management group.
      operationId: microsoftAzureTenantactiongroupsListbymanagementgroupid
      x-ms-examples:
        List tenant action groups at management group level:
          $ref: ./examples/listTenantActionGroups.json
      x-ms-pageable:
        nextLinkName:
      parameters:
        - $ref: '#/parameters/ManagementGroupIdParameter'
        - $ref: '#/parameters/TenantIdParameter'
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
      responses:
        '200':
          description: The request succeeded.
          schema:
            $ref: '#/definitions/TenantActionGroupList'
        default:
          description: >-
            An error occurred and the list of tenant action groups could not be
            retrieved.
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: >-
        Microsoft Azure Get Providers Microsoft Management Managementgroups Managementgroupid Providers Microsoft Insights Tenantactiongroups
      tags:
        - Providers
  ? /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}/createNotifications
  : post:
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: location
      description: Send test notifications to a set of provided receivers
      operationId: microsoftAzureCreatenotificationsattenantactiongroupresourcelevel
      x-ms-examples:
        Create notifications at tenant action group level:
          $ref: >-
            ./examples/postTestNotificationsAtTenantActionGroupResourceLevel.json
      parameters:
        - $ref: '#/parameters/ManagementGroupIdParameter'
        - $ref: '#/parameters/ActionGroupNameParameter'
        - $ref: '#/parameters/TenantIdParameter'
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
        - name: notificationRequest
          in: body
          required: true
          schema:
            $ref: '#/definitions/TenantNotificationRequestBody'
          description: The notification request body which includes the contact details
      responses:
        '200':
          description: The notification succeeded
          schema:
            $ref: '#/definitions/TestNotificationDetailsResponse'
        '202':
          description: The notification request accepted
          headers:
            location:
              type: string
              description: The location header that has the polling uri.
        default:
          description: An error occurred while sending the test notifications
          schema:
            $ref: >-
              ../../../../../common-types/resource-management/v2/types.json#/definitions/ErrorResponse
      summary: >-
        Microsoft Azure Post Providers Microsoft Management Managementgroups Managementgroupid Providers Microsoft Insights Tenantactiongroups Tenantactiongroupname Createnotifications
      tags:
        - Providers
  ? /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Insights/tenantActionGroups/{tenantActionGroupName}/notificationStatus/{notificationId}
  : get:
      description: Get the test notifications by the notification id
      operationId: microsoftAzureGettestnotificationsattenantactiongroupresourcelevel
      x-ms-examples:
        Get notification details at tenant action group level:
          $ref: ./examples/getTestNotificationsAtTenantActionGroupResourceLevel.json
      parameters:
        - $ref: '#/parameters/ManagementGroupIdParameter'
        - $ref: '#/parameters/ActionGroupNameParameter'
        - $ref: '#/parameters/TenantIdParameter'
        - $ref: >-
            ../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter
        - $ref: '#/parameters/NotificationIdParameter'
      responses:
        '200':
          description: The notification details
          schema:
            $ref: '#/definitions/TestNotificationDetailsResponse'
        default:
          description: An error occurred while sending the test notifications
          schema:
            $ref: '#/definitions/ErrorResponse'
      summary: >-
        Microsoft Azure Get Providers Microsoft Management Managementgroups Managementgroupid Providers Microsoft Insights Tenantactiongroups Tenantactiongroupname Notificationstatus Notificationid
      tags:
        - Providers
definitions:
  AzureResource:
    properties:
      id:
        type: string
        readOnly: true
        description: Azure resource Id
      name:
        type: string
        readOnly: true
        description: Azure resource name
      type:
        type: string
        readOnly: true
        description: Azure resource type
      location:
        type: string
        description: Resource location
        x-ms-mutability:
          - create
          - read
      tags:
        additionalProperties:
          type: string
        type: object
        description: Resource tags
    required:
      - location
    type: object
    x-ms-azure-resource: true
    description: An azure resource object
  TenantNotificationRequestBody:
    description: The request body which contain contact detail metadata
    type: object
    properties:
      alertType:
        type: string
        maxLength: 30
        description: >-
          The value of the supported alert type. Supported alert type value is:
          servicehealth
      emailReceivers:
        x-ms-identifiers: []
        type: array
        items:
          $ref: '#/definitions/EmailReceiver'
        description: The list of email receivers that are part of this action group.
      smsReceivers:
        x-ms-identifiers: []
        type: array
        items:
          $ref: '#/definitions/SmsReceiver'
        description: The list of SMS receivers that are part of this action group.
      webhookReceivers:
        x-ms-identifiers: []
        type: array
        items:
          $ref: '#/definitions/WebhookReceiver'
        description: The list of webhook receivers that are part of this action group.
      azureAppPushReceivers:
        x-ms-identifiers: []
        type: array
        items:
          $ref: '#/definitions/AzureAppPushReceiver'
        description: The list of AzureAppPush receivers that are part of this action group.
      voiceReceivers:
        x-ms-identifiers: []
        type: array
        items:
          $ref: '#/definitions/VoiceReceiver'
        description: The list of voice receivers that are part of this action group.
    required:
      - alertType
  TestNotificationDetailsResponse:
    description: The details of the test notification results.
    type: object
    properties:
      context:
        type: object
        $ref: '#/definitions/Context'
      state:
        type: string
        description: The overall state
      completedTime:
        type: string
        description: The completed time
      createdTime:
        type: string
        description: The created time
      actionDetails:
        x-ms-identifiers: []
        type: array
        items:
          $ref: '#/definitions/ActionDetail'
        description: The list of action detail
    required:
      - state
  ActionDetail:
    description: The action detail
    type: object
    properties:
      mechanismType:
        type: string
        description: The mechanism type
      name:
        type: string
        description: The name of the action
      status:
        type: string
        description: The status of the action
      subState:
        type: string
        description: The substatus of the action
      sendTime:
        type: string
        description: The send time
      message:
        type: string
        description: The detail of the friendly error message
  Context:
    description: The context info
    type: object
    properties:
      notificationSource:
        type: string
        description: The source of the notification request
      contextType:
        type: string
        description: The context id type
  TenantActionGroupResource:
    description: A tenant action group resource.
    type: object
    allOf:
      - $ref: '#/definitions/AzureResource'
    properties:
      properties:
        x-ms-client-flatten: true
        $ref: '#/definitions/TenantActionGroup'
        description: The tenant action groups properties of the resource.
  TenantActionGroupList:
    description: A list of tenant action groups.
    type: object
    properties:
      value:
        type: array
        items:
          $ref: '#/definitions/TenantActionGroupResource'
        description: The list of tenant action groups.
      nextLink:
        type: string
        description: Provides the link to retrieve the next set of elements.
  TenantActionGroup:
    description: A tenant  action group.
    type: object
    properties:
      groupShortName:
        type: string
        maxLength: 12
        description: The short name of the action group. This will be used in SMS messages.
      enabled:
        type: boolean
        default: true
        description: >-
          Indicates whether this tenant action group is enabled. If a tenant
          action group is not enabled, then none of its receivers will receive
          communications.
      emailReceivers:
        x-ms-identifiers:
          - emailAddress
        type: array
        items:
          $ref: '#/definitions/EmailReceiver'
        description: The list of email receivers that are part of this tenant action group.
      smsReceivers:
        x-ms-identifiers:
          - phoneNumber
        type: array
        items:
          $ref: '#/definitions/SmsReceiver'
        description: The list of SMS receivers that are part of this tenant action group.
      webhookReceivers:
        x-ms-identifiers:
          - name
        type: array
        items:
          $ref: '#/definitions/WebhookReceiver'
        description: >-
          The list of webhook receivers that are part of this tenant action
          group.
      azureAppPushReceivers:
        x-ms-identifiers:
          - emailAddress
        type: array
        items:
          $ref: '#/definitions/AzureAppPushReceiver'
        description: >-
          The list of AzureAppPush receivers that are part of this tenant action
          group.
      voiceReceivers:
        x-ms-identifiers:
          - phoneNumber
        type: array
        items:
          $ref: '#/definitions/VoiceReceiver'
        description: The list of voice receivers that are part of this tenant action group.
    required:
      - groupShortName
      - enabled
  EmailReceiver:
    description: An email receiver.
    type: object
    properties:
      name:
        type: string
        description: >-
          The name of the email receiver. Names must be unique across all
          receivers within a tenant action group.
      emailAddress:
        type: string
        description: The email address of this receiver.
      useCommonAlertSchema:
        type: boolean
        default: false
        description: Indicates whether to use common alert schema.
      status:
        readOnly: true
        $ref: '#/definitions/ReceiverStatus'
        description: The receiver status of the e-mail.
    required:
      - name
      - emailAddress
  SmsReceiver:
    description: An SMS receiver.
    type: object
    properties:
      name:
        type: string
        description: >-
          The name of the SMS receiver. Names must be unique across all
          receivers within a tenant action group.
      countryCode:
        type: string
        description: The country code of the SMS receiver.
      phoneNumber:
        type: string
        description: The phone number of the SMS receiver.
      status:
        readOnly: true
        $ref: '#/definitions/ReceiverStatus'
        description: The status of the receiver.
    required:
      - name
      - countryCode
      - phoneNumber
  WebhookReceiver:
    description: A webhook receiver.
    type: object
    properties:
      name:
        type: string
        description: >-
          The name of the webhook receiver. Names must be unique across all
          receivers within a tenant action group.
      serviceUri:
        type: string
        description: The URI where webhooks should be sent.
      useCommonAlertSchema:
        type: boolean
        default: false
        description: Indicates whether to use common alert schema.
      useAadAuth:
        type: boolean
        default: false
        description: Indicates whether or not use AAD authentication.
      objectId:
        type: string
        description: Indicates the webhook app object Id for aad auth.
      identifierUri:
        type: string
        description: Indicates the identifier uri for aad auth.
      tenantId:
        type: string
        description: Indicates the tenant id for aad auth.
    required:
      - name
      - serviceUri
  AzureAppPushReceiver:
    description: The Azure mobile App push notification receiver.
    type: object
    properties:
      name:
        type: string
        description: >-
          The name of the Azure mobile app push receiver. Names must be unique
          across all receivers within a tenant action group.
      emailAddress:
        type: string
        description: The email address registered for the Azure mobile app.
    required:
      - name
      - emailAddress
  VoiceReceiver:
    description: A voice receiver.
    type: object
    properties:
      name:
        type: string
        description: >-
          The name of the voice receiver. Names must be unique across all
          receivers within a tenant action group.
      countryCode:
        type: string
        description: The country code of the voice receiver.
      phoneNumber:
        type: string
        description: The phone number of the voice receiver.
    required:
      - name
      - countryCode
      - phoneNumber
  ReceiverStatus:
    type: string
    enum:
      - NotSpecified
      - Enabled
      - Disabled
    x-ms-enum:
      name: ReceiverStatus
      modelAsString: false
    description: >-
      Indicates the status of the receiver. Receivers that are not Enabled will
      not receive any communications.
  ErrorResponse:
    description: Describes the format of Error response.
    type: object
    properties:
      code:
        description: Error code
        type: string
      message:
        description: Error message indicating why the operation failed.
        type: string
  ActionGroupPatchBody:
    description: A tenant action group object for the body of patch operations.
    type: object
    properties:
      tags:
        type: object
        additionalProperties:
          type: string
        description: Resource tags
      properties:
        x-ms-client-flatten: true
        $ref: '#/definitions/ActionGroupPatch'
        description: The action group settings for an update operation.
  ActionGroupPatch:
    description: A tenant action group for patch operations.
    type: object
    properties:
      enabled:
        type: boolean
        default: true
        description: >-
          Indicates whether this tenant action group is enabled. If a tenant
          action group is not enabled, then none of its actions will be
          activated.
parameters:
  ManagementGroupIdParameter:
    name: managementGroupId
    in: path
    required: true
    type: string
    description: The management group id.
    x-ms-parameter-location: method
  ActionGroupNameParameter:
    name: tenantActionGroupName
    in: path
    required: true
    type: string
    pattern: ^[A-Za-z][A-Za-z0-9]*$
    minLength: 1
    maxLength: 260
    description: The name of the action group.
    x-ms-parameter-location: method
  NotificationIdParameter:
    name: notificationId
    in: path
    required: true
    type: string
    description: The notification id
    x-ms-parameter-location: method
  TenantIdParameter:
    name: x-ms-client-tenant-id
    in: header
    description: The tenant ID of the client making the request.
    required: true
    type: string
    x-ms-parameter-location: method
tags:
  - name: Providers