# AI Audit # Robots ## Get robots.txt rules `client.aiAudit.robots.get(RobotGetParamsparams, RequestOptionsoptions?): RobotGetResponse` **get** `/zones/{zone_id}/ai-audit/robots` Fetches and parses the robots.txt file for a zone or a specific subdomain within the zone. Returns parsed user-agent rules, content signals, and sitemaps. ### Parameters - `params: RobotGetParams` - `zone_id: string` Path param: Identifier of the zone. - `subdomain?: string` Query param: Optional subdomain to fetch robots.txt for. If omitted, fetches robots.txt for the zone apex domain. ### Returns - `RobotGetResponse` Parsed robots.txt rules for a single domain. - `userAgents: Record` Map of user-agent string to its parsed rules. - `allow: Array` List of allowed path patterns. - `disallow: Array` List of disallowed path patterns. - `contentSignals?: ContentSignals` Content signal directives from robots.txt. - `"ai-input"?: "yes" | "no"` Whether AI input usage is permitted. - `"yes"` - `"no"` - `"ai-train"?: "yes" | "no"` Whether AI training is permitted. - `"yes"` - `"no"` - `search?: "yes" | "no"` Whether search indexing is permitted. - `"yes"` - `"no"` - `crawlDelay?: number` Crawl delay in seconds. - `sitemaps?: Array` List of sitemap URLs found in robots.txt. - `status?: number` HTTP status code from fetching the robots.txt file. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const robot = await client.aiAudit.robots.get({ zone_id: 'zone_id' }); console.log(robot.userAgents); ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "userAgents": { "foo": { "allow": [ "string" ], "disallow": [ "string" ], "contentSignals": { "ai-input": "yes", "ai-train": "yes", "search": "yes" }, "crawlDelay": 0 } }, "sitemaps": [ "string" ], "status": 0 } } ``` ## Bulk get robots.txt rules `client.aiAudit.robots.bulkGet(RobotBulkGetParamsparams, RequestOptionsoptions?): RobotBulkGetResponse` **post** `/zones/{zone_id}/ai-audit/robots/bulk` Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname. ### Parameters - `params: RobotBulkGetParams` - `zone_id: string` Path param: Identifier of the zone. - `body: Array` Body param: Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request. ### Returns - `RobotBulkGetResponse = Record` Map of hostname to parsed robots.txt rules. - `userAgents: Record` Map of user-agent string to its parsed rules. - `allow: Array` List of allowed path patterns. - `disallow: Array` List of disallowed path patterns. - `contentSignals?: ContentSignals` Content signal directives from robots.txt. - `"ai-input"?: "yes" | "no"` Whether AI input usage is permitted. - `"yes"` - `"no"` - `"ai-train"?: "yes" | "no"` Whether AI training is permitted. - `"yes"` - `"no"` - `search?: "yes" | "no"` Whether search indexing is permitted. - `"yes"` - `"no"` - `crawlDelay?: number` Crawl delay in seconds. - `sitemaps?: Array` List of sitemap URLs found in robots.txt. - `status?: number` HTTP status code from fetching the robots.txt file. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.aiAudit.robots.bulkGet({ zone_id: 'zone_id', body: ['example.com', 'blog.example.com'], }); console.log(response); ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "foo": { "userAgents": { "foo": { "allow": [ "string" ], "disallow": [ "string" ], "contentSignals": { "ai-input": "yes", "ai-train": "yes", "search": "yes" }, "crawlDelay": 0 } }, "sitemaps": [ "string" ], "status": 0 } } } ``` ## Domain Types ### Robot Get Response - `RobotGetResponse` Parsed robots.txt rules for a single domain. - `userAgents: Record` Map of user-agent string to its parsed rules. - `allow: Array` List of allowed path patterns. - `disallow: Array` List of disallowed path patterns. - `contentSignals?: ContentSignals` Content signal directives from robots.txt. - `"ai-input"?: "yes" | "no"` Whether AI input usage is permitted. - `"yes"` - `"no"` - `"ai-train"?: "yes" | "no"` Whether AI training is permitted. - `"yes"` - `"no"` - `search?: "yes" | "no"` Whether search indexing is permitted. - `"yes"` - `"no"` - `crawlDelay?: number` Crawl delay in seconds. - `sitemaps?: Array` List of sitemap URLs found in robots.txt. - `status?: number` HTTP status code from fetching the robots.txt file. ### Robot Bulk Get Response - `RobotBulkGetResponse = Record` Map of hostname to parsed robots.txt rules. - `userAgents: Record` Map of user-agent string to its parsed rules. - `allow: Array` List of allowed path patterns. - `disallow: Array` List of disallowed path patterns. - `contentSignals?: ContentSignals` Content signal directives from robots.txt. - `"ai-input"?: "yes" | "no"` Whether AI input usage is permitted. - `"yes"` - `"no"` - `"ai-train"?: "yes" | "no"` Whether AI training is permitted. - `"yes"` - `"no"` - `search?: "yes" | "no"` Whether search indexing is permitted. - `"yes"` - `"no"` - `crawlDelay?: number` Crawl delay in seconds. - `sitemaps?: Array` List of sitemap URLs found in robots.txt. - `status?: number` HTTP status code from fetching the robots.txt file.