# Quickstart

> Install Opush, copy your push URL, and send your first push in a few minutes.

Opush gives every device a private push URL. Anything that can make an HTTP request (a shell script, a CI job, a cron task, a monitoring tool) can send a notification to your phone with that URL.

This guide takes you from zero to your first push.

<Steps>
<Step>

### Install the app [#install-the-app]

Opush is coming soon to the App Store (iPhone and Apple Watch) and Google Play (Android).

<Callout type="info" title="Not in the stores yet">
  The apps are not published yet. This page will link to the App Store and Google Play as soon as they are live.
</Callout>

</Step>
<Step>

### Open Opush and allow notifications [#open-opush-and-allow-notifications]

When you open the app for the first time, it registers your device and asks for permission to show notifications. Tap **Allow**. Opush can't deliver pushes without it.

The app then sends a test push, so you can check that notifications arrive.

</Step>
<Step>

### Copy your push URL [#copy-your-push-url]

Open the **Receive** tab. Under **Your push URL** you'll see something like this:

```
https://opu.sh/YOUR_KEY
```

`YOUR_KEY` is a 22-character key that points to this device. Copy the whole URL.

<Callout type="warn" title="Keep it private">
  Anyone with this URL can send pushes to your device. If it leaks, create a new key in the app. The old URL stops working right away.
</Callout>

</Step>
<Step>

### Send your first push [#send-your-first-push]

Paste your URL into a terminal and add a title and a body as path segments:

```bash
curl https://opu.sh/YOUR_KEY/Hello/My%20first%20push
```

Your phone shows a notification with the title "Hello" and the body "My first push". The server replies with:

```json
{ "code": 200, "message": "success", "timestamp": 1793546000 }
```

</Step>
</Steps>

## Other ways to send the same push [#other-ways-to-send-the-same-push]

Path segments are the shortest form. When your text gets longer or you need more options, use query parameters or JSON.

**Query parameters.** Good for adding options to a simple URL:

```bash
curl "https://opu.sh/YOUR_KEY?title=Backup%20done&body=42%20GB%20in%2012%20minutes&group=backup"
```

**POST JSON.** Best for scripts. No URL encoding needed:

```bash
curl -X POST https://opu.sh/push \
  -H "Content-Type: application/json" \
  -d '{
    "device_key": "YOUR_KEY",
    "title": "Deploy finished",
    "body": "api v1.4.2 is live",
    "url": "https://example.com/deploys/142"
  }'
```

<Callout type="info" title="Encode your text in URLs">
  In path segments and query strings, encode spaces and special characters (`%20` for a space). Most HTTP libraries do this for you. With JSON you don't need to think about it.
</Callout>

## Add it to a script [#add-it-to-a-script]

A common pattern is to send a push when a long job ends:

```bash
#!/bin/sh
OPUSH="https://opu.sh/YOUR_KEY"

if ./backup.sh; then
  curl -s "$OPUSH/Backup/Finished?group=backup" > /dev/null
else
  curl -s "$OPUSH/Backup/Failed?group=backup&level=timeSensitive" > /dev/null
fi
```

`level=timeSensitive` lets the failure break through Focus modes. See [Levels and sounds](/docs/push/levels-and-sounds).

## Already have push scripts? [#already-have-push-scripts]

Opush uses the common `/{key}/{title}/{body}` push URL format, with the usual parameter names. Scripts and tools that already send pushes this way only need the new server and key. See [Sending pushes](/docs/push).

## Next steps [#next-steps]

<Cards>
  <Card title="Sending pushes" href="/docs/push" description="Every way to send: path, query, form, JSON, and several devices at once." />
  <Card title="Parameters" href="/docs/push/parameters" description="The full list of push parameters." />
  <Card title="Levels and sounds" href="/docs/push/levels-and-sounds" description="Control how loud and how urgent a push is." />
  <Card title="Buttons and actions" href="/docs/push/buttons" description="Open links, copy text, and add your own action buttons." />
</Cards>
