# Create an incident group

Group incidents together, as **Group as similar** does in the incidents list. Send `incident_ids` to put incidents in a new group, or add `incident_group_ids` to put them in an existing group. An incident that's already in another group moves, and a group left with one incident or none dissolves.

[endpoint]
method = "POST"
base_url = "https://incidents.betterstack.com"
path = "/api/v6/incident-groups"

[[body_param]]
name = "incident_ids"
type = "array of strings"
description = "IDs of the incidents to group, as strings or numbers. A new group needs at least two."

[[body_param]]
name = "incident_group_ids"
type = "array of strings"
description = "IDs of existing groups to merge. Every incident in these groups, and the incidents in `incident_ids`, goes into the oldest group, which keeps its ID and name. The oldest group's acknowledgement is cleared, so new incidents that join it alert again. To merge groups only, send two or more IDs without `incident_ids`."

[[body_param]]
name = "name"
type = "string or null"
description = "Name for a new group, up to 100 characters. Can't be sent with `incident_group_ids`. Rename an existing group by updating it."

[[query_param]]
name = "team_id"
type = "string"
description = "Team to use, such as `t123`. Get the ID via [List teams](/docs/uptime/api/teams/list/). Required when you can access more than one team."

[[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 incident group."
body = '''
{
  "data": {
    "id": "123456789",
    "type": "incident_group",
    "attributes": {
      "name": "Checkout 502s",
      "incidents_count": 3,
      "started_at": "2026-11-21T22:04:11.000Z",
      "acknowledged_at": "2026-11-21T22:09:30.000Z",
      "acknowledged_by": {
        "name": "John Smith",
        "email": "john@example.com"
      },
      "team_id": "t123",
      "team_name": "Production"
    }
  }
}
'''

[[response]]
status = 200
description = "Returns the incident group. Returned when `incident_group_ids` is given, so an existing group received the incidents."
body = '''
{
  "data": {
    "id": "123456789",
    "type": "incident_group",
    "attributes": {
      "name": "Checkout 502s",
      "incidents_count": 3,
      "started_at": "2026-11-21T22:04:11.000Z",
      "acknowledged_at": "2026-11-21T22:09:30.000Z",
      "acknowledged_by": {
        "name": "John Smith",
        "email": "john@example.com"
      },
      "team_id": "t123",
      "team_name": "Production"
    }
  }
}
'''

[[response]]
status = 401
description = "The API token is missing or invalid."
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 = "The token is read-only, your role doesn't allow the action, or the token can't be used for this API."
body = '''
{
  "errors": "This API token is read-only and cannot be used for write operations."
}
'''

[[response]]
status = 404
description = "An incident or group wasn't found. `errors` names the IDs."

[[response]]
status = 409
description = "One of the incidents or groups is being removed."

[[response]]
status = 422
description = "There are too few incidents or groups to group, they're in different teams, `name` was sent with `incident_group_ids`, or the request has an unknown field."
body = '''
{
  "errors": "Sorry, these attributes have unsupported values",
  "allowed_values": {
    "incident_ids": "needs at least two incidents for a new group"
  }
}
'''

[[response]]
status = 503
description = "The team's incidents are being regrouped right now. Try again in a moment."
[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The ID of the incident group."

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

[[param]]
name = "name"
type = "string or null"
description = "The group's name, up to 100 characters. `null` when it has none."

[[param]]
name = "incidents_count"
type = "integer"
description = "How many incidents the group holds. Incidents still being confirmed aren't counted."

[[param]]
name = "started_at"
type = "datetime"
description = "When the group's earliest incident started. Removing that incident from the group doesn't change it. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "acknowledged_at"
type = "datetime or null"
description = "When someone acknowledged the group. New incidents that join it later are acknowledged too. `null` while nobody has. In ISO 8601 format, such as `2026-07-01T12:00:00Z`."

[[param]]
name = "acknowledged_by"
type = "object or null"
description = "Who acknowledged the group. `null` while nobody has."

[[param]]
name = "acknowledged_by.name"
type = "string"
description = "Full name of the team member, or the text credited instead of a team member."

[[param]]
name = "acknowledged_by.email"
type = "string or null"
description = "E-mail of the team member. `null` when the group was credited to something other than a team member, such as `API`, Slack or a custom text."

[[param]]
name = "team_id"
type = "string"
description = "Team that owns the group, such as `t123`."

[[param]]
name = "team_name"
type = "string"
description = "Name of the team that owns the group."
[/params]

#### Example cURL

[code-tabs]
```shell
[label Group incidents]
curl --request POST \
  --url https://incidents.betterstack.com/api/v6/incident-groups \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "incident_ids": [
    "123456",
    "123457"
  ],
  "name": "Checkout 502s"
}'
```
```shell
[label Add to a group]
curl --request POST \
  --url https://incidents.betterstack.com/api/v6/incident-groups \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "incident_ids": [
    "123458"
  ],
  "incident_group_ids": [
    "98765"
  ]
}'
```
[/code-tabs]
