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

# List content rule groups

Retrieve custom content rule groups (e.g. country groupings) for the current site.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Content rule groups",
    "version": "1.0.0",
    "description": "Site-scoped **content rule groups** and the read-only **global content rule groups** catalog.\n\nReadMe maps `info.title` to the API **category** and each operation's **first** `tags` entry to a **page** under that category, then `summary` lines as endpoint subpages. After upload you should see this OpenAPI file powering the Content rule groups section.\n"
  },
  "servers": [
    {
      "url": "https://api.zype.com/"
    }
  ],
  "security": [
    {
      "api_key": []
    }
  ],
  "tags": [
    {
      "name": "Content rule groups",
      "description": "CRUD for custom groupings on the current site (e.g. country lists)."
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "api_key",
        "in": "query"
      }
    }
  },
  "paths": {
    "/v3/content_rule_groups": {
      "get": {
        "tags": [
          "Content rule groups"
        ],
        "summary": "List content rule groups",
        "description": "Retrieve custom content rule groups (e.g. country groupings) for the current site.",
        "operationId": "listContentRuleGroups",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Response will contain an array of content rule groups, ordered by name.",
            "content": {
              "application/json": {
                "schema": {
                  "title": "ContentRuleGroupsResponse",
                  "type": "object",
                  "properties": {
                    "response": {
                      "type": "array",
                      "items": {
                        "$ref": "#/paths/~1v3~1content_rule_groups/post/responses/201/content/application~1json/schema/properties/response"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "title": "NotFound",
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Content rule groups"
        ],
        "summary": "Create content rule group",
        "description": "Create a custom content rule group for the current site.",
        "operationId": "createContentRuleGroup",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "ContentRuleGroupRequest",
                "type": "object",
                "required": [
                  "content_rule_group"
                ],
                "properties": {
                  "content_rule_group": {
                    "title": "ContentRuleGroupProperties",
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "group_type": {
                        "type": "string",
                        "description": "Optional. One of `country`, `state`, `city`, `zip_code`, `dma_code`, or `ip_address`. Defaults to `country` when omitted."
                      },
                      "countries": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "states": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "cities": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "zip_codes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "dma_codes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "ip_addresses": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "ip_ranges": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "start": {
                              "type": "string"
                            },
                            "end": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "title": "ContentRuleGroupResponse",
                  "type": "object",
                  "properties": {
                    "response": {
                      "title": "ContentRuleGroup",
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "countries": {
                          "type": "array",
                          "description": "ISO 3166-1 alpha-2 country codes (uppercase). Empty strings are stripped and values are normalized on save. Required payload when `group_type` is `country`.",
                          "items": {
                            "type": "string"
                          }
                        },
                        "states": {
                          "type": "array",
                          "description": "US state codes (uppercase) when targeting states. Required payload when `group_type` is `state` (US-only semantics match content rules).",
                          "items": {
                            "type": "string"
                          }
                        },
                        "cities": {
                          "type": "array",
                          "description": "City names as stored for matching. Required payload when `group_type` is `city`.",
                          "items": {
                            "type": "string"
                          }
                        },
                        "zip_codes": {
                          "type": "array",
                          "description": "ZIP/postal codes (normalized uppercase). Required payload when `group_type` is `zip_code`.",
                          "items": {
                            "type": "string"
                          }
                        },
                        "dma_codes": {
                          "type": "array",
                          "description": "DMA codes. Required payload when `group_type` is `dma_code`.",
                          "items": {
                            "type": "string"
                          }
                        },
                        "ip_addresses": {
                          "type": "array",
                          "description": "Single hosts or CIDR blocks for `group_type` `ip_address`. At least one entry in `ip_addresses` or `ip_ranges` is required for IP groups.",
                          "items": {
                            "type": "string"
                          }
                        },
                        "ip_ranges": {
                          "type": "array",
                          "description": "Inclusive start–end pairs for `group_type` `ip_address`. Bounds must be literal host addresses (not CIDR).",
                          "items": {
                            "type": "object",
                            "properties": {
                              "start": {
                                "type": "string"
                              },
                              "end": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "group_type": {
                          "type": "string",
                          "description": "One of `country`, `state`, `city`, `zip_code`, `dma_code`, or `ip_address`. Site-persisted groups default to `country`. Global catalog entries use `country`.",
                          "default": "country"
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/paths/~1v3~1content_rule_groups/get/responses/403/content/application~1json/schema"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Unprocessable Entity",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```