Apply suggestion
const url = 'https://dashboard.justcrawl.io/api/v1/workflows/example/smart/suggestions/example/apply';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.justcrawl.io/api/v1/workflows/example/smart/suggestions/example/apply \ --header 'Authorization: Bearer <token>'Atomically applies a pending suggestion: rewrites the workflow’s provider order to
match the suggestion’s suggested_provider_order, regenerates the DAG, and marks the
suggestion applied. Uses SELECT FOR UPDATE on the suggestion row inside a single
transaction so concurrent apply attempts from two browser tabs can’t double-spend the
suggestion.
Returns 400 when the suggestion is already applied or dismissed — by design, each
suggestion is one-shot. Returns 404 for missing suggestions or non-smart workflows
(the lookup is org-scoped so cross-tenant probes 404 indistinguishably).
Requires workflows:write.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Responses
Section titled “ Responses ”Suggestion applied; DAG regenerated.
object
Example generated
{ "workflowId": "example", "providerOrder": [ "example" ]}Validation failed — request body or query is missing/invalid
object
Example
{ "error": "Missing or invalid \"url\" field"}Missing or invalid authentication token
object
Example
{ "error": "Missing or invalid authentication token"}Insufficient permissions for this operation
object
Example
{ "error": "No organization. Complete onboarding first."}Resource not found
object
Example
{ "error": "Workflow not found"}Unexpected server error. Logs and PostHog $exception capture
object
Example
{ "error": "Something went wrong"}