swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: AutomationManagementClient
  version: 2015-10-31
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/webhook.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: automation-webhook
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters: {}
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks":
    get:
      description: Retrieve a list of webhooks.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/webhookoperations
      operationId: Webhook_ListByAutomationAccount
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The filter to apply on the operation.
          in: query
          name: $filter
          required: false
          type: string
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/WebhookListResult"
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Webhook
      x-ms-examples:
        List webhooks by Automation Account:
          parameters:
            api-version: 2015-10-31
            automationAccountName: myAutomationAccount33
            resourceGroupName: rg
            subscriptionId: subid
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook
                    name: TestWebhook
                    properties:
                      creationTime: 2017-03-29T22:18:14.6651862+00:00
                      expiryTime: 2018-03-29T22:18:13.7002872+00:00
                      isEnabled: true
                      lastInvokedTime: null
                      lastModifiedBy: ""
                      lastModifiedTime: 2017-03-29T22:18:14.6651862+00:00
                      parameters: null
                      runOn: null
                      runbook:
                        name: TestRunbook
                      uri: null
              headers: {}
      x-ms-odata: "#/definitions/Webhook"
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri":
    post:
      description: Generates a Uri for use in creating a webhook.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/webhookoperations
      operationId: Webhook_GenerateUri
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            type: string
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Webhook
      x-ms-examples:
        Generate webhook uri:
          parameters:
            api-version: 2015-10-31
            automationAccountName: myAutomationAccount33
            resourceGroupName: rg
            subscriptionId: subid
          responses:
            "200":
              body: https://s13events.azure-automation.net/webhooks?token=O6n03K%2b1%2bSLPH50m4x9%2fcbcqtAu2tJDTvr8QHnbJ1kw%3d
              headers: {}
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}":
    delete:
      description: Delete the webhook by name.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/webhookoperations
      operationId: Webhook_Delete
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The webhook name.
          in: path
          name: webhookName
          required: true
          type: string
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Webhook
      x-ms-examples:
        Delete webhook:
          parameters:
            api-version: 2015-10-31
            automationAccountName: myAutomationAccount33
            resourceGroupName: rg
            subscriptionId: subid
            webhookName: TestWebhook
          responses:
            "200": {}
    get:
      description: Retrieve the webhook identified by webhook name.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/webhookoperations
      operationId: Webhook_Get
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The webhook name.
          in: path
          name: webhookName
          required: true
          type: string
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Webhook"
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Webhook
      x-ms-examples:
        Get webhook:
          parameters:
            api-version: 2015-10-31
            automationAccountName: myAutomationAccount33
            resourceGroupName: rg
            subscriptionId: subid
            webhookName: TestWebhook
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook
                name: TestWebhook
                properties:
                  creationTime: 2017-03-29T22:18:14.6651862+00:00
                  expiryTime: 2018-03-29T22:18:13.7002872+00:00
                  isEnabled: true
                  lastInvokedTime: null
                  lastModifiedBy: ""
                  lastModifiedTime: 2017-03-29T22:18:14.6651862+00:00
                  parameters: null
                  runOn: null
                  runbook:
                    name: TestRunbook
                  uri: ""
              headers: {}
    patch:
      description: Update the webhook identified by webhook name.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/webhookoperations
      operationId: Webhook_Update
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The webhook name.
          in: path
          name: webhookName
          required: true
          type: string
        - description: The update parameters for webhook.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/WebhookUpdateParameters"
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Webhook"
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Webhook
      x-ms-examples:
        Update webhook:
          parameters:
            api-version: 2015-10-31
            automationAccountName: myAutomationAccount33
            parameters:
              name: TestWebhook
              properties:
                description: updated webhook
                isEnabled: false
            resourceGroupName: rg
            subscriptionId: subid
            webhookName: TestWebhook
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook
                name: TestWebhook
                properties:
                  creationTime: 2017-03-30T21:52:01.272378+00:00
                  expiryTime: 2018-03-30T23:03:14.5752078+00:00
                  isEnabled: false
                  lastInvokedTime: null
                  lastModifiedBy: ""
                  lastModifiedTime: 2017-03-30T23:03:14.9069441+00:00
                  parameters: null
                  runOn: null
                  runbook:
                    name: TestRunbook
                  uri: ""
              headers: {}
    put:
      description: Create the webhook identified by webhook name.
      externalDocs:
        url: http://aka.ms/azureautomationsdk/webhookoperations
      operationId: Webhook_CreateOrUpdate
      parameters:
        - description: Name of an Azure Resource group.
          in: path
          maxLength: 90
          minLength: 1
          name: resourceGroupName
          pattern: ^[-\w\._]+$
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The name of the automation account.
          in: path
          name: automationAccountName
          required: true
          type: string
          x-ms-parameter-location: method
        - description: The webhook name.
          in: path
          name: webhookName
          required: true
          type: string
        - description: The create or update parameters for webhook.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/WebhookCreateOrUpdateParameters"
        - description: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
          in: path
          name: subscriptionId
          required: true
          type: string
        - description: Client Api Version.
          in: query
          name: api-version
          required: true
          type: string
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/Webhook"
        "201":
          description: Created
          schema:
            $ref: "#/definitions/Webhook"
        default:
          description: Automation error response describing why the operation failed.
          schema:
            description: Error response of an operation failure
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Webhook
      x-ms-examples:
        Create or update webhook:
          parameters:
            api-version: 2015-10-31
            automationAccountName: myAutomationAccount33
            parameters:
              name: TestWebhook
              properties:
                expiryTime: 2018-03-29T22:18:13.7002872Z
                isEnabled: true
                runbook:
                  name: TestRunbook
                uri: https://s1events.azure-automation.net/webhooks?token=7u3KfQvM1vUPWaDMFRv2%2fAA4Jqx8QwS8aBuyO6Xsdcw%3d
            resourceGroupName: rg
            subscriptionId: subid
            webhookName: TestWebhook
          responses:
            "200":
              body:
                id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook
                name: TestWebhook
                properties:
                  creationTime: 2017-03-29T22:18:14.6651862+00:00
                  expiryTime: 2018-03-29T22:18:13.7002872+00:00
                  isEnabled: true
                  lastInvokedTime: null
                  lastModifiedBy: ""
                  lastModifiedTime: 2017-03-29T22:18:14.6651862+00:00
                  parameters: null
                  runOn: null
                  runbook:
                    name: TestRunbook
                  uri: ""
                type: Microsoft.Automation/AutomationAccounts/Webhooks
              headers: {}
            "201":
              body:
                id: /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/myAutomationAccount33/webhooks/TestWebhook
                name: TestWebhook
                properties:
                  creationTime: 2017-03-29T22:18:14.6651862+00:00
                  expiryTime: 2018-03-29T22:18:13.7002872+00:00
                  isEnabled: true
                  lastInvokedTime: null
                  lastModifiedBy: ""
                  lastModifiedTime: 2017-03-29T22:18:14.6651862+00:00
                  parameters: null
                  runOn: null
                  runbook:
                    name: TestRunbook
                  uri: ""
                type: Microsoft.Automation/AutomationAccounts/Webhooks
              headers: {}
