{
  "slug": "stripe-reporting-query-runs-api-v2-runs-sql-over-stripe-data-25775fb0f5fe",
  "title": "Stripe Reporting Query Runs API v2 runs SQL over Stripe data",
  "tools": [
    "stripe"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-22T00:00:00.000Z",
  "announced_at": "2026-04-22T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a workflow needs programmatic analysis of Stripe data, create a Reporting Query Run with SQL and retrieve it to check status and obtain results. Download results through the returned pre-signed URL before it expires after 5 minutes; lifecycle events are listed in the release note.",
    "examples": [
      "curl https://api.stripe.com/v2/data/reporting/query_runs/<query_run_id> \\\n  -H \"Authorization: Bearer <YOUR_SECRET_KEY>\" \\\n  -H \"Stripe-Version: 2026-04-22.preview\""
    ],
    "gotchas": [
      "Version: 2026-04-22.preview",
      "Availability: preview",
      "<query_run_id> (required): ID of the query run to retrieve; the reference example uses a qryrun_ ID.",
      "Authorization: Bearer <YOUR_SECRET_KEY> (required): Bearer authentication using a Stripe secret key.",
      "Stripe-Version (required): API version header; the reference example specifies 2026-04-22.preview.",
      "status: Returned current status: failed, running, or succeeded.",
      "result: Returned result details for a successfully completed query; includes a pre-signed download URL when results are ready.",
      "Prerequisite: A Stripe secret key is required for the documented Bearer-authenticated request.",
      "Prerequisite: Stripe documents a 403 query_run_api_inaccessible error when the API is unavailable to the request, such as when the feature is not enabled or the compartment is not allowed.",
      "Prerequisite: The release note states that result URLs expire after 5 minutes.",
      "Query results are delivered through pre-signed S3 URLs that expire after 5 minutes."
    ]
  },
  "why_it_matters": "For a repository workflow that needs to analyze Stripe data programmatically, run a SQL query against Stripe data and retrieve its status and results.",
  "sources": [
    "https://docs.stripe.com/changelog/dahlia/2026-04-22/reporting-query-runs-api-v2",
    "https://docs.stripe.com/api/v2/data/reporting/query-runs/retrieve?api-version=2026-04-22.preview"
  ],
  "rank": 0.98034,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-tools-20261017",
    "verdict_id": "wave1b-tools-20261017:wave1b-tools-20261017-748df378e2a4a798-0:gate",
    "evidence_hash": "517fea1915f00fb611f4c1a6945a7a5416fef8c5cc1faae235d5900f1625e942"
  },
  "review": {
    "draft_hash": "de0db087d9d7a2113715f88e0381cfbb0378f925fa4117206a1d14de1a8b51d0",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-tools-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.73 (>= 0.6 needed)."
  }
}
