{"openapi":"3.1.0","info":{"title":"Dataruma API","version":"0.1.0","description":"OpenRouter for Indonesian property data, plus a two-sided buy/sell/rent matchmaking API. Valuations are indicative estimates, not KJPP appraisals. Several engines still return labelled example data. Matchmaking routes under /v1/market require the dataruma.market scope and are not billed. Phone and WhatsApp are stored on the profile and are returned to the other party only after both sides consent on a lead. Success fees, commissions, and escrow are not implemented."},"servers":[{"url":"https://api.dataruma.com","description":"Production"},{"url":"http://localhost:8787","description":"Local development"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Dataruma API key (sk_live_ or sk_test_). Keys are stored as SHA-256 hashes and resolved by a 16-character prefix. A matching prefix alone is rejected."}}},"paths":{"/health":{"get":{"operationId":"health","summary":"Process health","responses":{"200":{"description":"Gateway is up"}}}},"/llms.txt":{"get":{"operationId":"llmsTxt","summary":"Agent discovery document","responses":{"200":{"description":"Plain-text operating guide"}}}},"/openapi.json":{"get":{"operationId":"openApi","summary":"This document","responses":{"200":{"description":"OpenAPI 3.1 document"}}}},"/mcp":{"get":{"operationId":"mcpMetadata","summary":"MCP tool catalog","responses":{"200":{"description":"Tool names and input schemas"}}}},"/mcp/tools/{toolName}":{"post":{"operationId":"mcpCallTool","summary":"Invoke an MCP tool","parameters":[{"name":"toolName","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Same payload as the matching REST capability, billed once"},"401":{"description":"Missing or invalid API key"},"402":{"description":"Insufficient credits"},"403":{"description":"API key lacks the capability scope"}}}},"/v1/comps":{"get":{"operationId":"comps","summary":"Nearby comparable listings","description":"One row per cross-listing cluster. Price is $0.03 (30000 micro-USD), billed on insufficient_data as well as on a full summary. Sale prices are total asks. Rent prices are annual. Portal URL and as_of are citations, not a copy of the listing.","security":[{"bearerAuth":[]}],"x-price-capability":"dataruma.comps","parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number"}},{"name":"lng","in":"query","required":true,"schema":{"type":"number"}},{"name":"property_type","in":"query","required":true,"schema":{"type":"string","enum":["house","apartment","land","shop_house"]}},{"name":"listing_type","in":"query","required":false,"schema":{"type":"string","enum":["sale","rent"],"default":"sale"}},{"name":"land_m2","in":"query","required":false,"schema":{"type":"number"}},{"name":"building_m2","in":"query","required":false,"schema":{"type":"number"}},{"name":"radius_m","in":"query","required":false,"schema":{"type":"number","default":2000,"maximum":10000}},{"name":"recency_days","in":"query","required":false,"schema":{"type":"integer","default":180,"maximum":730}}],"responses":{"200":{"description":"Comps and median/IQR, or status insufficient_data when fewer than 3 comps match"},"400":{"description":"Invalid coordinates, property type, radius, or recency"},"401":{"description":"Missing or invalid API key"},"402":{"description":"Insufficient credits"}}}},"/v1/valuation":{"get":{"operationId":"valuationComps","summary":"Comps-weighted AVM","description":"Price is $0.08 (80000 micro-USD). The estimate is a distance, recency, and size-weighted price per m2. status insufficient_data when fewer than 5 usable comps match. No example prices. A promoted LightGBM model is cited from avm.model_versions and is not executed in this build.","security":[{"bearerAuth":[]}],"x-price-capability":"dataruma.valuation","parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number"}},{"name":"lng","in":"query","required":true,"schema":{"type":"number"}},{"name":"property_type","in":"query","required":true,"schema":{"type":"string","enum":["house","apartment","land","shop_house"]}},{"name":"listing_type","in":"query","required":false,"schema":{"type":"string","enum":["sale","rent"],"default":"sale"}},{"name":"land_m2","in":"query","required":false,"schema":{"type":"number"}},{"name":"building_m2","in":"query","required":false,"schema":{"type":"number"}},{"name":"radius_m","in":"query","required":false,"schema":{"type":"number","default":2000,"maximum":10000}},{"name":"recency_days","in":"query","required":false,"schema":{"type":"integer","default":180,"maximum":730}}],"responses":{"200":{"description":"Estimate with low/high range, or status insufficient_data"},"400":{"description":"Invalid query, or missing land_m2 / building_m2 for the property type"},"401":{"description":"Missing or invalid API key"},"402":{"description":"Insufficient credits"}}},"post":{"operationId":"valuation","summary":"Legacy indicative valuation (p10, p50, p90)","description":"Reads resolved public.listings. May return a labelled example when none match. Prefer GET /v1/valuation for portal comps.","security":[{"bearerAuth":[]}],"x-price-capability":"dataruma.valuation","responses":{"200":{"description":"Estimate with disclaimer indicative_estimate_not_kjpp_appraisal"},"401":{"description":"Missing or invalid API key"},"402":{"description":"Insufficient credits"}}}},"/v1/flood-risk":{"get":{"operationId":"floodRisk","summary":"Flood components and band","security":[{"bearerAuth":[]}],"x-price-capability":"dataruma.flood","parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number"}},{"name":"lng","in":"query","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"score, band, hazard (InaRISK class, source, as_of), bpbd_hazard, history (events_recorded, events_12m, typical_depth_cm), disclaimer. data_source is database, partial, or example."},"401":{"description":"Missing or invalid API key"}}}},"/v1/neighborhood":{"get":{"operationId":"neighborhood","summary":"Neighborhood screen","security":[{"bearerAuth":[]}],"x-price-capability":"dataruma.neighborhood","parameters":[{"name":"lat","in":"query","required":true,"schema":{"type":"number"}},{"name":"lng","in":"query","required":true,"schema":{"type":"number"}},{"name":"radius_km","in":"query","required":false,"schema":{"type":"number"}}],"responses":{"200":{"description":"Admin, flood, and RDTR zoning (source, as_of). example_fields lists labelled sample blocks."}}}},"/v1/catalog":{"get":{"operationId":"listCatalog","summary":"Available capabilities","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Capability list with prices"}}}},"/v1/catalog/search":{"get":{"operationId":"searchCatalog","summary":"Search capabilities","security":[{"bearerAuth":[]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Matching capabilities"}}}},"/v1/catalog/{id}":{"get":{"operationId":"getCatalogEntry","summary":"One capability","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Capability detail"}}}},"/v1/accounts":{"post":{"operationId":"createAccount","summary":"Create an account and API key","description":"Public signup. Body is { email, turnstile_token }. No email is sent. The response includes the raw API key once and a balance of 0 micro-USD. A duplicate email returns 409. Cloudflare Turnstile and a per-network hourly limit apply.","responses":{"201":{"description":"Account created. api_key is shown once."},"400":{"description":"Invalid email or missing Turnstile token"},"403":{"description":"Turnstile rejected the token"},"409":{"description":"Email already has an account"},"429":{"description":"Too many signup attempts from this network"},"503":{"description":"Turnstile secret is not configured in production"}}}},"/v1/account":{"get":{"operationId":"account","summary":"Account profile","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Email, balance in micro-USD, created_at"}}}},"/v1/balance":{"get":{"operationId":"balance","summary":"Credit balance","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Balance in micro-USD"}}}},"/v1/keys":{"get":{"operationId":"listKeys","summary":"API keys for this account","description":"Prefixes and scopes only. Raw tokens are never stored and are not returned here.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Key metadata, newest first"}}}},"/v1/keys/rotate":{"post":{"operationId":"rotateKey","summary":"Rotate the current API key","description":"Disables the bearer key used on this request and returns a new token once, with the same scopes.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"New api_key, shown once"},"404":{"description":"Current key cannot be rotated"}}}},"/v1/topups":{"get":{"operationId":"listTopups","summary":"Recent USDC top-ups","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Newest top-ups for this account"}}},"post":{"operationId":"createTopup","summary":"Buy credits with USDC (x402)","description":"Without PAYMENT-SIGNATURE this returns 402 and a base64 PAYMENT-REQUIRED header (x402 v2, exact scheme, Solana USDC). A verified settlement credits micro-USD once. One micro-USD equals one USDC atomic unit. Body is { amount_micro_usd } from 10000 ($0.01) to 1000000000 ($1,000).","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Same payment was already credited"},"201":{"description":"Credits applied"},"402":{"description":"Payment required or rejected"},"503":{"description":"Recipient address or facilitator is not configured"}}}},"/v1/calls":{"get":{"operationId":"listCalls","summary":"Call history for the key account","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Completed calls, newest first, with next_cursor"}}}},"/v1/feedback":{"post":{"operationId":"submitFeedback","summary":"Store feedback for a result","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Feedback row id"}}}},"/v1/admin/topups":{"post":{"operationId":"adminTopup","summary":"Admin test credit","description":"Requires the admin scope. Writes the ledger with provider stub and does not collect a payment.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Test credit recorded"},"403":{"description":"Admin scope required"}}}},"/v1/admin/market-profiles/{id}/verification":{"post":{"operationId":"verifyMarketProfile","summary":"Set an agent verification status","description":"Admin scope. verification_status is unverified, pending, verified, or rejected. Optional verification_expires_at is ISO-8601 UTC.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Public profile. Contact fields are omitted."}}}},"/v1/admin/market-listings/{id}/ownership-proof":{"post":{"operationId":"setOwnershipProof","summary":"Set ownership proof status","description":"Admin scope. Callers cannot mark proof verified themselves. Values: unsubmitted, pending, verified, rejected.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Listing with the updated proof status"}}}},"/v1/admin/market-events/{id}/delivered":{"post":{"operationId":"markMarketEventDelivered","summary":"Mark a notification event delivered","description":"Admin hook for a future sender. This does not send SMS or WhatsApp.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Event id and delivered_at"}}}},"/v1/market/profile":{"put":{"operationId":"putMarketProfile","summary":"Create or replace the caller profile","description":"Roles are owner, agent, buyer, and renter. Phone and WhatsApp are stored and returned only to this caller. default_lead_routing is owner_direct unless set to delegate_agent (verified agent id required) or open_to_agents. service_area is a GeoJSON Polygon or MultiPolygon. service_kecamatan is a list of names. Not billed.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Private profile, including the caller contact fields"},"403":{"description":"Missing dataruma.market scope"}}},"get":{"operationId":"getMarketProfile","summary":"Read the caller profile","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Private profile"},"404":{"description":"PROFILE_REQUIRED"}}}},"/v1/market/profiles/{id}":{"get":{"operationId":"getPublicMarketProfile","summary":"Read another profile without contact fields","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Public profile. phone, whatsapp, and email are omitted."}}}},"/v1/market/listings":{"post":{"operationId":"createMarketListing","summary":"Create a first-party listing","description":"Property fields match the scraper normalization: listing_type sale or rent, property_type house, apartment, land, or shop_house, price_period total for sale and year or month for rent, certificate shm, hgb, shgb, hgu, girik, petok_d, ajb, ppjb, or unknown. location is {lat, lng}. photos are https URLs or R2 keys. portal_cluster_id may link a scrape.listings cluster and does not copy the portal row. Flood and zoning are snapshotted from the official layers. An owner listing is accepted immediately. A verified agent may submit for another owner; it stays draft until POST /accept. lead_routing null uses the owner default. Not billed.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Listing. No phone numbers."}}},"get":{"operationId":"listOwnMarketListings","summary":"List listings the caller owns or submitted","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Listing summaries"}}}},"/v1/market/listings/{id}":{"get":{"operationId":"getMarketListing","summary":"Read a listing","description":"Published listings are visible to any market profile. Drafts and withdrawn listings are visible to the owner, submitter, delegate, and representing agent.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Listing with flood and zoning snapshot"},"404":{"description":"Hidden or missing"}}},"patch":{"operationId":"updateMarketListing","summary":"Update a listing","description":"Owner or submitting agent. publish true requires owner acceptance. Moving the point refreshes flood and zoning. Not billed.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated listing"}}}},"/v1/market/listings/{id}/withdraw":{"post":{"operationId":"withdrawMarketListing","summary":"Withdraw a listing","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Listing status withdrawn, with withdrawn_at"}}}},"/v1/market/listings/{id}/accept":{"post":{"operationId":"acceptMarketListing","summary":"Owner accepts an agent-submitted listing","description":"Body { publish: true } also publishes it.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Listing with owner_accepted_at"}}}},"/v1/market/listings/{id}/context":{"post":{"operationId":"refreshMarketListingContext","summary":"Refresh flood and zoning from official layers","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Listing with a new context_attached_at"}}}},"/v1/market/listings/{id}/agent-matches":{"post":{"operationId":"matchAgents","summary":"Score agents who cover this listing","description":"Owner only. Coverage is the service polygon or kecamatan list. Score adds verification, closed-won count, and median reply time. Not billed.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent matches without contact fields"}}},"get":{"operationId":"listAgentMatches","summary":"List stored agent matches","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Agent matches"}}}},"/v1/market/listings/{id}/leads":{"post":{"operationId":"createLead","summary":"Open a lead on a published listing","description":"Body consent must be true. The seeker needs the buyer role for a sale and the renter role for a rent. Routing is snapshotted: owner_direct sends the lead to the owner, delegate_agent sends it to the selected verified agent, open_to_agents leaves recipient null until the owner accepts a representation request. One open lead per seeker per listing. Not billed.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Lead. counterparty_contact is null until both sides consent."},"409":{"description":"LEAD_EXISTS, CANNOT_INQUIRE_OWN_LISTING, or ROUTING_UNAVAILABLE"}}}},"/v1/market/listings/{id}/representation-requests":{"post":{"operationId":"requestRepresentation","summary":"Verified agent asks to represent an open listing","description":"Only when the effective routing mode is open_to_agents. Limited to 5 requests per hour and 20 per day. Not billed.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Representation request"},"429":{"description":"AGENT_RATE_LIMITED"}}},"get":{"operationId":"listRepresentationRequests","summary":"Owner lists representation requests","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Requests without agent contact fields"}}}},"/v1/market/representation-requests/{id}/resolve":{"post":{"operationId":"resolveRepresentation","summary":"Owner accepts or declines a representation request","description":"decision is accepted or declined. Accepting sets the representing agent and assigns queued open_to_agents leads that do not yet have a recipient.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Resolved request"}}}},"/v1/market/requests":{"post":{"operationId":"createSearchRequest","summary":"Save a buyer or renter search alert","description":"Requires an area polygon or a kecamatan list. Optional budget, property types, size, max_flood_band (low, medium, high), and zone_codes. A flood or zoning must-have fails closed when the listing snapshot is unknown. Not billed.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Search request"}}},"get":{"operationId":"listSearchRequests","summary":"List the caller search alerts","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Search requests"}}}},"/v1/market/requests/{id}":{"get":{"operationId":"getSearchRequest","summary":"Read one search alert","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Search request"}}},"patch":{"operationId":"updateSearchRequest","summary":"Update a search alert","description":"status may be active, paused, or closed. Criteria fields replace the saved alert when present.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Updated search request"}}}},"/v1/market/requests/{id}/matches":{"post":{"operationId":"matchSearchRequest","summary":"Score published listings against a search alert","description":"Replaces stored matches. Eligible listings match sale/rent, property type, area (polygon or kecamatan), budget within 10% over or half under, flood and zoning must-haves, and are not wildly outside the size range. Score is 0-100 from location, budget, size, type, and flood. New matches are written to the notification event table. Not billed.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Matches with listing summaries and factor breakdowns"}}},"get":{"operationId":"listSearchMatches","summary":"List stored listing matches","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Matches"}}}},"/v1/market/leads":{"get":{"operationId":"listLeads","summary":"List leads the caller is a party to","description":"Seeker, recipient, or listing owner. Other owners are omitted. counterparty_contact is always null on this list.","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Leads"}}}},"/v1/market/leads/{id}":{"get":{"operationId":"getLead","summary":"Read a lead, its status timestamps, and contact if revealed","description":"Timestamps are ISO-8601 UTC. Statuses: new, contacted, viewing_scheduled, offer, closed_won, closed_lost. counterparty_contact is present only when contacts_revealed_at is set and the caller is the seeker or the recipient. The listing owner who is not the recipient does not receive phone or WhatsApp. commercial_terms_status is always not_configured.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lead"},"404":{"description":"Not a party to this lead"}}}},"/v1/market/leads/{id}/status":{"post":{"operationId":"changeLeadStatus","summary":"Advance a lead","description":"Forward moves and skips are allowed. closed_won and closed_lost are terminal. The seeker may only set closed_lost. The recipient and the listing owner may set any forward status. Entering contacted records an agent reply sample. Entering a closed status updates that agent track record once.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lead with status timestamps"},"409":{"description":"INVALID_TRANSITION"}}}},"/v1/market/leads/{id}/consent":{"post":{"operationId":"setLeadConsent","summary":"Grant or revoke contact sharing","description":"action is grant or revoke. Reveal happens when both seeker_contact_consent_at and recipient_contact_consent_at are set, and is written to the consent audit. Revoke clears that side and contacts_revealed_at. The audit stores actions, not phone numbers.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Lead"},"403":{"description":"CONSENT_NOT_ALLOWED"}}}},"/v1/market/leads/{id}/audit":{"get":{"operationId":"listLeadAudit","summary":"Consent and reveal audit for a lead","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Audit events with created_at in ISO-8601 UTC. No contact fields."}}}},"/v1/market/events":{"get":{"operationId":"listMarketEvents","summary":"Notification events for the caller","description":"Queue only. Nothing is sent to SMS or WhatsApp. delivered_at stays null until an admin marks it.","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Events newest first"}}}}}}