using System.Text.Json.Nodes;
using var mc = new MailCraftApi(Environment.GetEnvironmentVariable("MAILCRAFT_API_KEY")!);
var body = JsonNode.Parse("""
{
"name": "Welcome flow",
"triggerType": "<trigger-type>",
"steps": [],
"connections": []
}
""");
JsonNode? result = await mc.SendAsync(HttpMethod.Put, "/automations/<id>", body);
Console.WriteLine(result?.ToJsonString(MailCraftApi.Pretty) ?? "(no content)");
import os
from mailcraft import MailCraft
mc = MailCraft(os.environ["MAILCRAFT_API_KEY"])
body = {'name': 'Welcome flow',
'triggerType': '<trigger-type>',
'steps': [],
'connections': []}
result = mc.request("PUT", "/automations/<id>", json=body)
print(result)
curl -X PUT "https://mailcraft.example.com/api/v1/automations/<id>" \
-H "Authorization: Bearer $MAILCRAFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Welcome flow", "triggerType": "<trigger-type>", "steps": [], "connections": []}'