> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pingtree.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Source List API

> The Campaign Source Overview API delivers reporting and statistical data for different lead sources within a campaign. This insight allows marketers to evaluate performance, identify top-performing sources, and refine their strategies accordingly.

## Overview

The Source List API returns performance and statistical data for all lead sources attached to a specific offer campaign. Use it to build reporting dashboards, monitor source-level metrics (leads, conversions, revenue), and identify top-performing or underperforming sources in real time.

## Endpoint

```
GET /api/source-list/{org-id}/{cid}
```

| Segment    | Description                              |
| ---------- | ---------------------------------------- |
| `{org-id}` | Your organization (advertiser) unique ID |
| `{cid}`    | The campaign unique ID                   |

## Authentication

Include your API token in the `Authorization` header:

```
Authorization: Bearer <your-api-token>
```

## Request Parameters

### Path Parameters

| Parameter | Type   | Required | Description            |
| --------- | ------ | -------- | ---------------------- |
| `org-id`  | string | Yes      | Organization unique ID |
| `cid`     | string | Yes      | Campaign unique ID     |

### Query Parameters

| Parameter | Type    | Required | Description                                  |
| --------- | ------- | -------- | -------------------------------------------- |
| `from`    | string  | No       | Start date filter (ISO 8601: `YYYY-MM-DD`)   |
| `to`      | string  | No       | End date filter (ISO 8601: `YYYY-MM-DD`)     |
| `search`  | string  | No       | Search by source name                        |
| `page`    | integer | No       | Page number (default: `1`)                   |
| `limit`   | integer | No       | Records per page (default: `10`, max: `100`) |

## Example Request

```bash theme={null}
curl -G "https://api.pingtree.com/api/source-list/org_5f1a2b3c/cmp_9z8y7x6w" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  --data-urlencode "from=2025-08-01" \
  --data-urlencode "to=2025-08-31"
```

## Example Response

```json theme={null}
{
  "status": 200,
  "message": "Source list retrieved successfully",
  "data": {
    "sources": [
      {
        "sourceUniqueId": "src_abc123",
        "sourceName": "Google Display - Debt",
        "totalLeads": 1240,
        "acceptedLeads": 980,
        "rejectedLeads": 180,
        "duplicateLeads": 80,
        "totalConversions": 120,
        "totalRevenue": 4800.00,
        "totalPayout": 3600.00,
        "margin": 1200.00,
        "status": "active"
      },
      {
        "sourceUniqueId": "src_def456",
        "sourceName": "Facebook Leads - Debt",
        "totalLeads": 540,
        "acceptedLeads": 430,
        "rejectedLeads": 70,
        "duplicateLeads": 40,
        "totalConversions": 55,
        "totalRevenue": 2200.00,
        "totalPayout": 1760.00,
        "margin": 440.00,
        "status": "active"
      }
    ],
    "totalRecord": 2,
    "page": 1,
    "limit": 10
  }
}
```

### Error — Campaign Not Found

```json theme={null}
{
  "status": 400,
  "message": "Campaign not found or access denied"
}
```

### Error — Unauthorized

```json theme={null}
{
  "status": 401,
  "message": "Unauthorized"
}
```

## Status Codes

| HTTP Code | Description                                      |
| --------- | ------------------------------------------------ |
| 200       | Source list returned successfully                |
| 400       | Invalid campaign ID, org ID, or query parameters |
| 401       | Invalid or missing API token                     |
| 500       | Internal server error                            |

## Tips

* **Date range filtering:** Use `from` and `to` to scope the stats to a reporting period. All metrics (leads, conversions, revenue) are calculated within the specified window.
* **Monitoring performance:** Poll this endpoint periodically (e.g. every 15 minutes) to refresh a live performance dashboard for your campaign sources.
* **Revenue vs payout:** `totalRevenue` is what buyers paid; `totalPayout` is what sources were paid. The difference (`margin`) represents your campaign's gross profit for that source.
* **Inactive sources:** Sources with `status: "inactive"` are included in the response for historical reference but are not currently receiving leads.


## OpenAPI

````yaml GET /api/source-list/{org-id}/{cid}
openapi: 3.1.0
info:
  title: Pingtree API Explore
  description: >-
    The Pingtree API Explore is a comprehensive guide designed to help you
    understand and integrate the Pingtree API effectively. It provides detailed
    insights into API endpoints, request parameters, and response structures to
    facilitate seamless lead distribution and tracking. Whether you're building
    custom integrations, automating lead flows, or optimizing campaign
    performance, this guide empowers you with the knowledge to leverage
    Pingtree's capabilities for enhanced lead management and improved results.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.pingtree.com
security: []
paths:
  /api/source-list/{org-id}/{cid}:
    get:
      description: >-
        The Campaign Source Overview API delivers reporting and statistical data
        for different lead sources within a campaign. This insight allows
        marketers to evaluate performance, identify top-performing sources, and
        refine their strategies accordingly.
      parameters:
        - name: org-id
          required: true
          in: path
          description: Your organization ID
          schema:
            type: string
        - name: cid
          required: true
          in: path
          description: Your campaign unique ID
          schema:
            type: string
        - name: date
          required: true
          in: query
          description: Valid date format YYYY-MM-DD
          schema:
            type: string
      responses:
        '201':
          description: Source data fetched successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status code of API response
                  type:
                    type: string
                    description: Type of API response which can be success or error
                  message:
                    type: string
                    description: Message of API response
                  totalRecord:
                    type: object
                    description: Lead's matrix details
        '400':
          description: >-
            Unexpected error, transaction_id or cid not found in the requested
            data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lead-response'
        '401':
          description: Access token is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lead-response'
        '429':
          description: >-
            Too many requests for fetch leads for organization Please wait 60
            seconds before trying again
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lead-response'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lead-response'
      security:
        - bearerAuth: []
components:
  schemas:
    lead-response:
      type: object
      properties:
        status:
          type: string
          description: Status code of API response
        type:
          type: string
          description: Type of API response which can be success or error
        message:
          type: string
          description: Message of API response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````