Skip to main content
PUT
/
api
/
v2
/
public
/
workflow
/
{workflow_id}
/
publish
Publish / Unpublish Private Workflow
curl --request PUT \
  --url https://api.gocobalt.io/api/v2/public/workflow/{workflow_id}/publish \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --header 'environment: <environment>' \
  --header 'linked_account_id: <linked_account_id>' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "published": true,
  "description": "<string>"
}
'
{
  "published": true,
  "current_version": 2,
  "updatedAt": "2025-07-10T11:22:00.000Z"
}
This API updates the published state of a private workflow. The same endpoint handles both publishing and unpublishing by toggling the published flag in the request body.
A private workflow is a workflow created by a linked account itself — it belongs exclusively to that linked account and is not visible to or shared with the organization.

Request description

This API supports two authentication methods. You can use either a Session Token OR the combination of an Org API key and linked account ID.

Authentication Option 1: Session Token

Authorization
string
required
Bearer token using the session token of the linked account.Format: Bearer <session_token>

Authentication Option 2: Org API Key + Linked Account ID

x-api-key
string
required
Your org-level Cobalt API key.
linked_account_id
string
required
The unique identifier of the linked account to scope the request to.

Other Headers

environment
string
required
The environment to target. Accepted values: test, production.

Path Parameters

workflow_id
string
required
The ID of the workflow to publish or unpublish. See usage notes below for which ID to pass depending on the operation.

Body Parameters

published
boolean
required
Set to true to publish the workflow, false to unpublish.
description
string
Optional description. Include when publishing.

Usage

Publishing and unpublishing use different workflow IDs. Read the steps below carefully.

Unpublish a workflow

Pass the parent workflow ID with "published": false:
cURL
curl --location --request PUT \
  'https://api.gocobalt.io/api/v2/public/workflow/<workflow_id>/publish' \
  --header 'Authorization: Bearer <session_token>' \
  --header 'x-api-key: <your_api_key>' \
  --header 'environment: test' \
  --header 'Content-Type: application/json' \
  --data '{"published": false}'

Publish a workflow

Publishing requires the draft workflow ID, not the parent workflow ID. Follow these two steps: Step 1 — Fetch the draft workflow ID Use the Get Draft Workflow endpoint to retrieve the draft:
cURL
curl --location \
  'https://api.gocobalt.io/api/v2/public/workflow/<workflow_id>/edit' \
  --header 'Authorization: Bearer <session_token>'
Copy the _id from the response — this is your draft_workflow_id:
{
  "_id": "69ce22a6ebade1cc4309b647",
  "associated_workflow": "69ce22a6ebade1cc4309b641",
  "name": "test",
  "published": false
}
Step 2 — Publish using the draft workflow ID Pass the draft_workflow_id into the publish endpoint with "published": true:
cURL
curl --location --request PUT \
  'https://api.gocobalt.io/api/v2/public/workflow/<draft_workflow_id>/publish' \
  --header 'Authorization: Bearer <session_token>' \
  --header 'x-api-key: <your_api_key>' \
  --header 'environment: test' \
  --header 'Content-Type: application/json' \
  --data '{"published": true, "description": ""}'

Response description

Returns the updated workflow object reflecting the new published state.
published
boolean
The new published state of the workflow — true if published, false if unpublished.
current_version
integer
The current version number, incremented on each successful publish.
updatedAt
string
ISO 8601 timestamp of when the state was last changed.
{
  "published": true,
  "current_version": 2,
  "updatedAt": "2025-07-10T11:22:00.000Z"
}