---
title: "Get a Rule by ID"
method: GET
path: "/v1/Webhooks/Rules/{ruleId}"
tags: ["Rules"]
---

# Get a Rule by ID

`GET /v1/Webhooks/Rules/{ruleId}`

## Request

- Base URL: `https://webhooks.twilio.com`
- URL: `https://webhooks.twilio.com/v1/Webhooks/Rules/{ruleId}`
- Auth: HTTP basic

Returns a Rule by its ID, including matchType, match value, and current traffic distribution settings.

## Response `200`

Rule details

- union: URL matching rule that applies Settings to webhook requests. Rules are discriminated by matchType - each type has different required fields.
  - PrefixMatchRule: Rule that matches URLs starting with a prefix
    - `id` string, required: Unique Rule identifier (TypeID/TTID format)
    - `friendlyName` string: Human-readable name for identification
    - `description` string: Optional description of the Rule's purpose and usage
    - `matchType` 'PREFIX_MATCH', required
    - `settings` SettingReference[], required: Settings to apply with traffic distribution (percentages must sum to 100)
      - `settingId` string, required: Setting resource ID (TypeID format)
      - `percentage` integer, required: Percentage of traffic to route (all settings in rule must sum to 100)
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `prefix` string, required: URL prefix to match. Must be unique - only one rule per prefix allowed. Example: 'https://api.example.com/webhooks/'
  - ExactMatchRule: Rule that matches an exact URL
    - `id` string, required: Unique Rule identifier (TypeID/TTID format)
    - `friendlyName` string: Human-readable name for identification
    - `description` string: Optional description of the Rule's purpose and usage
    - `matchType` 'EXACT_MATCH', required
    - `settings` SettingReference[], required: Settings to apply with traffic distribution (percentages must sum to 100)
      - `settingId` string, required: Setting resource ID (TypeID format)
      - `percentage` integer, required: Percentage of traffic to route (all settings in rule must sum to 100)
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `value` string, required: Exact URL to match. Must be unique - only one rule per value allowed. Example: 'https://api.example.com/webhooks/voice/incoming'
  - DefaultRule: Rule that matches all incoming requests not matched by other rules. Only ONE default rule allowed per account. Evaluated only when no exact-match or prefix-match rule matches.
    - `id` string, required: Unique Rule identifier (TypeID/TTID format)
    - `friendlyName` string: Human-readable name for identification
    - `description` string: Optional description of the Rule's purpose and usage
    - `matchType` 'DEFAULT', required
    - `settings` SettingReference[], required: Settings to apply with traffic distribution (percentages must sum to 100)
      - `settingId` string, required: Setting resource ID (TypeID format)
      - `percentage` integer, required: Percentage of traffic to route (all settings in rule must sum to 100)
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `401`: Authentication failed
- `403`: Authenticated account does not have permission to perform this operation
- `404`: Rule not found
- `429`: Rate limit exceeded
- `500`: An unexpected server error occurred

---

[API](https://skmtc.dev/twilio/apis/webhooks-v1.md) - [All operations](https://skmtc.dev/twilio/apis/webhooks-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/twilio/apis/webhooks-v1/revisions/629b4cc3a029?raw)
