## Update Route `workers.routes.update(strroute_id, RouteUpdateParams**kwargs) -> RouteUpdateResponse` **put** `/zones/{zone_id}/workers/routes/{route_id}` Updates the URL pattern or Worker associated with a route. ### Parameters - `zone_id: str` Identifier. - `route_id: str` Identifier. - `pattern: str` Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior). - `script: Optional[str]` Name of the script to run if the route matches. ### Returns - `class RouteUpdateResponse: …` - `id: str` Identifier. - `pattern: str` Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior). - `script: Optional[str]` Name of the script to run if the route matches. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) route = client.workers.routes.update( route_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", pattern="example.com/*", ) print(route.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "023e105f4ecef8ad9ca31a8372d0c353", "pattern": "example.com/*", "script": "my-workers-script" }, "success": true } ```