├── .github └── workflows │ ├── semgrep.yml │ └── stainless.yml ├── .gitignore ├── .redocly.lint-ignore.yaml ├── LICENSE ├── README.md ├── common.yaml ├── openapi.json └── openapi.yaml /.github/workflows/semgrep.yml: -------------------------------------------------------------------------------- 1 | 2 | on: 3 | schedule: 4 | - cron: '0 0 * * *' 5 | name: Semgrep config 6 | jobs: 7 | semgrep: 8 | name: semgrep/ci 9 | runs-on: ubuntu-latest 10 | env: 11 | SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} 12 | SEMGREP_URL: https://cloudflare.semgrep.dev 13 | SEMGREP_APP_URL: https://cloudflare.semgrep.dev 14 | SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version 15 | container: 16 | image: semgrep/semgrep 17 | steps: 18 | - uses: actions/checkout@v4 19 | - run: semgrep ci 20 | -------------------------------------------------------------------------------- /.github/workflows/stainless.yml: -------------------------------------------------------------------------------- 1 | name: Upload OpenAPI spec to Stainless 2 | on: 3 | push: 4 | branches: [main] 5 | workflow_dispatch: 6 | jobs: 7 | stainless: 8 | concurrency: upload-openapi-spec-action 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: stainless-api/upload-openapi-spec-action@main 13 | with: 14 | stainless_api_key: ${{ secrets.STAINLESS_API_KEY }} 15 | input_path: "openapi.json" 16 | project_name: "cloudflare" 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json -------------------------------------------------------------------------------- /.redocly.lint-ignore.yaml: -------------------------------------------------------------------------------- 1 | # This file instructs Redocly's linter to ignore the rules contained for specific parts of your API. 2 | # See https://redoc.ly/docs/cli/ for more information. 3 | {} 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2022, Cloudflare 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cloudflare API Schemas 2 | 3 | This repository contains OpenAPI schemas for the Cloudflare API. 4 | -------------------------------------------------------------------------------- /common.yaml: -------------------------------------------------------------------------------- 1 | openapi: 3.0.3 2 | info: 3 | title: Common 4 | description: Cloudflare Common API Components 5 | version: 4.0.0 6 | paths: {} 7 | components: 8 | schemas: 9 | uuid: 10 | description: UUID. 11 | type: string 12 | maxLength: 36 13 | example: f174e90a-fafe-4643-bbbc-4a0ed4fc8415 14 | x-auditable: true 15 | 16 | identifier: 17 | description: Identifier. 18 | type: string 19 | maxLength: 32 20 | example: 023e105f4ecef8ad9ca31a8372d0c353 21 | x-auditable: true 22 | 23 | timestamp: 24 | type: string 25 | format: date-time 26 | example: "2014-01-01T05:20:00.12345Z" 27 | x-auditable: true 28 | 29 | # API response envelopes 30 | api-response-collection: 31 | type: object 32 | allOf: 33 | - $ref: "#/components/schemas/api-response-common" 34 | - type: object 35 | properties: 36 | result_info: 37 | type: object 38 | properties: 39 | page: 40 | description: Current page within paginated list of results. 41 | type: number 42 | example: 1 43 | per_page: 44 | description: Number of results per page of results. 45 | type: number 46 | example: 20 47 | count: 48 | description: Total number of results for the requested service. 49 | type: number 50 | example: 1 51 | total_count: 52 | description: Total results available without any search parameters. 53 | type: number 54 | example: 2000 55 | 56 | messages: 57 | type: array 58 | items: 59 | type: object 60 | required: 61 | - code 62 | - message 63 | properties: 64 | code: 65 | type: integer 66 | minimum: 1000 67 | message: 68 | type: string 69 | documentation_url: 70 | type: string 71 | source: 72 | type: object 73 | properties: 74 | pointer: 75 | type: string 76 | uniqueItems: true 77 | example: [] 78 | 79 | api-response-common: 80 | type: object 81 | required: 82 | - success 83 | - errors 84 | - messages 85 | properties: 86 | success: 87 | description: Whether the API call was successful. 88 | type: boolean 89 | enum: 90 | - true 91 | example: true 92 | errors: 93 | $ref: "#/components/schemas/messages" 94 | messages: 95 | $ref: "#/components/schemas/messages" 96 | 97 | api-response-common-failure: 98 | type: object 99 | required: 100 | - success 101 | - errors 102 | - messages 103 | - result 104 | properties: 105 | success: 106 | description: Whether the API call was successful. 107 | type: boolean 108 | enum: 109 | - false 110 | example: false 111 | errors: 112 | allOf: 113 | - $ref: "#/components/schemas/messages" 114 | minLength: 1 115 | example: 116 | - code: 7003 117 | message: No route for the URI 118 | messages: 119 | allOf: 120 | - $ref: "#/components/schemas/messages" 121 | example: [] 122 | result: 123 | enum: 124 | - null 125 | example: null 126 | type: object 127 | nullable: true 128 | 129 | api-response-single-id: 130 | type: object 131 | allOf: 132 | - $ref: "#/components/schemas/api-response-common" 133 | - properties: 134 | result: 135 | type: object 136 | required: 137 | - id 138 | properties: 139 | id: 140 | $ref: "#/components/schemas/identifier" 141 | nullable: true 142 | 143 | api-response-single: 144 | type: object 145 | allOf: 146 | - $ref: "#/components/schemas/api-response-common" 147 | 148 | # Account 149 | account: 150 | type: object 151 | required: 152 | - id 153 | - name 154 | properties: 155 | id: 156 | $ref: "#/components/schemas/identifier" 157 | name: 158 | description: Account name. 159 | type: string 160 | maxLength: 100 161 | example: Demo Account 162 | x-auditable: true 163 | settings: 164 | type: object 165 | description: Account settings. 166 | properties: 167 | enforce_twofactor: 168 | type: boolean 169 | description: |- 170 | Indicates whether membership in this account requires that 171 | Two-Factor Authentication is enabled. 172 | default: false 173 | x-auditable: true 174 | use_account_custom_ns_by_default: 175 | type: boolean 176 | description: |- 177 | Indicates whether new zones should use the account-level custom 178 | nameservers by default. 179 | default: false 180 | x-auditable: true 181 | created_on: 182 | description: Timestamp for the creation of the account. 183 | type: string 184 | format: date-time 185 | readOnly: true 186 | example: 2014-03-01T12:21:02.0000Z 187 | x-auditable: true 188 | 189 | scope: 190 | description: All zones owned by the account will have the rule applied. 191 | type: object 192 | properties: 193 | id: 194 | $ref: "#/components/schemas/identifier" 195 | name: 196 | $ref: "#/components/schemas/account/properties/name" 197 | type: 198 | type: string 199 | enum: 200 | - account 201 | description: The scope of the rule. 202 | readOnly: true 203 | example: account 204 | x-auditable: true 205 | 206 | # Zone 207 | zone: 208 | type: object 209 | required: 210 | - id 211 | - name 212 | - development_mode 213 | - owner 214 | - account 215 | - meta 216 | - original_name_servers 217 | - original_registrar 218 | - original_dnshost 219 | - created_on 220 | - modified_on 221 | - activated_on 222 | properties: 223 | id: 224 | $ref: "#/components/schemas/identifier" 225 | name: 226 | description: The domain name. 227 | type: string 228 | pattern: ^([a-zA-Z0-9][\-a-zA-Z0-9]*\.)+[\-a-zA-Z0-9]{2,20}$ 229 | maxLength: 253 230 | readOnly: true 231 | example: example.com 232 | x-auditable: true 233 | development_mode: 234 | description: |- 235 | The interval (in seconds) from when development mode expires 236 | (positive integer) or last expired (negative integer) for the 237 | domain. If development mode has never been enabled, this value is 0. 238 | type: number 239 | readOnly: true 240 | example: 7200 241 | x-auditable: true 242 | original_name_servers: 243 | description: |- 244 | Original name servers before moving to Cloudflare. 245 | type: array 246 | items: 247 | type: string 248 | format: hostname 249 | x-auditable: true 250 | readOnly: true 251 | example: 252 | - ns1.originaldnshost.com 253 | - ns2.originaldnshost.com 254 | nullable: true 255 | original_registrar: 256 | description: Registrar for the domain at the time of switching to Cloudflare. 257 | type: string 258 | readOnly: true 259 | example: GoDaddy 260 | nullable: true 261 | x-auditable: true 262 | original_dnshost: 263 | description: DNS host at the time of switching to Cloudflare. 264 | type: string 265 | maxLength: 50 266 | readOnly: true 267 | example: NameCheap 268 | nullable: true 269 | x-auditable: true 270 | created_on: 271 | description: When the zone was created. 272 | type: string 273 | format: date-time 274 | readOnly: true 275 | example: 2014-01-01T05:20:00.12345Z 276 | x-auditable: true 277 | modified_on: 278 | description: When the zone was last modified. 279 | type: string 280 | format: date-time 281 | readOnly: true 282 | example: 2014-01-01T05:20:00.12345Z 283 | x-auditable: true 284 | activated_on: 285 | description: |- 286 | The last time proof of ownership was detected and the zone was made 287 | active. 288 | type: string 289 | format: date-time 290 | readOnly: true 291 | example: 2014-01-02T00:01:00.12345Z 292 | nullable: true 293 | x-auditable: true 294 | vanity_name_servers: 295 | description: |- 296 | An array of domains used for custom name servers. This is only 297 | available for Business and Enterprise plans. 298 | type: array 299 | items: 300 | type: string 301 | format: hostname 302 | maxLength: 253 303 | x-auditable: true 304 | example: 305 | - ns1.example.com 306 | - ns2.example.com 307 | 308 | # User 309 | user: 310 | type: object 311 | required: 312 | - id 313 | - email 314 | - last_name 315 | - first_name 316 | - telephone 317 | - country 318 | - zipcode 319 | - two_factor_authentication_enabled 320 | - created_on 321 | - modified_on 322 | properties: 323 | id: 324 | $ref: "#/components/schemas/identifier" 325 | email: 326 | description: The contact email address of the user.. 327 | type: string 328 | maxLength: 90 329 | example: user@example.com 330 | x-auditable: true 331 | first_name: 332 | description: User's first name. 333 | type: string 334 | maxLength: 60 335 | example: John 336 | nullable: true 337 | last_name: 338 | description: User's last name. 339 | type: string 340 | maxLength: 60 341 | example: Appleseed 342 | nullable: true 343 | username: 344 | description: A username used to access other cloudflare services, like support. 345 | type: string 346 | pattern: ^[a-z0-9]+([\-\._]?[a-z0-9]+)+$ 347 | minLength: 3 348 | maxLength: 90 349 | example: cfuser12345 350 | x-auditable: true 351 | telephone: 352 | description: User's telephone number. 353 | type: string 354 | maxLength: 20 355 | example: +1 123-123-1234 356 | nullable: true 357 | country: 358 | description: The country in which the user lives.. 359 | type: string 360 | maxLength: 30 361 | example: US 362 | nullable: true 363 | zipcode: 364 | description: The zipcode or postal code where the user lives.. 365 | type: string 366 | maxLength: 20 367 | example: "12345" 368 | nullable: true 369 | created_on: 370 | description: When the user signed up.. 371 | readOnly: true 372 | type: string 373 | format: date-time 374 | example: 2014-01-01T05:20:00Z 375 | x-auditable: true 376 | modified_on: 377 | description: Last time the user was modified. 378 | readOnly: true 379 | type: string 380 | format: date-time 381 | example: 2014-01-01T05:20:00Z 382 | x-auditable: true 383 | 384 | # Plan 385 | plan: 386 | type: object 387 | properties: 388 | id: 389 | $ref: "#/components/schemas/identifier" 390 | name: 391 | description: The plan name. 392 | type: string 393 | maxLength: 80 394 | readOnly: true 395 | example: Pro Plan 396 | x-auditable: true 397 | price: 398 | description: The price of the subscription that will be billed, in US dollars. 399 | type: number 400 | readOnly: true 401 | example: 20 402 | x-auditable: true 403 | currency: 404 | description: The monetary unit in which pricing information is displayed. 405 | type: string 406 | readOnly: true 407 | example: USD 408 | x-auditable: true 409 | frequency: 410 | description: The frequency at which you will be billed for this plan. 411 | type: string 412 | enum: 413 | - weekly 414 | - monthly 415 | - quarterly 416 | - yearly 417 | - "" 418 | readOnly: true 419 | example: monthly 420 | x-auditable: true 421 | legacy_id: 422 | description: |- 423 | A 'friendly' identifier to indicate to the UI what plan the 424 | object is. 425 | type: string 426 | enum: 427 | - free 428 | - pro 429 | - business 430 | - enterprise 431 | example: pro 432 | is_subscribed: 433 | description: If the zone is subscribed to this plan. 434 | type: boolean 435 | example: true 436 | x-auditable: true 437 | can_subscribe: 438 | description: If the zone is allowed to subscribe to this plan. 439 | type: boolean 440 | example: true 441 | x-auditable: true 442 | --------------------------------------------------------------------------------