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

# Set Screening Routing

> Set the order your workspace's v3 address screens try providers in; every provider other than Range needs your own connection for it.

Send `provider_order`: the providers to try, in order. A screen asks them one by one and stops at the first that answers. See [how a screen follows the order](https://docs.range.org/risk-api/risk-v3/bring-your-own-key.md#how-a-screen-follows-your-order).

```bash theme={null}
curl -X PATCH https://api.range.org/v3/risk/config \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"provider_order": ["chainalysis", "range"]}'
```

Rules for the order:

| Rule | Error when broken |
| - | - |
| `range` is in the order, at any position. | 400 `provider_order_range_required` |
| Each provider appears at most once. | 400 `provider_order_duplicate` |
| Every id is a provider from [List Screening Providers](https://docs.range.org/risk-api/risk-v3/list-providers.md) you can screen with. | 400 `invalid_request` |
| Every provider other than `range` has your workspace's own connection. Create it with [Create account connection](https://docs.range.org/platform-api/reference/v2/post-account-connections.md). | 409 `provider_connection_required` |
| Send `provider_order` or `screening_provider`, not both and not neither. | 400 `provider_order_invalid` |

`screening_provider` is deprecated but still accepted: a provider other than `range` means `["<provider>", "range"]`, and `range` means `["range"]`.

The response is the new setting, in the same shape as [Get Screening Routing](https://docs.range.org/risk-api/risk-v3/get-config.md). The order applies to every screen your workspace makes after it, from any key.

Deleting a connection later does not change the order. Screens then skip that provider, its result reads `outcome: provider-missing`, and [Get Screening Routing](https://docs.range.org/risk-api/risk-v3/get-config.md) warns you.

This call is free. Screens on your own key still cost Range credits. See [Credits](https://docs.range.org/risk-api/risk-v3/credits.md).


## OpenAPI

````yaml api-reference/risk-api.json patch /v3/risk/config
openapi: 3.0.0
info:
  title: Range Risk API
  description: The Range Risk API for risk assessment of crypto addresses.
  version: 1.7.39
  contact: {}
servers:
  - url: https://api.range.org
    description: Range API Server
security:
  - Authorization: []
  - Bearer: []
tags:
  - name: Risk
    description: Get risk information about a crypto address.
  - name: Risk v2
    description: >-
      Address risk assessment, workspace configuration, and signals catalogue
      (API v2).
  - name: Simulator
    description: Simulate a transaction on a network.
paths:
  /v3/risk/config:
    patch:
      tags:
        - Risk v3
      summary: Set v3 routing configuration
      description: >-
        Sets the order screens try providers in: `provider_order`, each provider
        at most once, `range` included. Every provider other than Range needs
        the workspace’s own connection for it (POST /v2/account-connections);
        without one the request is a 409. Deleting a connection later does not
        change the order: screens then skip that provider, and its result reads
        `outcome: provider-missing`. `screening_provider` is still accepted (a
        provider means `[provider, "range"]`); send one of the two. Free: this
        call costs no credits. Screens on the workspace’s own key still cost
        Range credits.
      operationId: patchRoutingConfig
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchRiskV3ConfigDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RiskV3ConfigDto'
        '400':
          description: >-
            An unknown provider (`invalid_request`), a provider listed twice
            (`provider_order_duplicate`), an order without `range`
            (`provider_order_range_required`), or both or neither of
            `provider_order` and `screening_provider`
            (`provider_order_invalid`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RiskV3ErrorResponseDto'
        '401':
          description: >-
            Missing or invalid credentials. A key that was checked and refused
            carries `code: unauthorized`. A request refused before it reaches
            the route (no API key at all, or an incomplete session) carries no
            `code`: handle it by its status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RiskV3ErrorResponseCodeOptionalDto'
        '409':
          description: >-
            The workspace holds no connection for a provider in the order
            (`provider_connection_required`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RiskV3ErrorResponseDto'
        '429':
          description: Too many requests for this key (`rate_limited`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RiskV3ErrorResponseDto'
        '500':
          description: >-
            Unexpected failure; retry later. An error Range raised itself
            carries `code: internal_error`; any other carries only `statusCode`
            and `message`. Nothing is charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RiskV3ErrorResponseCodeOptionalDto'
components:
  schemas:
    PatchRiskV3ConfigDto:
      type: object
      properties:
        provider_order:
          type: array
          example:
            - range
          description: >-
            The order to try providers in. Each at most once, `range` included;
            every other provider needs the workspace’s own connection.
          items:
            type: string
            description: A provider id from GET /v3/risk/providers.
        screening_provider:
          type: string
          example: range
          deprecated: true
          description: >-
            Deprecated: use `provider_order`. A provider other than Range means
            `[provider, "range"]`. A provider id from GET /v3/risk/providers.
    RiskV3ConfigDto:
      type: object
      properties:
        provider_order:
          type: array
          x-extensible-enum: true
          example:
            - range
          description: >-
            The order this workspace’s screens try providers in. The first
            provider that can answer does; the rest are not asked. `range` is
            always in the order.
          items:
            $ref: '#/components/schemas/ServableScreeningProviderId'
        screening_provider:
          x-extensible-enum: true
          example: range
          deprecated: true
          description: >-
            Deprecated: use `provider_order`. The first provider other than
            Range in the order, or `range` when it lists none.
          allOf:
            - $ref: '#/components/schemas/ServableScreeningProviderId'
        warnings:
          example: []
          description: >-
            What callers must know for this order to work as expected: that a
            provider screens one network per call, so `network` must be passed
            whenever the address format does not name one chain; or that a
            provider in the order has no connection, so screens skip it. Empty
            when the order is Range alone.
          type: array
          items:
            type: string
        providers:
          description: >-
            Every provider Range supports and whether this workspace has
            connected it (the same list as GET /v3/risk/providers).
          type: array
          items:
            $ref: '#/components/schemas/RiskProviderDto'
      required:
        - provider_order
        - screening_provider
        - warnings
        - providers
    RiskV3ErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: >-
            network is required for this address: its format does not name one
            chain
          description: >-
            Human-readable and fixed per cause; a list when several query
            parameters failed validation. Do not parse it: branch on `code`.
        code:
          x-extensible-enum: true
          example: network_required
          description: >-
            Stable machine code for the cause. Open list: handle a code you do
            not know by its HTTP status.
          allOf:
            - $ref: '#/components/schemas/RiskV3ErrorCode'
        retry_after_seconds:
          type: integer
          nullable: true
          example: null
          description: >-
            Seconds until a retry can succeed, also sent as the `Retry-After`
            header. Null when retrying will not help or the wait is unknown.
      required:
        - statusCode
        - error
        - message
        - code
        - retry_after_seconds
    RiskV3ErrorResponseCodeOptionalDto:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: >-
            network is required for this address: its format does not name one
            chain
          description: >-
            Human-readable and fixed per cause; a list when several query
            parameters failed validation. Do not parse it: branch on `code`.
        error:
          type: string
          example: Bad Request
        code:
          x-extensible-enum: true
          example: network_required
          description: >-
            Stable machine code for the cause. Open list: handle a code you do
            not know by its HTTP status.
          allOf:
            - $ref: '#/components/schemas/RiskV3ErrorCode'
        retry_after_seconds:
          type: integer
          nullable: true
          example: null
          description: >-
            Seconds until a retry can succeed, also sent as the `Retry-After`
            header. Null when retrying will not help or the wait is unknown.
      required:
        - statusCode
        - message
    ServableScreeningProviderId:
      type: string
      description: >-
        A provider id, as listed by GET /v3/risk/providers. Open list: Range may
        add values without a new contract version. Handle a value you do not
        know, never reject the response.
    RiskProviderDto:
      type: object
      properties:
        id:
          x-extensible-enum: true
          example: range
          allOf:
            - $ref: '#/components/schemas/ScreeningProviderId'
        name:
          type: string
          example: Range
        connectable:
          type: boolean
          example: true
          description: >-
            Whether a workspace can connect its own key for this provider. Range
            itself needs none.
        maturity:
          x-extensible-enum: true
          example: live_verified
          description: >-
            `live_verified`: checked against the provider’s live answers.
            `documented`: built from the provider’s published documentation and
            not yet checked live; its results carry a warning. `coming_soon`:
            not connectable yet.
          allOf:
            - $ref: '#/components/schemas/RiskProviderMaturity'
        key_check:
          x-extensible-enum: true
          nullable: true
          example: null
          description: >-
            When a connected key is checked: `probe`, when the connection is
            created; `first_screen`, by the first screen. Null when the provider
            takes no key.
          allOf:
            - $ref: '#/components/schemas/RiskProviderKeyCheck'
        credential_fields:
          type: array
          items:
            $ref: '#/components/schemas/RiskProviderCredentialFieldDto'
        docs_url:
          type: string
          example: null
          nullable: true
        connected:
          type: boolean
          example: false
          description: Whether this workspace holds a connection for the provider.
      required:
        - id
        - name
        - connectable
        - maturity
        - key_check
        - credential_fields
        - docs_url
        - connected
    RiskV3ErrorCode:
      type: string
      enum:
        - invalid_request
        - invalid_address
        - network_required
        - network_address_mismatch
        - unsupported_network
        - x_address_unsupported
        - invalid_cursor
        - invalid_idempotency_key
        - idempotency_key_reuse
        - idempotency_in_progress
        - invalid_time_range
        - unauthorized
        - forbidden
        - screen_not_found
        - not_found
        - provider_connection_required
        - provider_order_duplicate
        - provider_order_range_required
        - provider_order_invalid
        - providers_invalid
        - providers_duplicate
        - provider_unauthorized
        - rate_limited
        - network_monthly_limit
        - provider_unavailable
        - network_capacity_exhausted
        - network_not_covered
        - range_unavailable
        - all_providers_failed
        - internal_error
      description: >-
        Open list: Range may add values without a new contract version. Handle a
        value you do not know (for example as "other"), never reject the
        response.
      x-extensible-enum: true
    ScreeningProviderId:
      type: string
      description: >-
        A provider id, as listed by GET /v3/risk/providers. Open list: Range may
        add values without a new contract version. Handle a value you do not
        know, never reject the response.
    RiskProviderMaturity:
      type: string
      enum:
        - live_verified
        - documented
        - coming_soon
      description: >-
        Open list: Range may add values without a new contract version. Handle a
        value you do not know (for example as "other"), never reject the
        response.
      x-extensible-enum: true
    RiskProviderKeyCheck:
      type: string
      enum:
        - probe
        - first_screen
      description: >-
        Open list: Range may add values without a new contract version. Handle a
        value you do not know (for example as "other"), never reject the
        response.
      x-extensible-enum: true
    RiskProviderCredentialFieldDto:
      type: object
      properties:
        name:
          type: string
          example: api_key
          description: >-
            Field name inside the `<provider id>` object of POST
            /v2/account-connections (for example `api_key`).
        label:
          type: string
          example: API key
        secret:
          type: boolean
          example: true
          description: 'Write-only: never returned once stored.'
        optional:
          type: boolean
          example: true
          description: True when the field may be left out; absent means required.
      required:
        - name
        - label
        - secret
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Authorization method required to allow user to access the api endpoints.
    Bearer:
      type: http
      scheme: bearer
      description: 'Pass the API key as a bearer token (Authorization: Bearer <api-key>).'

````

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