definitions:
  RunbookAssociationProperty:
    description: The runbook property associated with the entity.
    properties:
      name:
        description: Gets or sets the name of the runbook.
        type: string
  Webhook:
    allOf:
      - allOf:
          - description: The core properties of ARM resources
            properties:
              id:
                description: Fully qualified resource Id for the resource
                readOnly: true
                type: string
              name:
                description: The name of the resource
                readOnly: true
                type: string
              type:
                description: The type of the resource.
                readOnly: true
                type: string
            type: object
            x-ms-azure-resource: true
        description: ARM proxy resource.
        properties: {}
        type: object
    description: Definition of the webhook type.
    properties:
      properties:
        $ref: "#/definitions/WebhookProperties"
        description: Gets or sets the webhook properties.
        x-ms-client-flatten: true
  WebhookCreateOrUpdateParameters:
    description: The parameters supplied to the create or update webhook operation.
    properties:
      name:
        description: Gets or sets the name of the webhook.
        type: string
      properties:
        $ref: "#/definitions/WebhookCreateOrUpdateProperties"
        description: Gets or sets the properties of the webhook.
        x-ms-client-flatten: true
    required:
      - name
      - properties
  WebhookCreateOrUpdateProperties:
    description: The properties of the create webhook operation.
    properties:
      expiryTime:
        description: Gets or sets the expiry time.
        format: date-time
        type: string
        x-nullable: false
      isEnabled:
        description: Gets or sets the value of the enabled flag of webhook.
        type: boolean
      parameters:
        additionalProperties:
          type: string
        description: Gets or sets the parameters of the job.
        type: object
      runOn:
        description: Gets or sets the name of the hybrid worker group the webhook job will run on.
        type: string
      runbook:
        $ref: "#/definitions/RunbookAssociationProperty"
        description: Gets or sets the runbook.
      uri:
        description: Gets or sets the uri.
        type: string
  WebhookListResult:
    description: The response model for the list webhook operation.
    properties:
      nextLink:
        description: Gets or sets the next link.
        type: string
      value:
        description: Gets or sets a list of webhooks.
        items:
          $ref: "#/definitions/Webhook"
        type: array
  WebhookProperties:
    description: Definition of the webhook properties
    properties:
      creationTime:
        description: Gets or sets the creation time.
        format: date-time
        type: string
        x-nullable: false
      description:
        description: Gets or sets the description.
        type: string
      expiryTime:
        description: Gets or sets the expiry time.
        format: date-time
        type: string
        x-nullable: false
      isEnabled:
        default: false
        description: Gets or sets the value of the enabled flag of the webhook.
        type: boolean
      lastInvokedTime:
        description: Gets or sets the last invoked time.
        format: date-time
        type: string
        x-nullable: true
      lastModifiedBy:
        description: Details of the user who last modified the Webhook
        type: string
      lastModifiedTime:
        description: Gets or sets the last modified time.
        format: date-time
        type: string
        x-nullable: false
      parameters:
        additionalProperties:
          type: string
        description: Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with.
        type: object
      runOn:
        description: Gets or sets the name of the hybrid worker group the webhook job will run on.
        type: string
      runbook:
        $ref: "#/definitions/RunbookAssociationProperty"
        description: Gets or sets the runbook the webhook is associated with.
      uri:
        description: Gets or sets the webhook uri.
        type: string
  WebhookUpdateParameters:
    description: The parameters supplied to the update webhook operation.
    properties:
      name:
        description: Gets or sets the name of the webhook.
        type: string
      properties:
        $ref: "#/definitions/WebhookUpdateProperties"
        description: Gets or sets the value of the webhook.
        x-ms-client-flatten: true
  WebhookUpdateProperties:
    description: The properties of the update webhook.
    properties:
      description:
        description: Gets or sets the description of the webhook.
        type: string
      isEnabled:
        description: Gets or sets the value of the enabled flag of webhook.
        type: boolean
      parameters:
        additionalProperties:
          type: string
        description: Gets or sets the parameters of the job.
        type: object
      runOn:
        description: Gets or sets the name of the hybrid worker group the webhook job will run on.
        type: string
