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

# Quickstart

> Send your first event in under 5 minutes

## Before you start

You need a Wede account and an API key. [Sign up at app.wede.pt](https://app.wede.pt/register) or contact [support@wede.pt](mailto:support@wede.pt) to get access.

Your API key looks like this: `wede_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`

***

## Step 1 — Send your first event

Events represent operational incidents requiring a team response. Choose your industry:

<Tabs>
  <Tab title="Healthcare">
    ```bash theme={null}
    curl -X POST https://api.wede.pt/v1/events \
      -H "x-wede-api-key: wede_live_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "EMERGENCY",
        "priority": "high",
        "vertical": "healthcare",
        "idempotency_key": "hc-evt-001",
        "payload": { "condition": "cardiac_arrest" },
        "location": { "lat": 38.7169, "lng": -9.1395 }
      }'
    ```
  </Tab>

  <Tab title="Banking">
    ```bash theme={null}
    curl -X POST https://api.wede.pt/v1/events \
      -H "x-wede-api-key: wede_live_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "DISPATCH",
        "priority": "high",
        "vertical": "banking",
        "idempotency_key": "bk-evt-001",
        "payload": { "terminal_id": "ATM-042", "issue": "offline" },
        "location": { "lat": 25.2048, "lng": 55.2708 }
      }'
    ```
  </Tab>

  <Tab title="Logistics">
    ```bash theme={null}
    curl -X POST https://api.wede.pt/v1/events \
      -H "x-wede-api-key: wede_live_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "STATUS_UPDATE",
        "priority": "normal",
        "vertical": "logistics",
        "idempotency_key": "lg-evt-001",
        "payload": { "driver_id": "DRV-019", "status": "incident" },
        "location": { "lat": -1.2921, "lng": 36.8219 }
      }'
    ```
  </Tab>

  <Tab title="Telecom">
    ```bash theme={null}
    curl -X POST https://api.wede.pt/v1/events \
      -H "x-wede-api-key: wede_live_YOUR_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "type": "EMERGENCY",
        "priority": "high",
        "vertical": "telecom",
        "idempotency_key": "tc-evt-001",
        "payload": { "site_id": "BTS-AE-112", "alert": "power_failure" },
        "location": { "lat": 25.1972, "lng": 55.2744 }
      }'
    ```
  </Tab>
</Tabs>

Response:

```json theme={null}
{
  "event_id": "fbea1e0d-8f6b-42f5-bf9b-58fe77430f53",
  "status": "pending",
  "channel_selected": "rest_full",
  "estimated_delivery_ms": 250
}
```

The event is now `pending` — awaiting dispatch to a team.

***

## Step 2 — Score and dispatch a team

Score available teams by proximity and capability, then dispatch the best match:

```bash theme={null}
# Score teams for the event location
curl -X POST https://api.wede.pt/v1/teams/dispatch/score \
  -H "x-wede-api-key: wede_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "lat": 38.7169,
    "lng": -9.1395,
    "vertical": "healthcare",
    "priority": "high"
  }'
```

```bash theme={null}
# Dispatch the top-scored team
curl -X POST https://api.wede.pt/v1/teams/dispatch \
  -H "x-wede-api-key: wede_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event_id": "fbea1e0d-8f6b-42f5-bf9b-58fe77430f53",
    "team_id": "259edc6e-95f3-42ba-bac5-263cfe51ebc0",
    "event_lat": 38.7169,
    "event_lng": -9.1395,
    "notes": "Patient is conscious, use south entrance"
  }'
```

This creates a mission and notifies the team. The team then updates their status as they progress: `ACK → ON_ROUTE → ON_SITE → COMPLETED`.

***

## Step 3 — Set up a webhook

Receive real-time notifications when missions progress:

```bash theme={null}
curl -X POST https://api.wede.pt/v1/webhooks \
  -H "x-wede-api-key: wede_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-system.com/wede-webhook",
    "events": ["team.dispatched", "mission.status_updated"]
  }'
```

***

## Step 4 — Enable auto-dispatch (optional)

Let Wede automatically dispatch the best team when an event arrives:

```bash theme={null}
curl -X PATCH https://api.wede.pt/v1/tenant/dispatch-settings \
  -H "x-wede-api-key: wede_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dispatch_mode": true,
    "dispatch_threshold": 0.20,
    "reinforcement_timeout_min": 10
  }'
```

With auto-dispatch enabled, the flow is fully automatic: event arrives → best team scored → dispatched → mission created.

***

## What happens when connectivity fails

Wede is offline-first. When internet is unavailable:

1. The SDK queues the dispatch locally with a sequence number
2. The local score engine selects the best team from cached data
3. When connectivity is restored, the queue syncs automatically
4. The server processes queued dispatches in order, idempotently

Your integration does not change — Wede handles routing transparently.

***

## Next steps

<CardGroup cols={2}>
  <Card title="Offline-First Architecture" icon="signal-bars-slash" href="/concepts/offline-first">
    How Wede keeps operations running without internet
  </Card>

  <Card title="SDKs" icon="code" href="/sdks/overview">
    JS, React Native, Android, Swift, Python
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Full endpoint documentation
  </Card>

  <Card title="Verticals" icon="buildings" href="/concepts/verticals">
    Healthcare, banking, logistics, telecom, emergency
  </Card>
</CardGroup>
