Back to Docs

Reference

RPC Reference

Complete reference for all public PostgreSQL RPCs available via the Supabase API.

Last updated March 19, 2026

RPC Reference

All RPCs are called via POST /rest/v1/rpc/<function_name> with a JSON body.

Discovery

find_nearby_cafes

Finds cafes within a radius of a given point.

Parameters:

  • p_lat (float) -- Latitude
  • p_lng (float) -- Longitude
  • p_radius_m (int, default 2000) -- Search radius in meters
  • p_limit (int, default 50) -- Max results

search_cafes_full

Full-text search with trigram matching and accent folding.

Parameters:

  • p_query (text) -- Search term
  • p_lat (float, optional) -- For distance sorting
  • p_lng (float, optional) -- For distance sorting
  • p_limit (int, default 20)

get_home_dashboard

Personalized home feed with nearby cafes, trending, and recommendations.

Parameters:

  • p_user_lat (float)
  • p_user_lng (float)

Social

get_social_feed

Activity feed from followed users.

Parameters:

  • p_user_id (text) -- Clerk user ID
  • p_limit (int, default 20)
  • p_offset (int, default 0)

Points Economy

spend_points

Spend redeemable points during check-in.

Parameters:

  • p_user_id (text)
  • p_points (int)
  • p_listing_id (uuid)
  • p_discount_percent (int)

get_discount_tiers

Get available discount tiers for a listing.

Parameters:

  • p_listing_id (uuid)

CRM

get_merchant_customers

Get customer list for a merchant's place.

Parameters:

  • p_place_id (text, optional)
  • p_listing_id (uuid, optional)
  • p_sort (text, default 'last_visit') -- Options: last_visit, visits, rating, points_spent
  • p_limit (int, default 50)
  • p_offset (int, default 0)

get_customer_timeline

Chronological timeline of a customer's interactions with a place.

Parameters:

  • p_user_id (text)
  • p_place_id (text, optional)
  • p_listing_id (uuid, optional)
  • p_limit (int, default 50)