A concise, REST-ful HTTP API. Requests use JSON. Authenticate with a bearer token in the Authorization header.
curl https://api.nestly.ro/v1/listings \ -H "Authorization: Bearer YOUR_TOKEN"
/v1/auth/sessionExchange OAuth code for a session token.
{
"provider": "google",
"code": "..."
}{
"token": "jwt...",
"user": { "id": "u-1", "role": "tenant" }
}/v1/auth/logoutInvalidate the current session.
{ "ok": true }/v1/listingsList rooms with filters.
{
"data": [{ "id": "l-1", "title": "Studio", "price": 480 }],
"page": 1, "total": 42
}/v1/listingsCreate a listing (owner only).
{
"title": "...", "price": 500,
"sector": "Sector 1", "photos": ["..."]
}{ "id": "l-abc", "status": "pending" }/v1/listings/{id}Fetch a single listing.
{ "id": "l-1", "title": "...", "owner": {...} }/v1/listings/{id}Update fields.
{ "price": 520 }{ "ok": true }/v1/listings/{id}Delete a listing.
{ "ok": true }/v1/threadsList conversations for the user.
[{ "userId": "u-2", "unread": 1, "last": "..." }]/v1/messagesSend a message.
{ "toId": "u-2", "listingId": "l-1", "text": "Hi" }{ "id": "m-abc" }/v1/threads/{userId}/readMark thread as read.
{ "ok": true }/v1/favoritesList saved listings.
["l-1","l-5"]
/v1/favorites/{listingId}Toggle favorite.
{ "saved": true }/v1/reportsReport a listing or user.
{ "targetType": "listing", "targetId": "l-4", "reason": "..." }{ "id": "r-1" }/v1/admin/moderationPending listings queue (admin).
[{ "id": "l-4", "status": "pending" }]/v1/admin/listings/{id}Approve or reject (admin).
{ "status": "active" }{ "ok": true }