Bot Management

The Bot Management API allows you to configure ContentGuard, which controls how Fastly responds to bot traffic. Bots are grouped into categories, each of which has a default action. You can override the action for an individual bot within a category.

This API configures ContentGuard. It is not the bot detection and rule feature set of the Next-Gen WAF API, which is documented separately.

Workspaces

A workspace is the container for bot management settings and policy. To find the workspace attached to a service, filter the list workspaces endpoint by service_id.

Policy, categories, and bots

Policy is the enforcement layer within a workspace. It contains categories, and each category contains bots:

  • Setting an action on a category applies that action to every bot in the category, including bots that Fastly adds to the category later.
  • Setting an action on a bot overrides the action of the category it belongs to. Set a bot's action to inherit to return it to the category action.

Categories and bots are both defined by Fastly. You cannot create or delete them, only change their actions.

Protection mode

Each workspace has a protection_mode that gates all enforcement:

  • off: no enforcement, regardless of category and bot actions.
  • log: bots are detected and logged, but no requests are blocked or challenged.
  • block: category and bot actions are fully enforced.

Data model

The action applied to matching requests.

typestringThe type of action to apply. Required.
actionobjectThe action applied to requests from a single bot. Set the action to 'inherit' to apply the category's action or to a specific value to override the category's action.
bot_idstringThe unique identifier of the bot. Read-only.
namestringThe display name of the bot. Read-only.
metaobjectMetadata about the request.
category_idstringThe unique identifier of the category. Read-only.
descriptionstringA description of the bots the category contains. Read-only.
detailstringAn explanation of the problem, specific to this occurrence.
statusintegerThe HTTP status code of the response.
titlestringA short summary of the problem.
limitintegerThe limit value used when making the request.
next_cursorstringThe cursor to use to request the next page of results. Set to null when there are no more results.
totalintegerThe count of results matching the request.
protection_modestringThe protection mode of the workspace. off disables all enforcement. log detects and logs bots without blocking or challenging requests. block enforces the actions set on categories and bots.
created_atstringThe date and time the workspace was created, in RFC 3339 format. Read-only.
idstringA UUID used to uniquely identify the workspace. Read-only.
servicesarrayThe IDs of the services attached to this workspace. Read-only.
updated_atstringThe date and time the workspace was last updated, in RFC 3339 format. Read-only.

Endpoints

List workspaces

GET/bot-management/v1/workspaces

Get a workspace

GET/bot-management/v1/workspaces/workspace_id

Update a workspace

PATCH/bot-management/v1/workspaces/workspace_id

List categories

GET/bot-management/v1/workspaces/workspace_id/policy/categories

Get a category

GET/bot-management/v1/workspaces/workspace_id/policy/categories/category_id

Set a category action

PATCH/bot-management/v1/workspaces/workspace_id/policy/categories/category_id

List all bots in a workspace

GET/bot-management/v1/workspaces/workspace_id/policy/bots

List bots in a category

GET/bot-management/v1/workspaces/workspace_id/policy/categories/category_id/bots

Get a bot

GET/bot-management/v1/workspaces/workspace_id/policy/categories/category_id/bots/bot_id

Set a bot action

PATCH/bot-management/v1/workspaces/workspace_id/policy/categories/category_id/bots/bot_id