diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
index 37803d4823b..e58c9c172c9 100644
--- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
+++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts
@@ -737,6 +737,7 @@ export const api: NavMenuConstant = {
url: '/guides/api/joins-and-nesting',
items: [],
},
+ { name: 'Using custom schemas', url: '/guides/api/using-custom-schemas', items: [] },
],
},
{
diff --git a/apps/docs/pages/guides/api/using-custom-schemas.mdx b/apps/docs/pages/guides/api/using-custom-schemas.mdx
new file mode 100644
index 00000000000..87d791aa5d9
--- /dev/null
+++ b/apps/docs/pages/guides/api/using-custom-schemas.mdx
@@ -0,0 +1,59 @@
+import Layout from '~/layouts/DefaultGuideLayout'
+
+export const meta = {
+ id: 'using-custom-schemas',
+ title: 'Using Custom Schemas',
+ description: 'You need additional steps to use custom database schemas with Serverless APIs.',
+}
+
+By default, your database has a `public` schema which is automatically exposed on Serverless APIs. You can also expose custom database schemas - to do so you need to follow these steps:
+
+1. Go to [API settings](https://supabase.com/dashboard/project/_/settings/api) and add your custom schema to "Exposed schemas".
+2. Run the following SQL, substituting `myschema` with your schema name:
+
+```sql
+GRANT USAGE ON SCHEMA myschema TO anon, authenticated, service_role;
+GRANT ALL ON ALL TABLES IN SCHEMA myschema TO anon, authenticated, service_role;
+GRANT ALL ON ALL ROUTINES IN SCHEMA myschema TO anon, authenticated, service_role;
+GRANT ALL ON ALL SEQUENCES IN SCHEMA myschema TO anon, authenticated, service_role;
+ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON TABLES TO anon, authenticated, service_role;
+ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON ROUTINES TO anon, authenticated, service_role;
+ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA myschema GRANT ALL ON SEQUENCES TO anon, authenticated, service_role;
+```
+
+Now you can access these schemas from Serverless APIs:
+
+
+
+
+```js
+// Initialize the JS client
+import { createClient } from '@supabase/supabase-js'
+const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, { db: { schema: 'myschema' } })
+
+// Make a request
+const { data: todos, error } = await supabase.from('todos').select('*')
+```
+
+
+
+
+```bash
+# Append /rest/v1/ to your URL, and then use the table name as the route
+curl '/rest/v1/todos' \
+ -H "apikey: " \
+ -H "Authorization: Bearer " \
+ -H "Accept-Profile: myschema"
+```
+
+
+
+
+export const Page = ({ children }) =>
+
+export default Page