Pipelines

Quartz API enables an easy access to pipeline data, metrics through the /pipelines API endpoint.

Pipelines and sub-pipelines represent a set of open opportunities (meaning opportunities still active in the CRM).

  • Pipeline is the set of all opportunities within the CRM for a company

  • Sub-pipeline is a subset of the complete pipeline. e.g team pipeline or individual pipeline

Pipelines Management

Create a Sub-Pipeline

Create a sub-pipeline.

While creating a sub-pipeline, it is required to set a filter by defining the filtering property.

Available property is member. value is member_id. This will create a sub-pipeline with opportunities owned by the member.

POST /pipelines
request
 {
    "name" : "name",
    to be detailed
}
response
{
    "message" : "Sub-Pipeline created",
    "success" : true,
    "statusCode" : 200,
    "pipeline_id" : 'e34uZ-eevon-65ezc-5c9nR' // id of sub-pipeline created
}

Get Pipelines

Retrieves the complete list of pipeline and sub-pipelines of open opportunities for the company.

GET /pipelines
response
{
    "snapshot_id": "4af7c8d0-20c7-11ef-acef-1568cab95b54",
    "created_at": "2024-06-02 10:00:48",
    "pipeline_definitions": [
        {
            "label": "Sales Pipeline",
            "pipeline_definition_id": "572af52d-20c7-11ef-aa7d-1568cab95b54",
            "pipelines": [
                {
                    "id": "57bdc608-20c7-11ef-84a5-1568cab95b54",
                    "is_sub_pipeline": true,
                },
                {
                    "id": "57a86818-20c7-11ef-89c0-1568cab95b54",
                    "is_sub_pipeline": false,
                },
                {
                    "id": "57bdc6f7-20c7-11ef-b68a-1568cab95b54",
                    "is_sub_pipeline": true
                }
            ]
        }
    ]
}

Get Pipeline Stages

Pipeline stages are defined in the CRM part of the initial configuration. We offer an endpoint to retrieve these stages for use in your application.

GET /pipelines/stages
request
{ 
    "pipeline_definition_id" : "572af52d-20c7-11ef-aa7d-1568cab95b54"
}
response
{
    "pipeline_definition_id": "572af52d-20c7-11ef-aa7d-1568cab95b54",
    "stages": [
        {
            "label": "Appointment Scheduled",
            "id": "ba03eb99-1da2-11ef-a5fa-ab11d6dd9cee",
            "order": "0",
            "metadata": {
                "is_closed": "false",
                "probability": "0.2"
            }
        },
        {
            "label": "Qualified To Buy",
            "id": "ba03ec0e-1da2-11ef-8be3-ab11d6dd9cee",
            "order": "1",
            "metadata": {
                "is_closed": "false",
                "probability": "0.4"
            }
        },
...
    ]
}

Pipelines Data

Get Pipeline Metrics

Retrieves pipeline metrics as documented in Metrics Reference.

All metrics and KPI available can be requested.

GET /pipelines/metrics
request all metrics
{ 
    "pipeline_id" : "s-53fJK-ervon-65ezc-hgEtE"
}
request some metrics
{ 
    "pipeline_id" : "s-53fJK-ervon-65ezc-hgEtE"
    "metrics" : {
        "PIPELINE_METRIC_APINAME_1",
        "PIPELINE_METRIC_APINAME_2",
        },
}
response
{
  "metrics": [
        {
            "metric_definition": {
                "id": "fa39ee34-1e6b-11ef-83ef-951eff9d6bcd",
                "api_codename": "win-rate"
            },
            "scope": {
                "pipeline": "ddc96daf-1e6b-11ef-aec0-0b6c155b44cd"
            },
            "metric_value": {
                "value": 0.4444444444444444,
                "unit": "percentage"
            }
        },
    ],
    ...    
  "status" : {
        "message" : "Pipeline metrics found and retrieved",
        "success" : true,
        "statusCode" : 200,
    }
}

Get Pipeline Metrics Time Series

Retrieves pipeline metrics as time series by specifying the metric and the duration to retrieve.

GET /pipelines/timeseries
request
{ 
    "pipeline_id" : "s-53fJK-ervon-65ezc-hgEtE"
    "metrics" : {
        "metric_name" : "PIPELINE_METRIC_APINAME_1",
        "duration" : 30,
        },
    "status" :  {
        ...
    }     
}
response
// Some code

Get Pipeline Health

GET /pipelines/health
request health metrics
{ 
    "pipeline_id" : "s-53fJK-]}-65ezc-hgEtE"
    "metrics" : {
        "PIPELINE_HEALTH_METRIC_APINAME_1",
        "PIPELINE_HEALTH_METRIC_APINAME_2",
        "PIPELINE_HEALTH_METRIC_APINAME_3"
        },
}
response
{
    "health-metrics" : {
        "PIPELINE_METRIC_APINAME_1" : "VALUE",
        "PIPELINE_METRIC_APINAME_2" : "VALUE",
        "PIPELINE_METRIC_APINAME_3" : {STRUCT},
    },
    "message" : "Pipeline health metrics found and retrieved",
    "success" : true,
    "statusCode" : 200,
}

Last updated