Skip to main content
GET
/
api
/
flows
Flows
curl --request GET \
  --url https://api.example.com/api/flows \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "theme_id": "<string>",
  "screens": [
    {}
  ],
  "is_default": true,
  "status": "<string>",
  "targeting": {}
}
'
{
  "success": true,
  "data": [
    {
      "id": "flow_abc123",
      "project_id": "proj_xyz789",
      "name": "Default Onboarding",
      "description": "Main onboarding flow for new users",
      "status": "active",
      "is_default": true,
      "theme_id": "theme_def456",
      "screens": [
        {
          "id": "screen_1",
          "order": 0,
          "type": "welcome"
        },
        {
          "id": "screen_2", 
          "order": 1,
          "type": "permissions"
        }
      ],
      "targeting": {
        "percentage": 100,
        "conditions": []
      },
      "stats": {
        "total_views": 15420,
        "completion_rate": 0.76
      },
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T14:45:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 3,
    "totalPages": 1
  }
}

Documentation Index

Fetch the complete documentation index at: https://muchadostudio.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

List Flows

Get all flows for a project.
project_id
string
required
The project ID to filter flows
status
string
Filter by status: active, draft, archived
page
number
default:"1"
Page number for pagination
limit
number
default:"20"
Number of items per page
{
  "success": true,
  "data": [
    {
      "id": "flow_abc123",
      "project_id": "proj_xyz789",
      "name": "Default Onboarding",
      "description": "Main onboarding flow for new users",
      "status": "active",
      "is_default": true,
      "theme_id": "theme_def456",
      "screens": [
        {
          "id": "screen_1",
          "order": 0,
          "type": "welcome"
        },
        {
          "id": "screen_2", 
          "order": 1,
          "type": "permissions"
        }
      ],
      "targeting": {
        "percentage": 100,
        "conditions": []
      },
      "stats": {
        "total_views": 15420,
        "completion_rate": 0.76
      },
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T14:45:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 3,
    "totalPages": 1
  }
}

Get Flow

Get details for a specific flow.
id
string
required
The flow ID
{
  "success": true,
  "data": {
    "id": "flow_abc123",
    "project_id": "proj_xyz789",
    "name": "Default Onboarding",
    "description": "Main onboarding flow for new users",
    "status": "active",
    "is_default": true,
    "theme_id": "theme_def456",
    "screens": [
      {
        "id": "screen_1",
        "order": 0,
        "type": "welcome",
        "content": {
          "title": "Welcome to MyApp",
          "subtitle": "Let's get you started",
          "image_url": "/images/welcome.png"
        }
      },
      {
        "id": "screen_2",
        "order": 1,
        "type": "permissions",
        "content": {
          "title": "Enable Notifications",
          "subtitle": "Stay updated with important alerts",
          "permissions": ["notifications"]
        }
      }
    ],
    "targeting": {
      "percentage": 100,
      "conditions": [],
      "priority": 1
    },
    "settings": {
      "allow_skip": true,
      "show_progress": true,
      "completion_action": "navigate_home"
    },
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-20T14:45:00Z"
  }
}

Create Flow

Create a new onboarding flow.
project_id
string
required
The project ID this flow belongs to
name
string
required
Flow name (3-50 characters)
description
string
Flow description
theme_id
string
Theme to apply to this flow
screens
array
Array of screen objects with content
is_default
boolean
default:"false"
Set as the default flow for the project
{
  "success": true,
  "data": {
    "id": "flow_new123",
    "project_id": "proj_xyz789",
    "name": "Premium User Onboarding",
    "description": "Special flow for premium users",
    "status": "draft",
    "is_default": false,
    "theme_id": "theme_premium",
    "screens": [],
    "created_at": "2024-01-25T12:00:00Z"
  }
}

Update Flow

Update an existing flow.
id
string
required
The flow ID to update
name
string
Updated flow name
description
string
Updated description
status
string
Flow status: active, draft, archived
screens
array
Updated screens array
targeting
object
Updated targeting rules

Delete Flow

Delete a flow.
Cannot delete the default flow. Set another flow as default first.
id
string
required
The flow ID to delete

Duplicate Flow

Create a copy of an existing flow.
id
string
required
The flow ID to duplicate
name
string
required
Name for the duplicated flow
{
  "success": true,
  "data": {
    "id": "flow_copy789",
    "name": "Default Onboarding (Copy)",
    "description": "Main onboarding flow for new users",
    "status": "draft",
    "screens": [...],
    "created_at": "2024-01-25T15:00:00Z"
  }
}

Flow Analytics

Get analytics data for a specific flow.
id
string
required
The flow ID
period
string
default:"7d"
Time period: 1d, 7d, 30d, 90d
timezone
string
default:"UTC"
Timezone for date grouping
{
  "success": true,
  "data": {
    "summary": {
      "total_starts": 5420,
      "total_completions": 4120,
      "completion_rate": 0.76,
      "avg_time_seconds": 45,
      "drop_off_rate": 0.24
    },
    "daily_metrics": [
      {
        "date": "2024-01-25",
        "starts": 342,
        "completions": 260,
        "completion_rate": 0.76
      }
    ],
    "screen_metrics": [
      {
        "screen_id": "screen_1",
        "views": 5420,
        "drop_offs": 200,
        "avg_time_seconds": 12
      }
    ],
    "user_segments": {
      "by_platform": {
        "ios": { "completion_rate": 0.78 },
        "android": { "completion_rate": 0.74 }
      }
    }
  }
}

Code Examples

// Create a new flow
const createFlow = async () => {
  const response = await fetch('https://onboardsync.vercel.app/api/flows', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      project_id: 'proj_xyz789',
      name: 'New User Onboarding',
      description: 'Welcome flow for new users',
      screens: [
        {
          type: 'welcome',
          content: {
            title: 'Welcome!',
            subtitle: 'Let\'s get started',
            image_url: '/images/welcome.png'
          }
        },
        {
          type: 'feature',
          content: {
            title: 'Key Features',
            features: [
              { icon: 'star', text: 'Feature 1' },
              { icon: 'heart', text: 'Feature 2' }
            ]
          }
        }
      ]
    })
  });
  
  return response.json();
};

// Update flow status
const activateFlow = async (flowId) => {
  const response = await fetch(`https://onboardsync.vercel.app/api/flows/${flowId}`, {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      status: 'active'
    })
  });
  
  return response.json();
};