> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/database-devops.md).

# Database DevOps

Manage database schemas, database instances, and migration state with the Harness Database DevOps API.

The Database DevOps API manages the database schemas and database instances in Harness Database DevOps, and reports which changes have been applied where.

## Request basics

* **API key token**: Send it in the `x-api-key` header on every request. Go to [Manage API keys](https://developer.harness.io/harness-platform/use-harness-platform/automation/api/add-and-manage-api-keys) to create a key and token.
* **Organization and project IDs**: Most endpoints take them as the `org` and `project` path parameters. Go to [Organizations and projects](https://developer.harness.io/harness-platform/use-harness-platform/organizations-and-projects) to find these identifiers.
* **Account ID**: Send it in the `Harness-Account` header only when you authenticate with something other than an `x-api-key` token.
* **Base URL**: Send requests to `https://app.harness.io/gateway/dbops`, followed by the endpoint path.

## Example request

List the database schemas in a project:

```bash
curl "https://app.harness.io/gateway/dbops/v1/orgs/ORG_ID/projects/PROJECT_ID/dbschema" \
  -H "x-api-key: $HARNESS_API_KEY"
```

Replace `ORG_ID` and `PROJECT_ID` with your own values, and set `HARNESS_API_KEY` to your API key token.

## Find an endpoint

Endpoint paths are relative to the base URL.

* **Database schemas**: The changelog repository and path that define a schema's changes. List schemas with `GET /v1/orgs/{org}/projects/{project}/dbschema` and create one with `POST /v1/orgs/{org}/projects/{project}/dbschema`. Go to [Changelogs & Schema changes](https://developer.harness.io/database-devops/use-db-devops/changelogs-and-schema-changes) to set up changelogs.
* **Database instances**: A specific database that a schema is deployed to, reached through a connector. List instances with `POST /v1/orgs/{org}/projects/{project}/dbinstancelist`. Go to [Set Up JDBC Connectors](https://developer.harness.io/database-devops/setup-db-devops/jdbc-connection-string/set-up-connectors) to connect a database.
* **Migration and deployed state**: Which changesets have been applied to each instance. Read what has been applied to an instance with `GET /v1/orgs/{org}/projects/{project}/dbschema/{dbschema}/dbinstance/{dbinstance}/migrationstate`. Go to [Access Applied ChangeSets in Database DevOps Pipelines](https://developer.harness.io/database-devops/use-db-devops/understanding-state-of-database/access-applied-changesets) to read applied changesets.
* **Pipeline steps**: Settings for the Database DevOps steps that apply and roll back changes in a pipeline. List the commands the steps support with `GET /v1/dbops/command-parameters/supported-commands`. Go to [Deployment Pipeline Configuration](https://developer.harness.io/database-devops/use-db-devops/deployment-pipeline-configuration) to configure a deployment pipeline.
