Authenticate using key-pair authentication or OAuth to obtain a JWT or Bearer token; the SQL API does not support username/password auth directly.
Send POST https://{account_identifier}.snowflakecomputing.com/api/v2/statements with header Authorization: Bearer YOUR_TOKEN and a JSON body containing {"statement": "SELECT ...", "warehouse": "WH_NAME", "database": "DB", "schema": "PUBLIC"}.
If the statement does not complete within the synchronous timeout, the response returns HTTP 202 with a statementHandle field.
Poll GET /api/v2/statements/{statementHandle} until the status field is success or failed.
Retrieve result pages via GET /api/v2/statements/{statementHandle}?partition=N for large result sets, incrementing the partition index.
Known gotchas
The account identifier in the URL must use underscores not hyphens (org_name-account_name becomes org_name-account_name but the host uses the correct locator format); verify the exact locator from your Snowflake account URL.
DDL and DML statements are supported but each request may contain only one statement; semicolon-separated multi-statement input is rejected.
The JWT token generated from the private key has a short expiry (typically 1 hour); refresh it before it expires to avoid 401 errors mid-pipeline.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp