# Get team maintenance

Returns whether a team is in [team-wide maintenance](https://betterstack.com/docs/uptime/team-wide-maintenance/) and when it ends. 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`.

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

[[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 = 200
description = '''Returns the team's maintenance state.'''
body = '''{
  "data": {
    "id": "t123",
    "type": "team_maintenance",
    "attributes": {
      "team_name": "Platform team",
      "maintenance": true,
      "maintenance_to": "2026-11-16T18:30:00Z"
    }
  }
}'''

[[response]]
status = 200
description = '''A team that isn't in maintenance.'''
body = '''{
  "data": {
    "id": "t123",
    "type": "team_maintenance",
    "attributes": {
      "team_name": "Platform team",
      "maintenance": false,
      "maintenance_to": null
    }
  }
}'''

[[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 = 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]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The ID of the team, like `t123`."

[[param]]
name = "type"
type = "string"
description = "Always `team_maintenance`."

[[param]]
name = "attributes.team_name"
type = "string"
description = "The name of the team."

[[param]]
name = "attributes.maintenance"
type = "boolean"
description = "Whether the team is in maintenance now."

[[param]]
name = "attributes.maintenance_to"
type = "string or null"
description = "When the maintenance ends, in ISO 8601 format, or `null` when the team isn't in maintenance."
[/params]

#### Example cURL

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