---
title: "POST /responder-gateway/{gatewayId}/link/{linkId}/routing-rule"
method: POST
path: "/responder-gateway/{gatewayId}/link/{linkId}/routing-rule"
---

# POST /responder-gateway/{gatewayId}/link/{linkId}/routing-rule

`POST /responder-gateway/{gatewayId}/link/{linkId}/routing-rule`

Creates a routing rule for a link.

Routing rules use priority-based evaluation where lower priority numbers are evaluated first. Each rule specifies conditions that must all match for the rule to apply.

## Path parameters

- `gatewayId` string, required
- `linkId` string, required

## Request body

- object
  - `clientToken` string, required — <p>Specifies a unique, case-sensitive identifier that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
  - `priority` integer, required — WAF-style evaluation priority. Lower number = evaluated first (priority 1 before 10). Gaps are allowed (1, 10, 20 is valid). Must be between 1 and 1000 inclusive. Uniqueness per link among non-deleted rules is enforced at the API layer (HTTP 409 on conflict).
  - `conditions` object, required — The conditions for a routing rule. All specified fields must match for the rule to apply (AND logic). At least one condition field must be set.
    - `hostHeader` string — The exact host header value to match.
    - `hostHeaderWildcard` string — A wildcard pattern for host header matching (for example, <code>*.example.com</code>).
    - `pathPrefix` string — The path prefix to match. The request path must start with this value. Must start with <code>/</code>.
    - `pathExact` string — The exact path to match. Must start with <code>/</code>.
    - `queryStringEquals` object — A query string key-value pair that must be present and match exactly.
      - `key` string, required — The key of the query string parameter to match. Must contain only RFC 3986 unreserved characters.
      - `value` string, required — The value of the query string parameter to match. Must contain only RFC 3986 unreserved characters.
    - `queryStringExists` string — A query string key that must be present in the request (any value is accepted).
  - `tags` object — A map of the key-value pairs of the tag or tags to assign to the resource.

## Response `200`

Success

- CreateLinkRoutingRuleResponse
  - `ruleId` string, required — The unique identifier of the routing rule.
  - `status` 'CREATION_IN_PROGRESS' | 'ACTIVE' | 'UPDATE_IN_PROGRESS' | 'DELETION_IN_PROGRESS' | 'DELETED' | 'FAILED', required — The status of the routing rule.
  - `createdAt` string, date-time, required — The timestamp of when the routing rule was created.

## Other responses

- `480` — ServiceQuotaExceededException
- `481` — ResourceNotFoundException
- `482` — ThrottlingException
- `483` — AccessDeniedException
- `484` — ConflictException
- `485` — InternalServerException
- `486` — ValidationException

---

[API](https://skmtc.net/aws/apis/rtbfabric.md) · [All operations](https://skmtc.net/aws/apis/rtbfabric/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/rtbfabric/versions/9fa17cecba3a/schema)
