File REST ingestion and outbound error alerts
REST can announce staged files when your application controls discovery. An outbound error integration reports qualifying load failures.
Understand the idea
For the REST alternative create a separate pipe with AUTO_INGEST=FALSE using an isolated source/target, authenticate a service user using the documented key-pair or supported federation flow, and grant its default role the required pipe privileges. Keep tokens in an approved secret store. Never submit the auto-ingest lab’s files through a second pipe.
| Concept | What it means |
|---|---|
| insertFiles | Queues paths for a non-auto-ingest pipe. |
| insertReport / COPY_HISTORY | Confirms later load outcomes. |
| Inbound integration | Delivers arrival events to Snowflake. |
| ERROR_INTEGRATION | Sends failure notifications out of Snowflake. |
A concrete example
A REST request is accepted, then loading fails because the file is invalid. Submission status and load status differ.
Remember: No failure notification does not prove healthy ingestion: missing arrival events produce no load failure.
Explain it step by step · full theory
Setup and reasoning
For the REST alternative create a separate pipe with AUTO_INGEST=FALSE using an isolated source/target, authenticate a service user using the documented key-pair or supported federation flow, and grant its default role the required pipe privileges. Keep tokens in an approved secret store. Never submit the auto-ingest lab’s files through a second pipe.
Error notifications require an outbound queue integration on the Snowflake account’s cloud: SNS on AWS, Pub/Sub on GCP or Event Grid on Azure. Configure cloud publishing IAM using the linked provider instructions, grant integration USAGE and attach it with ALTER PIPE. Email/webhook integrations cannot be attached here. Partial loads and lost notifications need separate monitoring.
Words used in this lesson
- insertFiles
- Queues paths for a non-auto-ingest pipe.
- insertReport / COPY_HISTORY
- Confirms later load outcomes.
- Inbound integration
- Delivers arrival events to Snowflake.
- ERROR_INTEGRATION
- Sends failure notifications out of Snowflake.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
File REST ingestion and outbound error alerts
Identify the input
REST can announce staged files when your application controls discovery. An outbound error integration reports qualifying load failures.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Identify the input
REST can announce staged files when your application controls discovery. An outbound error integration reports qualifying load failures.
- Follow delivery
A REST request is accepted, then loading fails because the file is invalid. Submission status and load status differ.
- Verify and recover
No failure notification does not prove healthy ingestion: missing arrival events produce no load failure.
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
Manual examples only. Complete Modules 05–07 and the first lesson’s M8_LAB setup. Select L2_OBJECTS_LAB.M8_LAB in each SQL session. Replace every placeholder and choose exactly one cloud provider. Cloud IAM/notifications require authorized setup; streaming protocol outlines are explicitly non-executable. No credentials belong in this website.
File REST request shape
POST https://<account>.snowflakecomputing.com/v1/data/pipes/<db.schema.rest_pipe>/insertFiles?requestId=<uuid>
Authorization: Bearer <short-lived-token>
Content-Type: application/json
{"files":[{"path":"batch001.json"}]}What to expect and why
The path is relative to the stage URL. Use a separately configured REST pipe. An accepted request means queued, not loaded.
Attach an already configured outbound integration
-- Administrator first provisions the cloud-compatible outbound integration.
-- TYPE=QUEUE, DIRECTION=OUTBOUND; publishing IAM must be configured.
ALTER PIPE M8_AUTO_PIPE SET ERROR_INTEGRATION=<approved_error_integration>;
DESC PIPE M8_AUTO_PIPE;What to expect and why
Requires OPERATE or OWNERSHIP and integration USAGE. Verify delivery in notification history and the receiving topic; do not reuse an inbound integration.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
How would you detect a producer that silently stopped uploading?
Compare your reasoning
Monitor expected arrival frequency and freshness independently of error notifications.
Official sources and curriculum
Module 08 · See module scope