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

# Reorder Node

> Reorder an existing node by moving it to a new position.

**CLI:**

```bash theme={null}
puffle campaign sequence node move --id <id> --node-id <node-id> --to-position <to-position>
```

## Overview

Reorder an existing node by moving it to a new position. Draft campaigns only. Uses an atomic RPC with row-level locking so concurrent moves can't corrupt the ordering. To edit a node's content (subject, body, delay values, etc.), use `updateSequenceNode` instead.

<Note>
  This operation shares the URL path `/api/campaigns/{id}/sequence/nodes` with other verbs. See [the sibling page](/api-reference/campaigns/add-sequence-node) for related operations on the same resource.
</Note>


## OpenAPI

````yaml patch /api/campaigns/{id}/sequence/nodes
openapi: 3.0.3
info:
  title: Puffle API
  version: 1.0.0
  description: >-
    HTTP API for the Puffle GTM platform - Feed and Lead Finder search
    preparation, campaign-backed Outbound execution, Puffle Agent runs, sender
    management, and Unibox reply workflows. Designed for operation by both
    humans and autonomous AI agents. Agents should start at the [Agent
    Playbook](/guides/agent-playbook) which prescribes a workspace-context check
    (`GET /api/context`) and core user journeys with exact call ordering.
  contact:
    name: Puffle Support
    url: https://puffle.ai
servers:
  - url: https://app.puffle.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Campaigns
    description: >-
      Campaign-backed Outbound execution. These endpoints manage draft,
      launching, active, paused, and completed Outbound runs with sequence
      nodes, contacts, and sender accounts.
  - name: Accounts
    description: Signed-in user account, settings, and workspace context endpoints.
  - name: Billing
    description: Billing customer portal and account billing endpoints.
  - name: Senders
    description: >-
      Connected sender accounts, email inboxes, sending domains, DNS
      verification, warmup, and sender capacity.
  - name: Socials
    description: >-
      Read connected LinkedIn and X accounts, review current and archived posts,
      and reconcile publication status. Creating, editing, scheduling,
      publishing, OAuth connection, analytics, and mentions remain
      dashboard-managed workflows and are not part of the public Bearer-token
      API.
paths:
  /api/campaigns/{id}/sequence/nodes:
    patch:
      tags:
        - Campaigns
      summary: Reorder Node
      description: >-
        Reorder an existing node by moving it to a new position. Draft campaigns
        only.
      operationId: moveSequenceNode
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: Campaign UUID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                nodeId:
                  type: string
                  description: String value with endpoint-specific validation.
                toPosition:
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
              required:
                - nodeId
                - toPosition
              additionalProperties: false
      responses:
        '200':
          description: >-
            Node moved. Returns the fresh ordered list, or a mutation fallback
            when read-back fails.
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      sequence_nodes:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: String value with endpoint-specific validation.
                            campaign_id:
                              type: string
                              description: String value with endpoint-specific validation.
                            position:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            type:
                              type: string
                              enum:
                                - connection_request
                                - message
                                - email
                                - delay
                                - ai
                                - end
                            subject:
                              type: string
                              nullable: true
                            body:
                              type: string
                              nullable: true
                            body_html:
                              type: string
                              nullable: true
                            signature:
                              type: string
                              nullable: true
                            from_name:
                              type: string
                              nullable: true
                            reply_to:
                              type: string
                              nullable: true
                            cc:
                              type: string
                              nullable: true
                            bcc:
                              type: string
                              nullable: true
                            attachments:
                              type: array
                              items: {}
                              nullable: true
                            include_message:
                              type: boolean
                              nullable: true
                            is_reply:
                              type: boolean
                              nullable: true
                            delay_days:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                              nullable: true
                            delay_hours:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                              nullable: true
                            delay_minutes:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                              nullable: true
                            ai_node:
                              type: object
                              properties:
                                output_type:
                                  type: string
                                  enum:
                                    - email
                                    - message
                              required:
                                - output_type
                              additionalProperties: {}
                              nullable: true
                          required:
                            - id
                            - campaign_id
                            - position
                            - type
                          additionalProperties: false
                    required:
                      - sequence_nodes
                    additionalProperties: false
                  - type: object
                    properties:
                      mutated:
                        type: boolean
                        enum:
                          - true
                      node_id:
                        type: string
                        description: String value with endpoint-specific validation.
                    required:
                      - mutated
                    additionalProperties: false
        '400':
          description: Validation failure, malformed RPC input, or non-draft campaign.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '404':
          description: Campaign or node not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: pk_live_...

````