> ## 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.

# Create Content Rule Profile

Create a content rule profile for the current site.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Content Rule Profiles",
    "version": "1.0.0",
    "description": "Content rule profile endpoints for managing reusable profile-based geo and access rules."
  },
  "servers": [
    {
      "url": "https://api.zype.com/"
    }
  ],
  "security": [
    {
      "api_key": []
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "api_key",
        "in": "query"
      }
    }
  },
  "paths": {
    "/v3/content_rule_profiles": {
      "post": {
        "tags": [
          "Content Rule Profiles"
        ],
        "summary": "Create Content Rule Profile",
        "description": "Create a content rule profile for the current site.",
        "operationId": "createContentRuleProfile",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "title": "ContentRuleProfileRequest",
                "type": "object",
                "required": [
                  "content_rule_profile"
                ],
                "properties": {
                  "content_rule_profile": {
                    "title": "ContentRuleProfileProperties",
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "is_default_profile": {
                        "type": "boolean"
                      },
                      "content_rules_attributes": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "description": "Used to update or remove an existing rule."
                            },
                            "_destroy": {
                              "type": "boolean",
                              "description": "Set to `true` to remove an existing rule."
                            },
                            "name": {
                              "type": "string"
                            },
                            "match_type": {
                              "type": "string",
                              "description": "Valid values include `global`, `country`, `state`, `city`, `zip_code`, `dma_code`, and `ip_address`."
                            },
                            "priority": {
                              "type": "integer"
                            },
                            "stackable": {
                              "type": "boolean"
                            },
                            "policy": {
                              "type": "string",
                              "description": "Valid values are `allow` and `deny`."
                            },
                            "enabled": {
                              "type": "boolean"
                            },
                            "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",
                              "description": "For `match_type` `ip_address`. Same semantics as `ContentRuleProfileRule.ip_ranges`.",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "start": {
                                    "type": "string"
                                  },
                                  "end": {
                                    "type": "string"
                                  }
                                }
                              }
                            },
                            "content_rule_group_ids": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "Site or global content rule group IDs whose `group_type` matches the rule `match_type`."
                            },
                            "geographies": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "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"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "title": "ContentRuleProfileResponse",
                  "type": "object",
                  "properties": {
                    "response": {
                      "title": "ContentRuleProfile",
                      "type": "object",
                      "properties": {
                        "_id": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "is_default_profile": {
                          "type": "boolean"
                        },
                        "content_rules": {
                          "type": "array",
                          "items": {
                            "title": "ContentRuleProfileRule",
                            "type": "object",
                            "properties": {
                              "_id": {
                                "type": "string"
                              },
                              "policy": {
                                "type": "string",
                                "description": "Valid values are `allow` and `deny`."
                              },
                              "priority": {
                                "type": "integer",
                                "description": "Rule priority. Lower values are evaluated first."
                              },
                              "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"
                                },
                                "description": "For `match_type` `ip_address`, single hosts or CIDR blocks (e.g. `192.168.1.0/24`). May be empty when `ip_ranges` is non-empty."
                              },
                              "ip_ranges": {
                                "type": "array",
                                "description": "Inclusive start–end pairs for `match_type` `ip_address`. At least one entry in `ip_addresses` or `ip_ranges` is required for IP rules. Bounds must be literal host addresses (not CIDR).",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "start": {
                                      "type": "string"
                                    },
                                    "end": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "content_rule_group_ids": {
                                "type": "array",
                                "description": "IDs of site `ContentRuleGroup` documents or global catalog groups. When present, the rule matches if individual criteria match **or** any linked group matches the viewer location for the same dimension as `match_type`. `group_type` on each referenced group must match the rule's `match_type`. Omitted or empty means no group branch.",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "match_type": {
                                "type": "string",
                                "description": "Valid values include `global`, `country`, `state`, `city`, `zip_code`, `dma_code`, and `ip_address`."
                              },
                              "enabled": {
                                "type": "boolean"
                              },
                              "created_at": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "created_at": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "title": "Unprocessable Entity",
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```