diff --git a/web/docs/guides/api.mdx b/web/docs/guides/api.mdx index 8883bb38142..d55c24dbae8 100644 --- a/web/docs/guides/api.mdx +++ b/web/docs/guides/api.mdx @@ -24,7 +24,7 @@ The APIs are: - **Scalable.**
The API can serve thousands of simultaneous requests, and works well for Serverless workloads. -### REST API +### REST API {#rest-api-overview} Supabase provides a RESTful API using [PostgREST](https://postgrest.org/). This is a very thin API layer on top of Postgres. It provides everything you need from a CRUD API: @@ -45,7 +45,7 @@ It provides everything you need from a CRUD API: allowFullScreen > -### GraphQL API +### GraphQL API {#graphql-api-overview} :::note @@ -55,7 +55,7 @@ GraphQL is in Beta, and may have breaking changes. It is only available on self- GraphQL in Supabase works through [pg_graphql](https://supabase.com/blog/2021/12/03/pg-graphql), an open source PostgreSQL extension for GraphQL. -### Realtime API +### Realtime API {#realtime-api-overview} Supabase provides a Realtime API using [Realtime](https://github.com/supabase/realtime). You can use this to listen to database changes over websockets. Realtime leverages PostgreSQL's built-in logical replication. You can manage your Realtime API simply by managing Postgres publications. @@ -69,33 +69,33 @@ All APIs are auto-created from Database tables. After you have added tables or f API routes are automatically created when you create Postgres Tables, Views, or Functions. Let's create our first -API route by creating a table called `todos` (which will store some public user information). -This will create a corresponding route `todos` which can accept `GET`, `POST`, `PATCH`, & `DELETE` requests. +API route by creating a table called `todos` to store tasks. +This creates a corresponding route `todos` which can accept `GET`, `POST`, `PATCH`, & `DELETE` requests. - + groupId="dashboard-or-sql" + defaultValue="dashboard" + values={[ + {label: 'Dashboard', value: 'dashboard'}, + {label: 'SQL', value: 'sql'}, + ]}> -```sh -1. Go to the "Table editor" section. -2. Click "New Table". -3. Enter the table name "todos". -4. Click "Save". -5. Click "New Column". -6. Enter the column name "task" and make the type "text". -7. Click "Save". -``` + + +1. Go to the [Table editor](https://app.supabase.com/project/_/editor) page in the Dashboard. +2. Click **New Table**. +3. Enter "todos" for the Name. +4. Click **Save**. +5. Click **New Column**. +6. Enter "task" for the Name and "text" as the Type. +7. Click **Save**. - + ```sql -- Create a table called "todos" with a column to store tasks. @@ -113,13 +113,9 @@ create table todos ( Every Supabase project has a unique API URL. Your API is secured behind an API gateway which requires an API Key for every request. - -```sh -1. Go to the "Settings" section. -2. Click "API" in the sidebar. -3. Find your API URL in this page. -4. Find your "anon" and "service_role" keys on this page. -``` +1. Go to the [Settings](https://app.supabase.com/project/_/settings/general) page in the Dashboard. +2. Click **API** in the sidebar. +3. Find your API `URL`, `anon`, and `service_role` keys on this page.