> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sailresearch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an egress policy

> Saves a named policy for your organization. Every secret named in the document must already exist. A saved policy's document cannot change after creation, but its name can.



## OpenAPI

````yaml /sailbox-openapi.json post /egress-policies
openapi: 3.1.0
info:
  title: Sail Sailbox API
  version: '2026-10-04'
  description: >-
    Create and operate Sailboxes over HTTP. Sailboxes are fast-booting virtual
    machines that you can pause, resume, and checkpoint.


    Run commands, stream files, manage lifecycle and networking, and inspect
    usage. Turning on SSH and building an image still require an SDK or the CLI.
    See the [HTTP API guide](/sailboxes-http-api).
servers:
  - url: https://sailbox-api.sailresearch.com/v1
security:
  - BearerAuth: []
tags:
  - name: Apps
    description: Groups that own Sailboxes. One app per workload.
  - name: Lifecycle
    description: >-
      A Sailbox's whole life: create it, watch it, stop and start it, terminate
      it.
  - name: Checkpoints
    description: Save a Sailbox to start from later, and copy a running one.
  - name: Exec
    description: Run commands and control their standard input and terminals.
  - name: Files
    description: Stream regular files into and out of a Sailbox.
  - name: Networking
    description: >-
      Publish ports, serve them on hostnames you own, and identify a Sailbox to
      other Sailboxes.
  - name: Secrets
    description: >-
      Organization values that egress policy rules can add to matching requests.
      Sail never returns a stored value.
  - name: Egress policies
    description: >-
      What a Sailbox may connect to, and what happens to the HTTPS requests it
      sends.
  - name: Volumes
    description: >-
      Shared storage that outlives any one Sailbox. Alpha: these endpoints can
      still change.
  - name: SSH access
    description: Certificates for connecting to a Sailbox with `ssh`.
  - name: Usage
    description: Resource usage and spend.
  - name: Identity
    description: Who your API key belongs to.
paths:
  /egress-policies:
    post:
      tags:
        - Egress policies
      summary: Create an egress policy
      description: >-
        Saves a named policy for your organization. Every secret named in the
        document must already exist. A saved policy's document cannot change
        after creation, but its name can.
      operationId: createEgressPolicy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEgressPolicyRequest'
            example:
              name: github
              document:
                allowlist:
                  - github.com
                  - api.github.com
                rules:
                  api.github.com:
                    - request:
                        set:
                          headers:
                            authorization: Bearer ${secrets.GITHUB_TOKEN}
      responses:
        '201':
          description: The policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EgressPolicy'
          headers:
            Location:
              description: Path of the new policy.
              schema:
                type: string
                pattern: >-
                  ^/v1/egress-policies/ep_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
        '400':
          description: >-
            The request was rejected. See the error message for the offending
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: name is required
                  type: invalid_request_error
                  param: null
                  code: null
        '401':
          description: The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: Invalid API key
                  type: authentication_error
                  param: null
                  code: invalid_api_key
        '402':
          description: >-
            The organization is out of credits. The error carries a
            `billing_url` pointing at the page where you add them. Retry once
            you have.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: >-
                    Your API key has been disabled due to insufficient credits.
                    Visit https://app.sailresearch.com/billing to add credits.
                  type: billing_error
                  param: null
                  code: credits_exhausted
                  billing_url: https://app.sailresearch.com/billing
        '403':
          description: The API key is not allowed to perform this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: sailboxes require an organization-scoped API key
                  type: permission_error
                  param: null
                  code: null
        '413':
          description: >-
            The encoded request body is larger than 72 KiB. A document over its
            own 64 KiB limit inside a smaller body is rejected with `400`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: request body too large
                  type: invalid_request_error
                  param: null
                  code: null
        '429':
          description: >-
            For its first ten minutes a new organization is capped on how many
            requests it can have in flight at once, and yours is over that cap.
            The request never started, so retry it unchanged after the delay in
            the `Retry-After` header. The limit clears as those requests finish.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: >-
                    Too many concurrent requests. Please retry after some of
                    your organization's in-flight requests complete.
                  type: rate_limit_error
                  param: null
                  code: rate_limited
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: create egress policy failed
                  type: server_error
                  param: null
                  code: null
        '503':
          description: >-
            Sail is momentarily unavailable. Retry after the delay in the
            `Retry-After` header when one is present, and with backoff
            otherwise.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  message: Authentication service unavailable
                  type: server_error
                  param: null
                  code: null
          headers:
            Retry-After:
              $ref: '#/components/headers/RetryAfter'
