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

# Get a lead's journey through the campaign

> **Trace one lead's path through the campaign step graph**

Returns every touchpoint the lead has had, which subsequence branches it
entered, its replies, and where it currently sits.

This is the only endpoint that reports **subsequence branch emails**. `GET
/campaigns/{id}/leads/{lead_id}` walks the linear MAIN chain and drops branch
steps, so a lead that was pulled into a branch looks idle there while it is
actually being emailed.

## What comes back

- `steps[]` -- one per scheduled or sent email, MAIN and branch alike: subject,
`scheduled_for`, `sent_at`, `opened_at`, `bounced_at`, plus `trigger_invalidated`
when a pending step was cancelled (a manual move into a branch does this to the
rest of the MAIN chain), `message_id` and `inbox_email`.
- `enrollments[]` -- each subsequence the lead entered: `entry_node_id`,
`entry_edge_id`, `trigger_reason`, `entered_at`, and `completed_at` once it has
finished the branch.
- `replies[]` -- with threading headers for step attribution.
- `current` / `next_scheduled` -- the derived node keys for where the lead is
now and what fires next.

`node_key` on a step is a stable, human-readable identifier for the graph
position; `node_id` is the flow node UUID.

## Example

```python
import requests

campaign_id = "550e8400-e29b-41d4-a716-446655440000"
lead_id     = "650e8400-e29b-41d4-a716-446655440000"

response = requests.get(
    f"https://api.coldsend.pro/api/public/v1/campaigns/{campaign_id}/leads/{lead_id}/journey",
    headers={"X-API-Key": "your-api-key"}
)
print(response.json())
```



## OpenAPI

````yaml /public_openapi.json get /api/public/v1/campaigns/{campaign_id}/leads/{lead_id}/journey
openapi: 3.0.3
info:
  title: ColdSend Public API
  description: >-
    Programmatic access to ColdSend for managing cold email campaigns and sender
    accounts.
  version: 1.0.0
  contact:
    name: ColdSend Support
    email: support@coldsend.pro
    url: https://coldsend.pro
