> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peerdb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Snowflake peer

```http theme={null}
POST api/v1/peers/create
```

You can create a Snowflake peer using this endpoint. Here is the request and response format for creating a Snowflake peer.

### Request Fields

<ParamField path="peer" type="object" required>
  Configuration of the peer to be created.
</ParamField>

<Expandable title="peer">
  <ParamField path="name" type="string" required>
    The name of the peer to be created.
  </ParamField>

  <ParamField path="type" type="1" required>
    The type of peer to be created. The value for Snowflake is **1**.
  </ParamField>

  <ParamField path="snowflake_config" type="object" required>
    Configuration for the Snowflake peer
  </ParamField>

  <Expandable title="snowflake_config">
    <ParamField path="account_id" type="string" required>
      The account ID of the Snowflake server.
    </ParamField>

    <ParamField path="username" type="string" required>
      The username to connect to the Snowflake server.
    </ParamField>

    <ParamField path="private_key" type="string" required>
      The private key in PEM or pk8 format to connect to the Snowflake server.

      If you are providing an encrypted key, please provide the password as a separate field (listed below).
    </ParamField>

    <ParamField path="database" type="string" required>
      The database to connect to.
    </ParamField>

    <ParamField path="warehouse" type="string" required>
      The warehouse to connect to.
    </ParamField>

    <ParamField path="role" type="boolean" required>
      The Snowflake role to connect to.
    </ParamField>

    <ParamField path="query_timeout" type="number">
      The query timeout in seconds. The default is 30 seconds.
    </ParamField>

    <ParamField path="password" type="string">
      This is optional, if the private key provided is encrypted.
    </ParamField>
  </Expandable>
</Expandable>

<ParamField path="allow_update" type="boolean">
  Whether you wish to update a peer with this name if it already exists. Default is `false`.
</ParamField>

### Response Fields

<ParamField path="status" type="CREATED|FAILED">
  Whether the creation/update was successful. If yes, the value will be `CREATED`. Else it will be `FAILED`.
</ParamField>

<ParamField path="message" type="string">
  Error message if any
</ParamField>

<RequestExample>
  ```bash Snowflake peer theme={null}
  curl --request POST \
    --url http://localhost:3000/api/v1/peers/create \
    --header 'Authorization: Basic OmJsXPNrU3dhbjEyMw==' \
    --header 'Content-Type: application/json' \
    --data '{
  	"peer": {
  		"name": "snowflake_peer_via_api",
  		"type": 1,
  		"snowflake_config": {
              "account_id": "account_id",
              "username": "username",
              "private_key":"***",
              "database": "database",
              "warehouse": "warehouse",
              "role": "role",
              "query_timeout": 30,
              "password": "password"
  		}
  	},
  	"allow_update":false
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
  	"status": "CREATED",
  	"message": ""
  }
  ```
</ResponseExample>
