Pipelines
The Pipelines API allows you to manage sales pipelines and deals. Introzy supports multiple pipeline types for different workflows:
- SALES - Direct sales opportunities and revenue tracking
- ADVOCACY - Customer advocacy and referral programs
- INTEGRATION - Integration partner deals
- REFERRAL - Referral tracking and management
- PARTNER - Partner network management
List Pipelines
GET /api/pipelines
Retrieves all pipelines for your organization with stage and deal counts.
Response
Success Response (200)
{
"success": true,
"data": [
{
"id": "pipeline-uuid",
"type": "SALES",
"name": "Sales Pipeline",
"description": "Direct sales opportunities and revenue tracking",
"stageCount": 5,
"dealCount": 23,
"createdAt": "2024-01-01T00:00:00.000Z"
},
{
"id": "pipeline-uuid-2",
"type": "REFERRAL",
"name": "Referral Pipeline",
"description": "Referral tracking and management",
"stageCount": 4,
"dealCount": 12,
"createdAt": "2024-01-01T00:00:00.000Z"
}
]
}
Get Pipeline
GET /api/pipelines/{type}
Retrieves a specific pipeline by type with its stages. If the pipeline doesn't exist, it will be auto-created with default stages.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Pipeline type (sales, advocacy, integration, referral, partner) |
Response
Success Response (200)
{
"success": true,
"data": {
"id": "pipeline-uuid",
"type": "SALES",
"name": "Sales Pipeline",
"description": "Direct sales opportunities",
"stages": [
{
"id": "stage-uuid-1",
"label": "Lead",
"color": "#3B82F6",
"description": "New leads to be qualified",
"sortOrder": 0,
"dealCount": 8
},
{
"id": "stage-uuid-2",
"label": "Qualified",
"color": "#10B981",
"description": "Qualified opportunities",
"sortOrder": 1,
"dealCount": 5
},
{
"id": "stage-uuid-3",
"label": "Won",
"color": "#8B5CF6",
"description": "Closed won deals",
"sortOrder": 2,
"dealCount": 10
}
]
}
}
List Deals
GET /api/pipelines/{type}/deals
Retrieves deals in a specific pipeline with pagination.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Pipeline type |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | No | Results per page (1-100, default: 50) |
page |
integer | No | Page number (default: 1) |
stageId |
string | No | Filter by stage ID |
Response
Success Response (200)
{
"success": true,
"data": {
"deals": [
{
"id": "deal-uuid",
"name": "Acme Corp - Enterprise Plan",
"description": "Potential enterprise customer",
"expectedValue": 50000,
"currency": "USD",
"notes": "Follow up next week",
"stage": {
"id": "stage-uuid",
"label": "Qualified",
"color": "#10B981"
},
"contact": {
"id": "contact-uuid",
"firstName": "John",
"lastName": "Doe",
"email": "john@acme.com"
},
"owner": {
"id": "user-uuid",
"firstName": "Sales",
"lastName": "Rep"
},
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-20T15:30:00.000Z"
}
],
"total": 23,
"page": 1,
"limit": 50,
"hasMore": false
}
}
Create Deal
POST /api/pipelines/{type}/deals
Creates a new deal in the specified pipeline. Deals are automatically placed in the first stage.
Request Body
{
"name": "Acme Corp - Enterprise Plan",
"description": "Potential enterprise customer from trade show",
"expectedValue": 50000,
"currency": "USD",
"contactId": "contact-uuid",
"contactType": "USER",
"notes": "Met at SaaS Conference 2024"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Deal name (1-200 characters) |
description |
string | No | Deal description (max 1000 characters) |
expectedValue |
number | No | Expected deal value |
currency |
string | No | Currency code (default: USD) |
contactId |
string | No | Link to contact (UUID) |
contactType |
string | No | Contact type: USER or COMPANY |
ownerId |
string | No | Deal owner (defaults to creator) |
notes |
string | No | Additional notes |
referredByCustomerId |
string | No | For referral deals, the referring contact |
referredByContactType |
string | No | Type of referring contact |
Response
Success Response (201)
{
"success": true,
"data": {
"id": "deal-uuid",
"name": "Acme Corp - Enterprise Plan",
"description": "Potential enterprise customer from trade show",
"expectedValue": 50000,
"currency": "USD",
"stage": {
"id": "stage-uuid",
"label": "Lead",
"color": "#3B82F6"
},
"contact": {
"id": "contact-uuid",
"firstName": "John",
"lastName": "Doe"
},
"createdAt": "2024-01-20T10:00:00.000Z"
},
"message": "Deal created successfully"
}
Get Deal
GET /api/pipelines/{type}/deals/{id}
Retrieves details for a specific deal.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Pipeline type |
id |
string | Yes | Deal UUID |
Response
Success Response (200)
{
"success": true,
"data": {
"id": "deal-uuid",
"name": "Acme Corp - Enterprise Plan",
"description": "Potential enterprise customer",
"expectedValue": 50000,
"currency": "USD",
"notes": "Follow up next week",
"stage": {
"id": "stage-uuid",
"label": "Qualified",
"color": "#10B981",
"description": "Qualified opportunities"
},
"contact": {
"id": "contact-uuid",
"firstName": "John",
"lastName": "Doe",
"email": "john@acme.com"
},
"owner": {
"id": "user-uuid",
"firstName": "Sales",
"lastName": "Rep",
"email": "sales@company.com"
},
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-20T15:30:00.000Z"
}
}
Update Deal
PATCH /api/pipelines/{type}/deals/{id}
Updates an existing deal. Use this to move deals between stages or update deal information.
Request Body
{
"pipelineStageId": "stage-uuid-qualified",
"expectedValue": 75000,
"notes": "Increased deal size after demo"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | No | Deal name |
description |
string | No | Deal description |
expectedValue |
number | No | Expected deal value |
currency |
string | No | Currency code |
pipelineStageId |
string | No | Move to different stage |
notes |
string | No | Additional notes |
ownerId |
string | No | Transfer to different owner |
Response
Success Response (200)
{
"success": true,
"data": {
"id": "deal-uuid",
"name": "Acme Corp - Enterprise Plan",
"expectedValue": 75000,
"stage": {
"id": "stage-uuid-qualified",
"label": "Qualified"
}
},
"message": "Deal updated successfully"
}
Delete Deal
DELETE /api/pipelines/{type}/deals/{id}
Soft-deletes a deal. The deal is removed from the pipeline but retained for historical reporting.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Pipeline type |
id |
string | Yes | Deal UUID |
Response
Success Response (200)
{
"success": true,
"data": {
"deleted": true
},
"message": "Deal deleted successfully"
}
Example Usage
# List all pipelines
curl -X GET "https://beta-api.introzy.com/api/pipelines" \
-H "Authorization: Bearer introzy_your_api_key"
# Get sales pipeline with stages
curl -X GET "https://beta-api.introzy.com/api/pipelines/sales" \
-H "Authorization: Bearer introzy_your_api_key"
# List deals in sales pipeline
curl -X GET "https://beta-api.introzy.com/api/pipelines/sales/deals?limit=20" \
-H "Authorization: Bearer introzy_your_api_key"
# Create a new deal
curl -X POST "https://beta-api.introzy.com/api/pipelines/sales/deals" \
-H "Authorization: Bearer introzy_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "New Enterprise Opportunity",
"expectedValue": 100000,
"contactId": "contact-uuid"
}'
# Move deal to next stage
curl -X PATCH "https://beta-api.introzy.com/api/pipelines/sales/deals/deal-uuid" \
-H "Authorization: Bearer introzy_your_api_key" \
-H "Content-Type: application/json" \
-d '{"pipelineStageId": "qualified-stage-uuid"}'
# Delete a deal
curl -X DELETE "https://beta-api.introzy.com/api/pipelines/sales/deals/deal-uuid" \
-H "Authorization: Bearer introzy_your_api_key"
Use Cases
- Sales Tracking: Track opportunities through your sales process
- Referral Management: Manage referral programs with the REFERRAL pipeline
- Partner Deals: Track integration and partner deals separately
- Advocacy Programs: Manage customer advocacy initiatives
- Pipeline Analytics: Get deal counts per stage for reporting