servers:
  - url: https://api.coldsend.pro
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/public/v1/campaigns/{campaign_id}/leads/{lead_id}/journey:
    get:
      tags:
        - Leads
      summary: Get a lead's journey through the campaign
      description: >-
        **Trace one lead's path through the campaign step graph**


        Returns every touchpoint the lead has had, which subsequence branches it

        entered, its replies, and where it currently sits.


        This is the only endpoint that reports **subsequence branch emails**.
        `GET

        /campaigns/{id}/leads/{lead_id}` walks the linear MAIN chain and drops
        branch

        steps, so a lead that was pulled into a branch looks idle there while it
        is

        actually being emailed.


        ## What comes back


        - `steps[]` -- one per scheduled or sent email, MAIN and branch alike:
        subject,

        `scheduled_for`, `sent_at`, `opened_at`, `bounced_at`, plus
        `trigger_invalidated`

        when a pending step was cancelled (a manual move into a branch does this
        to the

        rest of the MAIN chain), `message_id` and `inbox_email`.

        - `enrollments[]` -- each subsequence the lead entered: `entry_node_id`,

        `entry_edge_id`, `trigger_reason`, `entered_at`, and `completed_at` once
        it has

        finished the branch.

        - `replies[]` -- with threading headers for step attribution.

        - `current` / `next_scheduled` -- the derived node keys for where the
        lead is

        now and what fires next.


        `node_key` on a step is a stable, human-readable identifier for the
        graph

        position; `node_id` is the flow node UUID.


        ## Example


        ```python

        import requests


        campaign_id = "550e8400-e29b-41d4-a716-446655440000"

        lead_id     = "650e8400-e29b-41d4-a716-446655440000"


        response = requests.get(
            f"https://api.coldsend.pro/api/public/v1/campaigns/{campaign_id}/leads/{lead_id}/journey",
            headers={"X-API-Key": "your-api-key"}
        )

        print(response.json())

        ```
      operationId: >-
        get_lead_journey_api_public_v1_campaigns__campaign_id__leads__lead_id__journey_get
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Campaign Id
        - name: lead_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Lead Id
      responses:
        '200':
          description: Journey retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadJourneyResponse'
        '401':
          description: Missing or invalid API key
        '403':
          description: Insufficient permissions - requires 'leads:read' scope
        '404':
          description: Lead or campaign not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LeadJourneyResponse:
      properties:
        lead_id:
          type: string
          format: uuid
          title: Lead Id
          description: Lead ID
        status:
          type: string
          title: Status
          description: Lead status
        steps:
          items:
            $ref: '#/components/schemas/LeadJourneyStep'
          type: array
          title: Steps
          description: Touchpoints in send order
        enrollments:
          items:
            $ref: '#/components/schemas/LeadJourneyEnrollment'
          type: array
          title: Enrollments
          description: Subsequence branch enrollments
        replies:
          items:
            $ref: '#/components/schemas/LeadJourneyReply'
          type: array
          title: Replies
          description: Replies from the lead
        current:
          type: string
          nullable: true
          title: Current
          description: node_key of the last sent touchpoint
        next_scheduled:
          type: string
          nullable: true
          title: Next Scheduled
          description: node_key of the earliest future, unsent, non-invalidated follow-up
      type: object
      required:
        - lead_id
        - status
      title: LeadJourneyResponse
      description: >-
        Read-only journey of one lead through a campaign's step graph.


        Powers the Lead Journey canvas: `steps` draw/light the path,
        `enrollments`

        mark branch jumps, `replies` attribute a "Replied" marker, and `current`
        /

        `next_scheduled` name the lead's present position.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    LeadJourneyStep:
      properties:
        node_key:
          type: string
          title: Node Key
          description: 'Canvas key: node_id string, else ''step:{step_number}'''
        node_id:
          type: string
          format: uuid
          nullable: true
          title: Node Id
          description: Flow node id (subsequence branch emails); NULL for main-chain steps
        sequence_id:
          type: string
          format: uuid
          nullable: true
          title: Sequence Id
          description: Legacy sequence id; NULL for branch-only emails
        step_number:
          type: integer
          nullable: true
          title: Step Number
          description: >-
            Sequence step number (1=initial, 2-11=follow-ups); NULL for branch
            emails
        email_id:
          type: string
          format: uuid
          nullable: true
          title: Email Id
          description: Email/SequenceEmail row id
        subject:
          type: string
          nullable: true
          title: Subject
          description: Subject (rendered at send time)
        sent_at:
          type: string
          format: date-time
          nullable: true
          title: Sent At
          description: When sent (NULL if not yet sent)
        opened_at:
          type: string
          format: date-time
          nullable: true
          title: Opened At
          description: When opened
        bounced_at:
          type: string
          format: date-time
          nullable: true
          title: Bounced At
          description: When bounced
        scheduled_for:
          type: string
          format: date-time
          nullable: true
          title: Scheduled For
          description: When scheduled to send (follow-ups only)
        sent:
          type: boolean
          title: Sent
          description: Whether this email was sent
          default: false
        opened:
          type: boolean
          title: Opened
          description: Whether this email was opened
          default: false
        bounced:
          type: boolean
          title: Bounced
          description: Whether this email bounced
          default: false
        trigger_invalidated:
          type: boolean
          title: Trigger Invalidated
          description: Whether the follow-up trigger condition was invalidated
          default: false
        message_id:
          type: string
          nullable: true
          title: Message Id
          description: Message-ID header (used for reply attribution)
        inbox_email:
          type: string
          nullable: true
          title: Inbox Email
          description: Sender address
      type: object
      required:
        - node_key
      title: LeadJourneyStep
      description: |-
        One touchpoint on a lead's journey through a campaign.

        Covers both the initial email (step 1, from the `emails` table) and
        follow-ups (from `sequence_emails`). Follow-ups that belong to a
        subsequence branch carry a `node_id` and a NULL `sequence_id`; the LEFT
        JOIN in the service keeps those rows that `get_lead_details` drops.
    LeadJourneyEnrollment:
      properties:
        entry_node_id:
          type: string
          format: uuid
          title: Entry Node Id
          description: Node where the lead entered the subsequence
        entry_edge_id:
          type: string
          format: uuid
          nullable: true
          title: Entry Edge Id
          description: Edge that triggered the enrollment (NULL for manual)
        trigger_reason:
          type: string
          nullable: true
          title: Trigger Reason
          description: Human-readable reason the lead was enrolled
        entered_at:
          type: string
          format: date-time
          nullable: true
          title: Entered At
          description: When the lead entered the subsequence
      type: object
      required:
        - entry_node_id
      title: LeadJourneyEnrollment
      description: A lead's entry into a subsequence branch (graph path only).
    LeadJourneyReply:
      properties:
        reply_id:
          type: string
          format: uuid
          title: Reply Id
          description: Reply id
        received_at:
          type: string
          format: date-time
          nullable: true
          title: Received At
          description: When the reply was received
        subject:
          type: string
          nullable: true
          title: Subject
          description: Reply subject
        message_id:
          type: string
          nullable: true
          title: Message Id
          description: Reply Message-ID header
        in_reply_to:
          type: string
          nullable: true
          title: In Reply To
          description: In-Reply-To header (matches a sent step's message_id)
        references:
          type: string
          nullable: true
          title: References
          description: References header (thread chain of message_ids)
      type: object
      required:
        - reply_id
      title: LeadJourneyReply
      description: >-
        A reply from the lead, exposed with threading headers for step
        attribution.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key with format cs_live_xxx

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.