# Create Azure integration

Returns either a newly created Azure integration, or validation errors.

[endpoint]
base_url = "https://incidents.betterstack.com"
path = "/api/v2/azure-integrations"
method = "POST"

[[body_param]]
name = "team_name"
description = "Required if using [global API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-a-global-api-token) to specify the team which should own the resource"
required = false
type = "string"

[[body_param]]
name = "name"
description = "The name of the Azure integration that you can see in the dashboard."
required = false
type = "string"

[[body_param]]
name = "policy_id"
description = "ID of the escalation policy associated with the Azure integration."
required = false
type = "string"

[[body_param]]
name = "call"
description = "Call the on-call person."
required = false
type = "boolean"

[[body_param]]
name = "sms"
description = "Send an SMS to the on-call person."
required = false
type = "boolean"

[[body_param]]
name = "email"
description = "Send an e-mail to the on-call person."
required = false
type = "boolean"

[[body_param]]
name = "push"
description = "Send a push notification to the on-call person."
required = false
type = "boolean"

[[body_param]]
name = "critical_alert"
description = "Send a critical push notification that ignores the mute switch and Do not Disturb mode."
required = false
type = "boolean"

[[body_param]]
name = "team_wait"
description = "How long we wait before escalating the incident alert to the team. In seconds."
required = false
type = "integer"

[[body_param]]
name = "recovery_period"
description = "How long the alert must be up to automatically mark an incident as resolved. In seconds."
required = false
type = "integer"

[[body_param]]
name = "paused"
description = "Set to `true` to pause the integration, `false` to unpause it."
required = false
type = "boolean"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"

[[header]]
name = "Content-Type"
description = "application/json"
required = false
type = "string"
[/endpoint]

[responses]
[[response]]
status = 201
description = '''Returns the newly created Azure integration. Point your Azure webhook to the returned `webhook_url`'''
body = '''{
  "data": {
    "id": "37",
    "type": "azure_integration",
    "attributes": {
      "call": false,
      "sms": true,
      "email": true,
      "team_wait": 180,
      "recovery_period": null,
      "policy_id": null,
      "push": false,
      "critical_alert": false,
      "name": "Azure alerts",
      "webhook_url": "https://incidents.betterstack.com/api/v1/azure/webhook/[token]",
      "team_name": "Testing",
      "paused": false
    }
  }
}'''

[/responses]

#### Example cURL 

```shell
[label Example]
curl -X "POST" "https://incidents.betterstack.com/api/v2/azure-integrations/" \
     -H "Authorization: Bearer $TOKEN" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'{
  "name": "Azure alerts",
  "sms": true,
  "team_wait": 180
}'
```
