Code examples for sending events with the Loops API and SDKs.
await fetch("https://app.loops.so/api/v1/events/send", { method: "POST", headers: { "Authorization": "Bearer <your-api-key>", "Content-Type": "application/json" }, body: JSON.stringify({ email: "[email protected]", eventName: "testEvent", }), });
await fetch("https://app.loops.so/api/v1/events/send", { method: "POST", headers: { "Authorization": "Bearer <your-api-key>", "Content-Type": "application/json" }, body: JSON.stringify({ email: "[email protected]", eventName: "testEvent", eventProperties: { "testProperty": "testValue", }, }), });
await fetch("https://app.loops.so/api/v1/events/send", { method: "POST", headers: { "Authorization": "Bearer <your-api-key>", "Content-Type": "application/json" }, body: JSON.stringify({ email: "[email protected]", eventName: "testEvent", planName: "Pro", // Contact property }), });
Idempotency-Key
await fetch("https://app.loops.so/api/v1/events/send", { method: "POST", headers: { "Authorization": "Bearer <your-api-key>", "Content-Type": "application/json" "Idempotency-Key": "550e8400-e29b-41d4-a716-446655440000", }, body: JSON.stringify({ email: "[email protected]", eventName: "testEvent", }), });
Was this page helpful?