Edit a step

PATCH /api/v1/sequences/{sequenceId}/versions/{versionId}/nodes/{nodeId} Edits one node of a draft: subject, content, templateId, waitHours, tagId or webhookUrl. Send the fields of one family only — mixing a subject and a waitHours in the same call answers 400, and so does a body that carries nothing.

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 change

Request body

FieldTypeRequiredDescription
subject / contentstringnoOn a send_email step
waitHoursnumbernoOn a wait step
tagIdstringnoOn an add_tag / remove_tag step
webhookUrlstringnoOn a webhook step

Example

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

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 the step
data.versionIdstringThe draft or published version it belongs to
data.typestringsend_email, wait, add_tag, remove_tag, end_sequence, webhook
data.subject / contentstring \null
data.templateIdstring \null
data.waitHoursnumber \null
data.tagIdstring \null
data.webhookUrlstring \null
data.createdAt / updatedAtstringISO dates

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "versionId": "c41a7e55",
    "type": "send_email",
    "subject` / `content": "value",
    "templateId": "5a44b901",
    "waitHours": 24,
    "tagId": "7c2ef4b1",
    "webhookUrl": "https://example.com/hooks/agentsmail",
    "createdAt` / `updatedAt": "value"
  }
}