> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# Magic link events

Magic link events notify you when magic link emails are sent. When a magic link event is triggered, IDaaS sends an HTTP POST request to your configured webhook URL with a JSON payload containing the event details.

## Payload structure

Every magic link event payload has this structure:

```json
{
  "id": "019cf819-6695-7231-a51e-aa3856d3b34c",
  "type": "magiclink.email.sent",
  "accountId": "fba02d5c-2f79-4cfd-91f5-6bd454e97ab3",
  "eventTime": "2026-03-16T19:22:20Z",
  "data": {
    // Event-specific data here
  }
}
```

The `data` object contains event-specific fields. See the event examples later on this page for the full `data` object for each event type.

### Top-level fields

| Field       | Type   | Description                                                   |
| ----------- | ------ | ------------------------------------------------------------- |
| `id`        | string | Unique identifier for this webhook delivery                   |
| `type`      | string | The event that occurred (for example, `magiclink.email.sent`) |
| `accountId` | string | Your account identifier                                       |
| `eventTime` | string | When the event occurred (ISO 8601 format)                     |
| `data`      | object | Details about what happened (varies by event type)            |

## Event types

### magiclink.email.sent

Triggered when a magic link email is sent.

**Example payload:**

```json
{
  "id": "019cf819-6695-7231-a51e-aa3856d3b34c",
  "type": "magiclink.email.sent",
  "accountId": "fba02d5c-2f79-4cfd-91f5-6bd454e97ab3",
  "eventTime": "2026-03-16T19:22:20Z",
  "data": {
    "subject": "062e8a87-0e86-482a-a0ab-c6429fb599b9",
    "subjectName": "john",
    "subjectType": "USER",
    "resourceName": "Administration Portal",
    "sourceIp": "104.30.161.19",
    "subscriberAdminRoleName": "Super Administrator",
    "entityType": "MAGICLINKS",
    "entityId": "553d96a6-51ea-479b-9496-003cef589def",
    "entityName": "john",
    "entityAttributes": {
      "contactValue": "john@example.com",
      "magicLinkType": "Registration",
      "contactType": "Email"
    }
  }
}
```

The `data` object includes the following fields:

| Field                     | Description                                                                     |
| ------------------------- | ------------------------------------------------------------------------------- |
| `subject`                 | ID of the user associated with the magic link email                             |
| `subjectName`             | Username of the user associated with the magic link email                       |
| `subjectType`             | Always `USER`                                                                   |
| `resourceName`            | Where the magic link email was sent from (for example, `Administration Portal`) |
| `sourceIp`                | IP address from which the magic link email was sent                             |
| `subscriberAdminRoleName` | Administrator role used to send the magic link, when applicable                 |
| `entityType`              | Always `MAGICLINKS` for magic link events                                       |
| `entityId`                | ID of the magic link                                                            |
| `entityName`              | Name associated with the magic link                                             |
| `entityAttributes`        | Delivery details for the magic link email (see below)                           |

The `entityAttributes` object includes these fields:

- `contactValue` - Email address that received the magic link
- `magicLinkType` - Magic link type that was sent
- `contactType` - Contact method used for the delivery
