Move a step

POST /api/v1/sequences/{sequenceId}/versions/{versionId}/nodes/{nodeId}/move Moves the node one step up or down. Reordering a graph is a rewiring: three wires are rewritten in one transaction, so the journey is never left cut in half.

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERRefused — 403
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Path parameters

ParameterTypeDescription
nodeIdstringRequired. The step to move

Request body

FieldTypeRequiredDescription
directionstringyesup or down — one position at a time

Request body

FieldTypeRequiredDescription
directionstringyesup or down

Example

bash
curl -X POST -H "x-api-key: $AGENTMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"direction": "up"}' \
  "https://www.agentsmail.io/api/v1/sequences/$SEQUENCE_ID/versions/$VERSION_ID/nodes/$NODE_ID/move"

Response

  • 200 OK — the call succeeded.
  • 400 Bad Request — validation failed; details carries the field-level issues.
  • 401 Unauthorized — missing or invalid key, or its owner left the organization.
  • 403 Forbidden — the key's owner is a member of the organization, not an admin.
  • 404 Not Found — no such resource, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringIdentifier of what was removed

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2"
  }
}