{"openapi":"3.1.0","info":{"title":"Torque Lift API","description":"Read-only access to one tenant's growth loop: actions, pull requests, recommendations, experiments, readouts, the tracking plan and growth accounting.","version":"2026-11-01"},"paths":{"/v1/account":{"get":{"summary":"Get Account","description":"The tenant behind this key: timezone, repo, tracking plan SHA, consent, pilot day.","operationId":"get_account","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/actions":{"get":{"summary":"List Actions","description":"Every action Torque Lift took in the tenant's world, newest first.","operationId":"list_actions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Default 20, at most 100.","default":20,"title":"Limit"},"description":"Default 20, at most 100."},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"An id from the last page.","title":"Starting After"},"description":"An id from the last page."},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,40}$"},{"type":"null"}],"title":"Kind"}},{"name":"log_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^[a-z]{2,8}-\\d{4,}$"},{"type":"null"}],"title":"Log Id"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOf_Action_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/pull_requests":{"get":{"summary":"List pull requests","description":"Pull requests Torque Lift opened in the repo, most recently changed first.","operationId":"list_pull_requests","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Default 20, at most 100.","default":20,"title":"Limit"},"description":"Default 20, at most 100."},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"An id from the last page.","title":"Starting After"},"description":"An id from the last page."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOf_Thread_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/pull_requests/{id}":{"get":{"summary":"Get one pull request","description":"One of the pull requests torque lift opened in the repo, by its action log ID.","operationId":"get_pull_request","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z]{2,8}-\\d{4,}$","title":"Id"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/recommendations":{"get":{"summary":"List recommendations","description":"Tests Torque Lift recommended, most recently changed first.","operationId":"list_recommendations","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Default 20, at most 100.","default":20,"title":"Limit"},"description":"Default 20, at most 100."},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"An id from the last page.","title":"Starting After"},"description":"An id from the last page."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOf_Thread_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/recommendations/{id}":{"get":{"summary":"Get one recommendation","description":"One of the tests torque lift recommended, by its action log ID.","operationId":"get_recommendation","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z]{2,8}-\\d{4,}$","title":"Id"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/experiments":{"get":{"summary":"List experiments","description":"Experiments that ran, with their checks and results, most recently changed first.","operationId":"list_experiments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Default 20, at most 100.","default":20,"title":"Limit"},"description":"Default 20, at most 100."},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"An id from the last page.","title":"Starting After"},"description":"An id from the last page."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOf_Thread_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/experiments/{id}":{"get":{"summary":"Get one experiment","description":"One of the experiments that ran, with their checks and results, by its action log ID.","operationId":"get_experiment","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z]{2,8}-\\d{4,}$","title":"Id"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/incidents":{"get":{"summary":"List incidents","description":"Incidents Torque Lift found in the loop and what it did, most recently changed first.","operationId":"list_incidents","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Default 20, at most 100.","default":20,"title":"Limit"},"description":"Default 20, at most 100."},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"An id from the last page.","title":"Starting After"},"description":"An id from the last page."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOf_Thread_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/incidents/{id}":{"get":{"summary":"Get one incident","description":"One of the incidents torque lift found in the loop and what it did, by its action log ID.","operationId":"get_incident","security":[{"HTTPBearer":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z]{2,8}-\\d{4,}$","title":"Id"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/readouts":{"get":{"summary":"List Readouts","description":"The weekly readouts sent to the tenant, newest first, as Markdown.","operationId":"list_readouts","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Default 20, at most 100.","default":20,"title":"Limit"},"description":"Default 20, at most 100."},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"An id from the last page.","title":"Starting After"},"description":"An id from the last page."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOf_Readout_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/readouts/{week}":{"get":{"summary":"Get Readout","description":"One sent readout, by ISO week (such as 2026-W42).","operationId":"get_readout","security":[{"HTTPBearer":[]}],"parameters":[{"name":"week","in":"path","required":true,"schema":{"type":"string","pattern":"^\\d{4}-W\\d{2}$","title":"Week"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Readout"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/asks":{"get":{"summary":"List Asks","description":"What this tenant's agents asked Torque Lift's MCP server, newest first: the tools\nthey called (argument names only), tools they tried that don't exist, and questions\nthey logged as unanswered. This is everything we keep about it, for 90 days.","operationId":"list_asks","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Default 20, at most 100.","default":20,"title":"Limit"},"description":"Default 20, at most 100."},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"An id from the last page.","title":"Starting After"},"description":"An id from the last page."},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["call","unknown_tool","question"],"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOf_Ask_"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/tracking_plan":{"get":{"summary":"Get Tracking Plan","description":"The tracking plan in force: every event and property the tenant's code may send.","operationId":"get_tracking_plan","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackingPlan"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/tracking_plans/{sha}":{"get":{"summary":"Get Tracking Plan At","description":"The tracking plan as it was at one commit SHA.","operationId":"get_tracking_plan_at","security":[{"HTTPBearer":[]}],"parameters":[{"name":"sha","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{7,64}$","title":"Sha"}},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackingPlan"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/segments":{"get":{"summary":"Get Segments","description":"Who the users are and how they arrived: active or new users by user segment (channel,\nsource, medium, campaign, platform, device, os, language, region, landing_page, and the\nlive ones app_version, browser, browser_version, os_version, sdk_version, consent,\nvariant), one dimension at a time, in the period ending `end` and the one before. A user\nis in one value per dimension (their first-touch value; a live dimension's is the value\nthey had on their last active day in the period for active users, on the day they were\nfirst seen for new users), so a dimension's values add up to everyone. Channel groups the\nsources\n(Organic, Search, Paid, Social, Email, Referral, Other); source is the site or tag\nbehind it.\nA value with fewer than 20 users in both periods is left out (`hidden_values`). Counts\nonly, never a user.","operationId":"get_segments","security":[{"HTTPBearer":[]}],"parameters":[{"name":"grain","in":"query","required":false,"schema":{"enum":["day","week","month"],"type":"string","description":"day, week (7 days) or month (28 days) ending on `end`.","default":"week","title":"Grain"},"description":"day, week (7 days) or month (28 days) ending on `end`."},{"name":"measure","in":"query","required":false,"schema":{"enum":["active","new"],"type":"string","description":"Active users, or new users.","default":"active","title":"Measure"},"description":"Active users, or new users."},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"The period's last day: a Sunday for an ISO week. Default yesterday, the latest closed day.","title":"End"},"description":"The period's last day: a Sunday for an ISO week. Default yesterday, the latest closed day."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segments"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/growth_accounting":{"get":{"summary":"Get Growth Accounting","description":"Active, new, retained, resurrected and churned users per period, with the saved\nquery that produced them (`query`).","operationId":"get_growth_accounting","security":[{"HTTPBearer":[]}],"parameters":[{"name":"grain","in":"query","required":false,"schema":{"type":"string","pattern":"^(day|week|month|l\\d{1,3})$","description":"day, week, month, or a rolling window such as l28.","default":"week","title":"Grain"},"description":"day, week, month, or a rolling window such as l28."},{"name":"bucket","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"An event bucket, or __all__ for overall activity.","default":"__all__","title":"Bucket"},"description":"An event bucket, or __all__ for overall activity."},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Default 90 days ago.","title":"Since"},"description":"Default 90 days ago."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrowthAccounting"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/breaks":{"get":{"summary":"Get Breaks","description":"Whether the nightly break scan has something open, as counts: how many breaks are\nopen, how many hit everyone, how many hit one kind of user and in which trait (never\nwhich value), how many a person marked fixed, how long the oldest has been open and the\nday the last scan read. Read it before explaining a drop or choosing what to test: a\nmetric that is falling for a reason no test caused skews both. It names no segment, no\nmetric and no cause; the console's Insights page has each break's brief.","operationId":"get_breaks","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breaks"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/pipeline":{"get":{"summary":"Get Pipeline","description":"Each step of the loop, from the collector to the pull request: its state, a count, the\nlatest time and notes such as the lag against the 2-hour freshness target. Steps read\nfrom the query layer show as `off` when it isn't connected; the rest come from the\naction log.","operationId":"get_pipeline","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pipeline"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/events":{"get":{"summary":"List Events","description":"Is the tracking working? Every event in the tracking plan, and any other that\narrived, with this week's and today's counts, when it last arrived and the property keys\nit carried: counts and names only, never a value. Arrived events first, newest first.","operationId":"list_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/funnels":{"get":{"summary":"Get Funnel","description":"How many visitors get through a sequence of events, step by step: those who did the\nfirst event in the period, then, within `within` days of that, the next event after it, and\nso on. A visitor is a browser, or the user where a call carries no browser ID. With `by`,\nalso the funnel for each value of a segment dimension. Counts and shares only, never a\nvisitor. Suggested sequences are in list_funnel_suggestions.","operationId":"get_funnel","security":[{"HTTPBearer":[]}],"parameters":[{"name":"step","in":"query","required":true,"schema":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":6,"description":"The funnel's events in order, repeating this parameter: two to six events from the tracking plan (list_events), page routes as they are named there. Other events may happen between steps.","title":"Step"},"description":"The funnel's events in order, repeating this parameter: two to six events from the tracking plan (list_events), page routes as they are named there. Other events may happen between steps."},{"name":"days","in":"query","required":false,"schema":{"type":"integer","description":"Visitors who entered in the last this many days, today included: 7, 28 or 90.","enum":[7,28,90],"default":28,"title":"Days"},"description":"Visitors who entered in the last this many days, today included: 7, 28 or 90."},{"name":"within","in":"query","required":false,"schema":{"type":"integer","description":"Days a visitor has to reach each later step: 1, 7 or 30.","enum":[1,7,30],"default":7,"title":"Within"},"description":"Days a visitor has to reach each later step: 1, 7 or 30."},{"name":"by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Break the funnel down by a segment dimension: the same funnel for the visitors in each value, such as each source. One of channel, source, medium, campaign, platform, device, os, language, region or landing_page, or a segment the tenant added itself, as far as the tenant's settings have it. Values with fewer than 20 visitors entering are left out.","title":"By"},"description":"Break the funnel down by a segment dimension: the same funnel for the visitors in each value, such as each source. One of channel, source, medium, campaign, platform, device, os, language, region or landing_page, or a segment the tenant added itself, as far as the tenant's settings have it. Values with fewer than 20 visitors entering are left out."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Funnel"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/funnels/suggestions":{"get":{"summary":"List Funnel Suggestions","description":"Funnels worth trying, from where visitors went in the last 7 days: the way from the\nbusiest entry event to each event that makes a user active, and the routes visitors take\nmost often from the busiest entry events. Pass a suggestion's `steps` to get_funnel.\nCounts only.","operationId":"list_funnel_suggestions","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelSuggestions"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/quarantine":{"get":{"summary":"List Quarantine","description":"Calls the sink quarantined (never written) in the last 7 days, by reason, most first:\ncounts only.","operationId":"list_quarantine","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuarantineList"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/events/latest":{"get":{"summary":"List Latest Events","description":"The newest calls as they landed in the lake, newest first, each property and context\nvalue checked with the PII filter's own rules: a value it flags is never shown, only its\npath and why. No message or user IDs.","operationId":"list_latest_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"An operator key's tenant to read; refused with a tenant's key.","title":"Torque-Tenant"},"description":"An operator key's tenant to read; refused with a tenant's key."},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandedEventList"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/redeem":{"post":{"summary":"Redeem Setup Code","description":"Spends a one-time setup code for a setup token (shown once).","operationId":"redeem_setup_code","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupRedeem"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupToken"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/setup/pairing":{"post":{"summary":"Make Setup Pairing","description":"A pairing code for a surface that is not the command: 15 minutes, spent once for a\ntoken of its own. Only the command's own token, or Torque Lift, makes one: a surface\ncan't pair another.","operationId":"make_setup_pairing","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupPairing"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/pair":{"post":{"summary":"Pair Setup Surface","description":"Spends a pairing code for a surface token (shown once): `tl_setup_...`, 7 days, this\ntenant's setup only.","operationId":"pair_setup_surface","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupPair"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupToken"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/setup":{"get":{"summary":"Get Setup","description":"The tenant's setup: each step, who acts next, and the links to open.","operationId":"get_setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/wait":{"get":{"summary":"Wait Setup","description":"Holds the request until the setup changes from `after` (a status's `updated`), or\n`seconds` pass, then answers like GET /v1/setup: a driver waiting on someone else's step\nasks again at once instead of polling every few seconds.","operationId":"wait_setup","security":[{"HTTPBearer":[]}],"parameters":[{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"The `updated` of the setup you last saw.","title":"After"},"description":"The `updated` of the setup you last saw."},{"name":"seconds","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"description":"How long to wait at most.","default":30,"title":"Seconds"},"description":"How long to wait at most."},{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/events":{"get":{"summary":"Get Setup Events","description":"Every step change with the server's time, oldest first, and when setup started.","operationId":"get_setup_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupEventList"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/checks":{"put":{"summary":"Put Setup Checks","description":"What the command found in the repo: the PR agent's stack gates and the analytics. With\n`additional`, a repo beyond the tenant's first, kept beside the first one's checks.","operationId":"put_setup_checks","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChecksReport"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/repo":{"put":{"summary":"Put Setup Repo","description":"The repo to add tracking to, for a person with no terminal. Torque Lift reads it once\nthe GitHub App is installed on it and checks it against the PR agent's stack gates, as the\ncommand does in a repo it runs in. 409 when this API can't read a repo, when the repo is\nalready checked and supported, or when another company's setup has it.","operationId":"put_setup_repo","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupRepoGiven"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/aws_account":{"put":{"summary":"Put Setup Aws","description":"The customer's AWS account ID, which Torque Lift's roles for the stack name.","operationId":"put_setup_aws","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupAwsAccount"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/github_app":{"put":{"summary":"Put Setup App","description":"The engineer says the GitHub App is installed on the repo: the first one, or with\n`repo` one added after it. Where the API can ask GitHub (`installations`), GitHub's answer\ndecides: no installation there is a 409, and the installation ID is GitHub's. Otherwise\nthe ID the redirect carried is kept as the engineer's report. For a repo given by name\n(`PUT /v1/setup/repo`), this is when Torque Lift's check of it begins.","operationId":"put_setup_app","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupGithubApp"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/github_sign_in":{"post":{"summary":"Start Setup Github Sign In","description":"Begins a GitHub sign-in for the repo (the first one, or `repo`): the person types the\ncode it answers at github.com/login/device, as the Torque Lift App asks, then setup checks\nit (`POST /v1/setup/github_sign_in/check`). GitHub then says whether they can push to the\nrepo, which a new App installation needs. A sign-in already in progress for the same repo\nis answered again rather than begun twice.","operationId":"start_setup_github_sign_in","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupGithubSignIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSignInStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/github_sign_in/check":{"post":{"summary":"Check Setup Github Sign In","description":"Whether the person has typed the code on GitHub yet, and once they have, who they are\nand whether they can push to the repo. Ask no sooner than `interval` seconds after the\nlast answer: an earlier ask is answered from what is on record, without asking GitHub.","operationId":"check_setup_github_sign_in","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupSignInStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/stack_outputs":{"put":{"summary":"Put Setup Stack","description":"The customer stack's outputs: the bucket and the roles Torque Lift assumes.","operationId":"put_setup_stack","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStackOutputs"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/stack_created":{"put":{"summary":"Put Setup Stack Created","description":"The customer's stack exists: the customer's command saw it complete, or Torque Lift's\nside assumed its writer role. No outputs are sent. They are derived from the AWS\naccount and the link already on record (torque.api.setup.derived_stack_outputs), so the\ncustomer never copies them off the CloudFormation console.","operationId":"put_setup_stack_created","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/history":{"put":{"summary":"Put Setup History","description":"Which tool's history the customer exports to their bucket, or none. For Mixpanel, and\nfor an Amplitude pull, the project too (its secret goes to `history_secret`).","operationId":"put_setup_history","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupHistory"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/history_secret":{"put":{"summary":"Put Setup History Secret","description":"The secret for the history source (a Mixpanel service account's, an Amplitude project's\nsecret key), from the customer's own terminal only. It waits in a file of its own until\nonboarding stores it; no route, log or action log record carries it back.","operationId":"put_setup_history_secret","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupHistorySecret"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}},"delete":{"summary":"Drop Setup History Secret","description":"Onboarding has stored the secret in Torque Lift's secrets store: forget this copy.","operationId":"drop_setup_history_secret","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/history_secret/read":{"post":{"summary":"Read Setup History Secret","description":"Onboarding reads the customer's secret to store it (a POST: the MCP server offers\nonly GETs, so no agent is handed it). An operator's key with `setup:write`.","operationId":"read_setup_history_secret","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupHistorySecretValue"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/console_user":{"put":{"summary":"Put Setup Console User","description":"Names someone to sign in to this tenant's console with GitHub. The API asks GitHub\nwhose account the login is and keeps the numeric ID, so the customer can't name an ID\nthey don't mean. Onboarding copies it to the tenant file; it is a person who runs that.","operationId":"put_setup_console_user","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupConsoleLogin"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}},"/v1/setup/torque":{"put":{"summary":"Put Setup Torque","description":"Torque Lift's side, from onboarding: an operator key with `setup:write` only.","operationId":"put_setup_torque","security":[{"HTTPBearer":[]}],"parameters":[{"name":"Torque-Tenant","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Tenant"}},{"name":"Torque-Version","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Torque-Version"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Torque"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Too Many Requests"}}}}},"components":{"schemas":{"Account":{"properties":{"object":{"type":"string","const":"account","title":"Object","default":"account"},"id":{"type":"string","title":"Id","description":"The tenant ID."},"timezone":{"type":"string","title":"Timezone"},"repo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo"},"plan_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Sha"},"experiments_enabled":{"type":"boolean","title":"Experiments Enabled"},"history_import":{"items":{"type":"string"},"type":"array","title":"History Import"},"consent":{"anyOf":[{"$ref":"#/components/schemas/Consent"},{"type":"null"}]},"pilot":{"anyOf":[{"$ref":"#/components/schemas/Pilot"},{"type":"null"}]}},"type":"object","required":["id","timezone","repo","plan_sha","experiments_enabled","history_import","consent","pilot"],"title":"Account"},"Action":{"properties":{"object":{"type":"string","const":"action","title":"Object","default":"action"},"id":{"type":"string","title":"Id","description":"act-N, its place in the tenant's log, oldest first."},"log_id":{"type":"string","title":"Log Id"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"ts":{"type":"string","title":"Ts"},"actor":{"type":"string","title":"Actor"},"kind":{"type":"string","title":"Kind"},"state":{"type":"string","title":"State"}},"additionalProperties":true,"type":"object","required":["id","log_id","ts","actor","kind","state"],"title":"Action","description":"One action log record: everything Torque Lift did in the customer's world."},"Ask":{"properties":{"object":{"type":"string","const":"ask","title":"Object","default":"ask"},"id":{"type":"string","title":"Id","description":"The time it was logged and its place within that second."},"tenant":{"type":"string","title":"Tenant"},"created":{"type":"string","title":"Created"},"kind":{"type":"string","enum":["call","unknown_tool","question"],"title":"Kind"},"key":{"type":"string","title":"Key","description":"The prefix of the key that asked, never the key."},"tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool","description":"The MCP tool called, or tried and not found."},"args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Args","description":"Argument names the call used, no values."},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome","description":"`ok`, or the error code the call ended in."},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question","description":"What the agent logged as unanswered."},"missing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Missing","description":"What the agent said would have answered it."}},"type":"object","required":["id","tenant","created","kind","key"],"title":"Ask"},"Breaks":{"properties":{"object":{"type":"string","const":"breaks","title":"Object","default":"breaks"},"open":{"type":"integer","title":"Open","description":"Breaks not yet recovered: a metric fell sharply, for everyone or for one kind of user, past what the data and the calendar explain. A break a person marked fixed stays open until the scan sees the metric back."},"hit_everyone":{"type":"integer","title":"Hit Everyone","description":"Of the open ones, the breaks that hit everyone."},"by_dimension":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Dimension","description":"The rest, by the trait they hit (os, region, channel...): a count a trait, never the value, the metric or the cause."},"marked_fixed":{"type":"integer","title":"Marked Fixed","description":"Of the open ones, those a person marked fixed."},"oldest_open_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Oldest Open Days","description":"Days since the longest-open one began."},"recovered_last_30_days":{"type":"integer","title":"Recovered Last 30 Days"},"scanned":{"type":"boolean","title":"Scanned","description":"A scan has run and left its summary. False means no scan yet, not that nothing is broken."},"scanned_through":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scanned Through","description":"The newest closed day the last scan read."}},"type":"object","required":["open","hit_everyone","by_dimension","marked_fixed","oldest_open_days","recovered_last_30_days","scanned","scanned_through"],"title":"Breaks","description":"Whether the nightly break scan has something open, as counts."},"ChecksReport":{"properties":{"repo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo","description":"owner/name, from the git remote."},"app_path":{"type":"string","maxLength":200,"title":"App Path","default":"."},"platform":{"type":"string","enum":["web","android","ios"],"title":"Platform","description":"What the repo holds.","default":"web"},"gates":{"items":{"$ref":"#/components/schemas/Gate"},"type":"array","maxItems":24,"title":"Gates"},"analytics":{"items":{"type":"string","enum":["posthog","mixpanel","segment","amplitude","ga4","other"]},"type":"array","maxItems":6,"title":"Analytics"},"additional":{"type":"boolean","title":"Additional","default":false}},"additionalProperties":false,"type":"object","required":["gates"],"title":"ChecksReport","description":"The body of a checks report. `additional` is a repo beyond the tenant's first: it is kept\nbeside the first repo's checks, not in their place."},"Consent":{"properties":{"attested_by":{"type":"string","title":"Attested By","description":"A role on the customer's side, never a name."},"since":{"type":"string","title":"Since"}},"type":"object","required":["attested_by","since"],"title":"Consent"},"ErrorDetail":{"properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","api_error"],"title":"Type"},"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"}},"type":"object","required":["type","code","message"],"title":"ErrorDetail"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"type":"object","required":["error"],"title":"ErrorResponse"},"EventList":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/TrackedEvent"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"plan_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Sha","description":"The plan the last dbt build loaded."},"since":{"type":"string","title":"Since"},"queries":{"items":{"$ref":"#/components/schemas/QueryCitation"},"type":"array","title":"Queries"}},"type":"object","required":["data","has_more","plan_sha","since","queries"],"title":"EventList"},"Funnel":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/FunnelStep"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"By","description":"The segment dimension the funnel was broken down by, if any."},"segments":{"items":{"$ref":"#/components/schemas/FunnelSegment"},"type":"array","title":"Segments","description":"With `by`: the funnel for each value of that dimension with enough visitors entering to show, biggest first. A visitor is in the value their first call in the last 90 days carried, or unknown."},"hidden_values":{"type":"integer","title":"Hidden Values","description":"With `by`: values left out because fewer than 20 visitors entered, or past the 12 biggest.","default":0},"entered":{"type":"integer","title":"Entered","description":"Visitors who entered: those at step 1."},"converted":{"type":"integer","title":"Converted","description":"Visitors who got through every step."},"since":{"type":"string","title":"Since","description":"The first day a visitor may have entered on (UTC)."},"days":{"type":"integer","title":"Days","description":"Visitors who entered in the last this many days, today included."},"within_days":{"type":"integer","title":"Within Days","description":"Days a visitor has from entering to reach each step."},"queries":{"items":{"$ref":"#/components/schemas/QueryCitation"},"type":"array","title":"Queries"}},"type":"object","required":["data","has_more","entered","converted","since","days","within_days","queries"],"title":"Funnel"},"FunnelSegment":{"properties":{"object":{"type":"string","const":"funnel_segment","title":"Object","default":"funnel_segment"},"id":{"type":"string","title":"Id","description":"The segment value, such as google for the source dimension."},"entered":{"type":"integer","title":"Entered","description":"Visitors in this value who entered at step 1."},"converted":{"type":"integer","title":"Converted","description":"Visitors in this value who got through every step."},"share_converted":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Share Converted","description":"Of those who entered, the share who got through every step (0 to 1)."},"steps":{"items":{"$ref":"#/components/schemas/FunnelSegmentStep"},"type":"array","title":"Steps"}},"type":"object","required":["id","entered","converted","share_converted","steps"],"title":"FunnelSegment"},"FunnelSegmentStep":{"properties":{"position":{"type":"integer","title":"Position","description":"The step's place in the funnel, from 1."},"visitors":{"type":"integer","title":"Visitors","description":"Visitors in this segment value who got this far."},"share_of_entered":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Share Of Entered","description":"Of this value's visitors who entered at step 1, the share who got this far (0 to 1)."}},"type":"object","required":["position","visitors","share_of_entered"],"title":"FunnelSegmentStep"},"FunnelStep":{"properties":{"object":{"type":"string","const":"funnel_step","title":"Object","default":"funnel_step"},"id":{"type":"string","title":"Id","description":"The step's event, as the tracking plan names it."},"position":{"type":"integer","title":"Position","description":"The step's place in the funnel, from 1."},"visitors":{"type":"integer","title":"Visitors","description":"Visitors who got this far."},"share_of_entered":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Share Of Entered","description":"Of the visitors who entered at step 1, the share who got this far (0 to 1); null when nobody entered."},"share_of_previous":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Share Of Previous","description":"Of the visitors at the step before, the share who got here; null at step 1 and when the step before is empty."},"left":{"type":"integer","title":"Left","description":"Visitors at the step before who did not get here."}},"type":"object","required":["id","position","visitors","share_of_entered","share_of_previous","left"],"title":"FunnelStep"},"FunnelSuggestion":{"properties":{"object":{"type":"string","const":"funnel_suggestion","title":"Object","default":"funnel_suggestion"},"steps":{"items":{"type":"string"},"type":"array","title":"Steps","description":"The events, in order: pass them to get_funnel."},"kind":{"type":"string","enum":["goal","path"],"title":"Kind","description":"goal: the way to an event that makes a user active; path: a route visitors commonly take."},"started":{"type":"integer","title":"Started","description":"Sessions in the last 7 days that began with the first event."}},"type":"object","required":["steps","kind","started"],"title":"FunnelSuggestion"},"FunnelSuggestions":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/FunnelSuggestion"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"queries":{"items":{"$ref":"#/components/schemas/QueryCitation"},"type":"array","title":"Queries"}},"type":"object","required":["data","has_more","queries"],"title":"FunnelSuggestions"},"Gate":{"properties":{"name":{"type":"string","title":"Name"},"passed":{"type":"boolean","title":"Passed"},"detail":{"type":"string","maxLength":300,"title":"Detail"}},"additionalProperties":false,"type":"object","required":["name","passed","detail"],"title":"Gate"},"GrowthAccounting":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/GrowthPeriod"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"query":{"$ref":"#/components/schemas/QueryCitation"}},"type":"object","required":["data","has_more","query"],"title":"GrowthAccounting"},"GrowthPeriod":{"properties":{"object":{"type":"string","const":"growth_period","title":"Object","default":"growth_period"},"grain":{"type":"string","title":"Grain"},"bucket":{"type":"string","title":"Bucket"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"},"period_label":{"type":"string","title":"Period Label"},"active":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active"},"new_users":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"New Users"},"retained":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retained"},"resurrected":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resurrected"},"churned":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Churned"},"net_change":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Net Change"},"quick_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quick Ratio"},"retention_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Retention Rate"},"churn_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Churn Rate"},"is_complete":{"type":"boolean","title":"Is Complete"},"is_warmup":{"type":"boolean","title":"Is Warmup"}},"type":"object","required":["grain","bucket","period_start","period_end","period_label","active","new_users","retained","resurrected","churned","net_change","quick_ratio","retention_rate","churn_rate","is_complete","is_warmup"],"title":"GrowthPeriod"},"HistoryEntry":{"properties":{"state":{"type":"string","title":"State"},"ts":{"type":"string","title":"Ts"},"actor":{"type":"string","title":"Actor"}},"type":"object","required":["state","ts","actor"],"title":"HistoryEntry"},"LandedEvent":{"properties":{"object":{"type":"string","const":"landed_event","title":"Object","default":"landed_event"},"type":{"type":"string","title":"Type"},"event":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event"},"received_at":{"type":"string","title":"Received At"},"written_at":{"type":"string","title":"Written At"},"plan_sha":{"type":"string","title":"Plan Sha"},"values_dropped":{"type":"integer","title":"Values Dropped"},"values_blocked":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Values Blocked"},"values":{"items":{"$ref":"#/components/schemas/LandedValue"},"type":"array","title":"Values"}},"type":"object","required":["type","event","received_at","written_at","plan_sha","values_dropped","values_blocked","values"],"title":"LandedEvent","description":"One call as it landed in the lake. No message ID, and a flagged value is never shown."},"LandedEventList":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/LandedEvent"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"findings":{"type":"integer","title":"Findings","description":"Values the write filter should have removed and didn't."},"queries":{"items":{"$ref":"#/components/schemas/QueryCitation"},"type":"array","title":"Queries"}},"type":"object","required":["data","has_more","findings","queries"],"title":"LandedEventList"},"LandedValue":{"properties":{"path":{"type":"string","title":"Path"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Null when the PII check flagged it."},"finding":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finding","description":"Why the PII check flagged it."}},"type":"object","required":["path","text","finding"],"title":"LandedValue"},"ListOf_Action_":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/Action"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"ListOf[Action]"},"ListOf_Ask_":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/Ask"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"ListOf[Ask]"},"ListOf_Readout_":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/Readout"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"ListOf[Readout]"},"ListOf_Thread_":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/Thread"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"ListOf[Thread]"},"Pilot":{"properties":{"kickoff":{"type":"string","title":"Kickoff"},"day":{"type":"integer","title":"Day","description":"Day of the pilot today, 1 on kickoff day."},"length_days":{"type":"integer","title":"Length Days"}},"type":"object","required":["kickoff","day","length_days"],"title":"Pilot"},"Pipeline":{"properties":{"object":{"type":"string","const":"pipeline","title":"Object","default":"pipeline"},"tenant":{"type":"string","title":"Tenant"},"connected":{"type":"boolean","title":"Connected","description":"This tenant's query layer is connected."},"steps":{"items":{"$ref":"#/components/schemas/PipelineStep"},"type":"array","title":"Steps"},"failed":{"items":{"type":"string"},"type":"array","title":"Failed","description":"The saved queries that failed, or `connection`; their steps are `error`."},"queries":{"items":{"$ref":"#/components/schemas/QueryCitation"},"type":"array","title":"Queries"}},"type":"object","required":["tenant","connected","steps","failed","queries"],"title":"Pipeline","description":"Each step of the tenant's loop, from the collector to the pull request."},"PipelineStep":{"properties":{"object":{"type":"string","const":"pipeline_step","title":"Object","default":"pipeline_step"},"name":{"type":"string","title":"Name"},"runs":{"type":"string","title":"Runs","description":"What does the work at this step."},"state":{"type":"string","title":"State","description":"ok; idle (connected, nothing yet); off (not connected); error (its query failed)."},"live":{"type":"boolean","title":"Live","description":"The latest time is within the last 15 minutes."},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"count_label":{"type":"string","title":"Count Label"},"latest":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest","description":"A UTC time, or a day for the lake and growth steps."},"latest_label":{"type":"string","title":"Latest Label"},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"}},"type":"object","required":["name","runs","state","live","count","count_label","latest","latest_label","notes"],"title":"PipelineStep"},"QuarantineList":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/QuarantineReason"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"since":{"type":"string","title":"Since"},"queries":{"items":{"$ref":"#/components/schemas/QueryCitation"},"type":"array","title":"Queries"}},"type":"object","required":["data","has_more","since","queries"],"title":"QuarantineList"},"QuarantineReason":{"properties":{"object":{"type":"string","const":"quarantine_reason","title":"Object","default":"quarantine_reason"},"id":{"type":"string","title":"Id","description":"The reason the sink quarantined the calls."},"calls":{"type":"integer","title":"Calls"}},"type":"object","required":["id","calls"],"title":"QuarantineReason"},"QueryCitation":{"properties":{"name":{"type":"string","title":"Name"},"sha256":{"type":"string","title":"Sha256"},"model":{"type":"string","title":"Model"},"params":{"additionalProperties":{"type":"string"},"type":"object","title":"Params"},"ran_at":{"type":"string","title":"Ran At"}},"type":"object","required":["name","sha256","model","params","ran_at"],"title":"QueryCitation"},"Readout":{"properties":{"object":{"type":"string","const":"readout","title":"Object","default":"readout"},"id":{"type":"string","title":"Id","description":"The ISO week, such as 2026-W42."},"week":{"type":"string","title":"Week"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"markdown":{"type":"string","title":"Markdown"}},"type":"object","required":["id","week","metadata","markdown"],"title":"Readout"},"SegmentValue":{"properties":{"object":{"type":"string","const":"segment_value","title":"Object","default":"segment_value"},"dimension":{"type":"string","title":"Dimension","description":"channel, source, medium, campaign, platform, device, os, language, region, landing_page, app_version, browser, browser_version, os_version, sdk_version, consent or variant."},"value":{"type":"string","title":"Value"},"previous":{"type":"integer","title":"Previous","description":"Users in the period before."},"current":{"type":"integer","title":"Current","description":"Users in the period asked for."}},"type":"object","required":["dimension","value","previous","current"],"title":"SegmentValue"},"Segments":{"properties":{"object":{"type":"string","const":"list","title":"Object","default":"list"},"data":{"items":{"$ref":"#/components/schemas/SegmentValue"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"},"measure":{"type":"string","title":"Measure"},"grain":{"type":"string","title":"Grain"},"period_end":{"type":"string","title":"Period End","description":"The last day of the period asked for."},"previous_period_end":{"type":"string","title":"Previous Period End"},"hidden_values":{"additionalProperties":{"type":"integer"},"type":"object","title":"Hidden Values","description":"Values left out of `data`, by dimension: fewer than 20 users in both periods."},"queries":{"items":{"$ref":"#/components/schemas/QueryCitation"},"type":"array","title":"Queries"}},"type":"object","required":["data","has_more","measure","grain","period_end","previous_period_end","hidden_values","queries"],"title":"Segments"},"SetupAmplitudeSource":{"properties":{"api_key":{"type":"string","pattern":"^[0-9a-f]{32}$","title":"Api Key"},"region":{"type":"string","enum":["us","eu"],"title":"Region","default":"us"}},"type":"object","required":["api_key"],"title":"SetupAmplitudeSource","description":"Which Amplitude project to pull through its Export API. The API key is not secret (it is in\nevery page that sends events); the secret key is given to `put_setup_history_secret`."},"SetupAsk":{"properties":{"field":{"type":"string","enum":["repo","aws_account_id","history","console_login"],"title":"Field","description":"What the answer is for: the body field of the write that takes it."},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options","description":"The answers allowed, or null for free text."}},"type":"object","required":["field","options"],"title":"SetupAsk"},"SetupAwsAccount":{"properties":{"aws_account_id":{"type":"string","pattern":"^[0-9]{12}$","title":"Aws Account Id"}},"type":"object","required":["aws_account_id"],"title":"SetupAwsAccount"},"SetupConsoleLogin":{"properties":{"login":{"type":"string","maxLength":39,"minLength":1,"pattern":"^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$","title":"Login","description":"The GitHub login of someone who should see this tenant in the console."}},"type":"object","required":["login"],"title":"SetupConsoleLogin"},"SetupConsoleUser":{"properties":{"object":{"type":"string","const":"setup_console_user","title":"Object","default":"setup_console_user"},"github_id":{"type":"integer","title":"Github Id","description":"GitHub's numeric user ID, which decides access."},"login":{"type":"string","title":"Login"}},"type":"object","required":["github_id","login"],"title":"SetupConsoleUser"},"SetupEvent":{"properties":{"object":{"type":"string","const":"setup_event","title":"Object","default":"setup_event"},"step":{"type":"string","enum":["repo_checks","aws_account","torque_roles","github_app","aws_stack","history_export","console_access","onboarding"],"title":"Step"},"state":{"type":"string","enum":["done","todo","waiting","blocked","optional"],"title":"State"},"who":{"type":"string","enum":["you","your AWS admin","Torque Lift"],"title":"Who"},"at":{"type":"string","title":"At","description":"When the step took this state, set by the server."}},"type":"object","required":["step","state","who","at"],"title":"SetupEvent"},"SetupEventList":{"properties":{"object":{"type":"string","const":"setup_events","title":"Object","default":"setup_events"},"started":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started","description":"When the setup code was first spent."},"events":{"items":{"$ref":"#/components/schemas/SetupEvent"},"type":"array","title":"Events","description":"Every step change, oldest first."}},"type":"object","required":["started","events"],"title":"SetupEventList"},"SetupGithubApp":{"properties":{"installed":{"type":"boolean","const":true,"title":"Installed"},"installation_id":{"anyOf":[{"type":"integer","maximum":9.223372036854776e+18,"minimum":1.0},{"type":"null"}],"title":"Installation Id","description":"The installation number GitHub puts in the App's Setup URL redirect (`installation_id`). A report, not proof: the API replaces it with GitHub's own answer where it can ask."},"repo":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}/[A-Za-z0-9._-]{1,100}$"},{"type":"null"}],"title":"Repo","description":"A repo added after the first (owner/name); left out, the first repo."}},"type":"object","required":["installed"],"title":"SetupGithubApp"},"SetupGithubSignIn":{"properties":{"repo":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}/[A-Za-z0-9._-]{1,100}$"},{"type":"null"}],"title":"Repo","description":"The repo the person signs in for (owner/name); left out, the first repo."}},"type":"object","title":"SetupGithubSignIn"},"SetupHistory":{"properties":{"source":{"type":"string","enum":["posthog","mixpanel","segment","amplitude","none"],"title":"Source"},"mixpanel":{"anyOf":[{"$ref":"#/components/schemas/SetupMixpanelSource"},{"type":"null"}],"description":"With source mixpanel: the project and service account."},"amplitude":{"anyOf":[{"$ref":"#/components/schemas/SetupAmplitudeSource"},{"type":"null"}],"description":"With source amplitude: the project to pull. Leave out for Amplitude's own S3 destination, which needs no secret."}},"type":"object","required":["source"],"title":"SetupHistory"},"SetupHistorySecret":{"properties":{"secret":{"type":"string","maxLength":512,"minLength":8,"title":"Secret"}},"type":"object","required":["secret"],"title":"SetupHistorySecret","description":"The secret for the history source, typed in the customer's own terminal (never an agent's).\nIt is kept apart from the setup record and never returned to the customer."},"SetupHistorySecretValue":{"properties":{"object":{"type":"string","const":"setup_history_secret","title":"Object","default":"setup_history_secret"},"tenant":{"type":"string","title":"Tenant"},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["tenant","secret"],"title":"SetupHistorySecretValue","description":"What onboarding reads to store the secret in Torque Lift's secrets store."},"SetupLinks":{"properties":{"app_install":{"type":"string","title":"App Install","description":"Where the GitHub App is installed on one repo."},"quick_create":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quick Create","description":"The customer stack's prefilled CloudFormation link, once Torque Lift's roles for the account exist."},"quick_create_short":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quick Create Short","description":"A short link to the same page: it redirects to the prefilled link above, until the stack is created. Given to the same callers, and only when the API knows its public host."},"admin_page":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Page","description":"A page for the customer's AWS admin: only the stack's three actions and a button to the link, nothing to sign in with. Given and ended as `quick_create_short`."}},"type":"object","required":["app_install","quick_create"],"title":"SetupLinks"},"SetupMixpanelSource":{"properties":{"project_id":{"type":"string","pattern":"^[0-9]{1,20}$","title":"Project Id"},"username":{"type":"string","pattern":"^[A-Za-z0-9._@+-]{1,128}$","title":"Username","description":"Service account name."},"residency":{"type":"string","enum":["us","eu","in"],"title":"Residency","default":"us"}},"type":"object","required":["project_id","username"],"title":"SetupMixpanelSource","description":"Which Mixpanel project to read, and the service account to read it as. Not secret."},"SetupNow":{"properties":{"object":{"type":"string","const":"setup_now","title":"Object","default":"setup_now"},"step":{"type":"string","enum":["repo_checks","aws_account","torque_roles","github_app","aws_stack","history_export","console_access","onboarding"],"title":"Step"},"kind":{"type":"string","enum":["do","ask","handoff","wait"],"title":"Kind","description":"do: the driver does it itself; ask: the person answers a question; handoff: a person clicks through one outside screen (the driver never clicks for them); wait: someone else acts."},"who":{"type":"string","enum":["you","your AWS admin","Torque Lift"],"title":"Who"},"say":{"type":"string","title":"Say","description":"One line to show."},"instructions":{"items":{"type":"string"},"type":"array","title":"Instructions","description":"The actions for the person to take, in order: a driver numbers them when there is more than one."},"notes":{"items":{"type":"string"},"type":"array","title":"Notes","description":"Context to show before the actions, one line each."},"ask":{"anyOf":[{"$ref":"#/components/schemas/SetupAsk"},{"type":"null"}],"description":"Set when kind is ask."},"link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link","description":"The one outside screen to open, when kind is handoff."},"expected_seconds":{"type":"integer","title":"Expected Seconds","description":"How long the step usually takes; 0 if unknown."},"seen_by":{"items":{"type":"string","enum":["driver","torque_lift"]},"type":"array","title":"Seen By","description":"Who notices it is done: the driver reports it, or Torque Lift sees it."}},"type":"object","required":["step","kind","who","say","instructions","notes","expected_seconds","seen_by"],"title":"SetupNow","description":"The step to do now, with its wording: what every surface (the command, a coding agent,\na connector, a web page) shows, so the words live here and not in a driver."},"SetupPair":{"properties":{"code":{"type":"string","maxLength":30,"minLength":12,"title":"Code","description":"PAIR-XXXX-XXXX-XXXX"},"label":{"type":"string","enum":["connector","web","agent","other"],"title":"Label","description":"What the surface is, kept with its token and in the log.","default":"other"}},"type":"object","required":["code"],"title":"SetupPair"},"SetupPairing":{"properties":{"object":{"type":"string","const":"setup_pairing","title":"Object","default":"setup_pairing"},"code":{"type":"string","title":"Code","description":"PAIR-XXXX-XXXX-XXXX: shown once, spent once."},"expires":{"type":"string","title":"Expires"}},"type":"object","required":["code","expires"],"title":"SetupPairing"},"SetupRedeem":{"properties":{"code":{"type":"string","maxLength":40,"minLength":20,"title":"Code","description":"TL-XXXXX-XXXXX-XXXXX-XXXXX"}},"type":"object","required":["code"],"title":"SetupRedeem"},"SetupRepo":{"properties":{"object":{"type":"string","const":"setup_repo","title":"Object","default":"setup_repo"},"repo":{"type":"string","title":"Repo","description":"owner/name"},"platform":{"type":"string","enum":["web","android","ios"],"title":"Platform","description":"What the repo holds."},"app_path":{"type":"string","title":"App Path","description":"The app's folder in the repo."},"first":{"type":"boolean","title":"First","description":"The tenant's first repo; the others were added after it."},"supported":{"type":"boolean","title":"Supported","description":"The command's checks of the repo all passed."},"app_installed":{"type":"boolean","title":"App Installed","description":"The engineer says the GitHub App reaches the repo."}},"type":"object","required":["repo","platform","app_path","first","supported","app_installed"],"title":"SetupRepo"},"SetupRepoGiven":{"properties":{"repo":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9-]{0,38}/[A-Za-z0-9._-]{1,100}$","title":"Repo","description":"The repo to add tracking to, owner/name. Torque Lift checks it once the GitHub App is installed on it: for a person with no terminal."},"app_path":{"type":"string","maxLength":200,"title":"App Path","description":"The app's folder in the repo, if it is not at the top.","default":"."}},"additionalProperties":false,"type":"object","required":["repo"],"title":"SetupRepoGiven"},"SetupSignInStatus":{"properties":{"state":{"type":"string","enum":["pending","signed_in","cannot_push"],"title":"State","description":"`pending` until the person has typed the code on GitHub; `signed_in` when GitHub says they can push to the repo; `cannot_push` when it says they can't."},"repo":{"type":"string","title":"Repo"},"user_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Code","description":"While pending: the code the person types on GitHub."},"verification_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Uri","description":"While pending: where they type it (github.com/login/device)."},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At","description":"While pending: when the code stops working."},"interval":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Interval","description":"While pending: seconds to wait before checking again."},"login":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login","description":"Once signed in: their GitHub login."}},"type":"object","required":["state","repo"],"title":"SetupSignInStatus"},"SetupStackOutputs":{"properties":{"outputs":{"additionalProperties":{"type":"string"},"type":"object","maxProperties":10,"title":"Outputs","description":"The stack's outputs, as describe-stacks names them."}},"type":"object","required":["outputs"],"title":"SetupStackOutputs"},"SetupStatus":{"properties":{"object":{"type":"string","const":"setup","title":"Object","default":"setup"},"id":{"type":"string","title":"Id","description":"The tenant ID."},"tenant":{"type":"string","title":"Tenant"},"steps":{"items":{"$ref":"#/components/schemas/SetupStep"},"type":"array","title":"Steps"},"next":{"anyOf":[{"type":"string","enum":["repo_checks","aws_account","torque_roles","github_app","aws_stack","history_export","console_access","onboarding"]},{"type":"null"}],"title":"Next","description":"The first step not done, or null."},"now":{"anyOf":[{"$ref":"#/components/schemas/SetupNow"},{"type":"null"}],"description":"The step to do now and its wording, or null."},"guide":{"items":{"$ref":"#/components/schemas/SetupNow"},"type":"array","title":"Guide","description":"The wording of every step not done, in order, for a driver that walks the steps in its own order."},"done":{"type":"boolean","title":"Done"},"links":{"$ref":"#/components/schemas/SetupLinks"},"repo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Repo","description":"The tenant's first repo: the one checked, or the one given and waiting on its check."},"repos":{"items":{"$ref":"#/components/schemas/SetupRepo"},"type":"array","title":"Repos","description":"The first repo, then each one added."},"console_users":{"items":{"$ref":"#/components/schemas/SetupConsoleUser"},"type":"array","title":"Console Users","description":"The GitHub accounts named to sign in to the console for this tenant."},"owners":{"items":{"$ref":"#/components/schemas/SetupConsoleUser"},"type":"array","title":"Owners","description":"Who signed in to GitHub during setup and can push to the repo they named: onboarding makes them the console's first owners, who add and remove its people."},"aws_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aws Account Id"},"app_installation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Installation Id","description":"The GitHub App's installation on the first repo, once known."},"stack_outputs":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Stack Outputs"},"history":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"History"},"history_source":{"anyOf":[{"$ref":"#/components/schemas/SetupMixpanelSource"},{"$ref":"#/components/schemas/SetupAmplitudeSource"},{"type":"null"}],"title":"History Source","description":"The history source's project, never its secret."},"history_secret_given":{"type":"boolean","title":"History Secret Given","description":"Whether the history source's secret has been given.","default":false},"started":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started","description":"When the setup code was first spent."},"updated":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated"}},"type":"object","required":["id","tenant","steps","next","now","guide","done","links","repo","repos","console_users","aws_account_id","app_installation_id","stack_outputs","history","started","updated"],"title":"SetupStatus","description":"One tenant's setup: each step, who acts next, and the links the command opens."},"SetupStep":{"properties":{"object":{"type":"string","const":"setup_step","title":"Object","default":"setup_step"},"name":{"type":"string","enum":["repo_checks","aws_account","torque_roles","github_app","aws_stack","history_export","console_access","onboarding"],"title":"Name"},"state":{"type":"string","enum":["done","todo","waiting","blocked","optional"],"title":"State","description":"done; todo (someone on the customer's side acts next); waiting (on someone else); blocked (stopped until someone fixes `note`); optional (the customer may do this later: setup is complete without it, and it is shown only when asked for)."},"who":{"type":"string","enum":["you","your AWS admin","Torque Lift"],"title":"Who","description":"Who acts next at this step."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["name","state","who"],"title":"SetupStep"},"SetupToken":{"properties":{"object":{"type":"string","const":"setup_token","title":"Object","default":"setup_token"},"token":{"type":"string","title":"Token","description":"tl_setup_...: shown once; reads and writes this setup only."},"tenant":{"type":"string","title":"Tenant"},"expires":{"type":"string","title":"Expires"}},"type":"object","required":["token","tenant","expires"],"title":"SetupToken"},"Thread":{"properties":{"object":{"type":"string","enum":["pull_request","recommendation","experiment","incident"],"title":"Object"},"id":{"type":"string","title":"Id"},"state":{"type":"string","title":"State"},"created":{"type":"string","title":"Created"},"updated":{"type":"string","title":"Updated"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"details":{"additionalProperties":true,"type":"object","title":"Details"},"history":{"items":{"$ref":"#/components/schemas/HistoryEntry"},"type":"array","title":"History"}},"type":"object","required":["object","id","state","created","updated","parent_id","details","history"],"title":"Thread","description":"Every action log record of one thing (a PR, a recommendation, an experiment, an\nincident), newest state on top. `details` holds the newest value of each field any of its\nrecords set; the action log holds IDs, counts and statistics, never user data."},"Torque":{"properties":{"state":{"type":"string","enum":["waiting","applying","stack_ready","onboarding","onboarded","failed"],"title":"State"},"quick_create_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quick Create Url"},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Note"},"updated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated"}},"additionalProperties":false,"type":"object","required":["state"],"title":"Torque","description":"Torque's side, as onboarding reports it."},"TrackedEvent":{"properties":{"object":{"type":"string","const":"event","title":"Object","default":"event"},"id":{"type":"string","title":"Id","description":"The event's name."},"planned":{"type":"boolean","title":"Planned","description":"In the current tracking plan."},"state":{"type":"string","title":"State","description":"live (last seen within 15 minutes), today, quiet (this week, not today) or missing (not this week)."},"types":{"items":{"type":"string"},"type":"array","title":"Types"},"today":{"type":"integer","title":"Today","description":"Rows received today (UTC)."},"week":{"type":"integer","title":"Week","description":"Rows received in the last 7 UTC days, today included."},"last_received_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Received At"},"property_keys":{"items":{"type":"string"},"type":"array","title":"Property Keys"},"rows_with_drops":{"type":"integer","title":"Rows With Drops","description":"This week's rows the PII filter removed a value from."},"older_plan_rows":{"type":"integer","title":"Older Plan Rows","description":"This week's rows filtered with an older plan."}},"type":"object","required":["id","planned","state","types","today","week","last_received_at","property_keys","rows_with_drops","older_plan_rows"],"title":"TrackedEvent"},"TrackingPlan":{"properties":{"object":{"type":"string","const":"tracking_plan","title":"Object","default":"tracking_plan"},"id":{"type":"string","title":"Id","description":"The plan's commit SHA."},"version":{"type":"integer","title":"Version"},"plan":{"additionalProperties":true,"type":"object","title":"Plan"}},"type":"object","required":["id","version","plan"],"title":"TrackingPlan"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"A secret key, tl_live_...","scheme":"bearer"}}}}