> For the complete documentation index, see [llms.txt](https://integrations.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.impact.com/brand-api-reference/brand-api-reference-v12/reference/routing-rules/routing-rules.md).

# Routing Rules

## List All Routing Rules

> Returns a list of all routing rules for a specific program, with extensive filtering options.

```json
{"openapi":"3.1.0","info":{"title":"Brand API - Routing Rules","version":"v12"},"servers":[{"url":"https://api.impact.com"}],"paths":{"/Advertisers/{AccountSID}/Programs/{ProgramId}/BlockRedirectRules":{"get":{"summary":"List All Routing Rules","description":"Returns a list of all routing rules for a specific program, with extensive filtering options.","operationId":"listRoutingRules","tags":["Routing Rules"],"parameters":[{"name":"AccountSID","in":"path","required":true,"schema":{"type":"string"},"description":"Your unique Account SID."},{"name":"ProgramId","in":"path","required":true,"schema":{"type":"integer"},"description":"The ID of the program the rules belong to."},{"name":"Name","in":"query","schema":{"type":"string"}},{"name":"Condition","in":"query","description":"Filter rules by the type of condition that triggers them.","schema":{"type":"string","enum":["IP_ADDRESS","SHARED_ID","COUNTRY","REGION","AD_STATUS","SUB_ID1","SUB_ID2","SUB_ID3","MP_ID","DEVICE_TYPE","REF_URL","LANDING_PAGE","SKU","AD_ID","CURRENT_DATE","RANDOM","MOBILE_FALLBACK"]}},{"name":"Action","in":"query","schema":{"type":"string","enum":["REDIRECT","BLOCK","INTERSTITIAL"]}},{"name":"Rank","in":"query","schema":{"type":"string","enum":["HIGH","MEDIUM","LOW"]}},{"name":"State","in":"query","schema":{"type":"string","enum":["RUNNING","PAUSED","ENDED","ARCHIVED"]}},{"name":"StartDateBefore","in":"query","description":"Return routing rules that start before a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"StartDateAfter","in":"query","description":"Return routing rules that start after a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"EndDateBefore","in":"query","description":"Return routing rules that end before a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"EndDateAfter","in":"query","description":"Return routing rules that end after a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"DateLastUpdateBefore","in":"query","description":"Return routing rules that were last updated before a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"DateLastUpdatedAfter","in":"query","description":"Return routing rules that were last updated after a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"DateCreatedBefore","in":"query","description":"Return routing rules that were created before a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"DateCreatedAfter","in":"query","description":"Return routing rules that were created after a specific date and time (ISO 8601).","schema":{"type":"string","format":"date-time"}},{"name":"CreatedBy","in":"query","description":"Return routing rules that were created by a specific account user.","schema":{"type":"string"}},{"name":"LastUpdatedBy","in":"query","description":"Return routing rules that were last updated by a specific account user.","schema":{"type":"string"}},{"name":"Source","in":"query","description":"From where the routing rule was created. Possible values:\n- `GENERIC` — Created via the Create-a-routing-rule endpoint or the Blocking and Redirect Technical Settings screen.\n- `AD` — Created when an associated ad was created.\n- `COMPLIANCE` — Created as the result of a Compliance violation.\n- `TASK` — Created from the web app's Task Management system.","schema":{"type":"string"}}],"responses":{"200":{"description":"A paginated list of routing rule objects.","content":{"application/json":{"schema":{"type":"object","properties":{"BlockRedirectRules":{"type":"array","description":"The list of routing rule objects.","items":{"$ref":"#/components/schemas/RoutingRule"}}}}}}}}}}},"components":{"schemas":{"RoutingRule":{"type":"object","properties":{"Id":{"type":"string","description":"The unique identifier for the routing rule."},"Name":{"type":"string","description":"Name of the routing rule."},"Condition":{"type":"array","description":"What triggers the routing rule.","items":{"$ref":"#/components/schemas/RuleCondition"}},"Action":{"type":"string","description":"What traffic will experience if the routing rule is triggered.","enum":["REDIRECT","BLOCK","INTERSTITIAL"]},"RedirectUrl":{"type":"string","format":"uri","description":"The destination URL for REDIRECT-type rules."},"Interstitial":{"$ref":"#/components/schemas/Interstitial","description":"Interstitial page configuration for INTERSTITIAL-type rules."},"Rank":{"type":"string","description":"This determines the specific routing rule's rank in relation to others that have the same conditions.","enum":["HIGH","MEDIUM","LOW"]},"State":{"type":"string","description":"What state of use the routing rule is in.","enum":["RUNNING","PAUSED","ENDED","ARCHIVED"]},"StartDate":{"type":"string","format":"date-time","nullable":true,"description":"The date and time the rule becomes active."},"EndDate":{"type":"string","format":"date-time","nullable":true,"description":"The date and time the rule expires."},"Source":{"type":"string","description":"From where the routing rule was created.","enum":["GENERIC","AD","COMPLIANCE","TASK"]},"DateCreated":{"type":"string","format":"date-time","description":"The date and time the rule was created."},"DateLastUpdated":{"type":"string","format":"date-time","description":"The date and time the rule was last updated."},"CreatedBy":{"type":"string","description":"The account user that created the rule."},"LastUpdatedBy":{"type":"string","description":"The account user that last updated the rule."},"Uri":{"type":"string","format":"uri-reference","description":"The unique reference to this routing rule in the impact.com API."}}},"RuleCondition":{"type":"object","properties":{"SubConditions":{"type":"array","description":"A group of sub-conditions that must all be true for this condition to match (AND logic).","items":{"$ref":"#/components/schemas/SubCondition"}}}},"SubCondition":{"type":"object","properties":{"Variable":{"type":"string","description":"The variable to evaluate against.","enum":["IP_ADDRESS","SHARED_ID","COUNTRY","REGION","AD_STATUS","SUB_ID1","SUB_ID2","SUB_ID3","MP_ID","DEVICE_TYPE","REF_URL","LANDING_PAGE","SKU","AD_ID","CURRENT_DATE","RANDOM","MOBILE_FALLBACK"]},"Operator":{"type":"string","description":"How the variable is compared to the values.","enum":["CONTAINS","STARTS_WITH","ENDS_WITH","EQUALS","MATCHES","IP_RANGE","IN","NOT_CONTAINS","NOT_STARTS_WITH","NOT_ENDS_WITH","NOT_EQUALS","NOT_IN","REGEX","LT","GT"]},"Values":{"type":"array","description":"The values the variable is compared to.","items":{"type":"string"}}}},"Interstitial":{"type":"object","properties":{"HeaderText":{"type":"string","description":"Header text displayed on the interstitial page."},"BodyText":{"type":"string","description":"Body text displayed on the interstitial page."},"RequireUserAcknowledgement":{"type":"boolean","description":"Whether the user must acknowledge before continuing."},"ButtonText":{"type":"string","description":"Text shown on the acknowledgement button."},"ButtonColor":{"type":"string","description":"Color of the acknowledgement button."},"RequireUserInput":{"type":"boolean","description":"Whether the user must provide input before continuing."},"UserInputs":{"type":"array","description":"User input fields shown on the interstitial.","items":{"$ref":"#/components/schemas/InterstitialUserInput"}},"IncludeSkipOption":{"type":"boolean","description":"Whether to include a skip option."},"ShowPageAtLeastOnce":{"type":"boolean","description":"Whether the page must be shown at least once per session."},"CoBranded":{"type":"boolean","description":"Whether the interstitial is co-branded."},"CustomizeCss":{"type":"boolean","description":"Whether custom CSS is used."},"CustomCss":{"type":"string","description":"Custom CSS for styling the interstitial page."}}},"InterstitialUserInput":{"type":"object","properties":{"Variable":{"type":"string","description":"The variable the user input populates.","enum":["SHARED_ID","SUB_ID1","SUB_ID2","SUB_ID3","PARAM1","PARAM2","PARAM3","CUSTOMER_ID"]},"DisplayValue":{"type":"string","description":"Display label shown to the user."},"RegularExpression":{"type":"string","description":"Validation pattern for the input."},"ErrorMessage":{"type":"string","description":"Error message shown if validation fails."}}}}}}
```

## Retrieve a Routing Rule

> Retrieves the details of a single, existing routing rule by its unique ID.

```json
{"openapi":"3.1.0","info":{"title":"Brand API - Routing Rules","version":"v12"},"servers":[{"url":"https://api.impact.com"}],"paths":{"/Advertisers/{AccountSID}/Programs/{ProgramId}/BlockRedirectRules/{RuleId}":{"get":{"summary":"Retrieve a Routing Rule","description":"Retrieves the details of a single, existing routing rule by its unique ID.","operationId":"getRoutingRuleById","tags":["Routing Rules"],"parameters":[{"name":"AccountSID","in":"path","required":true,"description":"Your unique Account SID.","schema":{"type":"string"}},{"name":"ProgramId","in":"path","required":true,"description":"The ID of the program the rule belongs to.","schema":{"type":"integer"}},{"name":"RuleId","in":"path","required":true,"description":"The unique identifier for the routing rule.","schema":{"type":"integer"}}],"responses":{"200":{"description":"A single routing rule object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingRule"}}}}}}}},"components":{"schemas":{"RoutingRule":{"type":"object","properties":{"Id":{"type":"string","description":"The unique identifier for the routing rule."},"Name":{"type":"string","description":"Name of the routing rule."},"Condition":{"type":"array","description":"What triggers the routing rule.","items":{"$ref":"#/components/schemas/RuleCondition"}},"Action":{"type":"string","description":"What traffic will experience if the routing rule is triggered.","enum":["REDIRECT","BLOCK","INTERSTITIAL"]},"RedirectUrl":{"type":"string","format":"uri","description":"The destination URL for REDIRECT-type rules."},"Interstitial":{"$ref":"#/components/schemas/Interstitial","description":"Interstitial page configuration for INTERSTITIAL-type rules."},"Rank":{"type":"string","description":"This determines the specific routing rule's rank in relation to others that have the same conditions.","enum":["HIGH","MEDIUM","LOW"]},"State":{"type":"string","description":"What state of use the routing rule is in.","enum":["RUNNING","PAUSED","ENDED","ARCHIVED"]},"StartDate":{"type":"string","format":"date-time","nullable":true,"description":"The date and time the rule becomes active."},"EndDate":{"type":"string","format":"date-time","nullable":true,"description":"The date and time the rule expires."},"Source":{"type":"string","description":"From where the routing rule was created.","enum":["GENERIC","AD","COMPLIANCE","TASK"]},"DateCreated":{"type":"string","format":"date-time","description":"The date and time the rule was created."},"DateLastUpdated":{"type":"string","format":"date-time","description":"The date and time the rule was last updated."},"CreatedBy":{"type":"string","description":"The account user that created the rule."},"LastUpdatedBy":{"type":"string","description":"The account user that last updated the rule."},"Uri":{"type":"string","format":"uri-reference","description":"The unique reference to this routing rule in the impact.com API."}}},"RuleCondition":{"type":"object","properties":{"SubConditions":{"type":"array","description":"A group of sub-conditions that must all be true for this condition to match (AND logic).","items":{"$ref":"#/components/schemas/SubCondition"}}}},"SubCondition":{"type":"object","properties":{"Variable":{"type":"string","description":"The variable to evaluate against.","enum":["IP_ADDRESS","SHARED_ID","COUNTRY","REGION","AD_STATUS","SUB_ID1","SUB_ID2","SUB_ID3","MP_ID","DEVICE_TYPE","REF_URL","LANDING_PAGE","SKU","AD_ID","CURRENT_DATE","RANDOM","MOBILE_FALLBACK"]},"Operator":{"type":"string","description":"How the variable is compared to the values.","enum":["CONTAINS","STARTS_WITH","ENDS_WITH","EQUALS","MATCHES","IP_RANGE","IN","NOT_CONTAINS","NOT_STARTS_WITH","NOT_ENDS_WITH","NOT_EQUALS","NOT_IN","REGEX","LT","GT"]},"Values":{"type":"array","description":"The values the variable is compared to.","items":{"type":"string"}}}},"Interstitial":{"type":"object","properties":{"HeaderText":{"type":"string","description":"Header text displayed on the interstitial page."},"BodyText":{"type":"string","description":"Body text displayed on the interstitial page."},"RequireUserAcknowledgement":{"type":"boolean","description":"Whether the user must acknowledge before continuing."},"ButtonText":{"type":"string","description":"Text shown on the acknowledgement button."},"ButtonColor":{"type":"string","description":"Color of the acknowledgement button."},"RequireUserInput":{"type":"boolean","description":"Whether the user must provide input before continuing."},"UserInputs":{"type":"array","description":"User input fields shown on the interstitial.","items":{"$ref":"#/components/schemas/InterstitialUserInput"}},"IncludeSkipOption":{"type":"boolean","description":"Whether to include a skip option."},"ShowPageAtLeastOnce":{"type":"boolean","description":"Whether the page must be shown at least once per session."},"CoBranded":{"type":"boolean","description":"Whether the interstitial is co-branded."},"CustomizeCss":{"type":"boolean","description":"Whether custom CSS is used."},"CustomCss":{"type":"string","description":"Custom CSS for styling the interstitial page."}}},"InterstitialUserInput":{"type":"object","properties":{"Variable":{"type":"string","description":"The variable the user input populates.","enum":["SHARED_ID","SUB_ID1","SUB_ID2","SUB_ID3","PARAM1","PARAM2","PARAM3","CUSTOMER_ID"]},"DisplayValue":{"type":"string","description":"Display label shown to the user."},"RegularExpression":{"type":"string","description":"Validation pattern for the input."},"ErrorMessage":{"type":"string","description":"Error message shown if validation fails."}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://integrations.impact.com/brand-api-reference/brand-api-reference-v12/reference/routing-rules/routing-rules.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
