← Comparte Esterones

Community Swap API

Version 1 · Download OpenAPI 3 JSON

Base path: /api/v1. Browse anonymously. Mutations require a matching Origin header, except the Meta webhook, which requires a signature over its raw body. Verified sessions use the HttpOnly swap_session cookie.

Import the contract into Swagger Editor, Postman or your client generator for complete request and response schemas.

MethodPathPurpose
GET/healthApplication and database health
GET/openapi.jsonThis OpenAPI document
GET/communitiesList geographic namespaces and database feature flags
GET/listingsAnonymous nearest-first inventory; overlapping communities share listings
POST/listingsPost a free item at the saved location; expires in exactly seven days
GET/listings/{id}Get a visible listing without identity or exact coordinates
PATCH/listings/{id}Owner edits description; expiration stays unchanged; translation regenerated
DELETE/listings/{id}Owner marks item gone; irreversible through API
PATCH/listings/{id}/statusOwner changes state: available ↔ reserved → gone
POST/listings/{id}/contactVerified, rate-limited contact handoff; demo returns no external URL
POST/listings/{id}/reportReport once per verified user; three distinct reports hide listing
POST/reportsReport a listing (alias)
GET/mePrivate profile including own exact location and nonexpired inventory
PUT/me/locationSave private pickup location and stable coarse public area
POST/auth/development/startLocalhost only: begin simulated provider verification; sets HttpOnly challenge cookie
POST/auth/development/verifyConsume single-use challenge bound to browser cookie; sets session
POST/auth/telegramValidate Telegram signed Login Widget proof (5 minute age; no replay); sets session
POST/auth/whatsappRequest WhatsApp OTP; alias of /auth/whatsapp/start
POST/auth/whatsapp/startSend a five-minute OTP and set HttpOnly swap_whatsapp_challenge cookie; max three sends per phone/hour
POST/auth/whatsapp/verifyConsume OTP using originating browser cookie; five attempts maximum; sets session cookie
GET/whatsapp/webhookMeta subscription challenge; verify token required
POST/whatsapp/webhookSigned raw-body Meta messages webhook; no browser Origin required; duplicates ignored
POST/auth/logoutRevoke current session and clear cookie