> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Invent a New Signal

> Teach Mailofly about a brand-new signal and what goodies it can carry in its backpack.

Before your app starts shouting signals to Mailofly, you can register a new event definition!

This teaches Mailofly what name the signal will use (like `user.signed_up`) and what properties to expect in its backpack (like `first_name` or `plan`).

### Body

**name** `string` *required*

The unique name for this signal! Usually written with dot notation, like `"user.signup"` or `"item.purchased"`.

**schema** `object`

A map of expected backpack items and their types (`string`, `number`, or `boolean`). For example:

```json theme={null}
{
  "first_name": "string",
  "amount": "number",
  "is_trial": "boolean"
}
```

### Response

**object** `string`

Always says `"event"`.

**id** `string`

The unique ID badge assigned to this new signal definition.

```bash cURL theme={null}
curl -X POST 'https://api.mailofly.com/events' \
  -H 'Authorization: Bearer mf_live_xxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "user.signup",
    "schema": {
      "first_name": "string",
      "plan": "string"
    }
  }'
```

```javascript Node.js theme={null}
import { Mailofly } from "@mailofly/node";

const mailofly = new Mailofly("mf_live_xxxxxxxx");

const eventDef = await mailofly.events.create({
  name: "user.signup",
  schema: {
    first_name: "string",
    plan: "string"
  }
});

console.log("Invented signal ID:", eventDef.id);
```

```json 201 Created theme={null}
{
  "object": "event",
  "id": "evt_4b219081-3a11-4821-b810-091827361821"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.