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

# Import Snowflake candidates using key pair authentication

> Sync candidates from a Snowflake table into Great Question with key pair authentication, daily imports, custom attribute mapping, and push-back support.

The Snowflake integration imports candidates directly from your Snowflake warehouse into Great Question and keeps them in sync automatically. It uses key pair authentication for a secure connection, OAuth-based Snowflake connections are no longer supported, so if you're on an older setup, you'll need to reconnect using key pair authentication below.

## Before you start

You'll need:

* **Admin** permissions in Great Question
* Access to run SQL commands in Snowflake with the **SECURITYADMIN** or **ACCOUNTADMIN** role
* A Snowflake table that contains at least an **email** column, used to match candidates

## Step 1: Key management

Choose how to authenticate:

* **Let Great Question generate the key pair** (recommended). Great Question creates an RSA key pair and gives you the public key to install in Snowflake.
* **Provide your own private key** in PEM format (2048-bit minimum).

## Step 2: Connection details

Enter your Snowflake connection details:

* Account URL: Your full Snowflake URL (like `https://abc12345.us-east-1.snowflakecomputing.com`)
* Username: The Snowflake user that Great Question will connect as
* Role (optional): A specific Snowflake role to use
* Warehouse: The compute warehouse for running queries
* Database: Where your candidate table lives
* Schema (optional): Defaults to "PUBLIC" if you leave it blank
* Table: The specific table containing your candidates

<Tip>
  Not sure what values to use? Run these in Snowflake to find out:

  ```text theme={null}
  SELECT CURRENT_USER();
  SELECT CURRENT_ROLE();
  SELECT CURRENT_WAREHOUSE();
  ```
</Tip>

## Step 3: Grant privileges

This is where you set up permissions in Snowflake. The wizard shows you six SQL commands to run in your Snowflake console. Don't worry—each one has a handy "Copy command" button.

Here's what you'll be running:

**Allow public key assignment**

> USE ROLE SECURITYADMIN;
>
> GRANT MODIFY PROGRAMMATIC AUTHENTICATION METHODS ON USER your\_username TO ROLE your\_role;

**Add the public key to the user**

> USE ROLE SECURITYADMIN;
>
> ALTER USER your\_username SET RSA\_PUBLIC\_KEY='your\_public\_key\_here';

**Grant warehouse usage**

> USE ROLE SYSADMIN;
>
> GRANT USAGE ON WAREHOUSE your\_warehouse TO USER your\_username;

**Grant database access**

> GRANT USAGE ON DATABASE your\_database TO USER your\_username;

**Grant schema permissions**

> GRANT USAGE ON ALL SCHEMAS IN DATABASE your\_database TO USER your\_username;

**Grant table access**

> GRANT SELECT ON ALL TABLES IN DATABASE your\_database TO USER your\_username;

To run these commands, head to your Snowflake console, open a new Worksheet, paste each command, and execute. Make sure you're using a role with sufficient privileges (like SECURITYADMIN or ACCOUNTADMIN).

## Step 4: Test and complete

Test the connection to confirm Great Question can reach your Snowflake account and that the email column exists, then complete the setup.

### Configuring Your Integration

Once connected, you can customize how the integration works:

##### <u>Data Location</u>

Your warehouse, database, schema, and table settings from the wizard are saved here. You can update them anytime if your data moves.

##### <u>Import Filtering</u>

Want to control which records get imported? Add a boolean column called `gq_import` to your table. Set it to `true` for candidates you want to sync, and we'll skip the rest.

##### <u>Push Candidates to Snowflake</u>

Enable this to export candidates from Great Question back to your Snowflake table. When enabled, this creates a `CANDIDATES` table inside your configured database containing the **id** and **email** of all existing candidates.

<Note>
  Make sure your Snowflake user has owner privileges to the warehouse and permissions to create tables and insert data.
</Note>

This is useful if you want to restrict which candidates sync back to Great Question to only those that already exist in your system.

##### <u>Handling Deletions</u>

Add a boolean `is_deleted` column to your table if you want to soft-delete candidates. When this column is `true`, we'll remove that candidate from Great Question during the next sync.

If a previously imported record is removed from Snowflake without the `is_deleted` column, the candidate won't be automatically deleted from Great Question. Using the `is_deleted` column gives you explicit control over deletion behavior.

### Synchronization

Your candidates sync automatically every 24 hours at midnight PST. Need data sooner? Hit the "Sync now" button on your integration settings page.

If you've enabled candidate exports, those run daily at 11:30 PM PST. You can also trigger an export manually using the "Export Data" button.

### Custom Attributes

Any additional columns in your Snowflake table can map to candidate attributes in Great Question. To set this up:

1. Go to *Account* > *Candidate attributes* > *New attribute* ([or click here](https://greatquestion.co/custom_attrs/new))
2. Create an attribute with a name that **exactly matches** the column name from Snowflake

For example, if you have a `department` column in Snowflake, create a "department" custom attribute in Great Question, and the values will map automatically on each sync.

<Note>
  The name of the attribute **must** match the column name from Snowflake exactly.
</Note>

## Troubleshooting

| Issue                                                    | What's happening                          | How to fix                                                                                                                                       |
| -------------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| "Snowflake OAuth connections are no longer supported"    | You're on a legacy OAuth-based connection | Reconnect using key pair authentication as described above                                                                                       |
| **"Permission denied" errors when running SQL commands** | Error message.                            | The SECURITYADMIN role is required for the first two commands, and SYSADMIN typically handles the resource grants.                               |
| **"User not found" errors**                              | Error message.                            | Double-check that the username you entered in the wizard matches exactly what's in Snowflake. Usernames are case-sensitive.                      |
| **"Warehouse not found" errors**                         | Error message.                            | Verify the warehouse name and make sure it's running (not suspended). You can check this in Snowflake's Admin > Warehouses section.              |
| **Connection test fails**                                | Error message.                            | Walk back through your connection details and make sure there are no typos. Also confirm that all six SQL commands from Step 3 ran successfully. |

***

**Still need help?** Contact us at [support@greatquestion.co](mailto:support@greatquestion.co) — median response time is 19 minutes during [support hours](https://greatquestion.co/features/about-our-support-team).
