---
title: "Create Connection"
method: POST
path: "/api/v0/connections"
tags: ["connections > connections"]
---

# Create Connection

`POST /api/v0/connections`

Create a new connection to an external data source

## Headers

- `Authorization` string, required

## Request body

- union
  - ConnectionsCreateHTTPSBasicAuthConnectionRequest
    - `name` string, required — The connection name (3-255 characters, lowercase alphanumeric with underscores)
    - `description` string, nullable — Optional description for the connection
    - `test_location` string, nullable — Optional location to test the connection
    - `type` 'https_basic' | 'https_bearer' | 'aws_iam_role' — The type of connection
    - `config` ConnectionsHTTPSBasicAuthConfig, required
      - `hostname` string, required — The hostname to connect to
      - `username` string, required — The username for authentication
      - `password` string, required — The password for authentication
  - ConnectionsCreateHTTPSBearerAuthConnectionRequest
    - `name` string, required — The connection name (3-255 characters, lowercase alphanumeric with underscores)
    - `description` string, nullable — Optional description for the connection
    - `test_location` string, nullable — Optional location to test the connection
    - `type` 'https_basic' | 'https_bearer' | 'aws_iam_role' — The type of connection
    - `config` ConnectionsHTTPSBearerAuthConfig, required
      - `hostname` string, required — The hostname to connect to
      - `bearer_token` string, required — The bearer token for authentication
  - ConnectionsCreateAWSConnectionRequest
    - `name` string, required — The connection name (3-255 characters, lowercase alphanumeric with underscores)
    - `description` string, nullable — Optional description for the connection
    - `test_location` string, nullable — Optional location to test the connection
    - `type` 'https_basic' | 'https_bearer' | 'aws_iam_role' — The type of connection
    - `config` ConnectionsAWSIAMRoleConfig, required
      - `iam_role_arn` string, required — The ARN of the IAM role to assume
      - `scope` 's3' | 'bedrock' — The scope of permissions for an AWS IAM role connection
      - `bucket_name` string, nullable — The S3 bucket name associated with this connection
      - `session_ttl_seconds` integer — Session duration in seconds (60-3600)

## Response `201`

Successful Response

- ConnectionsGetConnectionResponse
  - `connection_id` string, uuid, required — The unique identifier for the connection
  - `name` string, required — The connection name
  - `description` string, nullable — The connection description
  - `type` 'https_basic' | 'https_bearer' | 'aws_iam_role', required — The type of connection
  - `status` 'pending' | 'ready' | 'error', required — The status of a connection
  - `config` union, required — The connection configuration
    - ConnectionsHTTPSBasicAuthConfig
      - `hostname` string, required — The hostname to connect to
      - `username` string, required — The username for authentication
      - `password` string, required — The password for authentication
    - ConnectionsHTTPSBearerAuthConfig
      - `hostname` string, required — The hostname to connect to
      - `bearer_token` string, required — The bearer token for authentication
    - ConnectionsAWSIAMRoleConfig
      - `iam_role_arn` string, required — The ARN of the IAM role to assume
      - `scope` 's3' | 'bedrock' — The scope of permissions for an AWS IAM role connection
      - `bucket_name` string, nullable — The S3 bucket name associated with this connection
      - `session_ttl_seconds` integer — Session duration in seconds (60-3600)
  - `created_dt` string, date-time, required — When the connection was created
  - `updated_dt` string, date-time, required — When the connection was last updated

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/coactive/apis/api-reference.md) · [All operations](https://skmtc.dev/coactive/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/coactive/api-reference/revisions/1223758be9ba/schema)
