## List an account or zone ruleset's versions `rulesets.versions.list(strruleset_id, VersionListParams**kwargs) -> SyncSinglePage[VersionListResponse]` **get** `/{accounts_or_zones}/{account_or_zone_id}/rulesets/{ruleset_id}/versions` Fetches the versions of an account or zone ruleset. ### Parameters - `ruleset_id: str` The unique ID of the ruleset. - `account_id: Optional[str]` The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. - `zone_id: Optional[str]` The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. ### Returns - `class VersionListResponse: …` A ruleset object. - `id: str` The unique ID of the ruleset. - `kind: Kind` The kind of the ruleset. - `"managed"` - `"custom"` - `"root"` - `"zone"` - `last_updated: datetime` The timestamp of when the ruleset was last modified. - `name: str` The human-readable name of the ruleset. - `phase: Phase` The phase of the ruleset. - `"ddos_l4"` - `"ddos_l7"` - `"http_config_settings"` - `"http_custom_errors"` - `"http_log_custom_fields"` - `"http_ratelimit"` - `"http_request_cache_settings"` - `"http_request_dynamic_redirect"` - `"http_request_firewall_custom"` - `"http_request_firewall_managed"` - `"http_request_late_transform"` - `"http_request_origin"` - `"http_request_redirect"` - `"http_request_sanitize"` - `"http_request_sbfm"` - `"http_request_transform"` - `"http_response_cache_settings"` - `"http_response_compression"` - `"http_response_firewall_managed"` - `"http_response_headers_transform"` - `"magic_transit"` - `"magic_transit_ids_managed"` - `"magic_transit_managed"` - `"magic_transit_ratelimit"` - `version: str` The version of the ruleset. - `description: Optional[str]` An informative description of the ruleset. ### 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 ) page = client.rulesets.versions.list( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", ) page = page.result[0] print(page.id) ``` #### Response ```json { "errors": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "messages": [ { "message": "something bad happened", "code": 10000, "source": { "pointer": "/rules/0/action" } } ], "result": [ { "id": "2f2feab2026849078ba485f918791bdc", "kind": "root", "last_updated": "2000-01-01T00:00:00.000000Z", "name": "My ruleset", "phase": "http_request_firewall_custom", "version": "1", "description": "A description for my ruleset." } ], "success": true, "result_info": { "cursors": { "after": "dGhpc2lzYW5leGFtcGxlCg" } } } ```