---
title: Routing Configs
summary: >-
  Routing Configs define path-based routing rules that direct traffic to Fastly
  services based on URL path patterns and request conditions. A routing config
  is composed of one or more paths, each containing one or more rules that
  evaluate request conditions and select a destination service when matched.
url: >-
  https://www.fastly.com/documentation/reference/api/domain-management/routing-configs
---

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `type` | string | The type of action to take when a rule matches. |
| `value` | string | The value for the action. For <code>service</code> actions, this is the target Fastly service ID. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `added` | array | Paths that exist in the draft but not in the active version. |
| `deleted` | array | Paths that exist in the active version but not in the draft. |
| `modified` | array | Paths that exist in both versions but have changed. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `comment` | string | A freeform comment for the draft version. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `activate` | boolean | Whether to activate the initial version on creation. |
| `comment` | string | A freeform comment for the initial version. |
| `paths` | array | The paths to create on the initial version. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `path` | string | The URL path pattern, beginning with <code>/</code>. Maximum 2048 characters. |
| `rules` | array | The rules to create on this path. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `limit` | integer | The number of records returned per page. |
| `next_cursor` | string | Cursor value used to retrieve the next page of results. Empty if there are no more results. |
| `previous_cursor` | string | Cursor value used to retrieve the previous page of results. Empty if there is no previous page. |
| `sort` | string | The sort order applied to the results. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `old_path` | string | The previous path pattern, if it changed. |
| `path` | string | The current path pattern. |
| `path_id` | string | Alphanumeric string identifying the path. Stable across versions of the routing config. (Read-only) |
| `rules_added` | array | Rules that were added to this path. |
| `rules_changed` | array | Rules that were modified on this path. |
| `rules_deleted` | array | Rules that were removed from this path. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `path` | string | The URL path pattern, beginning with <code>/</code>. Maximum 2048 characters. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `id` | string | Alphanumeric string identifying the path. Stable across versions of the routing config. (Read-only) |
| `path` | string | The URL path pattern, beginning with <code>/</code>. Maximum 2048 characters. |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `path` | string | The URL path pattern, beginning with <code>/</code>. Maximum 2048 characters. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `path` | object | All attributes for a path response. |
| `rules` | array |  |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `after` | string | The id of the rule that this rule should be placed after. |
| `before` | string | The id of the rule that this rule should be placed before. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `initial_version` | object | Optional initial version payload to seed the new routing config with paths and rules in a single request. |
| `name` | string | The user-defined name for the routing config. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `key` | string | The key to evaluate. For <code>header</code> conditions this is the header name. Required for <code>header</code> conditions. |
| `operator` | string | The comparison operator used to evaluate the condition. |
| `type` | string | The type of condition. |
| `value` | string | The value to compare against using the operator. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `activated_at` | string | Timestamp of when the version was most recently activated. <code>null</code> if the version has never been activated. (Read-only) |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `id` | string | Alphanumeric string identifying the routing config. (Read-only) |
| `name` | string | The user-defined name for the routing config. |
| `state` | string | The current state of the routing config's versions. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `activated_at` | string | Timestamp of when the version was most recently activated. <code>null</code> if the version has never been activated. (Read-only) |
| `comment` | string | A freeform comment describing the version. |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `id` | string | Alphanumeric string identifying the version. (Read-only) |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `new_action` | object | The action to take when a rule matches. |
| `old_action` | object | The action to take when a rule matches. |
| `rule_id` | string | Alphanumeric string identifying the rule. Stable across versions of the routing config. (Read-only) |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `action` | object | The action to take when a rule matches. |
| `conditions` | array | The conditions a request must satisfy for this rule to match. An empty array indicates the default rule for the path. |
| `position` | object | The position at which to place a new rule. At most one of <code>before</code> or <code>after</code> may be set. Cannot be used when creating a default (empty-conditions) rule. |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `action` | object | The action to take when a rule matches. |
| `conditions` | array | The conditions a request must satisfy for this rule to match. Empty for the default rule. |
| `created_at` | string | Date and time in ISO 8601 format. (Read-only) |
| `id` | string | Alphanumeric string identifying the rule. Stable across versions of the routing config. (Read-only) |
| `is_default` | boolean | Whether this is the default (catch-all) rule for the path. (Read-only) |
| `updated_at` | string | Date and time in ISO 8601 format. (Read-only) |

## Data model

| Field | Type | Description |
|-------|------|-------------|
| `action` | object | The action to take when a rule matches. |
| `conditions` | array |  |
| `position` | object | The position at which to place a new rule. At most one of <code>before</code> or <code>after</code> may be set. Cannot be used when creating a default (empty-conditions) rule. |

## API endpoints

### List routing configs

**GET** `/domain-management/v1/routing-configs`

List all routing configs for the authenticated customer.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `cursor` | string | query | No | Cursor value from the <code>next_cursor</code> field of a previous response, used to retrieve the next page. To request the first page, this should be empty. |
| `limit` | integer | query | No | Limit how many results are returned. |
| `sort` | string | query | No | The order in which to list the results. |
| `state` | array | query | No | Filter configs by lifecycle state. Accepts a comma-separated list of state values (e.g. <code>?state=active,active-with-draft</code>). Returns only configs whose current state matches one of the provided values. Returns 400 if any value is not a recognised state. |

### Create a routing config

**POST** `/domain-management/v1/routing-configs`

Create a new routing config. An optional <code>initial_version</code> may be provided to seed the config with paths and rules in a single request, and may also be activated immediately.

### Get a routing config

**GET** `/domain-management/v1/routing-configs/{config_id}`

