# Quickstart

Your first message on your phone in five minutes.

By the end of this page, your phone will have received a push notification that you sent yourself. You need the Packlets app and a terminal.

## 1. Create a packlet

A **packlet** is the connection between one of your tools and Packlets. Create one in the app:

1. In the **Channels** tab, tap the plus at the top left.
2. Choose **Messages** and tap **Continue**.
3. Enter a name, for example "Test", and pick an avatar.
4. Tap **Create**.

Leave the webhook URL field empty. You only need it once your tool should react to buttons.

## 2. Save the key

Packlets now shows the **key** of your packlet. It starts with `pk_` and is the password your tool uses to send messages.

> **Important:** You only see the key this one time. Copy it now. If it gets lost, you create a new one in the packlet's settings.

Store it in your terminal as an environment variable. That keeps it out of your code:

```bash
export PACKLETS_KEY="pk_…"
```

## 3. Send your first message

The app is now waiting for the first message. Send it:

```bash
curl https://api.packlets.app/v1/push \
  -H "Authorization: Bearer $PACKLETS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Hello","text":"My tool is connected"}'
```

```python
import os, requests

requests.post("https://api.packlets.app/v1/push", timeout=10,
              headers={"Authorization": f"Bearer {os.environ['PACKLETS_KEY']}"},
              json={"title": "Hello", "text": "My tool is connected"}).raise_for_status()
```

```typescript
const res = await fetch("https://api.packlets.app/v1/push", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PACKLETS_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ title: "Hello", text: "My tool is connected" }),
});
if (!res.ok) throw new Error(`Packlets ${res.status}: ${await res.text()}`);
```

The response contains the ID of the message:

```json
{ "message_id": "5b0c1a52-7c1e-4a43-9d0b-2f6f0c7d1e11" }
```

## 4. Done

The app shows **Connected!**, and the message is in your new channel. If the app is in the background, it arrives as a push.

You can now add the same three lines to any script: at the end of a backup, in a cron job, in an error handler.

## If it doesn't work

| What you see | Cause |
|---|---|
| `401` with `invalid_key` | The key is wrong. Check with `echo $PACKLETS_KEY` that it's complete. |
| `400` with `invalid_body` | `text` is missing from the JSON, or it's empty. |
| `200`, but no push | The message is there, only the push is missing: open the channel and check that notifications are allowed for Packlets. |

More in [Troubleshooting](https://packlets.app/en/docs/fehlersuche.md).

## What's next

- Understand what you just built: [How Packlets works](https://packlets.app/en/docs/konzepte.md).
- Get more out of the message: [Send a message](https://packlets.app/en/docs/senden.md) and [Buttons](https://packlets.app/en/docs/knoepfe.md).
- Have an AI add the call for you: [Build with AI](https://packlets.app/en/docs/ki.md).
- Ready-made functions for Python and TypeScript: [Ready-made code](https://packlets.app/en/docs/beispiele.md).
