> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Create a connection

POST https://api.sigmacomputing.com/v2/connections
Content-Type: application/json

Create a connection to a cloud data warehouse from Sigma. For additional details, see [Connect to data sources](https://help.sigmacomputing.com/docs/connect-to-data-sources).

Reference: https://help.sigmacomputing.com/reference/create-connection

## Authentication

- OAuth2 — send the obtained token as `Authorization: Bearer <token>`

## Servers

- `https://api.sigmacomputing.com` (Server for GCP (US) hosted organizations, default)
- `https://api.sa.gcp.sigmacomputing.com` (Server for GCP (KSA) hosted organizations)
- `https://aws-api.sigmacomputing.com` (Server for AWS US (West) hosted organizations)
- `https://api.us-a.aws.sigmacomputing.com` (Server for AWS US (East) hosted organizations)
- `https://api.ca.aws.sigmacomputing.com` (Server for AWS Canada hosted organizations)
- `https://api.eu.aws.sigmacomputing.com` (Server for AWS Europe hosted organizations)
- `https://api.au.aws.sigmacomputing.com` (Server for AWS Australia and APAC hosted organizations)
- `https://api.uk.aws.sigmacomputing.com` (Server for AWS UK hosted organizations)
- `https://api.us.azure.sigmacomputing.com` (Server for Azure US hosted organizations)
- `https://api.eu.azure.sigmacomputing.com` (Server for Azure Europe hosted organizations)
- `https://api.ca.azure.sigmacomputing.com` (Server for Azure Canada hosted organizations)
- `https://api.uk.azure.sigmacomputing.com` (Server for Azure United Kingdom hosted organizations)
- `https://api.au.azure.sigmacomputing.com` (Server for Azure Australia hosted organizations)

## Request

### Body (application/json)

This endpoint expects an object.

- `details` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails, required)
- `name` (string, required)
- `description` (map from string to any, optional)
- `poolSizes` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaPoolSizes, optional) — Connection pool sizes. Each pool bounds how many queries of a given type (ad hoc, scheduled, catalog, result cache) run concurrently against the warehouse.
- `timeoutSecs` (double, optional)
- `useFriendlyNames` (boolean, optional)

## Response

### 201

The newly created connection.

- `organizationId` (string, required) — Unique identifier of the organization
- `connectionId` (string, required) — Unique identifier of the connection
- `isSample` (boolean, required) — Whether the connection is the Sigma sample data connection
- `isAuditLog` (boolean, required) — Whether audit logging is enabled
- `lastActiveAt` (datetime, required) — Last activity date and time
- `name` (string, required) — Name of the connection
- `type` (string, required) — Type of the connection (e.g., "bigQuery")
- `useOauth` (boolean, required) — Whether OAuth is used
- `createdBy` (string, required) — Identifier of the user who created this connection
- `updatedBy` (string, required) — Identifier of the user or process that last updated this connection
- `createdAt` (datetime, required) — When the connection was created
- `updatedAt` (datetime, required) — When the connection was last updated
- `isArchived` (boolean, optional) — Whether the connection is archived
- `account` (string, optional) — Account associated with the connection
- `warehouse` (string, optional) — Warehouse associated with the connection
- `user` (string, optional) — User associated with the connection
- `httpPath` (string, optional) — For Databricks connections, HTTP path of the SQL warehouse. Not included when a user attribute sets the HTTP path.
- `role` (string, optional) — Role used by the connection user
- `timeout` (V2ConnectionsPostResponsesContentApplicationJsonSchemaTimeout, optional) — Timeout settings for the connection, with a default value in seconds
- `poolSizes` (V2ConnectionsPostResponsesContentApplicationJsonSchemaPoolSizes, optional) — Pool sizes for the connection, such as for catalogPoolSize or schedulePoolSize
- `writeAccess` (boolean, optional)
- `friendlyName` (boolean, optional) — Whether friendly names are enabled for this connection
- `writebacks` (list of V2ConnectionsPostResponsesContentApplicationJsonSchemaWritebacksItems, optional) — Configure write-back for non-OAuth connections
- `writebackSchemas` (list of V2ConnectionsPostResponsesContentApplicationJsonSchemaWritebackSchemasItems, optional) — Configure write-back for OAuth connections
- `inputTableAuditLogSchema` (V2ConnectionsPostResponsesContentApplicationJsonSchemaInputTableAuditLogSchema, optional) — Schema to use for the input table write-ahead log (WAL). Cannot be changed without breaking write behavior on this connection.
- `materializationWarehouse` (string, optional) — Warehouse used to run materialization jobs
- `exportsWarehouse` (string, optional) — Warehouse used to run export jobs
- `oauthMetadataUrl` (string, optional) — OAuth metadata URL configured directly on this connection.
- `oauthClientId` (string, optional) — Client ID configured directly on this connection.
- `oauthScopes` (list of string, optional) — OAuth scopes configured directly on this connection.
- `oauthIdpType` (V2ConnectionsPostResponsesContentApplicationJsonSchemaOauthIdpType, optional) — OAuth provider type configured or inferred for this connection.
- `oauthUsePkce` (boolean, optional, nullable) — Whether this connection-level OAuth configuration uses PKCE.
- `oauthUseJwt` (boolean, optional, nullable) — Whether this connection-level OAuth configuration uses JWT bearer token authentication.
- `oauthAudience` (string, optional) — Audience used for OAuth federation, such as the Google workforce identity federation audience for BigQuery.
- `isIndependentOAuth` (boolean, optional) — Whether this connection uses connection-level OAuth instead of organization-level OAuth.
- `userAttributes` (V2ConnectionsPostResponsesContentApplicationJsonSchemaUserAttributes, optional) — User attributes associated with the connection
- `roleSwitching` (enum, optional) — Whether a Snowflake OAuth connection allows users to switch roles when running queries. Only relevant for Snowflake OAuth connections.
  - Allowed values: `allRoles`, `disabled`
