---
title: "Connect a SQL database"
method: POST
path: "/v1/sources/connections/sql"
tags: ["Sources"]
---

# Connect a SQL database

`POST /v1/sources/connections/sql`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/sources/connections/sql`
- Auth: HTTP bearer

Connects a PostgreSQL, MySQL or Microsoft SQL Server database with credentials sent once. The credentials are checked against the system before the connection is saved; secrets in the body are write-only, stored encrypted and never returned. The connection string is write-only; to change it, delete the connection and connect again. A key that belongs to no person (one created before keys named their creator) is refused with 403.

**Scope:** `sources:write`. A key holding only the legacy `write` scope does not satisfy it.

## Request body

- object
  - `name` string, required: Display name.
  - `engine` 'postgres' | 'mysql' | 'mssql', required: Database engine.
  - `connection_string` string, required: Connection string including credentials. Write-only.

## Response `201`

The new connection (without its credentials).

- SourceConnection
  - `id` string, uuid, required
  - `customer_id` string, uuid
  - `type` string, required: Connector type, e.g. `s3`, `gmail`, `google_drive`, `sql`.
  - `status` 'active' | 'revoked', required
  - `name` string, required
  - `config` object: Connector settings.
  - `sync_status` 'idle' | 'queued' | 'syncing' | 'error'
  - `sync_error` string, nullable
  - `last_synced_at` string, date-time, nullable
  - `sync_interval` 'off' | 'hourly' | 'daily' | 'weekly' | 'every_minute'
  - `sync_scope` object, nullable
  - `document_count` integer
  - `connected_by` string, uuid, nullable: The person who connected it.
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: The request is invalid.
- `401`: Missing or invalid API key.
- `403`: The API key does not have the required scope.
- `429`: Daily rate limit exceeded.

## Changes

- **2026-11-28** `4e388563ca5a`: 1 warning
  - removed the request property `dedicated_egress`
- **2026-11-26** `622d429de7ea`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/sources/connections/sql/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
