v1

latestOpenAPI 3.0.02026-07-141,4077,1665.2 MB
On-Call

Set On-Call team routing rules

Set a team's On-Call routing rules

put/api/v2/on-call/teams/{team_id}/routing-rules

Path parameters

team_idstring required
Example:27590dae-47be-4a7d-9abf-8f4e45124020

The team ID

Query parameters

includestring

Comma-separated list of included relationships to be returned. Allowed values: rules, rules.policy.

Request body

Example request

{
  "data": {
    "attributes": {
      "rules": [
        {
          "actions": null,
          "policy_id": "",
          "query": "tags.service:test",
          "time_restriction": {
            "restrictions": [
              {
                "end_day": "monday",
                "end_time": "17:00:00",
                "start_day": "monday",
                "start_time": "09:00:00"
              },
              {
                "end_day": "tuesday",
                "end_time": "17:00:00",
                "start_day": "tuesday",
                "start_time": "09:00:00"
              }
            ],
            "time_zone": ""
          },
          "urgency": "high"
        },
        {
          "actions": [
            {
              "channel": "channel",
              "type": "send_slack_message",
              "workspace": "workspace"
            }
          ],
          "policy_id": "fad4eee1-13f5-40d8-886b-4e56d8d5d1c6",
          "query": "",
          "time_restriction": null,
          "urgency": "low"
        }
      ]
    },
    "id": "27590dae-47be-4a7d-9abf-8f4e45124020",
    "type": "team_routing_rules"
  }
}

Response

OK

Example response

{
  "data": {
    "id": "27590dae-47be-4a7d-9abf-8f4e45124020",
    "relationships": {
      "rules": {
        "data": [
          {
            "id": "03aff2d6-6cbf-496c-997f-a857bbe9a94a",
            "type": "team_routing_rules"
          },
          {
            "id": "03aff2d6-6cbf-496c-997f-a857bbe9a94a",
            "type": "team_routing_rules"
          }
        ]
      }
    },
    "type": "team_routing_rules"
  },
  "included": [
    {
      "attributes": {
        "actions": null,
        "query": "tags.service:test",
        "time_restriction": {
          "restrictions": [
            {
              "end_day": "monday",
              "end_time": "17:00:00",
              "start_day": "monday",
              "start_time": "09:00:00"
            },
            {
              "end_day": "tuesday",
              "end_time": "17:00:00",
              "start_day": "tuesday",
              "start_time": "09:00:00"
            }
          ],
          "time_zone": ""
        },
        "urgency": "high"
      },
      "id": "03aff2d6-6cbf-496c-997f-a857bbe9a94a",
      "relationships": {
        "policy": {
          "data": null
        }
      },
      "type": "team_routing_rules"
    }
  ]
}