Optimizations

Turn auto-optimization on or off for a site

Enable or disable auto-optimization for one site, and optionally reconfigure which suggestion types are auto-applied and the confidence threshold they must clear. Requires the write:optimizations scope.

site_id and enabled are always required. auto_apply_types and confidence_threshold are optional and are only written when supplied — omitting them leaves the site's stored values untouched, so disabling never discards a configuration you can re-enable later.

The response echoes the RAW PERSISTED site settings, not the effective policy. GET /auto-optimization/status reports the effective values, which may be narrower because a saved workspace policy (Content Guard) intersects the allowed types and takes the stricter threshold. An empty auto_apply_types means nothing is applied automatically and every suggestion waits for review.

A site that does not exist in your organization, or is in the Trash, is reported as a 400 (Site not found) rather than a 404. Invalid suggestion types and an out-of-range threshold are also 400s, with the message naming the valid values.

CORS preflight is supported (OPTIONS returns 204; allowed methods POST, OPTIONS; allowed headers Content-Type, X-API-KEY).

post/auto-optimization/toggle

Request

  • Base URL: https://next.frase.io/api/v1
  • URL: https://next.frase.io/api/v1/auto-optimization/toggle
  • Auth: API key in header X-API-KEY

Request body

site_idstring uuid required

Required. The site to configure. Must belong to your organization and not be trashed.

enabledboolean required

Required. True turns auto-optimization on for the site; false pauses it while preserving the stored types and threshold.

auto_apply_typesstring[]

Optional. Suggestion types eligible for automatic application. Only written when supplied; an empty array means nothing is auto-applied. Any value outside the enum rejects the whole request.

confidence_thresholdnumber

Optional. Minimum confidence (0-100) a suggestion must reach to be auto-applied. Only written when supplied.

Response

Site settings persisted. Values are the raw stored site settings, not the workspace-narrowed effective policy.

Changes

No recorded changes to this operation across all 1 revision of this API.