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

# Update a subsequence

> **Update a subsequence branch**

Partial update -- only the fields you send are changed. `subsequence_id` is
the branch's entry edge id, as returned on create or read from
`GET /campaigns/{id}/flow`.

## Updating steps

When `steps` is present it replaces the whole chain, but the service
**reconciles positionally** against the persisted nodes rather than deleting
and recreating them. Step 1 edits step 1, step 2 edits step 2, and so on;
extra steps are appended and surplus nodes removed. This matters because
leads already enrolled in the branch hold references to those node ids --
recreating them would orphan live enrollments.

An empty `steps` list is rejected with a 400; delete the branch instead.

As on create, `condition_type` between steps should stay `ALWAYS` and step
timing is `wait_seconds`.

## Example Usage

```python
import requests

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

response = requests.put(
    f"https://api.coldsend.pro/api/public/v1/campaigns/{campaign_id}/flow/subsequences/{subsequence_id}",
    headers={"X-API-Key": "your-api-key"},
    json={"label": "Interested - nurture v2", "priority": 20}
)

print(response.json())
```



## OpenAPI

````yaml /public_openapi.json put /api/public/v1/campaigns/{campaign_id}/flow/subsequences/{subsequence_id}
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/subsequences/{subsequence_id}:
    put:
      tags:
        - Flow
      summary: Update a subsequence
      description: >-
        **Update a subsequence branch**


        Partial update -- only the fields you send are changed. `subsequence_id`
        is

        the branch's entry edge id, as returned on create or read from

        `GET /campaigns/{id}/flow`.


        ## Updating steps


        When `steps` is present it replaces the whole chain, but the service

        **reconciles positionally** against the persisted nodes rather than
        deleting

        and recreating them. Step 1 edits step 1, step 2 edits step 2, and so
        on;

        extra steps are appended and surplus nodes removed. This matters because

        leads already enrolled in the branch hold references to those node ids
        --

        recreating them would orphan live enrollments.


        An empty `steps` list is rejected with a 400; delete the branch instead.


        As on create, `condition_type` between steps should stay `ALWAYS` and
        step

        timing is `wait_seconds`.


        ## Example Usage


        ```python

        import requests


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

        subsequence_id  = "750e8400-e29b-41d4-a716-446655440000"


        response = requests.put(
            f"https://api.coldsend.pro/api/public/v1/campaigns/{campaign_id}/flow/subsequences/{subsequence_id}",
            headers={"X-API-Key": "your-api-key"},
            json={"label": "Interested - nurture v2", "priority": 20}
        )


        print(response.json())

        ```
      operationId: >-
        update_subsequence_api_public_v1_campaigns__campaign_id__flow_subsequences__subsequence_id__put
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Campaign Id
        - name: subsequence_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Subsequence Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubsequenceUpdate'
      responses:
        '200':
          description: Subsequence updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubsequenceResponse'
        '400':
          description: Validation failed - see detail message
        '401':
          description: Missing or invalid API key
        '403':
          description: Insufficient permissions - requires 'campaigns:update' scope
        '404':
          description: Campaign or subsequence not found in this team
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SubsequenceUpdate:
      properties:
        label:
          type: string
          maxLength: 255
          nullable: true
          title: Label
        trigger_type:
          type: string
          nullable: true
          title: Trigger Type
        trigger_params:
          additionalProperties: true
          type: object
          nullable: true
          title: Trigger Params
        priority:
          type: integer
          nullable: true
          title: Priority
        is_active:
          type: boolean
          nullable: true
          title: Is Active
        steps:
          items:
            $ref: '#/components/schemas/SubsequenceStepCreate'
          type: array
          nullable: true
          title: Steps
          description: Ordered list of subsequence steps
      type: object
      title: SubsequenceUpdate
      description: Request to update a subsequence (label, entry edge params, and steps).
    SubsequenceResponse:
      properties:
        entry_edge:
          $ref: '#/components/schemas/FlowEdgeResponse'
        nodes:
          items:
            $ref: '#/components/schemas/FlowNodeResponse'
          type: array
          title: Nodes
        edges:
          items:
            $ref: '#/components/schemas/FlowEdgeResponse'
          type: array
          title: Edges
      type: object
      required:
        - entry_edge
        - nodes
        - edges
      title: SubsequenceResponse
      description: Response for a created/updated subsequence (entry edge + nodes).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SubsequenceStepCreate:
      properties:
        wait_seconds:
          type: integer
          minimum: 0
          title: Wait Seconds
          description: Seconds before this step fires
        condition_type:
          type: string
          title: Condition Type
          description: Timeout condition between steps
          default: ALWAYS
        label:
          type: string
          maxLength: 255
          nullable: true
          title: Label
        variants:
          items:
            additionalProperties: true
            type: object
          type: array
          nullable: true
          title: Variants
          description: Email variant data for this step node
      type: object
      required:
        - wait_seconds
      title: SubsequenceStepCreate
      description: A single step within a subsequence creation request.
    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.
    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.
    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.