Create a Navigation Policy

Changed on

Create a navigation policy for this project. Omitted fields take the defaults: enabled, block by default, block unknown domains, no category rules, and no overrides. Bind the policy to a session with browserSettings.riskPolicyId.

post/v1/navigation-policies

Request

  • Base URL
    https://api.browserbase.com
  • Auth
    API key in header X-BB-API-Key

Request body

namestring required

Display name. A policy's id identifies it, not its name.

descriptionstring

Free-form notes about the policy.

enabledboolean

Whether the policy can be bound to new sessions. Running sessions keep the policy they started with. A disabled policy stays editable and can be re-enabled.

defaultDecision'allow' | 'block'

Decision for each of a domain's categories that has no category rule. The strictest of a domain's category decisions applies, and overrides take precedence.

allowedCategoriesstring[]

Navigation categories. Browserbase blocks a domain in any blocked category, even if it is also in an allowed one.

blockedCategoriesstring[]

Navigation categories. Browserbase blocks a domain in any blocked category, even if it is also in an allowed one.

unknownDomainBehavior'allow' | 'block'

Decision for a domain, or one of its categories, that Browserbase can't classify. It counts as one of the domain's category decisions, so the strictest still applies.

Response

The navigation policy has been created.

idstring required

Unique identifier for the navigation policy.

projectIdstring required

The project the policy belongs to.

namestring required

Display name. A policy's id identifies it, not its name.

descriptionstring required

Free-form notes about the policy.

enabledboolean required

Whether the policy can be bound to new sessions. Running sessions keep the policy they started with. A disabled policy stays editable and can be re-enabled.

defaultDecision'allow' | 'block' required

Decision for each of a domain's categories that has no category rule. The strictest of a domain's category decisions applies, and overrides take precedence.

allowedCategoriesstring[] required

Navigation categories. Browserbase blocks a domain in any blocked category, even if it is also in an allowed one.

blockedCategoriesstring[] required

Navigation categories. Browserbase blocks a domain in any blocked category, even if it is also in an allowed one.

unknownDomainBehavior'allow' | 'block' required

Decision for a domain, or one of its categories, that Browserbase can't classify. It counts as one of the domain's category decisions, so the strictest still applies.

createdAtstring date-time required
updatedAtstring date-time required

Changes