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

# Replace



## OpenAPI

````yaml https://raw.githubusercontent.com/ngrok/ngrok-openapi/refs/heads/main/ngrok.yaml put /edges/https/{edge_id}/routes/{id}/saml
openapi: 3.0.0
info:
  title: ngrok OpenAPI
  version: 1.0.0
  description: >
    The ngrok REST API at https://api.ngrok.com provides programmatic access to
    provision and configure every ngrok resource: endpoints, domains, API keys,
    IP policies, tunnels, certificates, and more. Full documentation:
    https://ngrok.com/docs/api


    **Authentication:** Send an API key as a bearer token: "Authorization:
    Bearer {API key}". Create and revoke keys at
    https://dashboard.ngrok.com/api-keys or via the /api_keys resource. Requests
    without credentials receive an error with code ERR_NGROK_200.


    **Versioning and deprecation policy:** Every request must include the
    "ngrok-version: 2" header; a missing header returns HTTP 400 with error code
    ERR_NGROK_218. Version 2 is the current version; all earlier versions are
    deprecated. ngrok never makes breaking changes to a published API version.
    Breaking changes ship only as a new version that clients explicitly opt in
    to via this header. Additive changes (new resources, methods, and fields,
    and bug fixes that match documented behavior) may ship to a live version.
    Full policy: https://ngrok.com/docs/api#versioning-and-api-stability


    **Rate limits:** By default, the API allows 120 requests per rolling
    60-second window per account; some plans have higher limits. Exceeding the
    limit returns HTTP 429 with error code ERR_NGROK_226; wait for the window to
    pass before retrying. Details: https://ngrok.com/docs/errors/err_ngrok_226


    **Errors:** Every 4xx and 5xx response carries the Error schema: the
    status_code, a human-readable msg, and in most cases a globally unique
    machine-readable error_code and a details object. Every error code is
    documented at https://ngrok.com/docs/errors
servers:
  - url: https://api.ngrok.com
security:
  - authentication: []
paths:
  /edges/https/{edge_id}/routes/{id}/saml:
    put:
      tags:
        - EdgeRouteSAMLModule
      summary: Replace
      operationId: EdgeRouteSamlModuleReplace
      parameters:
        - $ref: '#/components/parameters/ngrokVersion'
        - name: edge_id
          in: path
          required: true
          schema:
            type: string
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EdgeRouteSAMLReplace'
      responses:
        '200':
          description: n/a
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndpointSAML'
        4XX:
          $ref: '#/components/responses/Error'
        5XX:
          $ref: '#/components/responses/Error'