components:
  schemas:
    CreateEgressPolicyRequest:
      type: object
      additionalProperties: false
      required:
        - name
        - document
      properties:
        name:
          type: string
          minLength: 1
          pattern: >-
            ^(?=[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[^\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000])[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[^\u0000-\u001F\u007F-\u009F]+[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          description: >-
            Display name. It does not need to be unique. It must contain visible
            text and cannot contain tabs, line breaks, or other control
            characters. At most 128 characters after surrounding whitespace is
            trimmed.
        document:
          $ref: '#/components/schemas/EgressPolicyDocument'
    EgressPolicy:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          pattern: >-
            ^(?:ep|hp)_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
          description: Stable policy ID.
        org_id:
          type: string
          description: Organization that owns the policy.
        name:
          type: string
          description: Display name.
        document:
          $ref: '#/components/schemas/EgressPolicyDocument'
        created_at:
          type: string
          format: date-time
          description: When the policy was created.
        updated_at:
          type: string
          format: date-time
          description: When the policy name last changed.
      required:
        - id
        - org_id
        - name
        - document
        - created_at
        - updated_at
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
    EgressPolicyDocument:
      type: object
      additionalProperties: false
      properties:
        no_network:
          type: boolean
          description: >-
            Remove all network access, inbound included; no other field may be
            set beside it. Leave it out (or send `false`) otherwise.
            https://docs.sailresearch.com/reference/egress-policy#no-network
        allowlist:
          oneOf:
            - type: array
              items:
                type: string
              maxItems: 128
            - type: 'null'
          description: >-
            The destinations the Sailbox may connect to. Leave it out (or send
            `null`) to allow every destination; an empty list allows none.
            https://docs.sailresearch.com/reference/egress-policy#entries
        blocked:
          oneOf:
            - type: array
              items:
                type: string
              maxItems: 128
            - type: 'null'
          description: >-
            Destinations removed from what the Sailbox may otherwise reach.
            Leave it out, or send `null` or `[]`, to block nothing.
            https://docs.sailresearch.com/reference/egress-policy#blocked
        rules:
          $ref: '#/components/schemas/EgressPolicyRules'
          description: >-
            What happens to the HTTPS requests sent to each host: change the
            request, forward it, or answer it. Leave it out to apply no rules.
            https://docs.sailresearch.com/reference/egress-policy#rules
        missing_alpn:
          type: object
          propertyNames:
            pattern: >-
              ^[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?![0-9A-Za-z.\u0130\u212A-]{254})[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?(?:\.[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?)*[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          additionalProperties:
            type: string
            enum:
              - http/1.1
          description: >-
            Rarely needed: the HTTP version to assume for an exact host under
            `rules` when a client on a port other than 443 does not announce
            one.
            https://docs.sailresearch.com/reference/egress-policy#missing-alpn
        env:
          type: object
          maxProperties: 100
          propertyNames:
            pattern: ^(?![Ss][Aa][Ii][Ll][Bb][Oo][Xx]_)[A-Za-z_][A-Za-z0-9_]{0,127}$
          additionalProperties:
            oneOf:
              - type: string
                pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$
              - type: object
                additionalProperties: false
                required:
                  - secret
                properties:
                  secret:
                    type: string
                    pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$
                  placeholder_prefix:
                    type: string
                    pattern: ^[A-Za-z0-9_-]{1,16}$
                    description: Text the placeholder starts with. Defaults to `sail_ph_`.
          description: >-
            Environment variables every command in the Sailbox gets, each
            holding a placeholder for the named secret. Every secret here must
            be named by a `request.replace`, and the reverse. Saved policies
            only. https://docs.sailresearch.com/reference/egress-policy#env
        oidc_identity_tokens:
          type: array
          maxItems: 10
          items:
            type: object
            additionalProperties: false
            required:
              - audience
              - path
            properties:
              audience:
                type: string
                pattern: ^[!-~]{1,512}$
                description: The token's `aud` claim.
              path:
                type: string
                pattern: ^/run/sailbox/oidc/[A-Za-z0-9][A-Za-z0-9._-]{0,63}$
                description: >-
                  The file in the Sailbox that holds the token. It must be
                  directly in `/run/sailbox/oidc/`, and no two tokens may share
                  it.
          description: >-
            Identity tokens Sail signs for the Sailbox. Each token is in the
            file at its `path`, which Sail rewrites before the token expires.
            Saved policies only.
            https://docs.sailresearch.com/sailboxes-identity-tokens
        tls_config:
          type: object
          maxProperties: 100
          propertyNames:
            pattern: >-
              ^[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?:\*(?:\.(?![0-9A-Za-z.\u0130\u212A-]{254})[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?(?:\.[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?)*)?|(?![0-9A-Za-z.\u0130\u212A-]{254})[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?(?:\.[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?)*)[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          additionalProperties:
            $ref: '#/components/schemas/EgressPolicyTLSConfig'
          description: >-
            Host patterns, written as under `rules`, mapped to the CAs Sail
            trusts and the client certificate it presents when connecting to
            them.
            https://docs.sailresearch.com/reference/egress-policy#tls-config
      description: >-
        An egress policy: what a Sailbox may connect to (`no_network`,
        `allowlist`, and `blocked`) and what happens to the HTTPS requests it
        sends (`rules`). Every field is optional. The empty document `{}` allows
        every destination and applies no rules. Sail saves a normalized form
        (for example, host names are lowercased and defaults are filled in), so
        reading a policy back can return a different shape with the same
        behavior. At most 64 KiB when encoded. Guide:
        https://docs.sailresearch.com/sailboxes-egress-policy
    ErrorObject:
      type: object
      required:
        - message
        - type
        - param
        - code
      properties:
        message:
          type: string
          description: Human-readable description of what went wrong.
        type:
          type: string
          description: >-
            Error category: `invalid_request_error`, `authentication_error`,
            `permission_error`, `billing_error`, `not_found_error`,
            `conflict_error`, `rate_limit_error`, `quota_exceeded_error`,
            `not_implemented_error`, or `server_error`.
        param:
          oneOf:
            - type: string
            - type: 'null'
          description: >-
            The request field the error refers to, when the error is about one
            field.
        code:
          oneOf:
            - type: string
            - type: integer
            - type: 'null'
          description: >-
            Stable short code for the error, when one applies. Errors relayed
            from the Sailbox runtime carry its status token, for example
            `already_exists` or `failed_precondition` on a 409, which the HTTP
            status alone does not distinguish.
        billing_url:
          type: string
          format: uri
          description: Page where you add credits. Sent with a 402.
      additionalProperties: true
    EgressPolicyRules:
      type: object
      maxProperties: 100
      propertyNames:
        pattern: >-
          ^[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?:\*(?:\.(?![0-9A-Za-z.\u0130\u212A-]{254})[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?(?:\.[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?)*)?|(?![0-9A-Za-z.\u0130\u212A-]{254})[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?(?:\.[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?)*)[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
      additionalProperties:
        type: array
        minItems: 1
        maxItems: 100
        items:
          $ref: '#/components/schemas/EgressPolicyRule'
        description: Rules for this host, in the order Sail tests them.
      description: >-
        Host patterns mapped to the rules for HTTPS requests to them. Use an
        exact hostname, `*.example.com` for every host below it at any depth, or
        `*` for any host without a more specific entry. An exact entry wins over
        a wildcard, and the nearest wildcard over a wider one. A hostname is at
        most 253 characters. A document can hold at most 100 host patterns and
        100 rules in total.
    EgressPolicyTLSConfig:
      type: object
      additionalProperties: false
      anyOf:
        - required:
            - trusted_cas
        - required:
            - client_certificate
      dependentRequired:
        client_certificate:
          - client_key
        client_key:
          - client_certificate
      description: How Sail connects to a host over HTTPS.
      properties:
        trusted_cas:
          type: string
          description: >-
            PEM CA certificates. Sail trusts only these for the host, in place
            of the public CAs.
        client_certificate:
          type: string
          description: >-
            PEM client certificate, leaf first, then any intermediates. Sail
            presents it when the host asks for one.
        client_key:
          type: string
          pattern: ^\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\}$
          description: >-
            `${secrets.NAME}`: the secret holding the client certificate's PEM
            private key.
    EgressPolicyRule:
      type: object
      additionalProperties: false
      description: >-
        One rule. Rules run in order and the first match decides the result.
        Only the last rule may omit `match`. Use `respond` by itself, or combine
        `forward` and `request` as needed.
      properties:
        match:
          $ref: '#/components/schemas/EgressPolicyRequestMatch'
        respond:
          $ref: '#/components/schemas/EgressPolicyResponse'
        forward:
          $ref: '#/components/schemas/EgressPolicyForward'
        request:
          $ref: '#/components/schemas/EgressPolicyRequestChange'
      not:
        anyOf:
          - required:
              - respond
              - forward
          - required:
              - respond
              - request
    EgressPolicyRequestMatch:
      type: object
      additionalProperties: false
      description: >-
        Conditions tested against the request before any changes are made. At
        least one condition is required.
      anyOf:
        - required:
            - method
        - required:
            - path
        - required:
            - headers
          properties:
            headers:
              minItems: 1
        - required:
            - query
          properties:
            query:
              minItems: 1
      properties:
        method:
          description: >-
            One or more case-sensitive HTTP methods, such as `GET`, as a single
            string or a nonempty list of strings.
          oneOf:
            - type: string
              maxLength: 4096
              pattern: ^[0-9A-Za-z!#$%&'*+\-.^_`|~]+$
            - type: array
              minItems: 1
              items:
                type: string
                maxLength: 4096
                pattern: ^[0-9A-Za-z!#$%&'*+\-.^_`|~]+$
        path:
          $ref: '#/components/schemas/EgressPolicyPathMatcher'
          description: Matches an absolute request path. Each value must start with `/`.
        headers:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/EgressPolicyHeaderNameValueMatcher'
          description: Header conditions. Every entry must match.
        query:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/EgressPolicyQueryNameValueMatcher'
          description: Query parameter conditions. Every entry must match.
    EgressPolicyResponse:
      type: object
      additionalProperties: false
      required:
        - status
      description: >-
        A response Sail returns in place of the destination. The request is not
        sent on.
      properties:
        status:
          type: integer
          minimum: 200
          maximum: 599
          description: HTTP status code to return.
        headers:
          type: object
          propertyNames:
            pattern: >-
              ^(?![\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?:[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Kk\u212A][Ee][Ee][Pp]-[Aa][Ll][Ii\u0130][Vv][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii\u0130][Cc][Aa][Tt][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Oo][Rr][Ii\u0130][Zz][Aa][Tt][Ii\u0130][Oo][Nn]|[Pp][Rr][Oo][Xx][Yy]-[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Tt][Ee]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg]|[Uu][Pp][Gg][Rr][Aa][Dd][Ee])[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$)[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[0-9A-Za-z!#$%&'*+\-.^_`|~\u0130\u212A]{1,128}[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          additionalProperties:
            description: >-
              One string or a nonempty list of strings. Each string is limited
              to 4096 bytes of UTF-8.
            oneOf:
              - type: string
                maxLength: 4096
                pattern: >-
                  ^(?:(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$(?!\{))*|(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$\$)*)$
              - type: array
                minItems: 1
                items:
                  type: string
                  maxLength: 4096
                  pattern: >-
                    ^(?:(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$(?!\{))*|(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$\$)*)$
          description: >-
            Headers to return. Secret references are not allowed here.
            Sail-managed headers such as `host` and `content-length` cannot be
            set, and a header name is at most 128 characters.
        body:
          type: string
          maxLength: 65536
          pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          description: >-
            Response body, up to 64 KiB as UTF-8. Secret references are not
            allowed here.
      allOf:
        - if:
            properties:
              status:
                enum:
                  - 204
                  - 304
          then:
            not:
              required:
                - body
    EgressPolicyForward:
      type: object
      additionalProperties: false
      required:
        - host
      description: Another HTTPS host to send the request to.
      properties:
        host:
          type: string
          pattern: >-
            ^[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?![0-9A-Za-z.\u0130\u212A-]{254})[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?(?:\.[A-Za-z0-9\u0130\u212A](?:[A-Za-z0-9\u0130\u212A-]{0,61}[A-Za-z0-9\u0130\u212A])?)*[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          description: >-
            Exact hostname, without a scheme, port, or wildcard. At most 253
            characters after surrounding whitespace is trimmed.
        port:
          type: integer
          minimum: 0
          maximum: 65535
          description: HTTPS port. Omit it, or send `0`, to use 443.
    EgressPolicyRequestChange:
      type: object
      additionalProperties: false
      minProperties: 1
      description: >-
        Changes to make before sending the request. A header, query parameter,
        path, or body field can be targeted only once in a rule, and a rule
        edits a JSON body or a form body, not both.
      properties:
        set:
          $ref: '#/components/schemas/EgressPolicySetChange'
        add:
          $ref: '#/components/schemas/EgressPolicyAddChange'
        remove:
          $ref: '#/components/schemas/EgressPolicyRemoveChange'
        replace:
          $ref: '#/components/schemas/EgressPolicyReplaceChange'
    EgressPolicyPathMatcher:
      description: >-
        A plain string means an exact match. Use `equals`, `prefix`, or `one_of`
        to choose the matching rule explicitly. Every value must start with `/`.
        Each string is limited to 4096 bytes of UTF-8. Secret references are not
        allowed in matchers.
      oneOf:
        - type: string
          maxLength: 4096
          pattern: ^/(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - equals
          properties:
            equals:
              type: string
              maxLength: 4096
              pattern: ^/(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - prefix
          properties:
            prefix:
              type: string
              maxLength: 4096
              pattern: ^/(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - one_of
          properties:
            one_of:
              type: array
              minItems: 1
              items:
                type: string
                maxLength: 4096
                pattern: ^/(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
    EgressPolicyHeaderNameValueMatcher:
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        name:
          $ref: '#/components/schemas/EgressPolicyHeaderNameMatcher'
          description: Matches the header name.
        value:
          $ref: '#/components/schemas/EgressPolicyMatcher'
          description: Matches its value.
        present:
          type: boolean
          description: >-
            Set to `false` with `name` to match when that name is absent. When
            omitted or true, each name or value condition you provide must be
            present and match.
      anyOf:
        - required:
            - name
        - required:
            - value
      allOf:
        - if:
            required:
              - present
            properties:
              present:
                const: false
          then:
            required:
              - name
            not:
              required:
                - value
    EgressPolicyQueryNameValueMatcher:
      type: object
      additionalProperties: false
      minProperties: 1
      properties:
        name:
          $ref: '#/components/schemas/EgressPolicyMatcher'
          description: Matches the query parameter name.
        value:
          $ref: '#/components/schemas/EgressPolicyMatcher'
          description: Matches its value.
        present:
          type: boolean
          description: >-
            Set to `false` with `name` to match when that name is absent. When
            omitted or true, each name or value condition you provide must be
            present and match.
      anyOf:
        - required:
            - name
        - required:
            - value
      allOf:
        - if:
            required:
              - present
            properties:
              present:
                const: false
          then:
            required:
              - name
            not:
              required:
                - value
    EgressPolicySetChange:
      type: object
      additionalProperties: false
      description: >-
        Values to replace or create. At least one of `path`, `headers`, `query`,
        `json`, or `form` must name a target.
      anyOf:
        - required:
            - path
        - required:
            - headers
          properties:
            headers:
              minProperties: 1
        - required:
            - query
          properties:
            query:
              minProperties: 1
        - required:
            - json
          properties:
            json:
              minProperties: 1
        - required:
            - form
          properties:
            form:
              minProperties: 1
      properties:
        path:
          type: string
          maxLength: 4096
          pattern: ^/(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          description: Replacement absolute path. Secret references are not allowed here.
        headers:
          type: object
          propertyNames:
            pattern: >-
              ^(?![\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?:[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Kk\u212A][Ee][Ee][Pp]-[Aa][Ll][Ii\u0130][Vv][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii\u0130][Cc][Aa][Tt][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Oo][Rr][Ii\u0130][Zz][Aa][Tt][Ii\u0130][Oo][Nn]|[Pp][Rr][Oo][Xx][Yy]-[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Tt][Ee]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg]|[Uu][Pp][Gg][Rr][Aa][Dd][Ee])[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$)[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[0-9A-Za-z!#$%&'*+\-.^_`|~\u0130\u212A]{1,128}[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          additionalProperties:
            description: >-
              One string or a nonempty list of strings. Each string is limited
              to 4096 bytes of UTF-8.
            oneOf:
              - type: string
                maxLength: 4096
                pattern: >-
                  ^(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$\$|\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\})*$
              - type: array
                minItems: 1
                items:
                  type: string
                  maxLength: 4096
                  pattern: >-
                    ^(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$\$|\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\})*$
          description: >-
            Headers to set. Values may include `${secrets.NAME}` for a secret
            that already exists in your organization. Write a literal dollar
            sign as `$$`. Sail-managed headers such as `host` and
            `content-length` cannot be set, and a header name is at most 128
            characters.
        query:
          type: object
          propertyNames:
            minLength: 1
            maxLength: 4096
            pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          additionalProperties:
            description: >-
              One string or a nonempty list of strings. Each string is limited
              to 4096 bytes of UTF-8.
            oneOf:
              - type: string
                maxLength: 4096
                pattern: >-
                  ^(?:[^$\r\n]|\$\$|\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\})*$
              - type: array
                minItems: 1
                items:
                  type: string
                  maxLength: 4096
                  pattern: >-
                    ^(?:[^$\r\n]|\$\$|\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\})*$
          description: >-
            Query parameters to set. Values may include `${secrets.NAME}` for a
            secret that already exists in your organization. Write a literal
            dollar sign as `$$`.
        json:
          type: object
          propertyNames:
            maxLength: 4096
            pattern: ^(?:/(?:[^~/]|~[01])*)+$
          additionalProperties:
            type: string
            maxLength: 4096
            pattern: >-
              ^(?:[^$\r\n]|\$\$|\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\})*$
          description: >-
            String values to set in a JSON request body, keyed by JSON Pointer.
            Missing parent objects are created. Values may include
            `${secrets.NAME}`. The request must have a JSON body of at most 8
            MiB with no Content-Encoding, or it fails with status 502.
            https://docs.sailresearch.com/reference/egress-policy#request-bodies
        form:
          type: object
          propertyNames:
            minLength: 1
            maxLength: 4096
            pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          additionalProperties:
            description: >-
              One string or a nonempty list of strings. Each string is limited
              to 4096 bytes of UTF-8.
            oneOf:
              - type: string
                maxLength: 4096
                pattern: >-
                  ^(?:[^$\r\n]|\$\$|\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\})*$
              - type: array
                minItems: 1
                items:
                  type: string
                  maxLength: 4096
                  pattern: >-
                    ^(?:[^$\r\n]|\$\$|\$\{secrets\.[A-Za-z0-9][A-Za-z0-9_-]{0,127}\})*$
          description: >-
            Fields to set in a form-encoded request body. Values may include
            `${secrets.NAME}`. The request must have a form-encoded body of at
            most 8 MiB with no Content-Encoding, or it fails with status 502.
            https://docs.sailresearch.com/reference/egress-policy#request-bodies
    EgressPolicyAddChange:
      type: object
      additionalProperties: false
      description: >-
        Values to append. Secret references are not allowed here. At least one
        of the two maps must be nonempty.
      anyOf:
        - required:
            - headers
          properties:
            headers:
              minProperties: 1
        - required:
            - query
          properties:
            query:
              minProperties: 1
      properties:
        headers:
          type: object
          propertyNames:
            pattern: >-
              ^(?![\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?:[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Kk\u212A][Ee][Ee][Pp]-[Aa][Ll][Ii\u0130][Vv][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii\u0130][Cc][Aa][Tt][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Oo][Rr][Ii\u0130][Zz][Aa][Tt][Ii\u0130][Oo][Nn]|[Pp][Rr][Oo][Xx][Yy]-[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Tt][Ee]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg]|[Uu][Pp][Gg][Rr][Aa][Dd][Ee])[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$)[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[0-9A-Za-z!#$%&'*+\-.^_`|~\u0130\u212A]{1,128}[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          additionalProperties:
            description: >-
              One string or a nonempty list of strings. Each string is limited
              to 4096 bytes of UTF-8.
            oneOf:
              - type: string
                maxLength: 4096
                pattern: >-
                  ^(?:(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$(?!\{))*|(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$\$)*)$
              - type: array
                minItems: 1
                items:
                  type: string
                  maxLength: 4096
                  pattern: >-
                    ^(?:(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$(?!\{))*|(?:[^\u0000-\u0008\u000A-\u001F\u007F$]|\$\$)*)$
          description: >-
            Headers to append. Sail-managed headers such as `host` and
            `content-length` cannot be changed, and a header name is at most 128
            characters.
        query:
          type: object
          propertyNames:
            minLength: 1
            maxLength: 4096
            pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          additionalProperties:
            description: >-
              One string or a nonempty list of strings. Each string is limited
              to 4096 bytes of UTF-8.
            oneOf:
              - type: string
                maxLength: 4096
                pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
              - type: array
                minItems: 1
                items:
                  type: string
                  maxLength: 4096
                  pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          description: Query parameters to append.
    EgressPolicyRemoveChange:
      type: object
      additionalProperties: false
      description: >-
        Header and query parameter names to remove. At least one of the two
        lists must be nonempty.
      anyOf:
        - required:
            - headers
          properties:
            headers:
              minItems: 1
        - required:
            - query
          properties:
            query:
              minItems: 1
      properties:
        headers:
          type: array
          uniqueItems: true
          items:
            type: string
            pattern: >-
              ^(?![\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?:[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Kk\u212A][Ee][Ee][Pp]-[Aa][Ll][Ii\u0130][Vv][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii\u0130][Cc][Aa][Tt][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Oo][Rr][Ii\u0130][Zz][Aa][Tt][Ii\u0130][Oo][Nn]|[Pp][Rr][Oo][Xx][Yy]-[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Tt][Ee]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg]|[Uu][Pp][Gg][Rr][Aa][Dd][Ee])[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$)[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[0-9A-Za-z!#$%&'*+\-.^_`|~\u0130\u212A]{1,128}[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          description: >-
            Header names to remove. Sail-managed headers such as `host` and
            `content-length` cannot be changed, and a header name is at most 128
            characters.
        query:
          type: array
          uniqueItems: true
          items:
            type: string
            minLength: 1
            maxLength: 4096
            pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          description: Query parameter names to remove.
    EgressPolicyReplaceChange:
      type: object
      additionalProperties: false
      minProperties: 1
      description: >-
        Request fields mapped to the `env` secret whose placeholder they may
        carry. A field holding exactly that placeholder, or a header holding a
        scheme and the placeholder, is sent with the secret in its place.
        https://docs.sailresearch.com/reference/egress-policy#env
      properties:
        headers:
          type: object
          propertyNames:
            pattern: >-
              ^(?![\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*(?:[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Kk\u212A][Ee][Ee][Pp]-[Aa][Ll][Ii\u0130][Vv][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Ee][Nn][Tt][Ii\u0130][Cc][Aa][Tt][Ee]|[Pp][Rr][Oo][Xx][Yy]-[Aa][Uu][Tt][Hh][Oo][Rr][Ii\u0130][Zz][Aa][Tt][Ii\u0130][Oo][Nn]|[Pp][Rr][Oo][Xx][Yy]-[Cc][Oo][Nn][Nn][Ee][Cc][Tt][Ii\u0130][Oo][Nn]|[Tt][Ee]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg]|[Uu][Pp][Gg][Rr][Aa][Dd][Ee])[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$)[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*[0-9A-Za-z!#$%&'*+\-.^_`|~\u0130\u212A]{1,128}[\t-\r\u0020\u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]*$
          additionalProperties:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$
          description: Header names.
        query:
          type: object
          propertyNames:
            minLength: 1
            maxLength: 4096
            pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          additionalProperties:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$
          description: Query parameter names.
        json:
          type: object
          propertyNames:
            maxLength: 4096
            pattern: ^(?:/(?:[^~/]|~[01])*)+$
          additionalProperties:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$
          description: JSON Pointers into a JSON request body.
        form:
          type: object
          propertyNames:
            minLength: 1
            maxLength: 4096
            pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
          additionalProperties:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$
          description: Field names in a form-encoded request body.
    EgressPolicyHeaderNameMatcher:
      description: >-
        A plain string means an exact match. Use `equals`, `prefix`, or `one_of`
        to choose the matching rule explicitly. Each string is limited to 4096
        bytes of UTF-8. Secret references are not allowed in matchers. The
        Sail-managed names `content-length`, `host`, `trailer`, and
        `transfer-encoding` are rejected in every matching form.
      oneOf:
        - type: string
          maxLength: 4096
          pattern: >-
            ^(?!(?:[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg])$)(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - equals
          properties:
            equals:
              type: string
              maxLength: 4096
              pattern: >-
                ^(?!(?:[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg])$)(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - prefix
          properties:
            prefix:
              type: string
              maxLength: 4096
              pattern: >-
                ^(?!(?:[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg])$)(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - one_of
          properties:
            one_of:
              type: array
              minItems: 1
              items:
                type: string
                maxLength: 4096
                pattern: >-
                  ^(?!(?:[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Ll][Ee][Nn][Gg][Tt][Hh]|[Hh][Oo][Ss][Tt]|[Tt][Rr][Aa][Ii\u0130][Ll][Ee][Rr]|[Tt][Rr][Aa][Nn][Ss][Ff][Ee][Rr]-[Ee][Nn][Cc][Oo][Dd][Ii\u0130][Nn][Gg])$)(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
    EgressPolicyMatcher:
      description: >-
        A plain string means an exact match. Use `equals`, `prefix`, or `one_of`
        to choose the matching rule explicitly. Each string is limited to 4096
        bytes of UTF-8. Secret references are not allowed in matchers.
      oneOf:
        - type: string
          maxLength: 4096
          pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - equals
          properties:
            equals:
              type: string
              maxLength: 4096
              pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - prefix
          properties:
            prefix:
              type: string
              maxLength: 4096
              pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
        - type: object
          additionalProperties: false
          required:
            - one_of
          properties:
            one_of:
              type: array
              minItems: 1
              items:
                type: string
                maxLength: 4096
                pattern: ^(?:(?:[^$]|\$(?!\{))*|(?:[^$\r\n]|\$\$)*)$
  headers:
    RetryAfter:
      description: >-
        How many seconds to wait before retrying. On a 429 it also means the
        request never started, so the retry can reuse the same
        `Idempotency-Key`.
      schema:
        type: integer
        minimum: 0
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````