---
title: "Set user database connection"
method: POST
path: "/api/v1/cosmos/connection"
---

# Set user database connection

`POST /api/v1/cosmos/connection`

## Request

- Base URL: `https://localhost:3000`
- URL: `https://localhost:3000/api/v1/cosmos/connection`
- Auth: OAuth 2 (authorization code, authorization URL `/oauth/authorize`, token URL `/oauth/token`)

Save Cosmos DB connection settings for the authenticated user and validate connectivity.

## Request body

- object
  - `host` string, required
  - `port` integer
  - `user` string, required
  - `password` string, required
  - `database` string, required
  - `ssl` string
  - `timeout` integer
  - `min_pool_size` integer
  - `max_pool_size` integer

## Response `200`

Database connection saved

- object
  - `configured` boolean
  - `connector_id` string
  - `session_user` string
  - `credential_identity` string
  - `host` string
  - `port` integer
  - `database` string
  - `username` string
  - `ssl` string

## Other responses

- `400`: Invalid payload or missing required fields
- `401`: Authentication required
- `500`: Internal server error

---

[API](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api.md) · [All operations](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api/llms.txt) · [OpenAPI document](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api/revisions/e25648ba6027?raw)