Retrieve a single routing config by its identifier.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |

### Delete a routing config

**DELETE** `/domain-management/v1/routing-configs/{config_id}`

Delete a routing config. By default, configs that have an active version cannot be deleted. Pass <code>force=true</code> to bypass the active-version check — this is destructive and will immediately stop traffic routing for any paths the config serves. The <code>force</code> parameter does <strong>not</strong> bypass the domain-association check; if domains are still associated, deletion is rejected with 409 regardless of <code>force</code>.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `force` | boolean | query | No | When <code>true</code>, allows deleting a routing config that has an active version. This is destructive — traffic routing for any paths served by the config will stop immediately. |

### List paths

**GET** `/domain-management/v1/routing-configs/{config_id}/paths`

List paths for the config. Returns paths from the active version if one exists, otherwise from the draft.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `cursor` | string | query | No | Cursor value from the <code>next_cursor</code> field of a previous response, used to retrieve the next page. To request the first page, this should be empty. |
| `limit` | integer | query | No | Limit how many results are returned. |
| `match` | string | query | No | How to match the value of the <code>path</code> filter against existing path patterns. Has no effect unless <code>path</code> is also provided. |
| `path` | string | query | No | Filter results by path pattern. The match strategy is controlled by the <code>match</code> parameter. |
| `sort` | string | query | No | The order in which to list the results. |

### Create a path

**POST** `/domain-management/v1/routing-configs/{config_id}/paths`

Add a new path to the config's draft version. If no draft exists, one is created automatically by cloning the active version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |

### Get a path

**GET** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}`

Retrieve a single path by its stable identifier.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |

### Delete a path

**DELETE** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}`

Delete a path from the config's draft version. If no draft exists, one is created automatically by cloning the active version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |

### Update a path

**PATCH** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}`

Update a path on the config's draft version. If no draft exists, one is created automatically by cloning the active version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |

### List rules

**GET** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}/rules`

List all rules for a path in evaluation order.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `cursor` | string | query | No | Cursor value from the <code>next_cursor</code> field of a previous response, used to retrieve the next page. To request the first page, this should be empty. |
| `limit` | integer | query | No | Limit how many results are returned. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |
| `sort` | string | query | No | The order in which to list the results. |

### Create a rule

**POST** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}/rules`

Add a new rule to a path on the config's draft version. If no draft exists, one is created automatically by cloning the active version. A rule with an empty <code>conditions</code> array is a default (catch-all) rule and there can be at most one default rule per path.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |

### Get a rule

**GET** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}/rules/{rule_id}`

Retrieve a single rule by its stable identifier.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |
| `rule_id` | string | path | Yes | Alphanumeric string identifying the rule. Stable across versions. |

### Delete a rule

**DELETE** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}/rules/{rule_id}`

Delete a rule from the config's draft version. If no draft exists, one is created automatically by cloning the active version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |
| `rule_id` | string | path | Yes | Alphanumeric string identifying the rule. Stable across versions. |

### Update a rule

**PATCH** `/domain-management/v1/routing-configs/{config_id}/paths/{path_id}/rules/{rule_id}`

Update a rule on the config's draft version. If no draft exists, one is created automatically by cloning the active version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `path_id` | string | path | Yes | Alphanumeric string identifying the path. Stable across versions. |
| `rule_id` | string | path | Yes | Alphanumeric string identifying the rule. Stable across versions. |

### Get the draft diff

**GET** `/domain-management/v1/routing-configs/{config_id}/draft/diff`

Compare the current draft version against the active version and return the paths and rules that have been added, modified, or deleted.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |

### Discard the draft

**DELETE** `/domain-management/v1/routing-configs/{config_id}/draft`

Delete the current draft version, reverting any unactivated changes.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |

### Update the draft

**PATCH** `/domain-management/v1/routing-configs/{config_id}/draft`

Update metadata on the draft version, such as its comment. If no draft exists, one is created automatically by cloning the active version.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |

### Activate the draft

**POST** `/domain-management/v1/routing-configs/{config_id}/activate`

Activate the current draft version. The previously active version, if any, becomes inactive but is retained in version history.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |

### Deactivate a routing config

**POST** `/domain-management/v1/routing-configs/{config_id}/deactivate`

Clear the active version designation. This is a bookkeeping operation only — it does not stop edge traffic. Minerva continues serving the last-activated version until the domain association is removed in Spotless. Only removing the routing config from the domain (via Spotless) triggers Neptune to drop the reference, which causes Minerva to stop fetching and eventually clean up the cached config. Idempotent: returns 200 even if already deactivated.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |

### List versions

**GET** `/domain-management/v1/routing-configs/{config_id}/versions`

List all versions for a routing config.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `cursor` | string | query | No | Cursor value from the <code>next_cursor</code> field of a previous response, used to retrieve the next page. To request the first page, this should be empty. |
| `limit` | integer | query | No | Limit how many results are returned. |
| `sort` | string | query | No | The order in which to list the results. |

### Reactivate a version

**POST** `/domain-management/v1/routing-configs/{config_id}/versions/{version_id}/activate`

Reactivate a previously-active version. The currently active version, if any, becomes inactive but is retained in version history.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
| `version_id` | string | path | Yes | Alphanumeric string identifying the version. |

### Delete inactive versions

**DELETE** `/domain-management/v1/routing-configs/{config_id}/versions/inactive`

Delete all inactive versions for a routing config. The currently active version, if any, is retained.

**Parameters:**

| Name | Type | In | Required | Description |
|------|------|----|---------|--------------|
| `config_id` | string | path | Yes | Alphanumeric string identifying the routing config. |
