Update auto/suggest mode
PUT
/api/v1/workflows/{workflowId}/smart/mode
const url = 'https://api.justcrawl.io/api/v1/workflows/example/smart/mode';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"mode":"auto"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.justcrawl.io/api/v1/workflows/example/smart/mode \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "mode": "auto" }'Switches the smart workflow between auto (the optimization worker re-ranks providers
and updates the DAG without asking) and suggest (the worker writes a
optimization_suggestions row and the user clicks Apply). The flip takes effect on
the next optimization tick — in-flight jobs already routed under the old DAG are not
re-routed. Requires workflows:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”workflowId
required
string
The workflow’s stable logical id — the workflowId field of a workflow object, NOT its id field. id is the per-version row key and 404s here.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
mode
required
string
Responses
Section titled “Responses”Mode updated.
Media typeapplication/json
object
mode
string
Example
{ "mode": "auto"}Validation failed — request body or query is missing/invalid
Media typeapplication/json
object
error
string
Example
{ "error": "Missing or invalid \"url\" field"}Missing or invalid authentication token
Media typeapplication/json
object
error
string
Example
{ "error": "Missing or invalid authentication token"}Insufficient permissions for this operation
Media typeapplication/json
object
error
string
Example
{ "error": "No organization. Complete onboarding first."}Resource not found
Media typeapplication/json
object
error
string
Example
{ "error": "Workflow not found"}Unexpected server error. Logs and PostHog $exception capture
Media typeapplication/json
object
error
string
Example
{ "error": "Something went wrong"}