Move contacts between segments
POST /segments/:id/move — move one contact, or every contact, from this segment to another.
/segments/:id/moveTakes contacts out of segment :id and puts them in destination_id, in one step. Both segments must be on the same domain. The contacts themselves, their opt-outs and their other segments are not changed. If the destination has rules (subscription status, properties or engagement), every moved contact must match them, or nothing is moved. Needs a full-access API key. A sending-only key gets 401 restricted_api_key.
destination_idstringrequiredThe segment to move the contacts to.
contact_idstringoptionalMove this one contact. Send either contact_id or all: true.
allbooleanoptionaltrue moves every contact currently in the segment.
previewbooleanoptionaltrue checks the move and returns the count without moving anything.
expected_countintegeroptionalThe count from a preview. If the segment no longer holds exactly that many, nothing is moved (409).
curl -X POST 'https://www.senddart.com/api/segments/SEGMENT_ID/move' \
-H 'Authorization: Bearer mb_xxxxxxxxx' \
-H 'Content-Type: application/json' \
-d '{ "destination_id": "DESTINATION_SEGMENT_ID", "all": true, "expected_count": 120 }'{
"source_id": "c0a8012e-…",
"destination_id": "5d1e7f20-…",
"source_name": "Trial users",
"destination_name": "Customers",
"count": 120,
"preview": false,
"moved": 120
}Errors: validation_error (422) for a bad body, the same segment twice, segments on different domains, or contacts that do not match the destination’s rules; validation_error with status 409 when the contact left the segment or the count changed; not_found when either segment is not yours; application_error (503) when the segment is busy — retry.