Get Zone Bot Management Config
client.BotManagement.Get(ctx, query) (*BotManagementGetResponse, error)
GET/zones/{zone_id}/bot_management
Retrieve a zone's Bot Management Config
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get Zone Bot Management Config
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/bot_management"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
botManagement, err := client.BotManagement.Get(context.TODO(), bot_management.BotManagementGetParams{
ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", botManagement)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"ai_bots_protection": "block",
"cf_robots_variant": "policy_only",
"crawler_protection": "enabled",
"enable_js": true,
"fight_mode": true,
"is_robots_txt_managed": false,
"stale_zone_configuration": {
"optimize_wordpress": true,
"sbfm_definitely_automated": "sbfm_definitely_automated",
"sbfm_likely_automated": "sbfm_likely_automated",
"sbfm_static_resource_protection": "sbfm_static_resource_protection",
"sbfm_verified_bots": "sbfm_verified_bots",
"suppress_session_score": true
},
"using_latest_model": true
}
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"success": true,
"result": {
"ai_bots_protection": "block",
"cf_robots_variant": "policy_only",
"crawler_protection": "enabled",
"enable_js": true,
"fight_mode": true,
"is_robots_txt_managed": false,
"stale_zone_configuration": {
"optimize_wordpress": true,
"sbfm_definitely_automated": "sbfm_definitely_automated",
"sbfm_likely_automated": "sbfm_likely_automated",
"sbfm_static_resource_protection": "sbfm_static_resource_protection",
"sbfm_verified_bots": "sbfm_verified_bots",
"suppress_session_score": true
},
"using_latest_model": true
}
}