> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hadoseo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Routing Rule

> Fetch a single redirect or proxy rule by ID

```
GET /functions/v1/domains/{domainId}/routing-rules/{ruleId}
```

<Info>
  **Beta.** The routing rules endpoints are new and their response shapes may
  still change.
</Info>

Returns one [routing rule](/dashboard/routing-rules). Any role on the rule's domain (`owner`, `manager`, or `viewer`) can fetch it.

<Warning>
  Always call this endpoint from a **server-side environment** (backend API, serverless function, build script, etc.). Never include your API key in client-side code — it will be visible to anyone inspecting your frontend.
</Warning>

<Info>
  Programmatic (API key) access requires the **Pro plan and above** — requests
  from Starter accounts return `403 plan_upgrade_required`.
</Info>

## Request

### Headers

| Header          | Required | Description                    |
| --------------- | -------- | ------------------------------ |
| `Authorization` | Yes      | `Bearer hado_sk_your_key_here` |

### Path Parameters

| Parameter  | Type   | Required | Description                                                                                                                                                                 |
| ---------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `domainId` | string | Yes      | The ID of the domain the rule belongs to, from [List Domains](/api-reference/endpoint/list-domains).                                                                        |
| `ruleId`   | string | Yes      | The rule's ID, from [List Routing Rules](/api-reference/endpoint/list-routing-rules) or the response to [Create Routing Rule](/api-reference/endpoint/create-routing-rule). |

### Example Request

```bash theme={null}
curl https://api.hadoseo.com/functions/v1/domains/11111111-1111-1111-1111-111111111111/routing-rules/cccccccc-cccc-cccc-cccc-cccccccccccc \
  -H "Authorization: Bearer hado_sk_your_key_here"
```

## Response

### Success (200)

```json theme={null}
{
  "rule": {
    "ruleId": "cccccccc-cccc-cccc-cccc-cccccccccccc",
    "domainId": "11111111-1111-1111-1111-111111111111",
    "sourcePath": "/old-blog/*",
    "targetUrl": "/blog",
    "ruleType": "redirect",
    "redirectCode": 301,
    "priority": 0,
    "isActive": true,
    "notes": "Blog moved in the 2026 redesign",
    "createdAt": "2026-09-25T10:00:00.000Z",
    "updatedAt": "2026-09-25T10:00:00.000Z"
  }
}
```

| Field  | Type   | Description                                                                                  |
| ------ | ------ | -------------------------------------------------------------------------------------------- |
| `rule` | object | The rule. See [The rule object](/api-reference/endpoint/list-routing-rules#the-rule-object). |

### Error Responses

| Status | Body                                                                     | Description                                                                                                                                                   |
| ------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    | `{ "error": "invalid_request", "message": "..." }`                       | The `domainId` or `ruleId` in the path isn't a valid ID.                                                                                                      |
| 401    | `{ "error": "invalid_api_key" }`                                         | API key is missing, invalid, or revoked.                                                                                                                      |
| 403    | `{ "error": "plan_upgrade_required" }`                                   | Programmatic access requires the Pro plan or above.                                                                                                           |
| 404    | `{ "error": "domain_not_found" }`                                        | The domain in the path doesn't exist or your account can't access it.                                                                                         |
| 404    | `{ "error": "rule_not_found" }`                                          | No rule with this ID on this domain.                                                                                                                          |
| 429    | `{ "error": "rate_limit_exceeded_monthly", "usage": 300, "limit": 300 }` | Rate limit exceeded. The code is `rate_limit_exceeded_monthly` or `rate_limit_exceeded_per_minute` — match on the `rate_limit_exceeded` prefix to catch both. |