- `enableHiveMetastore` (boolean, optional) — Whether this Databricks connection exposes the `hive_metastore` catalog in Sigma. Only relevant for Databricks connections.
- `usePython` (boolean, optional)
- `pythonComputeClusterId` (string, optional) — ID of the all-purpose compute cluster used to run Python queries. Only relevant for Databricks connections with Python enabled.

## Types

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaPoolSizes

Connection pool sizes. Each pool bounds how many queries of a given type (ad hoc, scheduled, catalog, result cache) run concurrently against the warehouse.

- `isPoolConfigured` (boolean, optional) — Whether custom connection pool sizes are configured. If any pool size is supplied without this field, the API stores it as true.
- `schedulePoolSize` (double, optional) — Pool size for scheduled workloads.
- `catalogPoolSize` (double, optional) — Pool size for catalog workloads.
- `resultPoolSize` (double, optional) — Pool size for result cache workloads.

### V2ConnectionsPostResponsesContentApplicationJsonSchemaTimeout

Timeout settings for the connection, with a default value in seconds

- `default` (double, required)
- `worksheet` (double, optional)
- `dashboard` (double, optional)
- `download` (double, optional)

### V2ConnectionsPostResponsesContentApplicationJsonSchemaPoolSizes

Pool sizes for the connection, such as for catalogPoolSize or schedulePoolSize

- `isPoolConfigured` (boolean, optional)
- `catalogPoolSize` (double, optional)
- `resultPoolSize` (double, optional)
- `schedulePoolSize` (double, optional)

### V2ConnectionsPostResponsesContentApplicationJsonSchemaWritebacksItems

- `database` (string, required) — Database, catalog, or top-level object to contain tables written back to the data platform
- `schema` (string, required) — Schema, database, or second-level object to contain tables written back to the data platform
- `writebackSchemaId` (string, optional) — Unique identifier of the writebackSchema
- `description` (string, optional) — Description for the write-back destination.

### V2ConnectionsPostResponsesContentApplicationJsonSchemaWritebackSchemasItems

- `database` (string, required) — Database, catalog, or top-level object to contain tables written back to the data platform
- `schema` (string, required) — Schema, database, or second-level object to contain tables written back to the data platform
- `writebackSchemaId` (string, optional) — Unique identifier of the writebackSchema
- `description` (string, optional) — Description for the write-back destination.

### V2ConnectionsPostResponsesContentApplicationJsonSchemaInputTableAuditLogSchema

Schema to use for the input table write-ahead log (WAL). Cannot be changed without breaking write behavior on this connection.

- `database` (string, required) — Database, catalog, or top-level object to contain tables written back to the data platform
- `schema` (string, required) — Schema, database, or second-level object to contain tables written back to the data platform
- `writebackSchemaId` (string, optional) — Unique identifier of the writebackSchema

### V2ConnectionsPostResponsesContentApplicationJsonSchemaOauthIdpType

OAuth provider type configured or inferred for this connection.

### V2ConnectionsPostResponsesContentApplicationJsonSchemaUserAttributes

User attributes associated with the connection

- `role` (string, optional)
- `warehouse` (string, optional)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails0

Details of the PostgreSQL connection.

- `type` (enum, required)
  - Allowed values: `postgres`, `redshift`, `alloydb`
- `host` (string, required)
- `database` (string, required)
- `user` (string, optional)
- `password` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf0Password, optional)
- `port` (double, optional)
- `useTls` (boolean, optional)
- `writeAccess` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf0WriteAccess, optional)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails1

