openapi: 3.2.0 info: title: Prisma Postgres Management Databases Connections API description: REST API for managing Prisma Postgres projects, databases, backups, and workspaces. version: v1 servers: - url: https://api.prisma.io security: - OAuth2: - workspace:admin - offline_access - Bearer: [] tags: - name: Databases Connections paths: /v1/databases/{databaseId}/connections: get: responses: '200': description: Returned all connections for the given database. content: application/json: schema: type: object properties: data: type: array items: type: object properties: id: type: string pattern: ^(con_)([cC][^\s-]{8,}|[a-z0-9]+)$ type: type: string const: connection url: type: string format: uri name: type: string createdAt: type: string format: date-time kind: type: string enum: - postgres - accelerate endpoints: type: object properties: direct: type: object properties: host: type: string port: type: number required: - host - port pooled: type: object properties: host: type: string port: type: number required: - host - port accelerate: type: object properties: host: type: string port: type: number required: - host - port directConnection: type: - object - 'null' properties: host: type: string pass: type: string user: type: string required: - host - pass - user deprecated: true description: 'Deprecated: use `endpoints.direct` instead.' database: type: object properties: id: type: string url: type: string format: uri name: type: string required: - id - url - name required: - id - type - url - name - createdAt - kind - endpoints - database pagination: type: object properties: nextCursor: type: - string - 'null' description: Next cursor to continue pagination hasMore: type: boolean description: Whether there are more items to paginate required: - nextCursor - hasMore required: - data - pagination '401': description: Missing or invalid authorization token. content: application/json: schema: type: object properties: error: type: object properties: code: type: string message: type: string hint: type: string required: - code - message required: - error operationId: getV1DatabasesByDatabaseIdConnections tags: - Databases Connections parameters: - in: path name: databaseId schema: type: string pattern: ^(db_)?([cC][^\s-]{8,}|[a-z0-9]+)$ required: true - in: query name: cursor schema: type: - string - 'null' description: Cursor for pagination - in: query name: limit schema: type: number default: 100 description: Limit for pagination summary: Get list of database connections description: Returns all connections for the given database. post: responses: '200': description: Created a new connection string for the database. content: application/json: schema: type: object properties: data: type: object properties: id: type: string pattern: ^(con_)([cC][^\s-]{8,}|[a-z0-9]+)$ type: type: string const: connection url: type: string format: uri name: type: string createdAt: type: string format: date-time kind: type: string enum: - postgres - accelerate endpoints: type: object properties: direct: type: object properties: host: type: string port: type: number connectionString: type: string required: - host - port - connectionString pooled: type: object properties: host: type: string port: type: number connectionString: type: string required: - host - port - connectionString accelerate: type: object properties: host: type: string port: type: number connectionString: type: string required: - host - port - connectionString connectionString: type: string deprecated: true description: 'Deprecated: use `endpoints.direct.connectionString` or `endpoints.pooled.connectionString` instead.' directConnection: type: - object - 'null' properties: host: type: string pass: type: string user: type: string required: - host - pass - user deprecated: true description: 'Deprecated: use `endpoints.direct` instead.' database: type: object properties: id: type: string url: type: string format: uri name: type: string required: - id - url - name host: type: - string - 'null' deprecated: true description: 'Deprecated: use `endpoints.direct` instead.' pass: type: - string - 'null' deprecated: true description: 'Deprecated: use `endpoints.direct.connectionString` or `endpoints.pooled.connectionString` instead.' user: type: - string - 'null' deprecated: true description: 'Deprecated: use `endpoints.direct.connectionString` or `endpoints.pooled.connectionString` instead.' required: - id - type - url - name - createdAt - kind - endpoints - connectionString - database - host - pass - user required: - data '401': description: Missing or invalid authorization token. content: application/json: schema: type: object properties: error: type: object properties: code: type: string message: type: string hint: type: string required: - code - message required: - error '404': description: Database with the given ID was not found. content: application/json: schema: type: object properties: error: type: object properties: code: type: string message: type: string hint: type: string required: - code - message required: - error operationId: postV1DatabasesByDatabaseIdConnections tags: - Databases Connections parameters: - in: path name: databaseId schema: type: string pattern: ^(db_)?([cC][^\s-]{8,}|[a-z0-9]+)$ required: true summary: Create database connection string description: Creates a new connection string for the given database. requestBody: content: application/json: schema: type: object properties: name: type: string minLength: 3 maxLength: 65 required: - name components: securitySchemes: OAuth2: type: oauth2 description: OAuth2 authentication flows: authorizationCode: authorizationUrl: https://auth.prisma.io/authorize tokenUrl: https://auth.prisma.io/token refreshUrl: https://auth.prisma.io/token scopes: workspace:admin: Full access to workspace resources offline_access: Offline access Bearer: type: http scheme: bearer bearerFormat: JWT description: OAuth2 token for API authentication