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

# Send your first event

> Make a door key, send one event with it, and see it arrive.

By the end of this page, Casefile has your first event, and its data health page lists the system that sent it.

## Before you start

* A Casefile organization, and a role that may make keys, such as admin.
* A terminal with curl, or Node.

## Steps

**1. Make a door key**

In Casefile, open the organization menu, then Settings, then Sources and keys.
Enter checkout as the source name, and choose Make a key.

![The key for checkout, shown once, with a command that sends a first event.](https://mintcdn.com/casefile/HndrkTmzYBnfXSb7/images/key-shown-once-light.png?fit=max\&auto=format\&n=HndrkTmzYBnfXSb7\&q=85\&s=366d84a9b1ad8bfac0f2fde3b678663c)

Copy the key now.
Casefile keeps only a fingerprint of it, so this is the only time it is shown.
The screen also shows a command with the key written in it, but this page uses one that reads the key from your terminal instead.

**2. Keep the key where your terminal can read it**

Put the key in an environment variable named `CASEFILE_KEY`.
The commands below read it from there, so the key stays out of your shell history.

**3. Send an event**

Send one event named hello from a source named checkout, with curl or with Node.

```bash curl theme={null}
# Sends one event with your door key, which CASEFILE_KEY holds.
curl --fail-with-body --silent --show-error \
  -X POST "${CASEFILE_DOOR:-https://ingest.casefile.win}/events" \
  -H "authorization: Bearer $CASEFILE_KEY" \
  -H 'content-type: application/json' \
  -d '{"id":"first-event","source":"checkout","name":"hello","occurredAt":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'"}'
```

```javascript Node theme={null}
// Sends one event with your door key, which CASEFILE_KEY holds.
const door = process.env.CASEFILE_DOOR ?? 'https://ingest.casefile.win'

const response = await fetch(`${door}/events`, {
  method: 'POST',
  headers: {
    authorization: `Bearer ${process.env.CASEFILE_KEY}`,
    'content-type': 'application/json',
  },
  body: JSON.stringify({
    id: 'first-event-from-node',
    source: 'checkout',
    name: 'hello',
    occurredAt: new Date().toISOString(),
  }),
})
console.log(response.status, await response.json())
if (!response.ok) process.exitCode = 1
```

The door, Casefile's address for events, answers `202` with your event's ID in `accepted`.

The door can refuse a new key with `unknown key` for up to 5 seconds after it is made.
If it does, send the same event again.

**4. See it arrive**

In Casefile, open Data health, and reload it if checkout is not listed yet.
The checkout source is listed with the time of its newest event.

![Data health listing the checkout source and the time of its newest event.](https://mintcdn.com/casefile/HndrkTmzYBnfXSb7/images/data-health-light.png?fit=max\&auto=format\&n=HndrkTmzYBnfXSb7\&q=85\&s=a9f5a55a325a804a495ae2d28b42ea31)

> [!TIP]
>
> Data health lists checkout, so Casefile has your first event.

## Next

* [Event fields](https://docs.casefile.win/reference/events.md) lists what else an event can carry, such as a value and tags.
* [Limits and refusals](https://docs.casefile.win/reference/limits.md) says how many events your plan allows, and why the door may refuse one.


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