From e20f21334c6d9a5f11f372961787a6c24d6bae60 Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 6 Aug 2025 14:24:54 +0600 Subject: [PATCH 1/2] refactor: chore make management API docs more visible --- .../230-management-api.mdx} | 27 ++++++++++++------- .../200-error-reference.mdx} | 0 static/_redirects | 4 +++ 3 files changed, 21 insertions(+), 10 deletions(-) rename content/250-postgres/{300-database/800-api-reference/200-management-api.mdx => 100-introduction/230-management-api.mdx} (88%) rename content/250-postgres/300-database/{900-error-reference.mdx => 800-api-reference/200-error-reference.mdx} (100%) diff --git a/content/250-postgres/300-database/800-api-reference/200-management-api.mdx b/content/250-postgres/100-introduction/230-management-api.mdx similarity index 88% rename from content/250-postgres/300-database/800-api-reference/200-management-api.mdx rename to content/250-postgres/100-introduction/230-management-api.mdx index a5864a5438..c7a1fd8185 100644 --- a/content/250-postgres/300-database/800-api-reference/200-management-api.mdx +++ b/content/250-postgres/100-introduction/230-management-api.mdx @@ -10,7 +10,15 @@ sidebar_class_name: early-access-badge This page covers the Prisma Management API which enables you to programmatically manage [platform](/platform/about) resources (e.g. projects or Prisma Postgres instances) in [Prisma Console](https://console.prisma.io). :::tip OpenApi -The API reference is also available via an [**OpenAPI 3.1. spec**](https://api.prisma.io/v1/swagger-editor). +An interactive [**OpenAPI 3.1 specification** is available here](https://api.prisma.io/v1/swagger-editor), where you can explore endpoints, request/response bodies, and detailed examples. +::: + +:::tip Guides +We have three guides to help you use the Management API for common scenarios: + +- [Getting started with the Prisma Management API](/guides/management-api-basic) +- [Provisioning preview databases with GitHub Actions and Prisma Postgres](/guides/github-actions) +- [Partner database provisioning & user claim flow](/guides/management-api) ::: @@ -42,16 +50,15 @@ To adhere to the Bearer Token Authentication, you need to format your `Authoriza Authorization: Bearer $TOKEN ``` - +1. Open the [Prisma Console](https://console.prisma.io/). +2. Navigate to your workspace. +3. Click on **Integrations** in the left sidebar. +4. Click on **New service token** button. +5. In the popup, enter a descriptive name in the **Token name** field. +6. Click the **Create service token** button. +7. Copy the generated token and store it in a safe location for future use. ### Example diff --git a/content/250-postgres/300-database/900-error-reference.mdx b/content/250-postgres/300-database/800-api-reference/200-error-reference.mdx similarity index 100% rename from content/250-postgres/300-database/900-error-reference.mdx rename to content/250-postgres/300-database/800-api-reference/200-error-reference.mdx diff --git a/static/_redirects b/static/_redirects index c551747094..6401d68e06 100644 --- a/static/_redirects +++ b/static/_redirects @@ -561,6 +561,8 @@ /optimize/recommendations/avoid-timestamp-timestampz-0 /docs/postgres/query-optimization/recommendations/avoid-timestamp-timestampz-0 /optimize/recommendations /docs/postgres/query-optimization/recommendations /optimize/recommendations/_category_.json /docs/postgres/query-optimization/recommendations/_category_.json +/postgres/database/api-reference/management-api /docs/postgres/introduction/management-api +/postgres/database/error-reference /docs/postgres/database/api-reference/error-reference ### Dynamic redirects ### /faq/* https://v1.prisma.io/docs/1.34/faq/:splat @@ -624,5 +626,7 @@ /postgres/integrations/vscode-agent /docs/postgres/integrations/vscode-extension#agent-mode /postgres/database/tcp-tunnel /docs/postgres/database/direct-connections +/postgres/database/error-reference /docs/postgres/database/api-reference/error-reference +/postgres/database/error-reference* /docs/postgres/database/api-reference/error-reference:splat ### NO REDIRECTS BELOW THIS LINE. ADD REDIRECTS ABOVE THIS SECTION ### From 057e993ca7fdd2168645da9052f95e153812a32b Mon Sep 17 00:00:00 2001 From: Ankur Datta <64993082+ankur-arch@users.noreply.github.com> Date: Wed, 6 Aug 2025 14:38:05 +0600 Subject: [PATCH 2/2] fix: broken links --- content/250-postgres/1200-more/1000-faq.mdx | 2 +- .../300-database/400-connection-pooling.mdx | 12 ++++++------ .../800-api-reference/100-caching-api.mdx | 2 +- content/300-accelerate/600-faq.mdx | 2 +- content/800-guides/240-management-api.mdx | 4 ++-- content/800-guides/330-management-api-basic.mdx | 4 ++-- static/_redirects | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/content/250-postgres/1200-more/1000-faq.mdx b/content/250-postgres/1200-more/1000-faq.mdx index dbfce8f80c..7363e8e0a6 100644 --- a/content/250-postgres/1200-more/1000-faq.mdx +++ b/content/250-postgres/1200-more/1000-faq.mdx @@ -342,7 +342,7 @@ Yes, you can increase your Prisma Postgres limits based on your subscription pla Check the [pricing page](https://www.prisma.io/pricing) for more details on the available plans and their corresponding limits. :::warning -While you can increase these limits based on your subscription plan, it's *still* recommended to optimize your database operations. [Learn more in our troubleshooting guide.](/postgres/database/error-reference) +While you can increase these limits based on your subscription plan, it's *still* recommended to optimize your database operations. [Learn more in our troubleshooting guide.](/postgres/database/api-reference/error-reference) ::: diff --git a/content/250-postgres/300-database/400-connection-pooling.mdx b/content/250-postgres/300-database/400-connection-pooling.mdx index b1fb03083c..83f92d3e5e 100644 --- a/content/250-postgres/300-database/400-connection-pooling.mdx +++ b/content/250-postgres/300-database/400-connection-pooling.mdx @@ -73,11 +73,11 @@ Prisma Postgres has a default global timeout of `10s` for each query, configurab |---------------|-----------------|-----------------|----------------|-----------------| | Query timeout | Up to `10` seconds | Up to `10` seconds | Up to `20` seconds | Up to `60` seconds | -See the [error reference](/postgres/database/error-reference#p6004-querytimeout) and our [pricing page](https://www.prisma.io/pricing) for more information. +See the [error reference](/postgres/database/api-reference/error-reference#p6004-querytimeout) and our [pricing page](https://www.prisma.io/pricing) for more information. :::warning -While you can increase the query timeout, it's recommended to inspect and optimize your database queries if they take longer than `10` seconds. This helps reduce stress on your underlying database, as long-running queries often indicate a need for optimization. Learn more in the [error reference](/postgres/database/error-reference#p6004-querytimeout). +While you can increase the query timeout, it's recommended to inspect and optimize your database queries if they take longer than `10` seconds. This helps reduce stress on your underlying database, as long-running queries often indicate a need for optimization. Learn more in the [error reference](/postgres/database/api-reference/error-reference#p6004-querytimeout). ::: ### Interactive transactions query timeout limit @@ -88,7 +88,7 @@ Prisma Postgres has a default global timeout of `15s` for each [interactive tran |-------------------------------|----------------|---------------|--------------|---------------| | Interactive transaction limit | Up to `15` seconds | Up to `15` seconds | Up to `30` seconds | Up to `90` seconds | -See the [error reference](/postgres/database/error-reference#p6004-querytimeout) and our [pricing page](https://www.prisma.io/pricing#accelerate) for more information. +See the [error reference](/postgres/database/api-reference/error-reference#p6004-querytimeout) and our [pricing page](https://www.prisma.io/pricing#accelerate) for more information. When you set a higher interactive transaction timeout in the Prisma Console, you **must also** specify a matching `timeout` value in your interactive transaction query via timeout [transaction option](/orm/prisma-client/queries/transactions#transaction-options). Otherwise, transactions will still time out at the lower default (e.g., 5 seconds limit when no timeout value is specified). Here's an example of how to set a `30`-second timeout in your code: @@ -105,7 +105,7 @@ await prisma.$transaction( :::warning -While you can increase the interactive transaction timeout limit, it's recommended to inspect and optimize your database transactions if they take longer than 15 seconds. Long-running transactions can negatively impact performance and often signal the need for optimization. Learn more in the [error reference](/postgres/database/error-reference#p6004-querytimeout) and review the [warning in the Interactive Transactions section](/orm/prisma-client/queries/transactions#interactive-transactions-1) in our documentation. +While you can increase the interactive transaction timeout limit, it's recommended to inspect and optimize your database transactions if they take longer than 15 seconds. Long-running transactions can negatively impact performance and often signal the need for optimization. Learn more in the [error reference](/postgres/database/api-reference/error-reference#p6004-querytimeout) and review the [warning in the Interactive Transactions section](/orm/prisma-client/queries/transactions#interactive-transactions-1) in our documentation. ::: @@ -117,11 +117,11 @@ Prisma Postgres has a default global response size limit of `5MB`, configurable |------------|--------------|---------------|--------------|---------------| | Query size | Up to `5MB` | Up to `5MB` | Up to `10MB` | Up to `20MB` | -See the [error reference](/postgres/database/error-reference#p6009-responsesizelimitexceeded) and our [pricing page](https://www.prisma.io/pricing#accelerate) for more information. +See the [error reference](/postgres/database/api-reference/error-reference#p6009-responsesizelimitexceeded) and our [pricing page](https://www.prisma.io/pricing#accelerate) for more information. :::warning -While you can increase the query response size, it’s recommended to limit data retrieval to what you actually need. This improves database performance, reduces stress on your database, and makes your frontend applications more responsive. Queries exceeding `5` MB in size often indicate a need for optimization. Learn more in the [error reference](/postgres/database/error-reference#p6009-responsesizelimitexceeded). +While you can increase the query response size, it’s recommended to limit data retrieval to what you actually need. This improves database performance, reduces stress on your database, and makes your frontend applications more responsive. Queries exceeding `5` MB in size often indicate a need for optimization. Learn more in the [error reference](/postgres/database/api-reference/error-reference#p6009-responsesizelimitexceeded). ::: diff --git a/content/250-postgres/300-database/800-api-reference/100-caching-api.mdx b/content/250-postgres/300-database/800-api-reference/100-caching-api.mdx index cead3f6cae..eb1c6ebde4 100644 --- a/content/250-postgres/300-database/800-api-reference/100-caching-api.mdx +++ b/content/250-postgres/300-database/800-api-reference/100-caching-api.mdx @@ -228,4 +228,4 @@ This clears cache for the entire environment—use with care. Prisma Postgres-related errors start with `P6xxx`. -You can find the full error code reference for Prisma Postgres [here](/postgres/database/error-reference). +You can find the full error code reference for Prisma Postgres [here](/postgres/database/api-reference/error-reference). diff --git a/content/300-accelerate/600-faq.mdx b/content/300-accelerate/600-faq.mdx index d87f09afe7..42c2fb1a4b 100644 --- a/content/300-accelerate/600-faq.mdx +++ b/content/300-accelerate/600-faq.mdx @@ -166,7 +166,7 @@ Yes, you can increase your Accelerate limits based on your subscription plan. He Check the [pricing page](https://www.prisma.io/pricing#accelerate) for more details on the available plans and their corresponding limits. :::warning -While you can increase these limits based on your subscription plan, it's _still_ recommended to optimize your database operations. [Learn more in our troubleshooting guide.](/postgres/database/error-reference) +While you can increase these limits based on your subscription plan, it's _still_ recommended to optimize your database operations. [Learn more in our troubleshooting guide.](/postgres/database/api-reference/error-reference) ::: ## How long does it take to invalidate a cache query result? diff --git a/content/800-guides/240-management-api.mdx b/content/800-guides/240-management-api.mdx index 5e3c2ae4fc..4166906718 100644 --- a/content/800-guides/240-management-api.mdx +++ b/content/800-guides/240-management-api.mdx @@ -39,7 +39,7 @@ To use the Prisma Postgres Management API, you first need to set up as a partner 1. **Request access to the Management API**: Contact the Prisma team from the [Prisma Partners page](https://www.prisma.io/partners) to request access to the Management API. You will be guided through the onboarding process. 2. **Obtain OAuth credentials**: Once approved, you will receive an OAuth client ID and client secret. These credentials are required to authenticate your integration and enable secure database transfers for your users. -For a complete list of available endpoints and details on request/response formats, see the [Prisma Management API documentation](/postgres/database/api-reference/management-api). +For a complete list of available endpoints and details on request/response formats, see the [Prisma Management API documentation](/postgres/introduction/management-api). ## Provisioning a Database as a Partner @@ -152,4 +152,4 @@ By following this guide, you have learned how to: This flow enables you to integrate Prisma Postgres provisioning and transfer seamlessly into your own product, providing a smooth onboarding experience for your users. -For further details, see the [create-db](https://github.com/prisma/create-db) repo for a reference implementation, or consult the [Prisma Management API documentation](/postgres/database/api-reference/management-api). \ No newline at end of file +For further details, see the [create-db](https://github.com/prisma/create-db) repo for a reference implementation, or consult the [Prisma Management API documentation](/postgres/introduction/management-api). \ No newline at end of file diff --git a/content/800-guides/330-management-api-basic.mdx b/content/800-guides/330-management-api-basic.mdx index e16e5687b3..9ca9a1dd7e 100644 --- a/content/800-guides/330-management-api-basic.mdx +++ b/content/800-guides/330-management-api-basic.mdx @@ -10,9 +10,9 @@ community_section: true ## Overview -This guide walks you through setting up a basic TypeScript project that uses the [Prisma Postgres Management API](/postgres/database/api-reference/management-api) to create a new [Prisma Console project](/platform/about#project) with a [Prisma Postgres](/postgres/introduction/overview) database, and print out all connection details. +This guide walks you through setting up a basic TypeScript project that uses the [Prisma Postgres Management API](/postgres/introduction/management-api) to create a new [Prisma Console project](/platform/about#project) with a [Prisma Postgres](/postgres/introduction/overview) database, and print out all connection details. -You'll authenticate via a [service token](/postgres/database/api-reference/management-api#bearer-tokens), set up your environment, and run a script to interact with the API. +You'll authenticate via a [service token](/postgres/introduction/management-api#bearer-tokens), set up your environment, and run a script to interact with the API. :::tip OpenApi The API reference is also available via an [OpenAPI 3.1. spec](https://api.prisma.io/v1/swagger-editor). diff --git a/static/_redirects b/static/_redirects index 6401d68e06..e25542b5ab 100644 --- a/static/_redirects +++ b/static/_redirects @@ -626,7 +626,7 @@ /postgres/integrations/vscode-agent /docs/postgres/integrations/vscode-extension#agent-mode /postgres/database/tcp-tunnel /docs/postgres/database/direct-connections -/postgres/database/error-reference /docs/postgres/database/api-reference/error-reference +/postgres/database/api-reference/management-api* /docs/postgres/introduction/management-api:splat /postgres/database/error-reference* /docs/postgres/database/api-reference/error-reference:splat ### NO REDIRECTS BELOW THIS LINE. ADD REDIRECTS ABOVE THIS SECTION ###