> ## 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.

# Fetch Form Submission API

> The Update Form API is used to modify existing lead form data within a campaign. This API is especially useful when updating incorrect details, adding new information, or making adjustments to previously submitted leads to ensure accurate campaign records.

## Overview

The Fetch Form Submission API retrieves the stored response data for a previously submitted lead. Use it to look up the distribution outcome, buyer response, deduplication result, or redirect URL associated with a specific `transaction_id`. This is useful for debugging integrations, auditing lead outcomes, and building confirmation pages that display post-submission results.

## Endpoint

```
GET /api/lead/fetch/:sourceID
```

Replace `:sourceID` with the source unique ID. The `transaction_id` is passed as a query parameter to identify the specific lead.

## Authentication

Include your API token in the `Authorization` header:

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

## Request Parameters

### Path Parameters

| Parameter  | Type   | Required | Description                          |
| ---------- | ------ | -------- | ------------------------------------ |
| `sourceID` | string | Yes      | The unique ID of the campaign source |

### Query Parameters

| Parameter        | Type   | Required | Description                                           |
| ---------------- | ------ | -------- | ----------------------------------------------------- |
| `transaction_id` | string | Yes      | The transaction ID of the lead submission to retrieve |

## Example Request

```bash theme={null}
curl -G "https://api.pingtree.com/api/lead/fetch/src_abc123" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  --data-urlencode "transaction_id=txn_7f3a2b1c-4d56-78ef-9012-abcdef123456"
```

## Example Responses

### Success — Lead Response Found

```json theme={null}
{
  "status": 200,
  "message": "Lead response fetched successfully",
  "data": {
    "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456",
    "leadStatus": "accepted",
    "redirect_url": "https://thank-you.example.com?tid=txn_7f3a2b1c",
    "isDeDupe": false,
    "cid": "cmp_9z8y7x6w",
    "pid": "src_abc123",
    "createdAt": "2025-08-14T10:32:00.000Z"
  }
}
```

### Success — Duplicate Lead

```json theme={null}
{
  "status": 200,
  "message": "Lead response fetched successfully",
  "data": {
    "transaction_id": "txn_7f3a2b1c-4d56-78ef-9012-abcdef123456",
    "leadStatus": "unsold",
    "isDeDupe": true,
    "cid": "cmp_9z8y7x6w",
    "pid": "src_abc123",
    "createdAt": "2025-08-14T10:35:00.000Z"
  }
}
```

### Error — Lead Not Found

```json theme={null}
{
  "status": 400,
  "message": "No lead found for the provided transaction_id",
  "data": {}
}
```

### Error — Unauthorized

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

## Status Codes

| HTTP Code | Description                                            |
| --------- | ------------------------------------------------------ |
| 200       | Lead response retrieved successfully                   |
| 400       | Invalid or missing `transaction_id`, or lead not found |
| 401       | Invalid or missing API token                           |
| 500       | Internal server error                                  |

## Tips

* **Immediate availability:** Response data is available as soon as the lead submission completes. In most cases, you can fetch it within a few milliseconds of the original POST.
* **Debugging submissions:** If a landing page integration is not behaving as expected, use this endpoint to confirm what the platform recorded and returned during distribution.
* **Redirect URL delivery:** If your form does not capture the `redirect_url` from the submission response, you can re-fetch it here and redirect the consumer server-side.
* **Deduplication flag:** The `isDeDupe` field lets you determine whether the consumer had previously submitted through this campaign.


## OpenAPI

````yaml GET /api/lead/fetch-response/{campaign-id}
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/lead/fetch-response/{campaign-id}:
    get:
      description: >-
        The Update Form API is used to modify existing lead form data within a
        campaign. This API is especially useful when updating incorrect details,
        adding new information, or making adjustments to previously submitted
        leads to ensure accurate campaign records.
      parameters:
        - name: campaign-id
          required: true
          in: path
          description: Your campaign ID
          schema:
            type: string
        - name: transaction_id
          required: true
          in: query
          description: Your lead transaction ID
          schema:
            type: string
      responses:
        '201':
          description: Lead successfully matched
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/lead-response'
        '400':
          description: >-
            Unexpected error, Lead not found or Token not valid or Campaign not
            found
          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

````