← Volver al listado

API — ManoAyuda

Endpoints públicos para integración con otros sistemas de respuesta a emergencias. Autenticación vía Supabase Auth (JWT Bearer token).

GET/api/resources

Lista todos los recursos activos (no expirados).

Response: Array de Resource

{
  id: "uuid",
  type: "offer" | "need",
  category: string,
  city: string,
  lat?: number,
  lng?: number,
  contact_info?: string,
  trust_score: number,
  is_verified_mod: boolean,
  created_at: string (ISO),
  expires_at: string (ISO)
}
POST/api/resources

Crea un nuevo recurso (requiere autenticación).

Headers: Authorization: Bearer {token}

Body:

{
  type: "offer" | "need",
  category: string,
  city: string,
  lat?: number,
  lng?: number,
  contact_info?: string
}
POST/api/ping/{id}/confirm

Confirma que un recurso sigue activo/válido.

Response: { ok: boolean }

POST/api/ping/{id}/renew

Renueva un recurso propio (+4h). Requiere ser el owner.

Headers: Authorization: Bearer {token}

Response: { ok: boolean }

Notas