Quick Start
Create a User
curl -X POST https://auth.redecasas.com.br/api/auth/register \ -H "Content-Type: application/json" \ -d '{ "email": "joao@email.com", "password": "senha123", "name": "João Silva", "phone": "11999999999" }'Response includes a Set-Cookie header with the session token.
Login
curl -X POST https://auth.redecasas.com.br/api/auth/login \ -H "Content-Type: application/json" \ -d '{ "email": "joao@email.com", "password": "senha123" }'Get Current User
curl https://auth.redecasas.com.br/api/auth/me \ -H "Cookie: session=<token>"Upload a Listing Image
curl -X POST https://listing.redecasas.com.br/api/listings/upload-image \ -H "Cookie: session=<token>" \ -F "image=@foto1.jpg"Save the returned url for the next step.
Create a Real Estate Listing
curl -X POST https://listing.redecasas.com.br/api/listings \ -H "Cookie: session=<token>" \ -H "Content-Type: application/json" \ -d '{ "title": "Casa em Florianópolis", "description": "Ótima casa com 3 quartos, piscina e vista para o mar.", "price": 850000, "property_type": "casa", "city": "Florianópolis", "state_code": "SC", "bedrooms": 3, "bathrooms": 2, "area_m2": 180, "whatsapp": "48999999999", "images": [ "https://{r2}/listings/temp/{userId}/{uuid}.jpg" ] }'Note: 1 free listing per user. Additional listings require an active subscription.
List My Listings
curl https://listing.redecasas.com.br/api/listings/me \ -H "Cookie: session=<token>"Register as a Real Estate Agent
curl -X POST https://corretores.redecasas.com.br/api/corretores \ -H "Content-Type: application/json" \ -d '{ "name": "Maria Souza", "email": "maria@corretora.com", "whatsapp": "11999999999", "creci_estado": "SP", "creci_numero": "123456", "cidade": "São Paulo", "estado": "SP", "especializacao": "Imóveis Residenciais" }'Registration is stored as pending and requires admin approval.
List Approved Agents
curl "https://corretores.redecasas.com.br/api/corretores?state=SP&city=São+Paulo"Check Subscription Status
curl https://billing.redecasas.com.br/api/billing/status \ -H "Cookie: session=<token>"Create Stripe Checkout
curl -X POST https://billing.redecasas.com.br/api/billing/checkout \ -H "Cookie: session=<token>"Response contains a Stripe checkout URL. Redirect the user to complete payment.
Open Customer Portal
curl -X POST https://billing.redecasas.com.br/api/billing/portal \ -H "Cookie: session=<token>"Logout
curl -X POST https://auth.redecasas.com.br/api/auth/logout \ -H "Cookie: session=<token>"