> ## 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 campaign flow graph

> **Read a campaign's full flow graph**

Returns every node and edge in the campaign's flow: the MAIN follow-up chain
and any subsequence branches hanging off it, plus `subsequences_enabled`.

## Reading the graph

- **nodes** -- `node_group` is `MAIN` for the linear follow-up chain and
`SUBSEQUENCE` for branch steps; `node_type` is `EMAIL` or `EXIT`.
- **variants** -- populated on `SUBSEQUENCE` nodes only, because a branch step
has no `sequences` row and this is the only place its content is served. MAIN
nodes stay `null`: their content comes from `GET /campaigns/{id}` instead.
Variant fields are `subject` / `body` / `html_body` / `weight` on the wire
(the columns are `subject_template` / `body_template` / `html_template` /
`distribution_percent`).
- **edges** -- `kind` is `TIMEOUT` (wait, then evaluate `condition_type`) or
`EVENT` (a branch entry trigger). A branch's **entry edge id is the
`subsequence_id`** used by the update and delete routes.

## Why ids are exposed but not editable

There is no public `/nodes` or `/edges` CRUD. Raw node and edge editing exists
to drive the in-app canvas and can easily produce a graph the worker cannot
dispatch. The ids are returned because two of them are needed as inputs:
`entry_from_node_id` when creating a branch, and
`target_subsequence_node_id` when moving leads into one.

## Example Usage

```python
import requests

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

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

print(response.json())
```



## OpenAPI

````yaml /public_openapi.json get /api/public/v1/campaigns/{campaign_id}/flow
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}/flow:
    get:
      tags:
        - Flow
      summary: Get campaign flow graph
      description: >-
        **Read a campaign's full flow graph**


        Returns every node and edge in the campaign's flow: the MAIN follow-up
        chain

        and any subsequence branches hanging off it, plus
        `subsequences_enabled`.


        ## Reading the graph


        - **nodes** -- `node_group` is `MAIN` for the linear follow-up chain and

        `SUBSEQUENCE` for branch steps; `node_type` is `EMAIL` or `EXIT`.

        - **variants** -- populated on `SUBSEQUENCE` nodes only, because a
        branch step

        has no `sequences` row and this is the only place its content is served.
        MAIN

        nodes stay `null`: their content comes from `GET /campaigns/{id}`
        instead.

        Variant fields are `subject` / `body` / `html_body` / `weight` on the
        wire

        (the columns are `subject_template` / `body_template` / `html_template`
        /

        `distribution_percent`).

        - **edges** -- `kind` is `TIMEOUT` (wait, then evaluate
        `condition_type`) or

        `EVENT` (a branch entry trigger). A branch's **entry edge id is the

        `subsequence_id`** used by the update and delete routes.


        ## Why ids are exposed but not editable


        There is no public `/nodes` or `/edges` CRUD. Raw node and edge editing
        exists

        to drive the in-app canvas and can easily produce a graph the worker
        cannot

        dispatch. The ids are returned because two of them are needed as inputs:

        `entry_from_node_id` when creating a branch, and

        `target_subsequence_node_id` when moving leads into one.


        ## Example Usage


        ```python

        import requests


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


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


        print(response.json())

        ```
      operationId: get_campaign_flow_api_public_v1_campaigns__campaign_id__flow_get
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Campaign Id
      responses:
        '200':
          description: Flow graph retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignFlowResponse'
        '401':
          description: Missing or invalid API key
        '403':
          description: Insufficient permissions - requires 'campaigns:read' scope
        '404':
          description: Campaign not found in this team
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CampaignFlowResponse:
      properties:
        campaign_id:
          type: string
          format: uuid
          title: Campaign Id
        subsequences_enabled:
          type: boolean
          title: Subsequences Enabled
        nodes:
          items:
            $ref: '#/components/schemas/FlowNodeResponse'
          type: array
          title: Nodes
        edges:
          items:
            $ref: '#/components/schemas/FlowEdgeResponse'
          type: array
          title: Edges
      type: object
      required:
        - campaign_id
        - subsequences_enabled
        - nodes
        - edges
      title: CampaignFlowResponse
      description: Full flow graph response for a campaign (nodes + edges).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FlowNodeResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        campaign_id:
          type: string
          format: uuid
          title: Campaign Id
        node_type:
          type: string
          title: Node Type
        node_group:
          type: string
          title: Node Group
        label:
          type: string
          nullable: true
          title: Label
        position:
          additionalProperties: true
          type: object
          nullable: true
          title: Position
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        variants:
          items:
            $ref: '#/components/schemas/FlowNodeVariantResponse'
          type: array
          nullable: true
          title: Variants
      type: object
      required:
        - id
        - campaign_id
        - node_type
        - node_group
        - created_at
        - updated_at
      title: FlowNodeResponse
      description: Response for a single flow node.
    FlowEdgeResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        campaign_id:
          type: string
          format: uuid
          title: Campaign Id
        from_node_id:
          type: string
          format: uuid
          title: From Node Id
        to_node_id:
          type: string
          format: uuid
          title: To Node Id
        kind:
          type: string
          title: Kind
        condition_type:
          type: string
          title: Condition Type
        condition_params:
          additionalProperties: true
          type: object
          nullable: true
          title: Condition Params
        wait_seconds:
          type: integer
          nullable: true
          title: Wait Seconds
        priority:
          type: integer
          title: Priority
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - campaign_id
        - from_node_id
        - to_node_id
        - kind
        - condition_type
        - priority
        - is_active
        - created_at
        - updated_at
      title: FlowEdgeResponse
      description: Response for a single flow edge.
    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
    FlowNodeVariantResponse:
      properties:
        variant_name:
          type: string
          title: Variant Name
        variant_label:
          type: string
          nullable: true
          title: Variant Label
        subject:
          type: string
          nullable: true
          title: Subject
        body:
          type: string
          nullable: true
          title: Body
        html_body:
          type: string
          nullable: true
          title: Html Body
        weight:
          type: integer
          title: Weight
          default: 100
        content_type:
          type: string
          nullable: true
          title: Content Type
      type: object
      required:
        - variant_name
      title: FlowNodeVariantResponse
      description: >-
        Email content stored against a SUBSEQUENCE node.


        Field names mirror the write side (``SubsequenceStepCreate.variants``)
        so a

        client can round-trip a branch step without translating: ``subject`` /

        ``body`` / ``html_body`` / ``weight`` on the wire, ``subject_template``
        /

        ``body_template`` / ``html_template`` / ``distribution_percent`` in the

        column. ``_VARIANT_FIELD_MAP`` in services/flow_service.py owns the
        write

        direction of the same mapping.
  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.