> ## Documentation Index
> Fetch the complete documentation index at: https://yuno-3979e326-2026-05-13-universal-sdk-proposal.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Routing

> Replaces the routing's full configuration.

Replaces the routing's full configuration. The body has the same shape as [Create a Routing](/reference/organizations/routing/create-routing) — the new `default_route` and `condition_sets[]` entirely supersede the previous live state. **There is no field-level merge.**

`account_code` and `payment_method` are sticky to the `routing_id` — they're set at creation and cannot be changed by `PATCH`.

### Path Parameters

<ParamField path="routing_id" type="string" required>
  The id returned by [Create a Routing](/reference/organizations/routing/create-routing).
</ParamField>

### Response

<ResponseField name="id" type="string">
  Unique identifier for the routing.
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl --request PATCH \
       --url https://api.y.uno/v1/routing/{routing_id} \
       --header 'Content-Type: application/json' \
       --header 'X-Idempotency-Key: <UUID>' \
       --header 'private-secret-key: <YOUR_SECRET_KEY>' \
       --header 'public-api-key: <YOUR_PUBLIC_KEY>' \
       --data '
  {
    "name": "Updated Card routing",
    "default_route": {
      "steps": [
        {
          "index": 1,
          "provider_id": "ADYEN",
          "connection_id": "b2c4d5e6-1a2b-3c4d-5e6f-7a8b9c0d1e2f"
        }
      ]
    }
  }
  '
  ```

  ```json Response Example theme={null}
  {
    "id": "r_8f2c1d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f",
    "account_code": "acc-uuid",
    "payment_method": "CARD",
    "name": "Updated Card routing",
    "default_route": {
      "steps": [
        { "index": 1, "provider_id": "ADYEN", "connection_id": "b2c4d5e6-1a2b-3c4d-5e6f-7a8b9c0d1e2f" }
      ]
    },
    "created_at": "2026-05-12T14:30:00Z",
    "updated_at": "2026-05-12T15:00:00Z"
  }
  ```
</CodeGroup>

### Errors

| HTTP  | `code`                             | When                                                                  |
| ----- | ---------------------------------- | --------------------------------------------------------------------- |
| `404` | `ROUTING_NOT_FOUND`                | Unknown `routing_id`, or id belongs to a different account.           |
| `400` | `ROUTING_VALIDATION_FAILED`        | Schema or rule violation.                                             |
| `400` | `ROUTING_PROVIDER_NOT_AVAILABLE`   | A step references an inactive/unknown connection.                     |
| `400` | `ROUTING_PAYMENT_METHOD_IMMUTABLE` | Body's `payment_method` doesn't match the routing's `payment_method`. |
| `409` | `ROUTING_VERSION_CONFLICT`         | Another concurrent `PATCH` won the publish race.                      |
| `403` | `INSUFFICIENT_SCOPE`               | API key missing `routing:write`.                                      |


## OpenAPI

````yaml openapi/organizations/routing/update-routing.json PATCH /routing/{routing_id}
openapi: 3.1.0
info:
  title: Routing API - Update
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
security:
  - sec0: []
    sec1: []
paths:
  /routing/{routing_id}:
    patch:
      summary: Update a Routing
      description: Replaces the routing's full configuration.
      operationId: update-routing
      parameters:
        - name: routing_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: X-Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: Updated Card routing
                default_route:
                  type: object
                condition_sets:
                  type: array
                  items:
                    type: object
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  account_code:
                    type: string
                  payment_method:
                    type: string
                  name:
                    type: string
                  default_route:
                    type: object
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: PUBLIC-API-KEY
      x-default: <Your PUBLIC-API-KEY>
    sec1:
      type: apiKey
      in: header
      name: PRIVATE-SECRET-KEY
      x-default: <Your PRIVATE-SECRET-KEY>

````