Create a Web Analytics site

Creates a new Web Analytics site.

/accounts/{account_identifier}/rum/site_info

post

Web Analytics

web-analytics-create-site

Debug "planAvailability"

{
  "business": true,
  "enterprise": true,
  "free": true,
  "pro": true
}

Debug "tokenPermissions"

null

Debug "parameters"

[
  {
    "in": "path",
    "name": "account_identifier",
    "required": true,
    "schema": {
      "description": "Identifier",
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "maxLength": 32,
      "readOnly": true,
      "type": "string"
    }
  }
]

Debug "requestBody"

{
  "content": {
    "application/json": {
      "schema": {
        "properties": {
          "auto_install": {
            "description": "If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.",
            "example": true,
            "type": "boolean"
          },
          "host": {
            "description": "The hostname to use for gray-clouded sites.",
            "example": "example.com",
            "type": "string"
          },
          "zone_tag": {
            "description": "The zone identifier.",
            "example": "023e105f4ecef8ad9ca31a8372d0c353",
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  },
  "required": true
}

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "properties": {
                    "errors": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "messages": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "success": {
                      "description": "Whether the API call was successful.",
                      "example": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "errors",
                    "messages"
                  ],
                  "type": "object"
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "properties": {
                    "auto_install": {
                      "description": "If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.",
                      "example": true,
                      "type": "boolean"
                    },
                    "created": {
                      "example": "2014-01-01T05:20:00.12345Z",
                      "format": "date-time",
                      "readOnly": true,
                      "type": "string"
                    },
                    "rules": {
                      "description": "A list of rules.",
                      "items": {
                        "properties": {
                          "created": {
                            "example": "2014-01-01T05:20:00.12345Z",
                            "format": "date-time",
                            "readOnly": true,
                            "type": "string"
                          },
                          "host": {
                            "description": "The hostname the rule will be applied to.",
                            "example": "example.com",
                            "type": "string"
                          },
                          "id": {
                            "description": "The Web Analytics rule identifier.",
                            "example": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
                            "type": "string"
                          },
                          "inclusive": {
                            "description": "Whether the rule includes or excludes traffic from being measured.",
                            "example": true,
                            "type": "boolean"
                          },
                          "is_paused": {
                            "description": "Whether the rule is paused or not.",
                            "example": false,
                            "type": "boolean"
                          },
                          "paths": {
                            "description": "The paths the rule will be applied to.",
                            "example": [
                              "*"
                            ],
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "priority": {
                            "example": 1000,
                            "type": "number"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "ruleset": {
                      "properties": {
                        "enabled": {
                          "description": "Whether the ruleset is enabled.",
                          "example": true,
                          "type": "boolean"
                        },
                        "id": {
                          "description": "The Web Analytics ruleset identifier.",
                          "example": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
                          "type": "string"
                        },
                        "zone_name": {
                          "example": "example.com",
                          "type": "string"
                        },
                        "zone_tag": {
                          "description": "The zone identifier.",
                          "example": "023e105f4ecef8ad9ca31a8372d0c353",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "site_tag": {
                      "description": "The Web Analytics site identifier.",
                      "example": "023e105f4ecef8ad9ca31a8372d0c353",
                      "type": "string"
                    },
                    "site_token": {
                      "description": "The Web Analytics site token.",
                      "example": "023e105f4ecef8ad9ca31a8372d0c353",
                      "type": "string"
                    },
                    "snippet": {
                      "description": "Encoded JavaScript snippet.",
                      "example": "<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{\"token\": \"bc40a2d1b5834453aba85c1b9a3054da\"}'></script><!-- End Cloudflare Web Analytics -->",
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              }
            }
          ]
        }
      }
    },
    "description": "Created Web Analytics site"
  },
  "4XX": {
    "content": {
      "application/json": {
        "schema": {
          "properties": {
            "errors": {
              "allOf": [
                {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                }
              ],
              "example": [
                {
                  "code": 7003,
                  "message": "No route for the URI"
                }
              ],
              "minLength": 1
            },
            "messages": {
              "allOf": [
                {
                  "example": [],
                  "items": {
                    "properties": {
                      "code": {
                        "minimum": 1000,
                        "type": "integer"
                      },
                      "message": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "code",
                      "message"
                    ],
                    "type": "object",
                    "uniqueItems": true
                  },
                  "type": "array"
                }
              ],
              "example": []
            },
            "result": {
              "enum": [
                null
              ],
              "nullable": true,
              "type": "object"
            },
            "success": {
              "description": "Whether the API call was successful",
              "enum": [
                false
              ],
              "example": false,
              "type": "boolean"
            }
          },
          "required": [
            "success",
            "errors",
            "messages",
            "result"
          ],
          "type": "object"
        }
      }
    },
    "description": "Failure response"
  }
}

Debug "security"

[
  {
    "api_email": [],
    "api_key": []
  }
]