Routing Configs
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.
Action
The action to take when a rule matches.
type | string | The type of action to take when a rule matches. Required. | |
value | string | The value for the action. For service actions, this is the target Fastly service ID. Required. |
Draft diff
The differences between the draft and active versions of a routing config.
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. |
Draft request (update)
All attributes for updating the draft version.
comment | string | A freeform comment for the draft version. |
Initial version
Optional initial version payload to seed the new routing config with paths and rules in a single request.
activate | boolean | Whether to activate the initial version on creation. [Default false] | |
comment | string | A freeform comment for the initial version. | |
paths | array | The paths to create on the initial version. |
Initial version path
A path on the initial version, with its rules.
path | string | The URL path pattern, beginning with /. Maximum 2048 characters. Required. | |
rules | array | The rules to create on this path. |
Pagination metadata
Cursor-based pagination metadata.
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. |
Path change
Modifications to an existing path between versions.
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. |
Path request (create)
All attributes for creating a path.
path | string | The URL path pattern, beginning with /. Maximum 2048 characters. Required. |
Path response
All attributes for a path response.
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 /. Maximum 2048 characters. | |
updated_at | string | Date and time in ISO 8601 format. Read-only. |
Path request (update)
All attributes for updating a path.
path | string | The URL path pattern, beginning with /. Maximum 2048 characters. |
Path with rules
A path together with all of its rules.
path | object | All attributes for a path response. | |
rules | array |
Position
The position at which to place a new rule. At most one of before or after may be set. Cannot be used when creating a default (empty-conditions) rule.
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. |
Routing config request (create)
All attributes for creating a routing config.
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. Required. |
Condition
A condition that must be met for a rule to match.
key | string | The key to evaluate. For header conditions this is the header name. Required for header conditions. | |
operator | string | The comparison operator used to evaluate the condition. Required. | |
type | string | The type of condition. Required. | |
value | string | The value to compare against using the operator. Required. |
Routing config response
All attributes for a routing config response.
activated_at | string | Timestamp of when the version was most recently activated. null 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. |
Version response
All attributes for a routing config version response.
activated_at | string | Timestamp of when the version was most recently activated. null 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. |
Rule change
A modification to an existing rule's action between versions.
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. |
Rule request (create)
All attributes for creating a rule. A rule with an empty conditions array is the default (catch-all) rule for its path.
action | object | The action to take when a rule matches. Required. | |
conditions | array | The conditions a request must satisfy for this rule to match. An empty array indicates the default rule for the path. Required. | |
position | object | The position at which to place a new rule. At most one of before or after may be set. Cannot be used when creating a default (empty-conditions) rule. |
Rule response
All attributes for a rule response.
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. |
Rule request (update)
All attributes for updating a rule. At least one of action, conditions, or position must be provided.
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 before or after may be set. Cannot be used when creating a default (empty-conditions) rule. |
Endpoints
POST/domain-management/v1/routing-configs/config_id/versions/version_id/activate