Skip to main content
POST
/
api
/
v2
/
public
/
workflow
curl -X POST "https://app.refold.ai/api/v2/public/workflow" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "linked_account_id: YOUR_LINKED_ACCOUNT_ID" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Lead Sync", "slug": "hubspot" }'
{
  "workflow": {
    "_id": "6a31545ed0aeb8165beb9a43",
    "name": "Lead Sync",
    "org_id": "6500a1b2c3d4e5f6a7b8c9d0",
    "nodes": [
      { "id": "1", "type": "start", "incoming_nodes": [], "outgoing_nodes": [], "data": null }
    ],
    "createdAt": "2026-06-16T13:49:18.390Z",
    "updatedAt": "2026-06-16T13:49:18.390Z"
  }
}
Create a workflow scoped to a linked account. If you don’t supply associated_application or slug, the workflow is attached to the org’s default custom application. The new workflow starts as an unpublished draft with a single start node — build it out, then publish it.
Because this call authenticates as a linked account (API key + linked_account_id, or a session token), it creates a private workflow — one that belongs to that specific linked account. Public workflows are org-level and tied to application slugs; they are not created through this endpoint.

Authentication

This endpoint is scoped to a linked account, so it accepts either authentication method. Option 1 — API key
x-api-key
string
Your Refold API key.
linked_account_id
string
The linked account to scope the workflow to.
Option 2 — Session token
Authorization
string
Session token. Format: Bearer YOUR_SESSION_TOKEN

Body Parameters

name
string
Workflow name.
slug
string
Application slug to associate. Defaults to the org’s default custom app.
associated_application
string
Application ID to associate (alternative to slug).

Response

workflow
object
The created workflow.
{
  "workflow": {
    "_id": "6a31545ed0aeb8165beb9a43",
    "name": "Lead Sync",
    "org_id": "6500a1b2c3d4e5f6a7b8c9d0",
    "nodes": [
      { "id": "1", "type": "start", "incoming_nodes": [], "outgoing_nodes": [], "data": null }
    ],
    "createdAt": "2026-06-16T13:49:18.390Z",
    "updatedAt": "2026-06-16T13:49:18.390Z"
  }
}
curl -X POST "https://app.refold.ai/api/v2/public/workflow" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "linked_account_id: YOUR_LINKED_ACCOUNT_ID" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Lead Sync", "slug": "hubspot" }'