---
title: Generate an RSA key pair for Snowflake authentication
description: "Generates a Snowflake-compatible RSA key pair. The private key is stored server-side in an ephemeral cache; you receive the public key (paste into your Snowf…"
product: general
lang: en
last_updated: 2026-09-15
token_estimate: 1213
---
# Generate an RSA key pair for Snowflake authentication

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Generate an RSA key pair for Snowflake authentication

**POST** `/v1/projects/{project_id}/snowflake-keys`

Full URL: `https://developer-api.amplitude.com/v1/projects/{project_id}/snowflake-keys`

**Servers:**
- Production (US): `https://developer-api.amplitude.com/v1/projects/{project_id}/snowflake-keys`
- Production (EU): `https://developer-api.eu.amplitude.com/v1/projects/{project_id}/snowflake-keys`

Generate an RSA key pair for Snowflake authentication

Generates a Snowflake-compatible RSA key pair. The private key is stored
server-side in an ephemeral cache; you receive the public key (paste into
your Snowflake user via `ALTER USER <user> SET RSA_PUBLIC_KEY = '...'`) and
an ephemeral ID to pass as `snowflake_private_key_ephemeral_id` in the
destination `config` on a subsequent `POST /destinations` for a Snowflake
direct-load destination.

This is the CLI equivalent of the "Generate RSA Key" step in the Amplitude
UI wizard, so customers do not have to run `openssl genrsa` and manage
private keys locally.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Authorization | string | Yes | — | http |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| project_id (path) | string | Yes | 12345 | Amplitude project identifier, backed by the canonical app ID. Constraints: pattern: ^[0-9]+$ |

## Header parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Idempotency-Key (header) | string | Yes | — | Unique idempotency key used to safely retry write operations. Constraints: min length: 8, max length: 255 |

## Response (application/json)

**201** — Key pair generated.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| data | object | Yes | — | — |
| data.public_key | string | Yes | — | RSA public key in PEM format. Add to your Snowflake user. |
| data.ephemeral_id | string | Yes | — | Reference to the server-held private key. Pass as `snowflake_private_key_ephemeral_id` in destination create/update config. |

```json
{
  "data": {
    "public_key": "string",
    "ephemeral_id": "string"
  }
}
```

**401**

**403**

**404**

**429**

**500**

## Code samples

### cURL

```bash
curl -X POST "https://developer-api.amplitude.com/v1/projects/12345/snowflake-keys" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.post(
    "https://developer-api.amplitude.com/v1/projects/12345/snowflake-keys",
    headers={
        "Content-Type": "application/json",
        "Authorization": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://developer-api.amplitude.com/v1/projects/12345/snowflake-keys", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://developer-api.amplitude.com/v1/projects/12345/snowflake-keys");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "Authorization: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("POST", "https://developer-api.amplitude.com/v1/projects/12345/snowflake-keys", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://developer-api.amplitude.com/v1/projects/12345/snowflake-keys"))
      .method("POST", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://developer-api.amplitude.com/v1/projects/12345/snowflake-keys")
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

