Skip to main content

Before you start

You need a Wede account and an API key. Sign up at app.wede.pt or contact 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:
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 }
  }'
Response:
{
  "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:
# 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"
  }'
# 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:
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:
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

Offline-First Architecture

How Wede keeps operations running without internet

SDKs

JS, React Native, Android, Swift, Python

API Reference

Full endpoint documentation

Verticals

Healthcare, banking, logistics, telecom, emergency