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

# Destinations

> Configure where to send your query results

Hypermodel API supports multiple destination types for delivering enriched data from async queries.

## Available Destinations

<CardGroup cols={2}>
  <Card title="URL Webhook" icon="link" href="#url-destination">
    Send data to any HTTP endpoint
  </Card>

  <Card title="Snowflake" icon="snowflake" href="#snowflake-destination">
    Insert data into Snowflake tables
  </Card>

  <Card title="Google Sheets" icon="table" href="#google-sheets-destination">
    Append data to Google Sheets
  </Card>

  <Card title="Clay" icon="clay" href="#clay-destination">
    Send data to Clay tables
  </Card>
</CardGroup>

***

## URL Destination

Send data to any HTTP endpoint via POST request. Perfect for webhooks, custom integrations, or serverless functions.

### Configuration

```json theme={null}
{
  "type": "URL",
  "config": {
    "endpoint": "https://webhook.site/unique-id",
    "headers": {
      "X-API-Key": "your-api-key",
      "X-Custom-Header": "custom-value"
    }
  }
}
```

### Parameters

<ParamField body="endpoint" type="string" required>
  The HTTP endpoint URL where data will be sent via POST request
</ParamField>

<ParamField body="headers" type="object">
  Optional custom headers to include in the POST request
</ParamField>

### Payload Format

The data sent to your endpoint will follow this structure:

```json theme={null}
{
  "id": "query_1234567890_abc123",
  "raw": "Raw unformatted response from Claude...",
  "data": [
    /* Formatted data matching your schema */
  ]
}
```

### Use Cases

<AccordionGroup>
  <Accordion title="Webhook Integration" icon="webhook">
    Send data to platforms like Zapier, Make, or n8n for workflow automation
  </Accordion>

  <Accordion title="Custom API" icon="code">
    POST data directly to your application's API endpoint
  </Accordion>

  <Accordion title="Serverless Functions" icon="bolt">
    Trigger AWS Lambda, Vercel Functions, or Cloudflare Workers
  </Accordion>
</AccordionGroup>

***

## Snowflake Destination

Insert enriched data directly into Snowflake data warehouse tables.

### Configuration

```json theme={null}
{
  "type": "Snowflake",
  "config": {
    "account": "your-account",
    "database": "your-database",
    "schema": "your-schema",
    "table": "your-table",
    "warehouse": "your-warehouse",
    "username": "your-username",
    "password": "your-password"
  }
}
```

### Parameters

<ParamField body="account" type="string" required>
  Your Snowflake account identifier
</ParamField>

<ParamField body="database" type="string" required>
  Target database name
</ParamField>

<ParamField body="schema" type="string" required>
  Target schema name
</ParamField>

<ParamField body="table" type="string" required>
  Target table name
</ParamField>

<ParamField body="warehouse" type="string" required>
  Snowflake warehouse to use for the operation
</ParamField>

<ParamField body="username" type="string" required>
  Snowflake username with write permissions
</ParamField>

<ParamField body="password" type="string" required>
  Snowflake password
</ParamField>

<Note>
  Ensure your table schema matches the JSON schema defined in your query for seamless data insertion.
</Note>

***

## Google Sheets Destination

Append data to Google Sheets for easy collaboration and visualization.

### Configuration

```json theme={null}
{
  "type": "Sheets",
  "config": {
    "spreadsheetId": "your-spreadsheet-id",
    "sheetName": "Sheet1",
    "accessToken": "google-oauth-access-token"
  }
}
```

### Parameters

<ParamField body="spreadsheetId" type="string" required>
  The Google Sheets spreadsheet ID (found in the sheet URL)
</ParamField>

<ParamField body="sheetName" type="string" required>
  The name of the specific sheet/tab within the spreadsheet
</ParamField>

<ParamField body="accessToken" type="string" required>
  Google OAuth access token with Google Sheets API permissions
</ParamField>

### How to Get Access Token

<Steps>
  <Step title="Enable Google Sheets API">
    Go to Google Cloud Console and enable the Google Sheets API
  </Step>

  <Step title="Create OAuth Credentials">
    Create OAuth 2.0 credentials for your application
  </Step>

  <Step title="Obtain Access Token">
    Use the OAuth flow to obtain an access token with `https://www.googleapis.com/auth/spreadsheets` scope
  </Step>
</Steps>

<Warning>
  Access tokens expire. Consider implementing token refresh logic for production use.
</Warning>

***

## Clay Destination

Send data to Clay tables via webhook for sales and marketing workflows.

### Configuration

```json theme={null}
{
  "type": "Clay",
  "config": {
    "webhookUrl": "https://clay.com/webhook/your-webhook-url"
  }
}
```

### Parameters

<ParamField body="webhookUrl" type="string" required>
  Your Clay webhook URL (obtained from Clay table settings)
</ParamField>

### Data Flattening

<Info>
  Clay webhooks expect flat data structures. The API automatically handles:

  * **Nested objects**: Flattened with underscore-separated keys (e.g., `address.city` becomes `address_city`)
  * **Primitive arrays**: Joined as comma-separated strings
  * **Object arrays**: Stringified as JSON
</Info>

### Example

**Before flattening:**

```json theme={null}
{
  "company": {
    "name": "Example Corp",
    "address": {
      "city": "San Francisco"
    }
  },
  "tags": ["tech", "saas"]
}
```

**After flattening (sent to Clay):**

```json theme={null}
{
  "company_name": "Example Corp",
  "company_address_city": "San Francisco",
  "tags": "tech,saas"
}
```

***

## Comparison

| Feature              | URL                 | Snowflake        | Sheets        | Clay            |
| -------------------- | ------------------- | ---------------- | ------------- | --------------- |
| **Setup Complexity** | Low                 | Medium           | Medium        | Low             |
| **Best For**         | Custom integrations | Data warehousing | Collaboration | Sales/Marketing |
| **Authentication**   | Optional            | Required         | OAuth         | Webhook URL     |
| **Data Volume**      | Any                 | Large            | Small-Medium  | Small-Medium    |
| **Real-time**        | ✅                   | ✅                | ✅             | ✅               |

## Next Steps

<CardGroup cols={2}>
  <Card title="Create Query" icon="plus" href="/api-reference/create-query">
    Learn how to create async queries with destinations
  </Card>

  <Card title="JSON Schemas" icon="code" href="/schemas">
    See example schemas for different use cases
  </Card>
</CardGroup>
