Skip to main content
PUT
/
api
/
v2
/
public
/
workflow
/
:workflow_id
/
publish
curl -X PUT "https://app.refold.ai/api/v2/public/workflow/{draft_workflow_id}/publish" \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "published": true }'
{
  "_id": "6a3158ffd396207fd25314e7",
  "name": "Lead Sync",
  "published": true,
  "nodes": [ { "id": "1", "type": "start" } ]
}
Publish or unpublish a workflow. Publishing registers the workflow’s triggers and crons and snapshots the current draft as a new version; unpublishing deregisters them. Publishing with a specific version publishes the draft as that version number.
The draft ID and the published ID are different.
  • To publish, pass the draft workflow ID — the _id returned by Create Workflow (or the workflow whose draft you opened via Get Workflow Draft).
  • The publish response returns the published workflow ID (a different _id). Use that ID — also visible in List Workflows — to unpublish, execute, or delete.
  • Calling unpublish with the draft ID fails with 400 INVALID_WORKFLOW_ID (“Only public and published workflows can be unpublished”).

Authentication

This endpoint requires a session token (issue one with Generate Session Token); it operates on the linked account’s private workflow.
Authorization
string
required
Session token for the linked account.Format: Bearer YOUR_SESSION_TOKEN

Path Parameters

workflow_id
string
required
When publishing (published: true), the draft workflow ID. When unpublishing (published: false), the published workflow ID returned by the publish call. See the note above.

Body Parameters

published
boolean
required
true to publish (registers triggers), false to unpublish.
version
integer
When publishing, publish the draft as this version number.

Response

Returns the published (or unpublished) workflow. On publish, the _id here is the published workflow ID — different from the draft ID you passed in.
{
  "_id": "6a3158ffd396207fd25314e7",
  "name": "Lead Sync",
  "published": true,
  "nodes": [ { "id": "1", "type": "start" } ]
}
curl -X PUT "https://app.refold.ai/api/v2/public/workflow/{draft_workflow_id}/publish" \
  -H "Authorization: Bearer YOUR_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "published": true }'