# Update heartbeat

Update an existing heartbeat configuration. Send only the parameters you wish to change (e.g. `name`)

[endpoint]
base_url = "https://uptime.betterstack.com"
path = "/api/v2/heartbeats/{heartbeat_id}"
method = "PATCH"

[[path_param]]
name = "heartbeat_id"
description = "The ID of your requested heartbeat."
required = true
type = "string"

[[body_param]]
name = "name"
description = "The name of the service for this heartbeat."
required = false
type = "string"

[[body_param]]
name = "period"
description = "How often should we expect this heartbeat? In seconds Minimum value: `30` seconds"
required = false
type = "integer"

[[body_param]]
name = "grace"
description = "Heartbeats can fluctuate; specify this value to control what is still acceptable Minimum value: `0` seconds We recommend setting this to approx. 20% of `period`"
required = false
type = "integer"

[[body_param]]
name = "call"
description = "Should we call the on-call person?"
required = false
type = "boolean"

[[body_param]]
name = "sms"
description = "Should we send an SMS to the on-call person?"
required = false
type = "boolean"

[[body_param]]
name = "email"
description = "Should we send an email to the on-call person?"
required = false
type = "boolean"

[[body_param]]
name = "push"
description = "Should we send a push notification to the on-call person?"
required = false
type = "boolean"

[[body_param]]
name = "critical_alert"
description = "Should we 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 should we wait before escalating the incident alert to the team? Leave blank to disable escalating to the entire team."
required = false
type = "integer"

[[body_param]]
name = "heartbeat_group_id"
description = "Set this attribute if you want to add this heartbeat to a heartbeat group"
required = false
type = "string"

[[body_param]]
name = "sort_index"
description = "An index controlling the position of a heartbeat in the heartbeat group."
required = false
type = "integer"

[[body_param]]
name = "maintenance_days"
description = "An array of maintenance days to set. If a maintenance window is overnight both affected days should be set. Allowed values are `['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']` or any subset of these days."
required = false
type = "array of strings"

[[body_param]]
name = "maintenance_from"
description = "Start of the maintenance window each day. We won't check your website during this window. Example: '01:00:00'"
required = false
type = "string"

[[body_param]]
name = "maintenance_to"
description = "End of the maintenance window each day. Example: '03:00:00'"
required = false
type = "string"

[[body_param]]
name = "maintenance_timezone"
description = "The timezone to use for the maintenance window each day. Defaults to UTC. The accepted values can be found in the Rails TimeZone documentation. https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html"
required = false
type = "string"

[[body_param]]
name = "paused"
description = "Set to `true` to pause monitoring — we won't notify you about downtime. Set to `false` to resume monitoring"
required = false
type = "boolean"

[[body_param]]
name = "policy_id"
description = "Set the escalation policy for the monitor."
required = false
type = "string"

[[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 = 200
description = ''''''
body = '''{
  "data": {
    "id": "12345",
    "type": "heartbeat",
    "attributes": {
      "url": "https://uptime.betterstack.com/api/v1/heartbeat/abcd1234abcd1234abcd1234",
      "name": "Testing heartbeat, with an update",
      "period": 10800,
      "grace": 300,
      "call": false,
      "sms": false,
      "email": true,
      "push": true,
      "team_wait": 180,
      "heartbeat_group_id": null,
      "team_name": "Test team",
      "sort_index": null,
      "maintenance_from": "01:02:00",
      "maintenance_to": "03:04:00",
      "maintenance_timezone": "Amsterdam",
      "maintenance_days": ["mon", "tue", "wed", "thu", "fri", "sat", "sun"],
      "paused_at": null,
      "created_at": "2020-05-05T11:41:49.327Z",
      "updated_at": "2020-12-10T15:00:15.089Z"
    }
  }
}'''

[/responses]

#### Example cURL 

```shell
[label Example]
curl --request PATCH \
  --url https://uptime.betterstack.com/api/v2/heartbeats/12345 \
  --header "Authorization: Bearer $TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
	"name": "Testing heartbeat, with an update"
}'
```

[info]
#### Looking for the details of a specific parameter?
Explore [the list of all heartbeats API parameters](https://betterstack.com/docs/uptime/api/heartbeats-api-response-params/)
[/info]
