---
title: "Create Connection"
method: POST
path: "/api/v1/connections"
tags: ["Connections"]
---

# Create Connection

`POST /api/v1/connections`

## Request

- The document declares no server URL.
- Auth: one of:
  - OAuth 2
    - Password
    - Token URL: `api/v1/login`
  - API key in query parameter `x-api-key`
  - API key in header `x-api-key`

Create connection metadata and optionally store encrypted credentials.

## Request body

- ConnectionCreate: Create metadata plus optional direct-provisioned credential material.
  - `allow_non_interactive` boolean
  - `credentials` ConnectionCredentialWrite: Write-only credential material encrypted before persistence.
    - `access_token` string, password, required
    - `expires_at` string, date-time, nullable
    - `refresh_token` string, password, nullable
    - `token_type` string
  - `display_name` string, required
  - `executing_identity` ExecutingIdentityDescriptor, required: Non-secret identity metadata shown by connection pickers.
    - `account` ConnectionAccount: Non-secret provider account metadata associated with a credential.
      - `display` string, nullable
      - `id` string, required
      - `tenant_id` string, nullable
    - `identity` 'user_delegated' | 'bot' | 'service', required
  - `granted_scopes` string[]
  - `name` string, required
  - `ownership_mode` 'user' | 'instance'
  - `provider_key` string, required

## Response `201`

Successful Response

- ConnectionRead: Credential-free connection metadata returned by every API route.
  - `allow_non_interactive` boolean, required
  - `created_at` string, date-time, required
  - `display_name` string, required
  - `executing_identity` ExecutingIdentityDescriptor, required: Non-secret identity metadata shown by connection pickers.
    - `account` ConnectionAccount: Non-secret provider account metadata associated with a credential.
      - `display` string, nullable
      - `id` string, required
      - `tenant_id` string, nullable
    - `identity` 'user_delegated' | 'bot' | 'service', required
  - `granted_scopes` string[], required
  - `has_credentials` boolean, required
  - `health` 'unknown' | 'healthy' | 'unhealthy', required
  - `health_checked_at` string, date-time, nullable, required
  - `id` string, uuid, required
  - `name` string, required
  - `owner_id` string, uuid, nullable, required
  - `ownership_mode` 'user' | 'instance', required
  - `provider_key` string, required
  - `status` 'pending' | 'ready' | 'expired' | 'revoked' | 'error', required
  - `status_reason` 'credential-missing' | 'credential-undecryptable' | 'oauth-denied' | 'oauth-expired' | 'oauth-failed': A credential error or the result of the most recent failed OAuth attempt.
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-21** `4349fbe90c64`: 1 info
  - endpoint added

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

---

[API](https://skmtc.dev/langflow-ai/apis/langflow.md) - [All operations](https://skmtc.dev/langflow-ai/apis/langflow/llms.txt) - [OpenAPI document](https://skmtc.dev/langflow-ai/apis/langflow/revisions/4349fbe90c64?raw)
