Search
Search the Cloudflare OpenAPI spec. All $refs are pre-resolved inline.
Products: cloudforce-one, access, magic, workers, dlp, realtime, email-security, devices, email, ai-gateway, intel, gateway, stream, brand-protection, settings, ai-search, data-security, browser-rendering, dex, logpush, api_gateway, builds, addressing, images, load_balancers, security-center, rulesets, vectorize, firewall, logs... (160 total)
Types:
interface OperationInfo {
summary?: string;
description?: string;
tags?: string[];
parameters?: Array<{ name: string; in: string; required?: boolean; schema?: unknown; description?: string }>;
requestBody?: { required?: boolean; content?: Record<string, { schema?: unknown }> };
responses?: Record<string, { description?: string; content?: Record<string, { schema?: unknown }> }>;
}
interface PathItem {
get?: OperationInfo;
post?: OperationInfo;
put?: OperationInfo;
patch?: OperationInfo;
delete?: OperationInfo;
}
declare const spec: {
paths: Record<string, PathItem>;
};
Examples:
// Find endpoints by product
async () => {
const results = [];
for (const [path, methods] of Object.entries(spec.paths)) {
for (const [method, op] of Object.entries(methods)) {
if (op.tags?.some(t => t.toLowerCase() === 'workers')) {
results.push({ method: method.toUpperCase(), path, summary: op.summary });
}
}
}
return results;
}
// Get endpoint with requestBody schema (refs are resolved)
async () => {
const op = spec.paths['/accounts/{account_id}/d1/database']?.post;
return { summary: op?.summary, requestBody: op?.requestBody };
}
// Get endpoint parameters
async () => {
const op = spec.paths['/accounts/{account_id}/workers/scripts']?.get;
return op?.parameters;
}