Skip to main content
PATCH
/
api
/
campaigns
/
{id}
/
sequence
/
nodes
Move a sequence node
curl --request PATCH \
  --url https://app.puffle.ai/api/campaigns/{id}/sequence/nodes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "nodeId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "toPosition": 4503599627370495
}
'
{
  "sequence_nodes": [
    {
      "id": "bbbb1111-1111-1111-1111-111111111111",
      "campaign_id": "8c2b2d4e-e29b-41d4-a716-446655440000",
      "position": 0,
      "type": "email",
      "subject": "Quick question about {{company}}",
      "body": "Hi {{first_name}}, ..."
    },
    {
      "id": "bbbb2222-1111-1111-1111-111111111111",
      "campaign_id": "8c2b2d4e-e29b-41d4-a716-446655440000",
      "position": 1,
      "type": "delay",
      "delay_days": 3
    }
  ]
}

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.
This operation shares the URL path /api/campaigns/{id}/sequence/nodes with other verbs. See the sibling page for related operations on the same resource.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

Campaign UUID

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$

Body

application/json

Draft-only. Both fields are required.

nodeId
string<uuid>
required

UUID of the node to move. Must belong to this campaign.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
toPosition
integer
required

Target 0-indexed position. Other nodes shift to accommodate the move.

Required range: 0 <= x <= 9007199254740991

Response

Node moved. Returns the fresh ordered list of sequence nodes. Falls back to { mutated: true } if the post-mutation read-back fails.

Successful mutation response. The server re-fetches the full sequence and returns it so clients don't have to round-trip a GET.

sequence_nodes
object[]
required

Fresh ordered list of nodes after the mutation. Absent (replaced by mutated: true + optional node_id) only if the server's best-effort read-back after the mutation failed.