Details of the BigQuery connection.

- `type` (enum, required)
  - Allowed values: `bigQuery`
- `projectId` (string, required)
- `additionalProjectIds` (list of string, optional)
- `serviceAccount` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1ServiceAccount, optional)
- `metadataUrl` (string, optional) — OAuth metadata URL for connection-level OAuth.
- `clientId` (string, optional) — Client ID for the OAuth application used by this connection.
- `clientSecret` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1ClientSecret, optional) — Client secret for the OAuth application used by this connection. This value is write-only and is not returned by the API.
- `scopes` (list of string, optional) — OAuth scopes to request when users authenticate to this connection.
- `idpType` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1IdpType, optional) — OAuth provider type. Supported values are adfs, auth0, azuread, okta, ping, snowflake, aws_databricks, azure_databricks, gcp_databricks, and unknown.
- `usePkce` (boolean, optional, nullable) — Whether the OAuth flow should require Proof Key for Code Exchange (PKCE). Databricks-hosted OAuth providers require PKCE.
- `useJwt` (boolean, optional, nullable) — Whether the OAuth flow should use JWT bearer token authentication instead of a client secret.
- `useOauth` (boolean, optional) — Whether this BigQuery connection uses OAuth federation.
- `audience` (string, optional) — Google workforce identity federation audience used to exchange the OAuth token for a Google access token.
- `writeAccess` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1WriteAccess, optional)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails4

Details of the MySQL connection.

- `type` (enum, required)
  - Allowed values: `mysql`
- `user` (string, required)
- `password` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf4Password, required)
- `host` (string, required)
- `port` (double, required)
- `writeAccess` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf4WriteAccess, optional)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails5

Details of the Azure SQL DB connection.

- `type` (enum, required) — Azure SQL DB connection type.
  - Allowed values: `azuresql`
- `server` (string, required) — Fully qualified server name or host.
- `database` (string, required) — Database to connect to on the Azure SQL DB server.
- `port` (double, required) — Port for the database server.
- `user` (string, required) — Username used to authenticate to the database.
- `password` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf5Password, required) — Password used to authenticate to the database. This value is write-only and is not returned by the API.
- `useReadUncommittedIsolation` (boolean, optional) — Whether queries run with READ UNCOMMITTED transaction isolation.
- `writeAccess` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf5WriteAccess, optional) — Configure write-back for the connection.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails6

Details of the SQL Server connection.

- `type` (enum, required) — SQL Server connection type.
  - Allowed values: `sqlserver`
- `server` (string, required) — Fully qualified server name or host.
- `port` (double, required) — Port for the database server.
- `user` (string, required) — Username used to authenticate to the database.
- `password` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf6Password, required) — Password used to authenticate to the database. This value is write-only and is not returned by the API.
- `useReadUncommittedIsolation` (boolean, optional) — Whether queries run with READ UNCOMMITTED transaction isolation.
- `writeAccess` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf6WriteAccess, optional) — Configure write-back for the connection.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetails7

Details of the Starburst connection.

- `type` (enum, required) — Starburst connection type.
  - Allowed values: `starburst`
- `host` (string, required) — The address of your Starburst Galaxy cluster as a URL or an IP address.
- `port` (double, required) — The port through which Sigma connects to your Starburst Galaxy cluster.
- `user` (string, required) — The username of the service account set up by your Starburst administrator.
- `password` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf7Password, required) — The password for the service account set up by your Starburst administrator. This value is write-only and is not returned by the API.
- `writeAccess` (V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf7WriteAccess, optional) — Configure write-back for the connection.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf0Password

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf0WriteAccess

- `writeSchema` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1ServiceAccount

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1ClientSecret

Client secret for the OAuth application used by this connection. This value is write-only and is not returned by the API.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1IdpType

OAuth provider type. Supported values are adfs, auth0, azuread, okta, ping, snowflake, aws_databricks, azure_databricks, gcp_databricks, and unknown.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1WriteAccess

- `writeProject` (string, required)
- `writeDataset` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf4Password

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf4WriteAccess

- `writeSchema` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf5Password

Password used to authenticate to the database. This value is write-only and is not returned by the API.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf5WriteAccess

Configure write-back for the connection.

- `writeDatabase` (string, required) — Database to contain tables written back to the data platform.
- `writeSchema` (string, required) — Schema to contain tables written back to the data platform.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf6Password

Password used to authenticate to the database. This value is write-only and is not returned by the API.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf6WriteAccess

Configure write-back for the connection.

- `writeDatabase` (string, required) — Database to contain tables written back to the data platform.
- `writeSchema` (string, required) — Schema to contain tables written back to the data platform.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf7Password

The password for the service account set up by your Starburst administrator. This value is write-only and is not returned by the API.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf7WriteAccess

