Customize Snowflake views using the Scripts API
Learn how to use the Reltio Scripts API to generate and apply custom Snowflake SQL views for entity, relation, and interaction data.
What is the Scripts
The Scripts allows you to retrieve pre-built SQL scripts that generate views for specific entity, relation, or interaction types stored in your Snowflake account. These views aren't created automatically by the Snowflake internal staging adapter. To generate them, use the API to request the relevant script, substitute type-specific values, and run the resulting SQL in your Snowflake environment.
When to use it
If you need to organize or isolate data by type, for example, creating a view for Individual entities or a view showing only ContactOf relations, the Scripts enables this without requiring you to write SQL manually. This approach supports self-service data modeling and simplifies downstream analytics and data warehouse usage.
Before you begin
To use the Scripts, you must first set up the Snowflake internal staging adapter for your tenant and complete authentication using Reltio's RSA key-based secrets mechanism. The adapter setup includes assigning roles and creating resources in your Snowflake account. You must also assign the public key provided by Reltio to your Snowflake user account. For more information, see Reltio Data Pipeline for Snowflake setup.
How the Scripts works
Once your adapter is configured, you can call the Scripts to retrieve a SQL script based on the type of view you need. For example, to generate a view for the Individual entity type, send a POST request to the /scripts endpoint with the appropriate placeholder value. The API returns a complete SQL statement that you can execute in Snowflake. For detailed steps, see Create a custom view for an entity type.
You can also request unpopulated scripts. This is useful if you want to see all available script templates before filling in placeholders. For this workflow, see List all available external Snowflake scripts.
View customization options
The Scripts API supports views for the following types:
- Entities: for example,
entity_Individual - Relations: for example,
relation_ContactOf - Interactions: for example,
interaction_Clickstream
Each script uses placeholder values that are replaced when you submit your request. For a complete list of available scripts and required placeholders, refer to External script index for Snowflake.