For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Get Started
    • Introduction
    • Quickstart
    • Authentication
  • API Reference
      • GETList Workflows
      • POSTCreate Workflow
      • GETGet Workflow
      • PUTUpdate Workflow
      • DELDelete Workflow
      • PATCHPatch Workflow
      • GETList Workflow Uploads
      • POSTPreview Run
      • GETRuns Summary
      • GETGet Run Steps
      • GETGet Run Overview
      • GETGet Run Data
      • GETDownload Run
      • GETDownload Run Node
      • POSTDuplicate Workflow
  • Python SDK
    • Install
    • Usage
    • Errors
  • CLI
    • Overview
LogoLogo
API Referenceworkflows

Duplicate Workflow

POST
/api/v1/workflows/:workflow_id/duplicate
POST
/api/v1/workflows/:workflow_id/duplicate
$curl -X POST https://api.onepin.ai/api/v1/workflows/workflow_id/duplicate \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "data": {
3 "id": "d4f1a2b3-9c8e-4f7a-8b2d-1e2f3a4b5c6d",
4 "user_id": "a1b2c3d4-e5f6-7a8b-9c0d-e1f2a3b4c5d6",
5 "name": "Marketing Campaign Workflow Copy",
6 "definition": {
7 "steps": [
8 {
9 "id": "step1",
10 "type": "email",
11 "config": {
12 "subject": "Welcome to our service",
13 "template_id": "tmpl_12345"
14 }
15 },
16 {
17 "id": "step2",
18 "type": "delay",
19 "config": {
20 "duration": "2d"
21 }
22 },
23 {
24 "id": "step3",
25 "type": "sms",
26 "config": {
27 "message": "Don't miss our spring sale!"
28 }
29 }
30 ],
31 "triggers": [
32 {
33 "type": "webhook",
34 "url": "https://hooks.example.com/trigger"
35 }
36 ]
37 },
38 "created_at": "2024-01-15T09:30:00Z",
39 "updated_at": "2024-01-15T09:30:00Z",
40 "description": "Duplicate of the original marketing campaign workflow for Q2 adjustments",
41 "runs_count": 12,
42 "last_run_at": "2024-04-10T14:45:00Z",
43 "last_run_status": "completed"
44 },
45 "meta": {
46 "request_id": "req_7f8e9d6c-1234-5678-9abc-def012345678",
47 "timestamp": "2024-04-11T08:00:00Z"
48 }
49}
Duplicate a workflow.
Was this page helpful?
Previous

List Runs

Next
Built with

Authentication

AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer

Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.

Path parameters

workflow_idstringRequiredformat: "uuid"

Headers

X-Workspace-Idstring or nullOptional

Response

Successful Response
dataobject
metaobject

Errors

422
Unprocessable Entity Error