The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
docs: add instructions for using management api as alternative to dashboard ui (#36676)
Charisa62ae515b176
diff --git a/apps/docs/content/_partials/quickstart_db_setup.mdx b/apps/docs/content/_partials/quickstart_db_setup.mdxindex cd282520da8..161ea8b7f5e 100644--- a/apps/docs/content/_partials/quickstart_db_setup.mdx+++ b/apps/docs/content/_partials/quickstart_db_setup.mdx@@ -2,6 +2,28 @@Go to [database.new](https://database.new) and create a new Supabase project.+Alternatively, you can create a project using the Management API:++```bash+# First, get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"++# List your organizations to get the organization ID+curl -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ https://api.supabase.com/v1/organizations++# Create a new project (replace <org-id> with your organization ID)+curl -X POST https://api.supabase.com/v1/projects \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "organization_id": "<org-id>",+ "name": "My Project",+ "region": "us-east-1",+ "password": "<your-secure-password>"+ }'+```+When your project is up and running, go to the [Table Editor](https://supabase.com/dashboard/project/_/editor), create a new table and insert some data.Alternatively, you can run the following snippet in your project's [SQL Editor](https://supabase.com/dashboard/project/_/sql/new). This will create a `instruments` table with some sample data.diff --git a/apps/docs/content/guides/auth/auth-email-templates.mdx b/apps/docs/content/guides/auth/auth-email-templates.mdxindex af34bfd7f4c..20167f74ac3 100644--- a/apps/docs/content/guides/auth/auth-email-templates.mdx+++ b/apps/docs/content/guides/auth/auth-email-templates.mdx@@ -29,6 +29,36 @@ The templating system provides the following variables for use:On hosted Supabase projects, edit your email templates on the [Email Templates](/dashboard/project/_/auth/templates) page. On self-hosted projects or in local development, edit your [configuration files](/docs/guides/local-development/customizing-email-templates).+You can also manage email templates using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Get current email templates+curl -X GET "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ | jq 'to_entries | map(select(.key | startswith("mailer_templates"))) | from_entries'++# Update email templates+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "mailer_subjects_confirmation": "Confirm your signup",+ "mailer_templates_confirmation_content": "<h2>Confirm your signup</h2><p>Follow this link to confirm your user:</p><p><a href=\"{{ .ConfirmationURL }}\">Confirm your email</a></p>",+ "mailer_subjects_magic_link": "Your Magic Link",+ "mailer_templates_magic_link_content": "<h2>Magic Link</h2><p>Follow this link to login:</p><p><a href=\"{{ .ConfirmationURL }}\">Log In</a></p>",+ "mailer_subjects_recovery": "Rest Your Password",+ "mailer_templates_recovery_content": "<h2>Reset Password</h2><p>Follow this link to reset the password for your user:</p><p><a href=\"{{ .ConfirmationURL }}\">Reset Password</a></p>",+ "mailer_subjects_invite": "You have been invited",+ "mailer_templates_invite_content": "<h2>You have been invited</h2><p>You have been invited to create a user on {{ .SiteURL }}. Follow this link to accept the invite:</p><p><a href=\"{{ .ConfirmationURL }}\">Accept the invite</a></p>",+ "mailer_subjects_email_change": "Confirm email change",+ "mailer_templates_email_change_content": "<h2>Confirm email change</h2><p>Follow this link to confirm the update of your email:</p><p><a href=\"{{ .ConfirmationURL }}\">Change email</a></p>",+ }'+```+## Mobile deep linkingFor mobile applications, you might need to link or redirect to a specific page within your app. See the [Mobile Deep Linking guide](/docs/guides/auth/native-mobile-deep-linking) to set this up.diff --git a/apps/docs/content/guides/auth/auth-smtp.mdx b/apps/docs/content/guides/auth/auth-smtp.mdxindex 1d1558d3c18..5f7f05b0ed5 100644--- a/apps/docs/content/guides/auth/auth-smtp.mdx+++ b/apps/docs/content/guides/auth/auth-smtp.mdx@@ -50,6 +50,30 @@ A non-exhaustive list of services that work with Supabase Auth is:Once you've set up your account with an email sending service, head to the [Authentication settings page](/dashboard/project/_/settings/auth) to enable and configure custom SMTP.+You can also configure custom SMTP using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure custom SMTP+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_email_enabled": true,+ "mailer_secure_email_change_enabled": true,+ "mailer_autoconfirm": false,+ "smtp_admin_email": "[email protected]",+ "smtp_host": "smtp.example.com",+ "smtp_port": 587,+ "smtp_user": "your-smtp-user",+ "smtp_pass": "your-smtp-password",+ "smtp_sender_name": "Your App Name"+ }'+```+Once you save these settings, your project's Auth server will send messages to all addresses. To protect the reputation of your newly set up service a low rate-limit of 30 messages per hour is imposed. To adjust this to an acceptable value for your use case head to the [Rate Limits configuration page](/dashboard/project/_/auth/rate-limits).## Dealing with abuse: How to maintain the sending reputation of your SMTP server?diff --git a/apps/docs/content/guides/auth/rate-limits.mdx b/apps/docs/content/guides/auth/rate-limits.mdxindex 6edd22b0df8..1233f2c06b3 100644--- a/apps/docs/content/guides/auth/rate-limits.mdx+++ b/apps/docs/content/guides/auth/rate-limits.mdx@@ -5,4 +5,31 @@ subtitle: 'Rate limits protect your services from abuse'Supabase Auth enforces rate limits on endpoints to prevent abuse. Some rate limits are [customizable](/dashboard/project/_/auth/rate-limits).+You can also manage rate limits using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Get current rate limits+curl -X GET "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ | jq 'to_entries | map(select(.key | startswith("rate_limit_"))) | from_entries'++# Update rate limits+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "rate_limit_anonymous_users": 10,+ "rate_limit_email_sent": 10,+ "rate_limit_sms_sent": 10,+ "rate_limit_verify": 10,+ "rate_limit_token_refresh": 10,+ "rate_limit_otp": 10,+ "rate_limit_web3": 10+ }'+```+<$Partial path="auth_rate_limits.mdx" />diff --git a/apps/docs/content/guides/auth/social-login/auth-apple.mdx b/apps/docs/content/guides/auth/social-login/auth-apple.mdxindex a80abc34d71..b2fd02f6eec 100644--- a/apps/docs/content/guides/auth/social-login/auth-apple.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-apple.mdx@@ -67,6 +67,24 @@ When developing with Expo, you can test Sign in with Apple via the Expo Go app,6. Create a signing **Key** in the [Keys](https://developer.apple.com/account/resources/authkeys/list) section of the Apple Developer Console. You can use this key to generate a secret key using the tool below, which is added to your Supabase project's Auth configuration. Make sure you safely store the `AuthKey_XXXXXXXXXX.p8` file. If you ever lose access to it, or make it public accidentally, revoke it from the Apple Developer Console and create a new one immediately. You will have to generate a new secret key using this file every 6 months, so make sure you schedule a recurring meeting in your calendar!7. Finally, add the information you configured above to the [Apple provider configuration in the Supabase dashboard](https://supabase.com/dashboard/project/_/auth/providers).+You can also configure the Apple auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Apple auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_apple_enabled": true,+ "external_apple_client_id": "your-services-id",+ "external_apple_secret": "your-generated-secret-key"+ }'+```+<Admonition type="tip">Use this tool to generate a new Apple client secret. No keys leave your browser! Be aware that this tool does not currently work in Safari, so use Firefox or a Chrome-based browser instead.diff --git a/apps/docs/content/guides/auth/social-login/auth-azure.mdx b/apps/docs/content/guides/auth/social-login/auth-azure.mdxindex 1b31c75b679..1057da8f831 100644--- a/apps/docs/content/guides/auth/social-login/auth-azure.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-azure.mdx@@ -44,6 +44,25 @@ Setting up OAuth with Azure consists of four broad steps:+You can also configure the Azure auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Azure auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_azure_enabled": true,+ "external_azure_client_id": "your-azure-client-id",+ "external_azure_secret": "your-azure-client-secret",+ "external_azure_url": "your-azure-url"+ }'+```+## Guarding against unverified email domainsMicrosoft Entra ID can send out unverified email domains in certain cases. This may open up your project to a vulnerability where a malicious user can impersonate already existing accounts on your project.diff --git a/apps/docs/content/guides/auth/social-login/auth-discord.mdx b/apps/docs/content/guides/auth/social-login/auth-discord.mdxindex 64ca269b7c4..18992be42c0 100644--- a/apps/docs/content/guides/auth/social-login/auth-discord.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-discord.mdx@@ -43,6 +43,24 @@ Setting up Discord logins for your application consists of 3 parts:<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Discord" }} />+You can also configure the Discord auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Discord auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_discord_enabled": true,+ "external_discord_client_id": "your-discord-client-id",+ "external_discord_secret": "your-discord-client-secret"+ }'+```+## Add login code to your client app<Tabsdiff --git a/apps/docs/content/guides/auth/social-login/auth-facebook.mdx b/apps/docs/content/guides/auth/social-login/auth-facebook.mdxindex be25a4f8e10..b8f17ff2bd5 100644--- a/apps/docs/content/guides/auth/social-login/auth-facebook.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-facebook.mdx@@ -60,6 +60,24 @@ Under `Build Your App`, click on `Use Cases` screen. From there, do the followin<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Facebook" }} />+You can also configure the Facebook auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Facebook auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_facebook_enabled": true,+ "external_facebook_client_id": "your-facebook-app-id",+ "external_facebook_secret": "your-facebook-app-secret"+ }'+```+## Add login code to your client app<Tabsdiff --git a/apps/docs/content/guides/auth/social-login/auth-github.mdx b/apps/docs/content/guides/auth/social-login/auth-github.mdxindex 1125c1b7b7c..49dcbe799c6 100644--- a/apps/docs/content/guides/auth/social-login/auth-github.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-github.mdx@@ -38,6 +38,24 @@ Copy your new OAuth credentials<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "GitHub" }} />+You can also configure the GitHub auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure GitHub auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_github_enabled": true,+ "external_github_client_id": "your-github-client-id",+ "external_github_secret": "your-github-client-secret"+ }'+```+## Add login code to your client app<Tabsdiff --git a/apps/docs/content/guides/auth/social-login/auth-google.mdx b/apps/docs/content/guides/auth/social-login/auth-google.mdxindex 7dfb9e58196..aa82bd3dcaf 100644--- a/apps/docs/content/guides/auth/social-login/auth-google.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-google.mdx@@ -53,6 +53,24 @@ To use your own application code:1. When you finish configuring your credentials, you will be shown your client ID and secret. Add these to the [Google Auth Provider section of the Supabase Dashboard](/dashboard/project/_/auth/providers).+ Alternatively, you can configure Google authentication using the Management API:++ ```bash+ # First, get your access token from https://supabase.com/dashboard/account/tokens+ export SUPABASE_ACCESS_TOKEN="your-access-token"+ export PROJECT_REF="your-project-ref"++ # Update auth config to enable Google provider+ curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_google_enabled": true,+ "external_google_client_id": "your-google-client-id",+ "external_google_secret": "your-google-client-secret"+ }'+ ```+<Admonition type="tip">In local development, you can add the client ID and secret to your `config.toml` file.diff --git a/apps/docs/content/guides/auth/social-login/auth-linkedin.mdx b/apps/docs/content/guides/auth/social-login/auth-linkedin.mdxindex 4d1c8364493..c01d491f023 100644--- a/apps/docs/content/guides/auth/social-login/auth-linkedin.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-linkedin.mdx@@ -46,6 +46,24 @@ Ensure that the appropriate scopes have been added under OAuth 2.0 Scopes at the<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "LinkedIn (OIDC)" }} />+You can also configure the LinkedIn (OIDC) auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure LinkedIn (OIDC) auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_linkedin_oidc_enabled": true,+ "external_linkedin_oidc_client_id": "your-linkedin-client-id",+ "external_linkedin_oidc_secret": "your-linkedin-client-secret"+ }'+```+## Add login code to your client app<Tabsdiff --git a/apps/docs/content/guides/auth/social-login/auth-slack.mdx b/apps/docs/content/guides/auth/social-login/auth-slack.mdxindex 4ee888d8d09..25593c498aa 100644--- a/apps/docs/content/guides/auth/social-login/auth-slack.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-slack.mdx@@ -62,6 +62,24 @@ Under `Scopes`:<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Slack" }} />+You can also configure the Slack (OIDC) auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Slack (OIDC) auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_slack_oidc_enabled": true,+ "external_slack_oidc_client_id": "your-slack-client-id",+ "external_slack_oidc_secret": "your-slack-client-secret"+ }'+```+## Add login code to your client app<Tabsdiff --git a/apps/docs/content/guides/auth/social-login/auth-spotify.mdx b/apps/docs/content/guides/auth/social-login/auth-spotify.mdxindex 403bc0fc068..c160594c60d 100644--- a/apps/docs/content/guides/auth/social-login/auth-spotify.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-spotify.mdx@@ -48,6 +48,24 @@ Under `Redirect URIs`:<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Spotify" }} />+You can also configure the Spotify auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Spotify auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_spotify_enabled": true,+ "external_spotify_client_id": "your-spotify-client-id",+ "external_spotify_secret": "your-spotify-client-secret"+ }'+```+## Add login code to your client appThe following outlines the steps to sign in using Spotify with Supabase Auth.diff --git a/apps/docs/content/guides/auth/social-login/auth-twitter.mdx b/apps/docs/content/guides/auth/social-login/auth-twitter.mdxindex 8c181621f0b..f1ed101fbc1 100644--- a/apps/docs/content/guides/auth/social-login/auth-twitter.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-twitter.mdx@@ -50,6 +50,24 @@ Setting up Twitter logins for your application consists of 3 parts:<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Twitter" }} />+You can also configure the Twitter auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Twitter auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_twitter_enabled": true,+ "external_twitter_client_id": "your-twitter-api-key",+ "external_twitter_secret": "your-twitter-api-secret-key"+ }'+```+## Add login code to your client app<Tabsdiff --git a/apps/docs/content/guides/auth/social-login/auth-workos.mdx b/apps/docs/content/guides/auth/social-login/auth-workos.mdxindex 56a9c1fb5ee..ecd807b8528 100644--- a/apps/docs/content/guides/auth/social-login/auth-workos.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-workos.mdx@@ -40,6 +40,25 @@ You must be signed in to see these values.1. Copy the `Callback URL (for OAuth)` value from the form and save it somewhere handy.1. Click Save.+You can also configure the WorkOS auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure WorkOS auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_workos_enabled": true,+ "external_workos_url": "https://api.workos.com",+ "external_workos_client_id": "your-workos-client-id",+ "external_workos_secret": "your-workos-client-secret"+ }'+```+## Step 4. Set your Supabase redirect URI in the WorkOS DashboardVisit the WorkOS dashboard and click the redirects button in the left navigation panel.diff --git a/apps/docs/content/guides/auth/social-login/auth-zoom.mdx b/apps/docs/content/guides/auth/social-login/auth-zoom.mdxindex 24901dcee90..4c961dec1d1 100644--- a/apps/docs/content/guides/auth/social-login/auth-zoom.mdx+++ b/apps/docs/content/guides/auth/social-login/auth-zoom.mdx@@ -57,6 +57,24 @@ Under `Scopes`<$Partial path="social_provider_settings_supabase.mdx" variables={{ "provider": "Zoom" }} />+You can also configure the Zoom auth provider using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Configure Zoom auth provider+curl -X PATCH "https://api.supabase.com/v1/projects/$PROJECT_REF/config/auth" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "external_zoom_enabled": true,+ "external_zoom_client_id": "your-zoom-client-id",+ "external_zoom_secret": "your-zoom-client-secret"+ }'+```+## Add login code to your client app<Tabsdiff --git a/apps/docs/content/guides/functions/secrets.mdx b/apps/docs/content/guides/functions/secrets.mdxindex 5439ff3c8c3..7dc1e1362c2 100644--- a/apps/docs/content/guides/functions/secrets.mdx+++ b/apps/docs/content/guides/functions/secrets.mdx@@ -75,6 +75,35 @@ You will also need to set secrets for your production Edge Functions. You can do}}/>+### Using the Management API++You can also manage secrets programmatically using the Management API:++```bash+# First, get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Create a secret+curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/secrets" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '[{+ "name": "MY_SECRET_NAME",+ "value": "my-secret-value"+ }]'++# List all secrets+curl -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ "https://api.supabase.com/v1/projects/$PROJECT_REF/secrets"++# Delete a secret+curl -X DELETE "https://api.supabase.com/v1/projects/$PROJECT_REF/secrets" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '["MY_SECRET_NAME"]'+```+### Using the CLILet's create a `.env` to help us deploy our secrets to production. In this case we'll just use the same as our local secrets:diff --git a/apps/docs/content/guides/platform/access-control.mdx b/apps/docs/content/guides/platform/access-control.mdxindex 444a153b35b..37b7b85dd52 100644--- a/apps/docs/content/guides/platform/access-control.mdx+++ b/apps/docs/content/guides/platform/access-control.mdx@@ -32,6 +32,20 @@ This is a security measure to prevent accidental invites to accounts not managed</Admonition>+### Viewing organization members using the Management API++You can also view organization members using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export ORG_ID="your-organization-id"++# List organization members+curl "https://api.supabase.com/v1/organizations/$ORG_ID/members" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"+```+### Transferring ownership of an organizationEach Supabase organization must have at least one owner. If your organization has other owners then you can relinquish ownership and leave the organization by clicking **Leave team** in your organization's team [settings](/dashboard/org/_/team).diff --git a/apps/docs/content/guides/platform/backups.mdx b/apps/docs/content/guides/platform/backups.mdxindex aadb728ba21..64efb201ba5 100644--- a/apps/docs/content/guides/platform/backups.mdx+++ b/apps/docs/content/guides/platform/backups.mdx@@ -71,6 +71,26 @@ The Postgres utility [pg_dumpall](https://www.postgresql.org/docs/current/app-pgYou can access daily backups in the [Scheduled backups](https://supabase.com/dashboard/project/_/database/backups/scheduled) settings in the Dashboard. Pro Plan projects can access the last 7 days' worth of daily backups. Team Plan projects can access the last 14 days' worth of daily backups, while Enterprise Plan projects can access up to 30 days' worth of daily backups. Users can restore their project to any one of the backups. If you wish to generate a logical backup on your own, you can do so through the [Supabase CLI](/docs/reference/cli/supabase-db-dump).+You can also manage backups programmatically using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# List all available backups+curl -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ "https://api.supabase.com/v1/projects/$PROJECT_REF/database/backups"++# Restore from a PITR (not logical) backup (replace ISO timestamp with desired restore point)+curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/database/backups/restore-pitr" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "recovery_time_target_unix": "1735689600"+ }'+```+#### Backup process for large databasesDatabases larger than 15GB[^1], if they're on a recent build[^2] of the Supabase platform, get automatically transitioned[^3] to use daily physical backups. Physical backups are a more performant backup mechanism that lowers the overhead and impact on the database being backed up, and also avoids holding locks on objects in your database for a long period of time. While restores are unaffected, the backups created using this method cannot be downloaded from the Backups section of the dashboard.diff --git a/apps/docs/content/guides/platform/ipv4-address.mdx b/apps/docs/content/guides/platform/ipv4-address.mdxindex b8510e7ba3d..790ea522196 100644--- a/apps/docs/content/guides/platform/ipv4-address.mdx+++ b/apps/docs/content/guides/platform/ipv4-address.mdx@@ -28,6 +28,30 @@ IPv4 addresses are guaranteed to be static for ingress traffic. If your databaseYou can enable the IPv4 add-on in your project's [add-ons settings](/dashboard/project/_/settings/addons).+You can also manage the IPv4 add-on using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Get current IPv4 add-on status+curl -X GET "https://api.supabase.com/v1/projects/$PROJECT_REF/billing/addons" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"++# Enable IPv4 add-on+curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/addons" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "addon_type": "ipv4"+ }'++# Disable IPv4 add-on+curl -X DELETE "https://api.supabase.com/v1/projects/$PROJECT_REF/billing/addons/ipv4" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"+```+<Admonition type="caution">Note that direct database connections can experience a short amount of downtime when toggling theadd-on due to DNS reconfiguration and propagation. Generally, this should be less than a minute.diff --git a/apps/docs/content/guides/platform/network-restrictions.mdx b/apps/docs/content/guides/platform/network-restrictions.mdxindex aa80fbbc638..95c84224460 100644--- a/apps/docs/content/guides/platform/network-restrictions.mdx+++ b/apps/docs/content/guides/platform/network-restrictions.mdx@@ -18,6 +18,30 @@ If direct connections to your database [resolve to a IPv6 address](https://supabNetwork restrictions can be configured in the [Database Settings](https://supabase.com/dashboard/project/_/settings/database) page. Ensure that you have [Owner or Admin permissions](/docs/guides/platform/access-control#manage-team-members) for the project that you are enabling network restrictions.+## To get started via the Management API:++You can also manage network restrictions using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Get current network restrictions+curl -X GET "https://api.supabase.com/v1/projects/$PROJECT_REF/network-restrictions" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"++# Update network restrictions+curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/network-restrictions/apply" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "db_allowed_cidrs": [+ "192.168.0.1/24",+ ]+ }'+```+## To get started via the CLI:1. [Install](/docs/guides/cli) the Supabase CLI 1.22.0+.diff --git a/apps/docs/content/guides/platform/read-replicas.mdx b/apps/docs/content/guides/platform/read-replicas.mdxindex 358b348332f..4d6b836fbf2 100644--- a/apps/docs/content/guides/platform/read-replicas.mdx+++ b/apps/docs/content/guides/platform/read-replicas.mdx@@ -51,6 +51,30 @@ Projects must meet these requirements to use Read Replicas:To add a Read Replica, go to the [Infrastructure Settings page](/dashboard/project/_/settings/infrastructure) in your dashboard.+You can also manage Read Replicas using the Management API (beta functionality):++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Create a new Read Replica+curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/read-replicas/setup" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "region": "us-east-1"+ }'++# Delete a Read Replica+curl -X POST "https://api.supabase.com/v1/projects/$PROJECT_REF/read-replicas/remove" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "database_identifier": "abcdefghijklmnopqrst"+ }'+```+Projects on an XL compute add-on or larger can create up to five Read Replicas. Projects on compute add-ons smaller than XL can create up to two Read Replicas. All Read Replicas inherit the compute size of their Primary database.### Deploying a Read Replicadiff --git a/apps/docs/content/guides/platform/ssl-enforcement.mdx b/apps/docs/content/guides/platform/ssl-enforcement.mdxindex d0b4c82efa6..5f9b5d62167 100644--- a/apps/docs/content/guides/platform/ssl-enforcement.mdx+++ b/apps/docs/content/guides/platform/ssl-enforcement.mdx@@ -18,6 +18,40 @@ Projects need to be at least on Postgres 13.3.0 to enable SSL enforcement. You cSSL enforcement can be configured via the "Enforce SSL on incoming connections" setting under the SSL Configuration section in [Database Settings page](https://supabase.com/dashboard/project/_/settings/database) of the dashboard.+## Manage SSL enforcement via the Management API++You can also manage SSL enforcement using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Get current SSL enforcement status+curl -X GET "https://api.supabase.com/v1/projects/$PROJECT_REF/ssl-enforceemnt" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN"++# Enable SSL enforcement+curl -X PUT "https://api.supabase.com/v1/projects/$PROJECT_REF/ssl-enforcement" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "requestedConfig": {+ "database": true+ }+ }'++# Disable SSL enforcement+curl -X PUT "https://api.supabase.com/v1/projects/$PROJECT_REF/ssl-enforcement" \+ -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ -H "Content-Type: application/json" \+ -d '{+ "requestedConfig": {+ "database": false+ }+ }'+```+## Manage SSL enforcement via the CLITo get started:diff --git a/apps/docs/content/guides/telemetry/metrics.mdx b/apps/docs/content/guides/telemetry/metrics.mdxindex eac18f6d9ad..267e4692747 100644--- a/apps/docs/content/guides/telemetry/metrics.mdx+++ b/apps/docs/content/guides/telemetry/metrics.mdx@@ -29,6 +29,18 @@ Access to the endpoint is secured via HTTP Basic Auth:- username: `service_role`- password: the service role JWT from the [Supabase dashboard](https://supabase.com/dashboard/project/_/settings/api-keys)+You can also retrieve your service role key programmatically using the Management API:++```bash+# Get your access token from https://supabase.com/dashboard/account/tokens+export SUPABASE_ACCESS_TOKEN="your-access-token"+export PROJECT_REF="your-project-ref"++# Get project API keys including service_role key+curl -H "Authorization: Bearer $SUPABASE_ACCESS_TOKEN" \+ "https://api.supabase.com/v1/projects/$PROJECT_REF/api-keys?reveal=true"+```+<ProjectConfigVariables variable="url" />```shell