Overview
Roark analyzes every call and produces structured metric values (frustration, sentiment, task completion, latency, custom metrics, and more). A common next step is to land that analysis in your own data warehouse so you can join it against your operational data, for example correlating call frustration with downstream business outcomes. This guide covers the recommended pattern for syncing Roark analysis into Snowflake using the tools available today. The same approach works for BigQuery, Redshift, or Databricks: only the load step changes.Want a fully managed connector or a scheduled file drop into your own bucket? See Deeper integrations at the bottom of this page and reach out. We are actively expanding warehouse-export options.
The recommended pattern
The pattern is event-driven pull: Roark notifies you when a call finishes analysis, you pull the results from the API, land the raw JSON in cloud storage, and load it into Snowflake.callId, not the metric values themselves, so your handler makes one follow-up API call to fetch the analysis. This keeps payloads small and lets you pull exactly the fields you need.
1
Create a read-only API key
Generate a key scoped to the project you want to export. Read endpoints require the
call:read, metric:read, and transcript:read permissions. See API Keys.2
Subscribe to analysis webhooks
Add a webhook endpoint and subscribe to
call.analysis.completed. See Webhooks.3
Fetch analysis on each event
In your handler, call the metrics (and optionally transcript) endpoints for the
callId you received.4
Land the raw JSON in cloud storage
Write each call’s payload to S3 (or GCS / Azure Blob). Store it as raw JSON so schema changes never break ingestion.
5
Load into Snowflake
Point Snowpipe at the bucket to auto-ingest, then flatten into modeled tables.
What you can export
All data is served from the Customer API athttps://api.roark.ai/v1 and is scoped to the project your API key belongs to.
Chats have the identical set of endpoints under
/v1/chat.
Approach A: Event-driven (recommended for ongoing sync)
Best for keeping the warehouse continuously fresh with low latency.Approach B: Scheduled backfill / poll
Best for the initial backfill of historical data, or as a simpler alternative to webhooks. Page through the calls list on a schedule and fetch metrics per call. The list endpoint uses keyset (cursor) pagination. Sort bystartedAt and walk the cursor to move forward in time.
For a large backfill you can also pull metric values a whole job at a time with
GET /v1/metric/collection-jobs/{jobId}/metric-values, which returns every metric value for that collection job in one paginated stream rather than one request per call.Loading into Snowflake
Land the raw JSON in an external stage, ingest into aVARIANT staging table, then flatten into modeled tables with LATERAL FLATTEN. Storing the raw payload first means a new metric or field never breaks your pipeline.
1
Create an external stage over your bucket
2
Auto-ingest with Snowpipe
3
Flatten metrics into a queryable table
4
Join against your operational data
Things to know
- Idempotency. Keying S3 objects and Snowflake rows by
callId(plus the metric collection job id) makes re-delivery and backfills safe to re-run without double counting. - Webhook delivery. Roark retries failed deliveries up to 3 times with backoff. Respond
200within 5 seconds and process asynchronously. See Webhooks. - Date filtering. The calls list does not yet accept an explicit
from/todate range. Approximate a range by sorting onstartedAtand walking the cursor until you pass your window. - Transcripts are fetched per call from the transcript endpoint; they are not included in the metrics payload.
- Rate limits and pagination. Use
limit=100and honornextCursor/hasMorerather than assuming a fixed page count.
Deeper integrations
The pattern above uses only what is available today. If you need something more managed, we are building toward it and would like to scope it with you:Managed connector
A Fivetran / Airbyte-style connector with incremental, updated-since cursors so your warehouse stays in sync automatically.
Scheduled file drop
Roark writes incremental Parquet or CSV to your own S3 bucket on a schedule, ready for Snowpipe.
Secure data share
A hands-off Snowflake Secure Data Share so there is nothing to run on your side.
Talk to us
Tell us your volume, latency needs, and the joins you want to run.
Next steps
Webhooks
Set up the analysis-completed notification
API Keys
Create a read-only key for the export
API Reference
Full endpoint and parameter reference
Reports
Analyze the same data inside Roark