---
title: "Create or update the source connection"
method: POST
path: "/migrations/{migration_id}/source-connection"
tags: ["Migrations"]
---

# Create or update the source connection

`POST /migrations/{migration_id}/source-connection`

## Request

- Base URL: `https://app.vern.so/api/v1`
- URL: `https://app.vern.so/api/v1/migrations/{migration_id}/source-connection`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/vern-so/apis/vern-api/docs/migrations/:migration_id/source-connection/post.ts> (a function with typed inputs; its response is checked against the schema)

Attach a live API source to the migration, or update it in place. `credentials` (optional here) go to a secured vault and are never returned; you can also supply them later via Submit credentials.

## Request body

- object
  - `source_key` string, required: The connector to attach, lower-cased. Unknown or not-yet-enabled keys return 400.
  - `profile_id` string, nullable: Scope to a profile; null binds to the workbook; omit for the default profile.
  - `config` object: Non-secret connector configuration.
  - `selected_streams` string[], nullable: Streams to extract, or null for connector default.
  - `stream_state` object: Incremental-sync cursor state.
  - `credentials` object: Secret values, vaulted and never returned.

## Response `201`

The created or updated connection.

- object
  - `source_connection` SourceConnection: A migration's live API source connection. Never includes secret values; `creds_configured` reports whether credentials are stored.
    - `id` string, uuid
    - `profile_id` string, nullable
    - `source_key` string
    - `name` string: Connector display name; falls back to source_key.
    - `category` string, nullable
    - `config` object: Non-secret connector configuration.
    - `selected_streams` string[], nullable
    - `stream_state` object
    - `creds_configured` boolean
    - `bound_source_extractor_id` string, nullable
    - `last_snapshot` object, nullable: Metadata about the most recent extraction.
    - `last_sync_at` string, date-time, nullable

## Other responses

- `400`: Malformed request.
- `401`: API key missing, malformed, or revoked.
- `404`: The referenced resource isn't in your account.
- `429`: Rate limit hit. Counted per account, not per API key. Creating a migration and starting a `generate` run are limited to 30/hour each; answering a run is limited to 30/hour; reads allow 30/minute and writes 30/minute. `Retry-After` gives the seconds until the window resets, alongside `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`.

## Changes

- **2026-06-25** `aaaced6a1cac`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vern-so/apis/vern-api/changes/migrations/:migration_id/source-connection/post.md)

---

[API](https://skmtc.dev/vern-so/apis/vern-api.md) - [All operations](https://skmtc.dev/vern-so/apis/vern-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vern-so/apis/vern-api/revisions/6ae61af2db81?raw)