components:
  parameters:
    ngrokVersion:
      name: ngrok-version
      in: header
      required: true
      schema:
        type: integer
        default: 2
  schemas:
    EdgeRouteSAMLReplace:
      type: object
      properties:
        edge_id:
          description: n/a
          type: string
        id:
          description: n/a
          type: string
        module:
          $ref: '#/components/schemas/EndpointSAMLMutate'
          description: n/a
    EndpointSAML:
      type: object
      properties:
        enabled:
          description: >
            `true` if the module will be applied to traffic, `false` to disable.
            default `true` if unspecified
          type: boolean
        options_passthrough:
          description: >
            Do not enforce authentication on HTTP OPTIONS requests. necessary if
            you are supporting CORS.
          type: boolean
        cookie_prefix:
          description: >
            the prefix of the session cookie that ngrok sets on the http client
            to cache authentication. default is 'ngrok.'
          type: string
        inactivity_timeout:
          description: >
            Integer number of seconds of inactivity after which if the user has
            not accessed the endpoint, their session will time out and they will
            be forced to reauthenticate.
          type: integer
        maximum_duration:
          description: >
            Integer number of seconds of the maximum duration of an
            authenticated session. After this period is exceeded, a user must
            reauthenticate.
          type: integer
        idp_metadata:
          description: >
            The full XML IdP EntityDescriptor. Your IdP may provide this to you
            as a a file to download or as a URL.
          type: string
        force_authn:
          description: >
            If true, indicates that whenever ngrok redirects a user to the IdP
            for authentication that the IdP must prompt the user for
            authentication credentials even if the user already has a valid
            session with the IdP.
          type: boolean
        allow_idp_initiated:
          description: >
            If true, the IdP may initiate a login directly (for example, the
            user does not need to visit the endpoint first and then be
            redirected). The IdP should set the `RelayState` parameter to the
            target URL of the resource they want the user to be redirected to
            after the SAML login assertion has been processed.
          type: boolean
        authorized_groups:
          description: >
            If present, only users who are a member of one of the listed groups
            may access the target endpoint.
          type: array
          items:
            type: string
        entity_id:
          description: >
            The SP Entity's unique ID. This always takes the form of a URL. In
            ngrok's implementation, this URL is the same as the metadata URL.
            This will need to be specified to the IdP as configuration.
          type: string
        assertion_consumer_service_url:
          description: >
            The public URL of the SP's Assertion Consumer Service. This is where
            the IdP will redirect to during an authentication flow. This will
            need to be specified to the IdP as configuration.
          type: string
        single_logout_url:
          description: >
            The public URL of the SP's Single Logout Service. This is where the
            IdP will redirect to during a single logout flow. This will
            optionally need to be specified to the IdP as configuration.
          type: string
        request_signing_certificate_pem:
          description: >
            PEM-encoded x.509 certificate of the key pair that is used to sign
            all SAML requests that the ngrok SP makes to the IdP. Many IdPs do
            not support request signing verification, but ngrok highly
            recommends specifying this in the IdP's configuration if it is
            supported.
          type: string
        metadata_url:
          description: >
            A public URL where the SP's metadata is hosted. If an IdP supports
            dynamic configuration, this is the URL it can use to retrieve the SP
            metadata.
          type: string
        nameid_format:
          description: >
            Defines the name identifier format the SP expects the IdP to use in
            its assertions to identify subjects. If unspecified, a default value
            of `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent` will be
            used. A subset of the allowed values enumerated by the SAML
            specification are supported.
          type: string
    EndpointSAMLMutate:
      type: object
      properties:
        enabled:
          description: >
            `true` if the module will be applied to traffic, `false` to disable.
            default `true` if unspecified
          type: boolean
        options_passthrough:
          description: >
            Do not enforce authentication on HTTP OPTIONS requests. necessary if
            you are supporting CORS.
          type: boolean
        cookie_prefix:
          description: >
            the prefix of the session cookie that ngrok sets on the http client
            to cache authentication. default is 'ngrok.'
          type: string
        inactivity_timeout:
          description: >
            Integer number of seconds of inactivity after which if the user has
            not accessed the endpoint, their session will time out and they will
            be forced to reauthenticate.
          type: integer
        maximum_duration:
          description: >
            Integer number of seconds of the maximum duration of an
            authenticated session. After this period is exceeded, a user must
            reauthenticate.
          type: integer
        idp_metadata:
          description: >
            The full XML IdP EntityDescriptor. Your IdP may provide this to you
            as a a file to download or as a URL.
          type: string
        force_authn:
          description: >
            If true, indicates that whenever ngrok redirects a user to the IdP
            for authentication that the IdP must prompt the user for
            authentication credentials even if the user already has a valid
            session with the IdP.
          type: boolean
        allow_idp_initiated:
          description: >
            If true, the IdP may initiate a login directly (for example, the
            user does not need to visit the endpoint first and then be
            redirected). The IdP should set the `RelayState` parameter to the
            target URL of the resource they want the user to be redirected to
            after the SAML login assertion has been processed.
          type: boolean
        authorized_groups:
          description: >
            If present, only users who are a member of one of the listed groups
            may access the target endpoint.
          type: array
          items:
            type: string
        nameid_format:
          description: >
            Defines the name identifier format the SP expects the IdP to use in
            its assertions to identify subjects. If unspecified, a default value
            of `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent` will be
            used. A subset of the allowed values enumerated by the SAML
            specification are supported.
          type: string
    Error:
      type: object
      description: >
        The error body every api.ngrok.com 4xx and 5xx response returns. Every
        error condition has a globally unique, documented error code; see
        https://ngrok.com/docs/errors
      required:
        - status_code
        - msg
      properties:
        error_code:
          description: >
            Globally unique machine-readable error code, for example
            ERR_NGROK_226. Each code is documented at
            https://ngrok.com/docs/errors/reference. Omitted on transport-level
            errors such as a plain 404 for an unknown path.
          type: string
        status_code:
          description: |
            The HTTP status code of the response, duplicated in the body.
          type: integer
        msg:
          description: |
            Human-readable description of the error and how to resolve it.
          type: string
        details:
          description: >
            Additional error context. details.operation_id identifies the failed
            request when contacting support.
          type: object
          additionalProperties:
            type: string
  responses:
    Error:
      description: >
        An error. The body carries a machine-readable error_code and a
        human-readable msg; every code is documented at
        https://ngrok.com/docs/errors. A 429 with error code ERR_NGROK_226 means
        the account exceeded the documented request-rate limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    authentication:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.