Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
:::


Expand Down Expand Up @@ -42,16 +50,15 @@ To adhere to the Bearer Token Authentication, you need to format your `Authoriza
Authorization: Bearer $TOKEN
```

<!--
You can create a service token like this:
1. Open the [Prisma Console](https://console.prisma.io/)
2. Navigate to the **Integrations** page of your workspace
3. Click **Generate integration token**
4. Copy and save the generated service token securely.
You can create a service token to use the Management API like this:

:::note
The **Generate integration token** is currently listed in the **Netlify** section. Don't get confused by this, the token will still work and the UI is going to be updated soon.
::: -->
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

Expand Down
2 changes: 1 addition & 1 deletion content/250-postgres/1200-more/1000-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
:::


Expand Down
12 changes: 6 additions & 6 deletions content/250-postgres/300-database/400-connection-pooling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand All @@ -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.

:::

Expand All @@ -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).

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
2 changes: 1 addition & 1 deletion content/300-accelerate/600-faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 2 additions & 2 deletions content/800-guides/240-management-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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).
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).
4 changes: 2 additions & 2 deletions content/800-guides/330-management-api-basic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 4 additions & 0 deletions static/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/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 ###
Loading