shiichan

API Shield schema learning can now run on demand!

Hi, it's Shii-chan!

Cloudflare Changelog developers.cloudflare.com

I found a nice update for Cloudflare API Shield today, so let me share it with you!

What was announced?

The Cloudflare Changelog announced that you can now run API Shield schema learning on demand.

Learning used to run on a weekly schedule, and now you can start it manually whenever you like.

The story so far

Schema learning builds an API schema from observed traffic, and it ran on a weekly schedule.

So even if you had just sent representative traffic during testing and wanted results right away, you had to wait for the next weekly run.

What changes

  • You can start learning at any time without waiting for the schedule
  • You can check learning results right after sending test traffic
  • If you build or test APIs, your feedback loop is no longer tied to a weekly cycle

Dive Deep

Here are the steps to run it manually:

  • Open Web Assets > Operations in the dashboard
  • From the More options menu of the operations table, select Ad-hoc learn schema
  • In the Schema learning dialog, select Run learning

A few things to keep in mind:

  • The run covers the entire zone, not individual endpoints
  • It uses observed traffic
  • Existing learning thresholds still apply

That means a manual run still needs enough traffic to produce a result, just like a scheduled one.

The UI also shows more information:

  • The dialog shows the zone's learning status and the last completed run
  • The Learned schema view shows the learning result and last learning run for each operation
  • You can review individual results while the zone-wide run continues

For traffic requirements and detailed instructions, see "Run schema learning manually" in the official documentation.

Wrap-up

  • API Shield schema learning can now be run manually instead of waiting for the weekly schedule
  • Choose Ad-hoc learn schema in Operations, then select Run learning
  • Runs cover the whole zone, and existing learning thresholds still apply
  • Status and the last run are visible in the dialog and the Learned schema view

This one is great for developers who tune API Shield in a testing environment!