canonical: https://jentic.com/apis/prisma.io/prisma

# Prisma Postgres Management API

The Prisma Postgres Management API provisions and operates Prisma Postgres projects, databases, connections, and backups across your workspaces. It creates a project with a Postgres database in a chosen region, issues and rotates connection strings, lists backups and restores a database from one, and reports usage metrics between a startDate and endDate. Beyond the database it manages branches keyed by gitName, services and their deployments, storage buckets and bucket keys, environment variables, source repository links, and workspace service tokens.

## For AI agents

Create Prisma Postgres projects and databases, issue and rotate connection strings, restore from backups, and read usage metrics, plus manage branches, services, and environment variables in a workspace.

## Scope

Does not run SQL queries, apply schema migrations, or generate Prisma Client code. Use for provisioning and operating Prisma Postgres projects, databases, and connections only.

## Capabilities

- Create a project with a Prisma Postgres database in a chosen region, or add a database to an existing project
- Issue a named connection string for a database and rotate a connection's credentials
- List a database's backups and restore a target database from a backup source
- Read database usage metrics between a startDate and endDate
- Create branches by gitName under a project and soft-delete them when a preview is done
- Deploy services, promote or roll back deployments, and read deployment logs
- Set environment variables and workspace service tokens for CI and runtime configuration

## Use cases

### Agent-provisioned Postgres for new projects

A coding agent scaffolding an app can create the database it needs instead of asking you to click through a console. Through Jentic the agent searches for 'create a Postgres database', reads the available regions from getV1RegionsPostgres, calls postV1Projects with a name and region to create a project with a database, and then creates a named connection string to write into the app's environment.

Example prompt: GET `/v1/regions/postgres`, POST `/v1/projects` with name 'todo-app' and a region from the list, then POST `/v1/databases/{databaseId}/connections` with name 'local-dev'

### Preview databases per git branch

Teams that open a preview environment per pull request can create a Prisma branch keyed by the git branch name, then add a database tied to that branchId. When the pull request closes, the branch is soft-deleted. The branch endpoints are marked experimental in the spec, so callers should expect changes.

Example prompt: POST `/v1/projects/{projectId}/branches` with gitName 'feature/login', then POST `/v1/databases` with projectId and the returned branchId

### Backup checks and restores

Before a risky migration, an operator can list a database's backups to confirm a recent one exists. If the migration goes wrong, the restore operation overwrites the target database from the chosen backup source while keeping connections and credentials. The spec flags restore as destructive and irreversible, so it should only run with explicit approval.

Example prompt: GET `/v1/databases/{databaseId}/backups` and report the most recent backup, without calling the restore operation

### Credential rotation and usage review

Routine hygiene work for a Prisma Postgres workspace includes rotating connection credentials and checking consumption. postV1ConnectionsByIdRotate generates new credentials for a connection, with revocation of the old ones handled best-effort, and the usage operation returns metrics for a database over a date range for cost review.

Example prompt: GET `/v1/databases/{databaseId}/usage` with startDate '2026-10-01' and endDate '2026-10-31', then POST `/v1/connections/{id}/rotate` for the app's connection

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/projects` | Create a project with a Postgres database |
| POST | `/v1/databases` | Create a database |
| POST | `/v1/databases/{databaseId}/connections` | Create a connection string |
| POST | `/v1/connections/{id}/rotate` | Rotate connection credentials |
| GET | `/v1/databases/{databaseId}/backups` | List database backups |
| GET | `/v1/databases/{databaseId}/usage` | Get database usage metrics |
| POST | `/v1/projects/{projectId}/branches` | Create a branch |
| GET | `/v1/regions/postgres` | List Prisma Postgres regions |

## Key resources

- **Projects and databases** — Prisma Postgres projects and their databases, with regions, usage metrics, and backups
- **Connections** — Named connection strings per database with credential rotation
- **Branches** — Per-git-branch environments under a project, with preview and production roles
- **Services and deployments** — Deployable services with deployments, promotion, rollback, custom domains, and logs
- **Workspaces** — Workspaces with service tokens, integrations, environment variables, and subscription

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 60 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 77 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 38 / 100
  - Agent Usability: 80 / 100
  - Security: 83 / 100
  - AI Discoverability: 70 / 100
- **View full report:** https://jentic.com/apis/prisma.io/prisma/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring Prisma Postgres by hand means running the OAuth2 authorization code flow at auth.prisma.io or minting a workspace service token, refreshing tokens, and paging cursor-based lists across projects, databases, and branches. Through Jentic you install once, import Prisma Postgres from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Prisma puts the database, project, and branch ids in the URL path (`/v1/databases/{databaseId}/...`, `/v1/projects/{projectId}/branches`), so a rule can pin your agent to one database. You choose the operations it may call, so destructive ones like the backup restore, database deletion, or project deletion are not included unless you add them.
- **Credential handling:** Your Prisma token is stored once, encrypted, by your own Jentic One instance and injected into the Authorization header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a Postgres database' or 'rotate connection credentials', and Jentic returns the matching Prisma operation with its input schema, including projectId and region, so the agent calls the right endpoint directly.

## Related APIs

- **Neon** — Serverless Postgres with branching and a management API
- **Supabase** — Postgres platform bundling auth, storage, and edge functions
- **PlanetScale** — Managed database platform with branching and deploy requests
- **Vercel** — Frontend hosting and deployments that consume database connection strings

## FAQ

### What authentication does the Prisma Postgres Management API use?

Per its OpenAPI spec, the Prisma Postgres Management API accepts OAuth2 via the authorization code flow at auth.prisma.io with the workspace:admin and offline_access scopes, or a bearer JWT token such as a workspace service token. POST `/v1/auth/github-actions/token` is a public endpoint that needs no credential: it exchanges a GitHub Actions OIDC token for a workspace service token. Through Jentic the token is held by your own instance and attached at call time.

### Can I restore a database from a backup with the Prisma Postgres Management API?

Yes. GET `/v1/databases/{databaseId}/backups` lists the backups, and POST `/v1/databases/{targetDatabaseId}/restore` replaces the target database's data from a backup given in the required source field. The spec marks restore as destructive: it immediately and irreversibly overwrites all data, while connections and credentials are preserved.

### What are the rate limits for the Prisma Postgres Management API?

The OpenAPI spec documents a rate limit exceeded response but does not state numeric limits. Check the Prisma documentation at https://www.prisma.io/docs for current limits before scripting bulk provisioning.

### Is there a Prisma Postgres MCP server?

You don't need an MCP server to give your agent the Prisma Postgres Management API. Jentic connects it directly from the API Directory: import it, store your token once, and your agent discovers the project, database, and connection operations on demand instead of loading every operation into its context.

### How do I create a Prisma Postgres database through Jentic?

Search Jentic for 'create a Postgres database', load postV1Projects, and execute it with a name and region to create a project with a database, or call postV1Databases with a projectId to add one to an existing project. Then create a connection string for the app. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the Prisma Postgres Management API?

Yes. Write a rule that allows only the reads and the connection-string create under `/v1/databases/db_123`/, so the agent can inspect that one database, check its backups and usage, and issue a connection string, but cannot restore over it or delete it. Every call it makes is logged for review.
