---
title: "Set On-Call team routing rules"
method: PUT
path: "/api/v2/on-call/teams/{team_id}/routing-rules"
tags: ["On-Call"]
---

# Set On-Call team routing rules

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

Set a team's On-Call routing rules

## Path parameters

- `team_id` string, required

## Query parameters

- `include` string

## Request body

- TeamRoutingRulesRequest — Represents a request to create or update team routing rules, including the data payload.
  - `data` TeamRoutingRulesRequestData — Holds the data necessary to create or update team routing rules, including attributes, ID, and resource type.
    - `attributes` TeamRoutingRulesRequestDataAttributes — Represents the attributes of a request to update or create team routing rules.
      - `rules` TeamRoutingRulesRequestRule[] — A list of routing rule items that define how incoming pages should be handled.
        - `actions` RoutingRuleAction[] — Specifies the list of actions to perform when the routing rule is matched.
          - union — Defines an action that is executed when a routing rule matches certain criteria.
            - SendSlackMessageAction — Sends a message to a Slack channel.
              - …
            - SendTeamsMessageAction — Sends a message to a Microsoft Teams channel.
              - …
            - TriggerWorkflowAutomationAction — Triggers a Workflow Automation.
              - …
            - RoutingRuleEscalationPolicyAction — Triggers an escalation policy.
              - …
        - `policy_id` string — Identifies the policy to be applied when this routing rule matches.
        - `query` string — Defines the query or condition that triggers this routing rule.
        - `time_restriction` TimeRestrictions — Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field.
          - `restrictions` TimeRestriction[], required — Defines the list of time-based restrictions.
            - `end_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' — A day of the week.
            - `end_time` string — Specifies the ending time for this restriction.
            - `start_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' — A day of the week.
            - `start_time` string — Specifies the starting time for this restriction.
          - `time_zone` string, required — Specifies the time zone applicable to the restrictions.
        - `urgency` 'low' | 'high' | 'dynamic' — Specifies the level of urgency for a routing rule (low, high, or dynamic).
    - `id` string — Specifies the unique identifier for this set of team routing rules.
    - `type` 'team_routing_rules', required — Team routing rules resource type.

## Response `200`

OK

- TeamRoutingRules — Represents a complete set of team routing rules, including data and optionally included related resources.
  - `data` TeamRoutingRulesData — Represents the top-level data object for team routing rules, containing the ID, relationships, and resource type.
    - `id` string — Specifies the unique identifier of this team routing rules record.
    - `relationships` TeamRoutingRulesDataRelationships — Specifies relationships for team routing rules, including rule references.
      - `rules` TeamRoutingRulesDataRelationshipsRules — Holds references to a set of routing rules in a relationship.
        - `data` TeamRoutingRulesDataRelationshipsRulesDataItems[] — An array of references to the routing rules associated with this team.
          - `id` string, required — Specifies the unique identifier for the related routing rule.
          - `type` 'team_routing_rules', required — Indicates that the resource is of type 'team_routing_rules'.
    - `type` 'team_routing_rules', required — Team routing rules resource type.
  - `included` TeamRoutingRulesIncluded[] — Provides related routing rules or other included resources.
    - `attributes` RoutingRuleAttributes — Defines the configurable attributes of a routing rule, such as actions, query, time restriction, and urgency.
      - `actions` RoutingRuleAction[] — Specifies the list of actions to perform when the routing rule matches.
        - union — Defines an action that is executed when a routing rule matches certain criteria.
          - SendSlackMessageAction — Sends a message to a Slack channel.
            - `channel` string, required — The channel ID.
            - `type` 'send_slack_message', required — Indicates that the action is a send Slack message action.
            - `workspace` string, required — The workspace ID.
          - SendTeamsMessageAction — Sends a message to a Microsoft Teams channel.
            - `channel` string, required — The channel ID.
            - `team` string, required — The team ID.
            - `tenant` string, required — The tenant ID.
            - `type` 'send_teams_message', required — Indicates that the action is a send Microsoft Teams message action.
          - TriggerWorkflowAutomationAction — Triggers a Workflow Automation.
            - `handle` string, required — The handle of the Workflow Automation to trigger.
            - `type` 'workflow', required — Indicates that the action triggers a Workflow Automation.
          - RoutingRuleEscalationPolicyAction — Triggers an escalation policy.
            - `ack_timeout_minutes` integer — The number of minutes before an acknowledged page is re-triggered.
            - `policy_id` string, required — The ID of the escalation policy to route to.
            - `support_hours` RoutingRuleEscalationPolicyActionSupportHours — Support hours during which the escalation policy will be executed. Outside of these hours, the escalation policy will be on hold and triggered once the next support hours window starts. This is mutually exclusive with the top-level `time_restriction` field on the routing rule.
              - …
            - `type` 'escalation_policy', required — Indicates that the action pages an escalation policy. This action can be set once per routing rule item, and is mutually exclusive with the top-level `policy_id` field on the routing rule.
            - `urgency` 'low' | 'high' | 'dynamic' — Specifies the level of urgency for a routing rule (low, high, or dynamic).
      - `query` string — Defines the query or condition that triggers this routing rule.
      - `time_restriction` TimeRestrictions — Time restrictions during which the routing rule is active. Outside of these hours, the rule does not match and routing continues to subsequent rules. This is mutually exclusive with the action-level `support_hours` field.
        - `restrictions` TimeRestriction[], required — Defines the list of time-based restrictions.
          - `end_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' — A day of the week.
          - `end_time` string — Specifies the ending time for this restriction.
          - `start_day` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' — A day of the week.
          - `start_time` string — Specifies the starting time for this restriction.
        - `time_zone` string, required — Specifies the time zone applicable to the restrictions.
      - `urgency` 'low' | 'high' | 'dynamic' — Specifies the level of urgency for a routing rule (low, high, or dynamic).
    - `id` string — Specifies the unique identifier of this routing rule.
    - `relationships` RoutingRuleRelationships — Specifies relationships for a routing rule, linking to associated policy resources.
      - `policy` RoutingRuleRelationshipsPolicy — Defines the relationship that links a routing rule to a policy.
        - `data` RoutingRuleRelationshipsPolicyData — Represents the policy data reference, containing the policy's ID and resource type.
          - `id` string, required — Specifies the unique identifier of the policy.
          - `type` 'policies', required — Indicates that the resource is of type 'policies'.
    - `type` 'team_routing_rules', required — Team routing rules resource type.

## Other responses

- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
