---
title: "Create or rotate database credentials"
method: POST
path: "/db-credentials/rotate"
tags: ["Database Credentials"]
---

# Create or rotate database credentials

`POST /db-credentials/rotate`

Creates credentials if none exist, otherwise rotates the password. Returns password once.

## Response `200`

Rotated existing credentials

- GithubComActiveloopaiDeeplakeApiInternalOrgdbRotateCredentialResponse
  - `database` string
  - `host` string
  - `message` string
  - `password` string — #nosec G117 -- intentionally returned to user after credential rotation
  - `port` integer
  - `ssl_mode` string
  - `username` string

## Other responses

- `201` — Created new credentials
- `401` — Unauthorized
- `403` — Admin access required
- `503` — DLPG not configured

---

[API](https://skmtc.net/deeplake/apis/deeplake-api.md) · [All operations](https://skmtc.net/deeplake/apis/deeplake-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeplake/deeplake-api/revisions/e16ed11d991c/schema)
