Wire two steps

POST /api/v1/sequences/{sequenceId}/versions/{versionId}/edges Both ends must be nodes of the version in the URL: an end taken from another version answers 404. A wire across two versions would tie your draft to the journey contacts are walking right now.

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.

Request body

FieldTypeRequiredDescription
fromNodeIdstringyesStep the wire leaves — must belong to this version
toNodeIdstringyesStep it reaches — same rule

Request body

FieldTypeRequiredDescription
fromNodeIdstringyesA node of this version
toNodeIdstringyesA node of this version
branchstringnodefault (default), yes or no

Example

bash
curl -X POST -H "x-api-key: $AGENTMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fromNodeId": "$FROM", "toNodeId": "$TO"}' \
  "https://www.agentsmail.io/api/v1/sequences/$SEQUENCE_ID/versions/$VERSION_ID/edges"

Response

  • 201 Created — the created resource.
  • 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

201 with the wire.
FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringIdentifier of the wire
data.fromNodeIdstringStep it leaves
data.toNodeIdstringStep it reaches

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "fromNodeId": "d77b0913",
    "toNodeId": "e08c1a24"
  }
}