---
title: "Pause a space's traffic rules"
method: POST
path: "/v1/spaces/{spaceId}/rules/pause"
tags: ["Spaces"]
---

# Pause a space's traffic rules

`POST /v1/spaces/{spaceId}/rules/pause`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/rules/pause`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.spacefast.com/v1/auth/oauth2/authorize`, token URL `https://api.spacefast.com/v1/auth/oauth2/token`; client credentials, token URL `https://api.spacefast.com/v1/auth/oauth2/token`, scopes: `spaces:write`)

Parks every rule at the edge and keeps the space paused, so a rule it declares later is parked as it arrives. The space serves as if it declared none. The rules are kept, so resume puts them back without the author writing them again.

## Path parameters

- `spaceId` string, required

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` TrafficRules, required: A space's traffic rules and what the edge is doing with them.
    - `rules` TrafficRuleState[], required: The space's rules, in the order the edge reads them.
      - `id` string, required: Spacefast's id for this rule.
      - `name` string, required: The rule's name at the edge, derived from what it does.
      - `handle` string, nullable, required: The name the author gave the rule, or null when they gave it none.
      - `kind` 'firewall' | 'cacheBypass' | 'redirect' | 'rewrite' | 'header', required: What the rule does.
      - `origin` 'file' | 'config' | 'overlay' | 'platform', required: Where the rule was declared: `file` in the space's own source, `config` in the live version's config, `overlay` in the space settings, `platform` by Spacefast.
      - `sourceRef` string, nullable, required: The config the rule was read from, for a rule a version declared.
      - `placement` 'edge' | 'origin', required: Where the rule runs. `edge` answers before the request reaches the space.
      - `placementReason` string, nullable, required: Why the rule runs at the space instead of the edge, or null for a rule that runs at the edge. `placement_off`: this space does not run its rules at the edge, so nothing about the rule was judged. Every other code is an `edge_ineligible_*` one, and says what about the rule the edge could not carry. `edge_ineligible_capture`: the rule captures part of the path, or its destination uses a capture. `edge_ineligible_condition`: it matches on a request fact the edge would read differently from the space, such as a country, a cookie, a query string, or the user agent. `edge_ineligible_destination`: it sends the visitor to another origin. `edge_ineligible_status`: its redirect status is not 301, 302, 307, or 308. `edge_ineligible_shadowed`: a published file already answers that path and the rule is not forced. `edge_ineligible_order`: an earlier rule that stayed at the space could answer the same request first. `edge_ineligible_reentry`: it is a rewrite, and the space has to match its own rules against the rewritten path. `edge_ineligible_proxy`: it proxies to another origin. `edge_ineligible_not_found`: it answers 404. `edge_ineligible_path_preservation`: it is a whole-host redirect, and the edge cannot carry the path across. `edge_ineligible_platform_header`: it sets or removes a header the platform owns. `edge_ineligible_header_folds`: more than one rule sets the same header, and the space folds them where the edge would replace. `edge_ineligible_quota`: the space has more placeable rules than the edge holds.
      - `desiredState` 'enabled' | 'disabled' | 'suspended', required: What the rule is meant to do. `suspended` is a paused space's parked rule.
      - `edgeState` 'pending' | 'live' | 'invalid' | 'over_quota' | 'failed' | 'unknown', required: What the edge last said about the rule. `pending` means the edge accepted it and is still applying it; `over_quota` means the space has more rules than the edge allows and this one was left off.
      - `definition` union, required: The rule as its author wrote it. Null for a rule the edge still holds but the space no longer declares: the next reconcile removes it, and there is no authored rule left to show.
        - object: Blocks or challenges requests before they reach the space.
          - `name` string: Name for this rule: lowercase letters, digits, `-` and `_`, up to 61 characters. Names the rule in the CLI and the API.
          - `description` string: What this rule is for.
          - `action` 'block' | 'challenge', required: `block` answers without reaching the space; `challenge` asks for proof of a human.
          - `status` integer: Status a blocked request gets. Defaults to 403. Blocks only.
          - `match` TrafficRuleMatch, required: Request attributes the rule looks at. At least one.
            - `path` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `host` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `method` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `ip` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `country` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `asn` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `userAgent` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `referer` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `header` object: Per-name conditions: { "x-api-client": { "op": "exists" } }.
            - `cookie` object: Per-name conditions: { "x-api-client": { "op": "exists" } }.
            - `query` object: Per-name conditions: { "x-api-client": { "op": "exists" } }.
            - `extension` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `ja3` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `ja4` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
          - `any` boolean: Fire when any match field holds. Defaults to false: all of them have to.
        - object: Serves matching requests fresh instead of from the cache.
          - `name` string: Name for this rule: lowercase letters, digits, `-` and `_`, up to 61 characters. Names the rule in the CLI and the API.
          - `description` string: What this rule is for.
          - `match` TrafficRuleMatch, required: Request attributes the rule looks at. At least one.
            - `path` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `host` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `method` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `ip` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `country` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `asn` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `userAgent` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `referer` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `header` object: Per-name conditions: { "x-api-client": { "op": "exists" } }.
            - `cookie` object: Per-name conditions: { "x-api-client": { "op": "exists" } }.
            - `query` object: Per-name conditions: { "x-api-client": { "op": "exists" } }.
            - `extension` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `ja3` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
            - `ja4` union: What the field has to match. A string with a `*` in it matches as a wildcard, any other string matches exactly, and a list matches any of its values. An `ip` value with a `/` in it matches a CIDR range. Everything else is an explicit clause: { "op": "exists" }, { "op": "contains", "value": "bot" }, { "op": "in", "values": ["RU"], "not": true }.
              - …
          - `any` boolean: Fire when any match field holds. Defaults to false: all of them have to.
        - TrafficRuleRoutingDefinition: A redirect or header rule: what it matches, and what it does.
          - `source` string, required: The path the rule matches.
          - `destination` string: Where a redirect sends the request.
          - `status` integer: The status a redirect answers with.
          - `headers` string[]: The response header names a header rule sets or removes.
          - `force` boolean: True when a redirect answers even if a published file can serve its source. Absent on a header rule.
          - `query` object: The query parameters a redirect matches, each mapped to the capture name it fills. Absent when the rule matches on the path only.
          - `conditional` boolean: True when the rule also matches on a country, a language, a cookie, or the user agent. Only a `_redirects` line can state those, so a rule with this flag cannot be written in the space settings.
      - `lastError` object, nullable, required: Why the edge refused the rule, or null.
        - `code` string, required
        - `message` string, required
    - `quota` object, nullable, required: How many rules this space has at the edge and how many it may have. Null means the space has no edge yet, so there is no allowance to spend. `stale: false` is the edge's own answer; `stale: true` is our record of it, because the edge did not answer.
      - `used` integer, required: Rules this space currently has at the edge.
      - `limit` integer, nullable, required: Rules the edge allows this space. Null when the edge could not be read, because the allowance is the edge's to state and this platform does not know it.
      - `stale` boolean, required: True when the edge could not be reached, so these numbers are this platform's own record rather than the edge's answer.
    - `paused` boolean, required: True while the space is paused. A paused space serves as if it declared none, and a rule it declares while paused is parked as it arrives.
    - `hostnames` string[], required: The hostnames these rules answer on.
    - `collapsed` CollapsedTrafficRule[], required: Rules the space declares that the edge never got, and why.
      - `ruleName` string, required: The rule's name at the edge.
      - `origin` 'file' | 'config' | 'overlay' | 'platform', required: Where the rule was declared: `file` in the space's own source, `config` in the live version's config, `overlay` in the space settings, `platform` by Spacefast.
      - `reason` 'fingerprint' | 'name', required: `fingerprint`: an earlier rule already does the same thing. `name`: an earlier rule already has this name.

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
