# End team maintenance

Ends [team-wide maintenance](https://betterstack.com/docs/uptime/team-wide-maintenance/) now and resumes monitoring. Your team's Slack and Microsoft Teams integrations are notified that maintenance ended. On a team that isn't in maintenance, nothing changes.

An [Incidents API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-an-incidents-api-token) acts on its own team. With a [global API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-a-global-api-token), pick the team with `team_name` or `team_id`. Read-only tokens can't end maintenance.

[endpoint]
base_url = "https://incidents.betterstack.com"
path = "/api/v2/team-maintenance"
method = "DELETE"

[[query_param]]
name = "team_name"
description = "The name of the team. Required with a [global API token](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-a-global-api-token) that reaches several teams, unless you set `team_id`."
required = false
type = "string"

[[query_param]]
name = "team_id"
description = "The ID of the team shown in Better Stack URLs, with the `t` prefix, like `t123`. Use it instead of `team_name` with a global API token."
required = false
type = "string"

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

[responses]
[[response]]
status = 204
description = '''Maintenance ended, or the team wasn't in maintenance.'''
body = ''''''

[[response]]
status = 401
description = '''Authentication failed due to a missing or invalid token.'''
body = '''{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-an-incidents-api-token"
}'''

[[response]]
status = 403
description = '''Returned for a read-only token.'''
body = '''{
  "errors": "This API token is read-only and cannot be used for write operations."
}'''

[[response]]
status = 422
description = '''Returned when a global API token reaches several teams and the request doesn't pick one.'''
body = '''{
  "errors": "This token has access to multiple teams. Please use `team_name` or `better_stack_team_id` to specify the team"
}'''
[/responses]

#### Example cURL

```shell
[label Example]
curl --request DELETE \
  --url https://incidents.betterstack.com/api/v2/team-maintenance \
  --header "Authorization: Bearer $TOKEN"
```
