Skip to content New SourceLoop MCP: chat with your attribution data in Claude, ChatGPT & Cursor
SourceLoop
API reference

Events

Send server-side events for anything the browser cannot see: OAuth callbacks, payment webhooks, queue workers.

Endpoint Method Path Permission
Send events Send server-side events POST /v1/events events:write

Base URL https://app.sourceloop.ai/api/v1

Send events

Send server-side events

POST /v1/events

Requires events:write

For anything the browser cannot see: OAuth callbacks, payment webhooks, queue workers. Events are validated and classified with exactly the same rules the browser tracker applies, so a server-side conversion attributes identically.

Each event needs an email, a phone, or an `anonymous_id` to be attributable. Read `_sl_aid` from the visitor's cookie and pass it as `anonymous_id` to stitch a backend event to their browsing history.

Partial success: one malformed event does not discard the batch.

curl -s -X POST "https://app.sourceloop.ai/api/v1/events" \
  -H "Authorization: Bearer $SOURCELOOP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "event_type": "custom",
        "event_name": "signup_completed",
        "email": "[email protected]",
        "anonymous_id": "a1b2c3"
      }
    ]
  }'
const res = await fetch(
  "https://app.sourceloop.ai/api/v1/events",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "events": [
        {
          "event_type": "custom",
          "event_name": "signup_completed",
          "email": "[email protected]",
          "anonymous_id": "a1b2c3"
        }
      ]
    }),
  },
);

const data = await res.json();
import os, requests

res = requests.post(
    "https://app.sourceloop.ai/api/v1/events",
    headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
    json={
      "events": [
        {
          "event_type": "custom",
          "event_name": "signup_completed",
          "email": "[email protected]",
          "anonymous_id": "a1b2c3"
        }
      ]
    },
)
data = res.json()

Headers

Idempotency-Keystringheader

Request body

websitestring

eventsobject[]required

Event

events[].event_typestring

Example custom

events[].event_namestring

Example signup_completed

events[].occurred_atstring (date-time)

Identity

events[].emailstring

events[].phonestring

events[].anonymous_idstring

The visitor's _sl_aid cookie value.

Value

events[].revenuenumber

events[].currencystring

events[].propertiesobject

Responses

  • 200 Accepted and rejected counts
  • 400 Something was wrong with the request or the credential.
  • 429 Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.

Track every conversion to its true source

Capture and send full attribution data from every signup, lead, booking, and sale to your CRM and ad platforms, so you know exactly what's driving revenue.

Without SourceLoop

Untagged

Kayden Floyd

kayden@abc.com

  • SourceUnknown
  • MediumUnknown
  • CampaignUnknown
  • Landing pageUnknown
Journey
No touchpoints captured

With SourceLoop

Auto-tagged

Kayden Floyd

kayden@abc.com · Acme Co.

  • Channel Paid Social
  • CampaignFree_demo
  • Landing page/pricing
Journey
Synced to HubSpot Google Ads Meta