Configure write-back for the connection.

- `writeCatalog` (string, required) — Catalog to contain tables written back to the data platform.
- `writeSchema` (string, required) — Schema to contain tables written back to the data platform.

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf0Password1

- `type` (enum, required)
  - Allowed values: `plain`
- `value` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf0Password2

- `secretManagerId` (string, required)
- `secretId` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1ServiceAccount1

- `secretManagerId` (string, required)
- `secretId` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf1ClientSecret1

- `secretManagerId` (string, required)
- `secretId` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf4Password1

- `type` (enum, required)
  - Allowed values: `plain`
- `value` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf4Password2

- `secretManagerId` (string, required)
- `secretId` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf5Password1

- `type` (enum, required)
  - Allowed values: `plain`
- `value` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf5Password2

- `secretManagerId` (string, required)
- `secretId` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf6Password1

- `type` (enum, required)
  - Allowed values: `plain`
- `value` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf6Password2

- `secretManagerId` (string, required)
- `secretId` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf7Password1

- `type` (enum, required)
  - Allowed values: `plain`
- `value` (string, required)

### V2ConnectionsPostRequestBodyContentApplicationJsonSchemaDetailsOneOf7Password2

- `secretManagerId` (string, required)
- `secretId` (string, required)

## Examples

**Request**

```json
{
  "details": {
    "database": "string",
    "host": "string",
    "type": "postgres"
  },
  "name": "string"
}
```

**Response**

```json
{
  "organizationId": "string",
  "connectionId": "string",
  "isSample": true,
  "isAuditLog": true,
  "lastActiveAt": "2024-01-15T09:30:00Z",
  "name": "string",
  "type": "string",
  "useOauth": true,
  "createdBy": "string",
  "updatedBy": "string",
  "createdAt": "2024-01-15T09:30:00Z",
  "updatedAt": "2024-01-15T09:30:00Z",
  "isArchived": true,
  "account": "string",
  "warehouse": "string",
  "user": "string",
  "httpPath": "string",
  "role": "string",
  "timeout": {
    "default": 1.1,
    "worksheet": 1.1,
    "dashboard": 1.1,
    "download": 1.1
  },
  "poolSizes": {
    "isPoolConfigured": true,
    "catalogPoolSize": 1.1,
    "resultPoolSize": 1.1,
    "schedulePoolSize": 1.1
  },
  "writeAccess": true,
  "friendlyName": true,
  "writebacks": [
    {
      "database": "string",
      "schema": "string",
      "writebackSchemaId": "string",
      "description": "string"
    }
  ],
  "writebackSchemas": [
    {
      "database": "string",
      "schema": "string",
      "writebackSchemaId": "string",
      "description": "string"
    }
  ],
  "inputTableAuditLogSchema": {
    "database": "string",
    "schema": "string",
    "writebackSchemaId": "string"
  },
  "materializationWarehouse": "string",
  "exportsWarehouse": "string",
  "oauthMetadataUrl": "string",
  "oauthClientId": "string",
  "oauthScopes": [
    "string"
  ],
  "oauthIdpType": "aws_databricks",
  "oauthUsePkce": true,
  "oauthUseJwt": true,
  "oauthAudience": "string",
  "isIndependentOAuth": true,
  "userAttributes": {
    "role": "string",
    "warehouse": "string"
  },
  "roleSwitching": "allRoles",
  "enableHiveMetastore": true,
  "usePython": true,
  "pythonComputeClusterId": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.sigmacomputing.com/v2/connections"

payload = {
    "details": {
        "database": "string",
        "host": "string",
        "type": "postgres"
    },
    "name": "string"
}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.sigmacomputing.com/v2/connections';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"details":{"database":"string","host":"string","type":"postgres"},"name":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.sigmacomputing.com/v2/connections"

	payload := strings.NewReader("{\n  \"details\": {\n    \"database\": \"string\",\n    \"host\": \"string\",\n    \"type\": \"postgres\"\n  },\n  \"name\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.sigmacomputing.com/v2/connections")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"details\": {\n    \"database\": \"string\",\n    \"host\": \"string\",\n    \"type\": \"postgres\"\n  },\n  \"name\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/connections")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"details\": {\n    \"database\": \"string\",\n    \"host\": \"string\",\n    \"type\": \"postgres\"\n  },\n  \"name\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/connections', [
  'body' => '{
  "details": {
    "database": "string",
    "host": "string",
    "type": "postgres"
  },
  "name": "string"
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/connections");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"details\": {\n    \"database\": \"string\",\n    \"host\": \"string\",\n    \"type\": \"postgres\"\n  },\n  \"name\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  "details": [
    "database": "string",
    "host": "string",
    "type": "postgres"
  ],
  "name": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/connections")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```