# Inicio rápido

Empieza a usar PocketAlert en pocos minutos. Esta guía te explica cómo enviar tu primera notificación push.

## Requisitos previos

- Una cuenta de PocketAlert: [Registrarse](https://pocketalert.app/signup) o [Iniciar sesión](https://pocketalert.app/signin)
- La aplicación móvil de PocketAlert instalada en tu dispositivo

---

## Paso 1: Obtén tu clave de API

1. Inicia sesión en [PocketAlert](https://pocketalert.app/signin)
2. Ve a [Claves de API](https://pocketalert.app/account/apikeys)
3. Haz clic en **Crear nueva clave**
4. Copia y guarda tu clave de API en un lugar seguro

> **Warning: Importante**
>
> Tu clave de API solo se muestra una vez. Guárdala en un lugar seguro.

---

## Paso 2: Envía tu primera notificación

Elige el método que prefieras:

**cURL**

```bash
curl -X POST "https://api.pocketalert.app/v1/messages" \
  -H "Token: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Hello from API",
    "message": "This is my first notification!"
  }'
```

**JavaScript**

```javascript
const response = await fetch('https://api.pocketalert.app/v1/messages', {
  method: 'POST',
  headers: {
    'Token': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    title: 'Hello from API',
    message: 'This is my first notification!'
  })
});

const data = await response.json();
console.log('Message sent:', data.tid);
```

**Python**

```python
import requests

response = requests.post(
    'https://api.pocketalert.app/v1/messages',
    headers={
        'Token': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'title': 'Hello from API',
        'message': 'This is my first notification!'
    }
)

print('Message sent:', response.json()['tid'])
```

**PHP**

```php
$response = Http::withHeaders([
    'Token' => 'YOUR_API_KEY',
])->post('https://api.pocketalert.app/v1/messages', [
    'title' => 'Hello from API',
    'message' => 'This is my first notification!',
]);

echo 'Message sent: ' . $response['tid'];
```

**Go**

```go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string]string{
        "title":   "Hello from API",
        "message": "This is my first notification!",
    }
    body, _ := json.Marshal(payload)

    req, _ := http.NewRequest("POST", 
        "https://api.pocketalert.app/v1/messages", 
        bytes.NewBuffer(body))
    req.Header.Set("Token", "YOUR_API_KEY")
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    client.Do(req)
}
```

---

## Paso 3: Revisa la respuesta

Una solicitud correcta devuelve:

```json
{
  "tid": "cq4k7rml9m2qqmuw44ypoos93",
  "title": "Hello from API",
  "message": "This is my first notification!",
  "application": "",
  "device": "",
  "created_at": "18.01.2026 15:30:00"
}
```

| Campo | Descripción |
|-------|-------------|
| `tid` | Identificador único del mensaje |
| `title` | Título de tu notificación |
| `message` | Cuerpo de tu notificación |
| `created_at` | Fecha y hora en que se envió el mensaje |

---

## ¿Qué sigue?

<div class="tip custom-block" style="padding-top: 8px">

**Explora más funciones:**

- [Crear aplicaciones](https://info.pocketalert.app/api/applications/create.md) — Organiza los mensajes por proyecto
- [Gestionar dispositivos](https://info.pocketalert.app/api/devices/get-devices.md) — Envía a dispositivos concretos
- [Configurar webhooks](https://info.pocketalert.app/api/webhooks/create.md) — Recibe alertas de servicios externos
- [Usar la CLI](https://info.pocketalert.app/cli.md) — Envía notificaciones desde tu terminal

</div>

---

## ¿Necesitas ayuda?

Para más asistencia o para compartir tus casos de uso:

| Recurso | Enlace |
|----------|------|
| Soporte por correo | [support@pocketalert.app](mailto:support@pocketalert.app) |
| Referencia de la API | [Documentación completa](https://info.pocketalert.app/intro.md) |
| Herramienta CLI | [Descargar e instalar](https://info.pocketalert.app/cli.md) |
