{"openapi":"3.1.0","info":{"title":"quote.dev sandbox API","version":"0.2.0","description":"M2 quotes and manual-capture deposit rail. Idempotency: send Idempotency-Key on every mutating POST; retries with the same key and body replay the original response (Idempotent-Replayed: true) and never create a second hold; mismatched bodies return 409. The header is required on POST /v1/quotes and optional elsewhere today; it will become required on all mutating POSTs in a future API version with advance notice. Sandbox never charges; live payments fail closed without connected-account secrets. quote.dev is not merchant of record. OAuth 2.1 authorization-code grants require S256 PKCE and verified human consent."},"servers":[{"url":"https://api.quote.dev"}],"components":{"securitySchemes":{"agentBearer":{"type":"http","scheme":"bearer","description":"qd_test_ or sandbox-only qd_live_ key; status also accepts poll_token."}},"schemas":{"MintedAgentKey":{"allOf":[{"$ref":"#/components/schemas/AgentKey"},{"type":"object","properties":{"api_key":{"type":"string","description":"Plaintext key. Returned exactly once; only its SHA-256 digest and display hints are stored."},"scopes":{"type":"array","items":{"type":"string"}},"consent_policy":{"type":"string","enum":["legacy","strict_v1"]},"shown_once":{"type":"boolean","enum":[true]},"custodial":{"type":"boolean","enum":[false]}},"required":["api_key","scopes","consent_policy","shown_once","custodial"]}]},"AgentKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key_prefix":{"type":"string"},"key_last4":{"type":["string","null"],"minLength":4,"maxLength":4},"mode":{"type":"string","enum":["sandbox"]},"owner_key":{"type":"boolean"},"allowed_packs":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","revoked","expired"]},"created_at":{"type":["integer","null"]},"expires_at":{"type":"integer"},"revoked_at":{"type":["integer","null"]},"setup":{"type":"boolean","description":"Setup key: expires 15 minutes after minting unless used."},"unused_expires_at":{"type":["integer","null"]},"first_used_at":{"type":["integer","null"]},"last_used_at":{"type":["integer","null"],"description":"Last authenticated use (epoch ms, 10-minute resolution); null if never used."},"spend_caps":{"type":"object","properties":{"max_deposit_authorization_minor":{"type":["integer","null"]},"monthly_deposit_authorization_ceiling_minor":{"type":["integer","null"]}},"required":["max_deposit_authorization_minor","monthly_deposit_authorization_ceiling_minor"],"description":"Per-key caps enforced alongside the agent spend policy; null = agent policy only."}},"required":["id","name","key_prefix","key_last4","mode","owner_key","allowed_packs","status","created_at","expires_at","revoked_at","setup","unused_expires_at","first_used_at","last_used_at","spend_caps"]},"MintAgentKeyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"spend_caps":{"$ref":"#/components/schemas/KeySpendCaps"},"allowed_packs":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"expires_in_days":{"type":"integer","minimum":1,"maximum":30}},"required":["name","allowed_packs"],"additionalProperties":false},"KeySpendCaps":{"type":"object","properties":{"max_deposit_authorization_minor":{"type":"integer","exclusiveMinimum":0,"maximum":100000000},"monthly_deposit_authorization_ceiling_minor":{"type":"integer","exclusiveMinimum":0,"maximum":1000000000}},"additionalProperties":false},"AgentActivity":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["key_created","key_revoked","estimate_created","quote_created","hold_authorized","deposit_captured","hold_released","request_blocked"]},"mode":{"type":"string","enum":["sandbox","live"]},"key_prefix":{"type":["string","null"]},"ref_id":{"type":["string","null"]},"receipt_id":{"type":["string","null"]},"pack_id":{"type":["string","null"]},"amount_minor":{"type":"integer","minimum":0},"currency":{"type":["string","null"]},"detail":{"type":["object","null"],"additionalProperties":{}},"created_at":{"type":"integer"}},"required":["id","kind","mode","key_prefix","ref_id","receipt_id","pack_id","amount_minor","currency","detail","created_at"]},"MintSetupKeyRequest":{"type":"object","properties":{"allowed_packs":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":8},"name":{"type":"string","minLength":1,"maxLength":60},"spend_caps":{"allOf":[{"$ref":"#/components/schemas/KeySpendCaps"},{"description":"Defaults: max_deposit_authorization_minor 25000 (USD 250 per hold), monthly_deposit_authorization_ceiling_minor 100000 (USD 1,000 per rolling 30 days)."}]}},"required":["allowed_packs"],"additionalProperties":false},"RolledOwnerKey":{"type":"object","properties":{"api_key":{"type":"string","description":"New owner key. Returned exactly once; only its SHA-256 digest and display hints are stored."},"key_prefix":{"type":"string"},"key_last4":{"type":["string","null"],"minLength":4,"maxLength":4},"previous_key_prefix":{"type":"string"},"mode":{"type":"string","enum":["test"]},"expires_at":{"type":"integer","description":"Unchanged: rolling never extends the agent lifetime."},"rotated":{"type":"boolean","enum":[true]},"shown_once":{"type":"boolean","enum":[true]},"custodial":{"type":"boolean","enum":[false]},"note":{"type":"string"}},"required":["api_key","key_prefix","key_last4","previous_key_prefix","mode","expires_at","rotated","shown_once","custodial","note"]},"ReplacedLiveKey":{"type":"object","properties":{"api_key":{"type":"string","description":"New qd_live_ key, returned exactly once; only its SHA-256 digest and display hints are stored."},"key_prefix":{"type":"string"},"key_last4":{"type":["string","null"],"minLength":4,"maxLength":4},"previous_key_prefix":{"type":["string","null"]},"mode":{"type":"string","enum":["live"]},"expires_at":{"type":"null","description":"Live keys do not expire; revoke or replace them."},"replaced":{"type":"boolean","enum":[true]},"shown_once":{"type":"boolean","enum":[true]},"custodial":{"type":"boolean","enum":[false]},"note":{"type":"string"}},"required":["api_key","key_prefix","key_last4","previous_key_prefix","mode","expires_at","replaced","shown_once","custodial","note"]},"RevokedLiveKey":{"type":"object","properties":{"revoked":{"type":"boolean","enum":[true]},"key_prefix":{"type":["string","null"]},"key_last4":{"type":["string","null"],"minLength":4,"maxLength":4},"revoked_at":{"type":"integer"},"oauth_tokens_revoked":{"type":"integer"}},"required":["revoked","key_prefix","key_last4","revoked_at","oauth_tokens_revoked"]},"AgentRun":{"type":"object","properties":{"run_id":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"created_at":{"type":"integer"},"last_seen_at":{"type":"integer"},"request_count":{"type":"integer"},"totals":{"type":"object","properties":{"receipts":{"type":"integer"},"estimates":{"type":"integer"},"quotes":{"type":"integer"},"authorized_minor":{"type":"integer"},"captured_minor":{"type":"integer"},"open_holds_minor":{"type":"integer"},"released":{"type":"integer"},"billed_minor":{"type":"integer"},"currency":{"type":["string","null"]}},"required":["receipts","estimates","quotes","authorized_minor","captured_minor","open_holds_minor","released","billed_minor","currency"]},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"short_id":{"type":"string","minLength":1},"state":{"type":"string","enum":["received","estimated","routed","provider_pending","countered","accepted","held","captured","released","failed"]},"estimate_id":{"type":["string","null"]},"quote_id":{"type":["string","null"]},"request_id":{"type":["string","null"],"description":"Consultation or availability request (req_…), when this receipt tracks one."},"pack_id":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"held_minor":{"type":"integer","minimum":0},"billed_minor":{"type":"integer","minimum":0},"currency":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"failure_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"next_action":{"type":["string","null"]},"created_at":{"type":"integer"},"updated_at":{"type":"integer"}},"required":["id","short_id","state","held_minor","billed_minor","currency","mode","created_at","updated_at"]}},"activity":{"type":"array","items":{"$ref":"#/components/schemas/AgentActivity"}},"custodial":{"type":"boolean","enum":[false]},"note":{"type":"string"}},"required":["run_id","mode","created_at","last_seen_at","request_count","totals","receipts","activity","custodial","note"]},"CatalogProviderList":{"type":"object","properties":{"providers":{"type":"array","items":{"$ref":"#/components/schemas/CatalogProvider"}},"count":{"type":"integer"},"total":{"type":"integer"},"next_cursor":{"type":["string","null"]},"unconnected_listings":{"type":"array","items":{"$ref":"#/components/schemas/UnconnectedListing"},"description":"Unclaimed providers: public facts only, unverified, not a quote from this provider. Estimate with listing_id for a ballpark + handoff; holds return 422."},"query":{"type":["string","null"]},"filters":{"type":"object","additionalProperties":{}},"geo":{"type":"object","properties":{"supported":{"type":"boolean","enum":[false]},"requested":{"type":["string","null"]},"note":{"type":"string"}},"required":["supported","requested","note"]},"mode":{"type":"string","enum":["sandbox"]},"fixture_labels":{"type":"boolean","enum":[true]},"note":{"type":"string"}},"required":["providers","count","total","next_cursor","unconnected_listings","query","filters","geo","mode","fixture_labels","note"]},"CatalogProvider":{"allOf":[{"$ref":"#/components/schemas/SandboxProvider"},{"type":"object","properties":{"provider_status":{"$ref":"#/components/schemas/ProviderStatus"},"labels":{"type":"array","items":{"type":"string"}},"pack_names":{"type":"array","items":{"type":"string"}},"links":{"type":"object","properties":{"detail":{"type":"string","format":"uri"},"estimate":{"type":"string"},"catalog":{"type":"string"}},"required":["detail","estimate","catalog"]},"match_fields":{"type":"array","items":{"type":"string"}},"ranking":{"$ref":"#/components/schemas/CatalogRankingSignals"}},"required":["provider_status","labels","pack_names","links"]}]},"ProviderStatus":{"type":"string","enum":["unclaimed","claimed","connected"],"description":"connected: estimates and (sandbox) holds work."},"CatalogRankingSignals":{"type":"object","properties":{"order_by":{"type":"string","enum":["calibration_score"]},"approval_rate":{"type":"object","properties":{"value":{"type":["number","null"]},"source":{"type":"string","enum":["sandbox_fixture","closed_loop","none"]},"sample_size":{"type":"integer","minimum":0},"label":{"type":"string"}},"required":["value","source","sample_size","label"],"description":"Approved decisions / all provider decisions."},"p50_response_seconds":{"type":"object","properties":{"value":{"type":["number","null"]},"source":{"type":"string","enum":["sandbox_fixture","closed_loop","none"]},"sample_size":{"type":"integer","minimum":0},"label":{"type":"string"}},"required":["value","source","sample_size","label"],"description":"Median seconds from quote request to provider decision."},"usable_quote_rate":{"type":"object","properties":{"value":{"type":["number","null"]},"source":{"type":"string","enum":["sandbox_fixture","closed_loop","none"]},"sample_size":{"type":"integer","minimum":0},"label":{"type":"string"}},"required":["value","source","sample_size","label"],"description":"Approved or countered decisions / all decisions."},"invoice_accuracy":{"type":"object","properties":{"value":{"type":["number","null"]},"source":{"type":"string","enum":["sandbox_fixture","closed_loop","none"]},"sample_size":{"type":"integer","minimum":0},"label":{"type":"string"},"metric":{"type":"string","enum":["final_invoice_accuracy"]},"version":{"type":"string","enum":["1.0.0-preview"]},"report_only":{"type":"boolean","enum":[true]},"public_ranking_updated":{"type":"boolean","enum":[false]}},"required":["value","source","sample_size","label","metric","version","report_only","public_ranking_updated"],"description":"Same-scope final-invoice accuracy. Report-only: never changes ranking."}},"required":["order_by","approval_rate","p50_response_seconds","usable_quote_rate","invoice_accuracy"],"description":"Ranking signals; present on every catalog response. Order stays calibration_score."},"SandboxProvider":{"type":"object","properties":{"median_estimate_ms":{"type":"number","minimum":0},"calibration_score":{"type":"number","minimum":0,"maximum":1},"p50_approval_seconds":{"type":"number","minimum":0},"void_rate":{"type":"number","minimum":0,"maximum":1},"dispute_rate":{"type":"number","minimum":0,"maximum":1},"provider_id":{"type":"string"},"name":{"type":"string"},"host":{"type":"string"},"tier":{"type":"string","enum":["A","B","C"]},"active":{"type":"boolean"},"fixture":{"type":"boolean","enum":[true]},"mode":{"type":"string","enum":["sandbox"]},"config_version":{"type":"integer"},"price_multiplier_bps":{"type":"integer","exclusiveMinimum":0},"deposit_policy":{"type":"string"},"pack_ids":{"type":"array","items":{"type":"string"}},"calibration_metric":{"type":"string","enum":["legacy_quote_agreement_v1","legacy_invoice_subtotal_v1"],"default":"legacy_quote_agreement_v1"},"calibration_source":{"type":"string","enum":["closed_loop","sandbox_fixture"],"default":"sandbox_fixture"},"telemetry_label":{"type":"string"},"logo_url":{"type":["string","null"]},"brand_color":{"type":["string","null"]},"website_url":{"type":["string","null"]},"description":{"type":["string","null"]},"services":{"type":["array","null"],"items":{"type":"string"}},"service_area":{"type":["string","null"]},"hours":{"type":["string","null"]},"booking_url":{"type":["string","null"]},"source":{"type":["object","null"],"properties":{"url":{"type":["string","null"]},"fetched_at":{"type":["string","null"]}},"required":["url","fetched_at"]}},"required":["median_estimate_ms","calibration_score","p50_approval_seconds","void_rate","dispute_rate","provider_id","name","host","tier","active","fixture","mode","config_version","price_multiplier_bps","deposit_policy","pack_ids","telemetry_label"]},"UnconnectedListing":{"type":"object","properties":{"listing_id":{"type":"string"},"provider_status":{"$ref":"#/components/schemas/ProviderStatus"},"verification":{"type":"string","enum":["unverified","verified"]},"label":{"type":"string","enum":["unverified, not a quote from this provider","claimed: provider-set rates, non-binding; not connected, no holds"]},"name":{"type":"string"},"locality":{"type":"object","properties":{"city":{"type":"string"},"region":{"type":["string","null"]},"country":{"type":"string"}},"required":["city","region","country"]},"pack_ids":{"type":"array","items":{"type":"string"}},"pack_names":{"type":"array","items":{"type":"string"}},"booking_url":{"type":["string","null"]},"contact_channel_type":{"type":"string","enum":["web_form","phone","email","instagram","none"]},"logo_url":{"type":"null","description":"Always null: no third-party logos until the provider consents."},"fixture":{"type":"boolean"},"labels":{"type":"array","items":{"type":"string"}},"source":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"},"added_at":{"type":"string","format":"date-time"}},"required":["url","type","added_at"]},"hold_allowed":{"type":"boolean","enum":[false]},"links":{"type":"object","properties":{"detail":{"type":"string"},"estimate":{"type":"string"},"claim":{"type":"string"},"opt_out":{"type":"string"}},"required":["detail","estimate","claim","opt_out"]}},"required":["listing_id","provider_status","verification","label","name","locality","pack_ids","pack_names","booking_url","contact_channel_type","logo_url","fixture","labels","source","hold_allowed","links"]},"ProviderListingValidation":{"type":"object","properties":{"valid":{"type":"boolean"},"issues":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["error","warning"]}},"required":["field","description","severity"]}},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}},"pricing":{"type":"array","items":{"type":"object","properties":{"listing_id":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string","enum":["unknown","free","fixed","range","pricing_model","quote_required"]},"price_known":{"type":"boolean"}},"required":["listing_id","name","mode","price_known"]}},"routable_pack_ids":{"type":"array","items":{"type":"string"}}},"required":["valid","issues","missing_fields","suggested_user_questions","pricing","routable_pack_ids"]},"ProviderListing":{"type":"object","properties":{"listing_id":{"type":"string"},"provider_id":{"type":"string"},"provider_name":{"type":"string"},"status":{"type":"string","enum":["draft","in_review","changes_requested","approved","rejected"]},"revision":{"type":"integer"},"expected_revision":{"type":"integer","description":"Send this as expected_revision on the next update or submit."},"uqp_provider_version":{"type":"string"},"mode":{"type":"string","enum":["sandbox"]},"validation":{"$ref":"#/components/schemas/ProviderListingValidation"},"review_url":{"type":["string","null"],"description":"Human-readable review page for the provider. Returned in full only on create; later reads return null."},"live_connect":{"type":"boolean","enum":[false]},"listed_in_catalog":{"type":"boolean","enum":[false]},"next_actions":{"type":"array","items":{"type":"string"}},"created_at":{"type":"integer"},"updated_at":{"type":"integer"},"submitted_at":{"type":["integer","null"]},"listing":{"type":"object","additionalProperties":{}}},"required":["listing_id","provider_id","provider_name","status","revision","expected_revision","uqp_provider_version","mode","validation","review_url","live_connect","listed_in_catalog","next_actions","created_at","updated_at","submitted_at"]},"ActionRequest":{"type":"object","properties":{"request_id":{"type":"string"},"kind":{"type":"string","enum":["consultation","availability"]},"status":{"type":"string","enum":["requested","in_review","accepted","declined","answered","unavailable","cancelled","expired"]},"provider_id":{"type":"string"},"pack_id":{"type":"string"},"estimate_id":{"type":["string","null"]},"mode":{"type":"string","enum":["sandbox"]},"details":{"type":"object","additionalProperties":{}},"response":{"type":["object","null"],"properties":{"source":{"type":"string","enum":["sandbox_simulated","provider","connector"]},"slots":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string"},"end":{"type":"string"}},"required":["start","end"]}},"note":{"type":"string"}},"required":["source"]},"price":{"type":"null","description":"Consultation and availability never carry a price. Use quote_estimate / POST /v1/estimates for pricing."},"connection_required":{"type":"boolean","description":"True when the provider has no availability connector and must answer manually."},"lifecycle":{"type":"array","items":{"type":"string","enum":["requested","in_review","accepted","declined","answered","unavailable","cancelled","expired"]}},"history":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["requested","in_review","accepted","declined","answered","unavailable","cancelled","expired"]},"actor":{"type":"string"},"note":{"type":["string","null"]},"at":{"type":"integer"}},"required":["status","actor","note","at"]}},"next_actions":{"type":"array","items":{"type":"string"}},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1},"short_id":{"type":"string","minLength":1},"state":{"type":"string","enum":["received","estimated","routed","provider_pending","countered","accepted","held","captured","released","failed"]},"estimate_id":{"type":["string","null"]},"quote_id":{"type":["string","null"]},"request_id":{"type":["string","null"],"description":"Consultation or availability request (req_…), when this receipt tracks one."},"pack_id":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"held_minor":{"type":"integer","minimum":0},"billed_minor":{"type":"integer","minimum":0},"currency":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"failure_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"next_action":{"type":["string","null"]},"created_at":{"type":"integer"},"updated_at":{"type":"integer"}},"required":["id","short_id","state","held_minor","billed_minor","currency","mode","created_at","updated_at"]},"run_id":{"type":["string","null"]},"expires_at":{"type":"integer"},"created_at":{"type":"integer"},"updated_at":{"type":"integer"}},"required":["request_id","kind","status","provider_id","pack_id","estimate_id","mode","details","response","price","connection_required","lifecycle","history","next_actions","receipt","run_id","expires_at","created_at","updated_at"]},"ActionRequestCreate":{"type":"object","properties":{"kind":{"type":"string","enum":["consultation","availability"]},"provider_id":{"type":"string","minLength":1,"maxLength":80},"pack_id":{"type":"string","minLength":1,"maxLength":80},"estimate_id":{"type":"string","maxLength":120},"consultation":{"type":"object","properties":{"topic":{"type":"string","minLength":1,"maxLength":500,"description":"What the customer wants reviewed. No names, emails or phone numbers."},"format":{"type":"string","enum":["in_person","video","phone_call","any"],"default":"any"},"factors":{"type":"object","additionalProperties":{},"description":"Pack intake factors gathered so far."}},"required":["topic"],"additionalProperties":false},"availability":{"type":"object","properties":{"window_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},"window_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}]},"duration_minutes":{"type":"integer","minimum":15,"maximum":720},"timezone":{"type":"string","maxLength":64,"description":"IANA zone, e.g. America/Los_Angeles"}},"required":["window_start","window_end"],"additionalProperties":false},"notes":{"type":"string","maxLength":500}},"required":["kind","provider_id","pack_id"],"additionalProperties":false},"Report":{"type":"object","properties":{"report_id":{"type":"string"},"category":{"type":"string","enum":["price_above_quote","invoice_mismatch","hold_not_released","unauthorized_hold","duplicate_hold","service_not_provided","provider_no_show","customer_no_show","quality_issue","safety_concern","listing_inaccurate","other"]},"dispute":{"type":"boolean"},"status":{"type":"string","enum":["open","under_review","resolved","rejected","withdrawn"]},"quote_id":{"type":["string","null"]},"receipt_id":{"type":["string","null"]},"request_id":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"summary":{"type":"string"},"disputed_amount_minor":{"type":["integer","null"]},"currency":{"type":["string","null"]},"resolution_note":{"type":["string","null"]},"mode":{"type":"string","enum":["sandbox","live"]},"run_id":{"type":["string","null"]},"next_actions":{"type":"array","items":{"type":"string"}},"moves_money":{"type":"boolean","enum":[false]},"created_at":{"type":"integer"},"updated_at":{"type":"integer"}},"required":["report_id","category","dispute","status","quote_id","receipt_id","request_id","provider_id","summary","disputed_amount_minor","currency","resolution_note","mode","run_id","next_actions","moves_money","created_at","updated_at"]},"ReportCreate":{"type":"object","properties":{"category":{"type":"string","minLength":1,"maxLength":40},"quote_id":{"type":"string","minLength":1,"maxLength":120},"receipt_id":{"type":"string","minLength":1,"maxLength":120},"request_id":{"type":"string","minLength":1,"maxLength":120},"summary":{"type":"string","minLength":10,"maxLength":1000,"description":"What happened. No customer names, emails or phone numbers."},"disputed_amount_minor":{"type":"integer","minimum":0}},"required":["category","summary"],"additionalProperties":false},"AgentRegisterResponse":{"type":"object","properties":{"api_key":{"type":"string"},"key_prefix":{"type":"string"},"key_last4":{"type":["string","null"],"minLength":4,"maxLength":4},"mode":{"type":"string","enum":["test"]},"scopes":{"type":"array","items":{"type":"string","enum":["estimates:write","quotes:dry_run"]}},"consent_policy":{"type":"string","enum":["legacy","strict_v1"]},"consent_policy_note":{"type":"string","minLength":1},"claim_url":{"type":"string","format":"uri"},"claim_code":{"type":"string"},"poll_token":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["api_key","key_prefix","key_last4","mode","scopes","consent_policy","consent_policy_note","claim_url","claim_code","poll_token","expires_at"]},"AgentRegisterRequest":{"type":"object","properties":{"owner_email":{"type":"string","maxLength":254},"agent_name":{"type":"string","minLength":1,"maxLength":100}},"required":["owner_email","agent_name"]},"RoutedEstimateResponse":{"allOf":[{"$ref":"#/components/schemas/EstimateResponse"},{"type":"object","properties":{"price_range":{"type":"object","properties":{"low":{"type":"integer","minimum":0},"mid":{"type":"integer","minimum":0},"high":{"type":"integer","minimum":0},"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]}},"required":["low","mid","high","min","max","currency","unit"]},"low":{"type":"integer"},"mid":{"type":"integer"},"high":{"type":"integer"},"min":{"type":"integer"},"max":{"type":"integer"},"matched_providers_count":{"type":"integer"},"calibration_score":{"type":"number"},"p50_approval_seconds":{"type":"number"},"void_rate":{"type":"number"},"dispute_rate":{"type":"number"},"calibration_metric":{"type":"string","enum":["legacy_quote_agreement_v1","legacy_invoice_subtotal_v1","mixed_legacy_targets","no_samples"]},"calibration_metrics":{"type":"array","items":{"type":"string","enum":["legacy_quote_agreement_v1","legacy_invoice_subtotal_v1"]}},"calibration_source":{"type":"string","enum":["closed_loop","sandbox_fixture"],"default":"sandbox_fixture"},"fixture":{"type":"boolean","enum":[true]},"candidates":{"type":"array","items":{"type":"object","properties":{"provider_id":{"type":"string"},"tier":{"type":"string","enum":["A","B","C"]},"mode":{"type":"string","enum":["sandbox"]},"fixture":{"type":"boolean","enum":[true]},"low":{"type":"integer"},"mid":{"type":"integer"},"high":{"type":"integer"},"min":{"type":"integer"},"max":{"type":"integer"},"price_range":{"type":"object","properties":{"low":{"type":"integer","minimum":0},"mid":{"type":"integer","minimum":0},"high":{"type":"integer","minimum":0},"min":{"type":"integer","minimum":0},"max":{"type":"integer","minimum":0},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]}},"required":["low","mid","high","min","max","currency","unit"]},"sessions":{"type":"object","properties":{"min":{"type":"integer"},"max":{"type":"integer"},"unit":{"type":"string","enum":["C62"]}},"required":["min","max","unit"]},"deposit_preview":{"type":"object","properties":{"amount":{"type":"integer"},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]},"capture_method":{"type":"string","enum":["manual"]},"charged":{"type":"boolean","enum":[false]}},"required":["amount","currency","unit","capture_method","charged"]},"matched_providers_count":{"type":"integer"},"calibration_score":{"type":"number"},"p50_approval_seconds":{"type":"number"},"void_rate":{"type":"number"},"dispute_rate":{"type":"number"},"calibration_metric":{"type":"string","enum":["legacy_quote_agreement_v1","legacy_invoice_subtotal_v1"]},"calibration_source":{"type":"string","enum":["closed_loop","sandbox_fixture"],"default":"sandbox_fixture"},"assumptions":{"type":"array","items":{"type":"string"}},"fee":{"type":"object","properties":{"amount":{"type":"number","enum":[0]},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]}},"required":["amount","currency","unit"]}},"required":["provider_id","tier","mode","fixture","low","mid","high","min","max","price_range","sessions","deposit_preview","matched_providers_count","calibration_score","p50_approval_seconds","void_rate","dispute_rate","calibration_metric","assumptions","fee"]}}},"required":["matched_providers_count","calibration_score","p50_approval_seconds","void_rate","dispute_rate","calibration_metric","calibration_metrics","fixture","candidates"]}]},"EstimateResponse":{"type":"object","properties":{"schema":{"type":"string","enum":["dev.quote.estimate.v1"]},"estimate_id":{"type":"string","minLength":1,"maxLength":200},"pack_id":{"type":"string","enum":["tattoo/custom","medspa/laser-removal"]},"dry_run":{"type":"boolean","enum":[true]},"mode":{"type":"string","enum":["sandbox"]},"binding":{"type":"boolean","enum":[false]},"price_range":{"type":"object","properties":{"low":{"type":"integer","minimum":0,"maximum":9007199254740991},"mid":{"type":"integer","minimum":0,"maximum":9007199254740991},"high":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"max":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]}},"required":["low","mid","high","min","max","currency","unit"]},"low":{"type":"integer","minimum":0,"maximum":9007199254740991},"mid":{"type":"integer","minimum":0,"maximum":9007199254740991},"high":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"integer","minimum":0,"maximum":9007199254740991},"max":{"type":"integer","minimum":0,"maximum":9007199254740991},"sessions":{"type":"object","properties":{"min":{"type":"integer","exclusiveMinimum":0},"max":{"type":"integer","exclusiveMinimum":0},"unit":{"type":"string","enum":["C62"]}},"required":["min","max","unit"]},"deposit_preview":{"type":"object","properties":{"amount":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]},"capture_method":{"type":"string","enum":["manual"]},"charged":{"type":"boolean","enum":[false]}},"required":["amount","currency","unit","capture_method","charged"]},"fee":{"type":"object","properties":{"amount":{"type":"number","enum":[0]},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]}},"required":["amount","currency","unit"]},"assumptions":{"type":"array","items":{"type":"string"}},"shortlist_cap":{"type":"number","enum":[2]}},"required":["schema","pack_id","dry_run","mode","binding","price_range","low","mid","high","min","max","sessions","deposit_preview","fee","assumptions","shortlist_cap"]},"BallparkResponse":{"type":"object","properties":{"schema":{"type":"string","enum":["dev.quote.ballpark.v1"]},"kind":{"type":"string","enum":["ballpark"]},"estimate_id":{"type":"string"},"listing_id":{"type":"string"},"provider_status":{"type":"string","enum":["unclaimed","claimed"]},"verification":{"type":"string","enum":["unverified","verified"]},"label":{"type":"string","enum":["unverified, not a quote from this provider","claimed: provider-set rates, non-binding; not connected, no holds"]},"binding":{"type":"boolean","enum":[false]},"hold_allowed":{"type":"boolean","enum":[false]},"pack_id":{"type":"string"},"ballpark":{"type":["object","null"],"properties":{"basis":{"type":"string","enum":["pack_illustrative_ballpark","provider_rate_card"]},"low":{"type":"integer","minimum":0},"mid":{"type":"integer","minimum":0},"high":{"type":"integer","minimum":0},"currency":{"type":"string","enum":["USD"]},"unit":{"type":"string","enum":["minor"]}},"required":["basis","low","mid","high","currency","unit"],"description":"null when the pack cannot produce a ballpark; never zero or free."},"sessions":{"type":["object","null"],"properties":{"min":{"type":"integer"},"max":{"type":"integer"},"unit":{"type":"string","enum":["C62"]}},"required":["min","max","unit"]},"handoff":{"$ref":"#/components/schemas/ProviderHandoff"},"assumptions":{"type":"array","items":{"type":"string"}},"next_steps":{"type":"array","items":{"type":"string"}}},"required":["schema","kind","estimate_id","listing_id","provider_status","verification","label","binding","hold_allowed","pack_id","ballpark","sessions","handoff","assumptions","next_steps"]},"ProviderHandoff":{"type":"object","properties":{"method":{"type":"string","enum":["web_form","phone","email","instagram","none"]},"booking_url":{"type":["string","null"]},"contact_url":{"type":["string","null"]},"instructions":{"type":"string"},"intake_summary":{"type":"object","properties":{"text":{"type":"string","description":"Paste-ready plain text of the intake answers for the human to submit themselves."},"fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"label":{"type":"string"},"value":{"type":"string"}},"required":["field","label","value"]}}},"required":["text","fields"]},"submitted_on_behalf":{"type":"boolean","enum":[false]}},"required":["method","booking_url","contact_url","instructions","intake_summary","submitted_on_behalf"]},"EstimateValidationError":{"type":"object","properties":{"error":{"type":"string","enum":["intake_incomplete"]},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"},"enum":{"type":"array","items":{"type":"string"}},"minimum":{"type":"number"},"maximum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"minLength":{"type":"number"},"maxLength":{"type":"number"},"minItems":{"type":"number"}},"required":["field","type","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}}},"required":["error","message","missing_fields","suggested_user_questions"]},"EstimateRequest":{"type":"object","properties":{"pack_id":{"type":"string","enum":["tattoo/custom","medspa/laser-removal","tattoo","laser-removal"]},"dry_run":{"type":"boolean","enum":[true],"default":true},"factors":{"type":"object","additionalProperties":{}},"listing_id":{"type":"string","maxLength":120,"description":"Unclaimed listing from unconnected_listings: returns a labeled ballpark plus handoff, never a provider quote or hold."},"market":{"type":"object","properties":{"country":{"type":"string","enum":["US"]},"postal_code":{"type":"string","pattern":"^\\d{5}(?:-\\d{4})?$"}},"additionalProperties":false}},"required":["pack_id","factors"]},"SandboxPack":{"type":"object","properties":{"median_estimate_ms":{"type":"number","minimum":0},"calibration_score":{"type":"number","minimum":0,"maximum":1},"p50_approval_seconds":{"type":"number","minimum":0},"void_rate":{"type":"number","minimum":0,"maximum":1},"dispute_rate":{"type":"number","minimum":0,"maximum":1},"pack_id":{"type":"string"},"name":{"type":"string"},"aliases":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"config_version":{"type":"integer"},"mode":{"type":"string","enum":["sandbox"]},"fixture":{"type":"boolean","enum":[true]},"sandbox_providers_count":{"type":"integer"},"matched_providers_count":{"type":"integer"},"intake_schema":{"type":"object","additionalProperties":{}},"schema":{"type":"object","additionalProperties":{}},"fields":{"type":"array","items":{"type":"object","additionalProperties":{}}},"consultation_required":{"type":"boolean"},"version":{"type":"string"},"deposit_policy":{"type":"string"},"assumptions":{"type":"array","items":{"type":"string"}}},"required":["median_estimate_ms","calibration_score","p50_approval_seconds","void_rate","dispute_rate","pack_id","name","aliases","description","config_version","mode","fixture","sandbox_providers_count","matched_providers_count","intake_schema","schema","fields","consultation_required","version","deposit_policy","assumptions"]},"OutcomeReceipt":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200},"quote_id":{"type":"string","minLength":1,"maxLength":200},"provider_id":{"type":"string","minLength":1,"maxLength":200},"pack_id":{"type":"string","minLength":1,"maxLength":200},"mode":{"type":"string","enum":["sandbox","live"]},"source":{"type":"string","enum":["stripe","square","crm","custom"]},"final_invoice_subtotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"final_invoice_total":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"actual_duration_minutes":{"type":"number","minimum":0},"sessions_completed":{"type":"integer","minimum":0},"deposit_received":{"type":"integer","minimum":0,"maximum":9007199254740991},"outcome_status":{"type":"string","enum":["completed","cancelled","no_show","disputed"]},"settled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"integer","minimum":0}]},"external_reference_id":{"type":"string","minLength":1,"maxLength":200},"provider_attested":{"type":"boolean"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"integer","minimum":0}]},"replay":{"type":"boolean"},"calibration_preview":{"type":"object","properties":{"calibration_metric":{"type":"string","enum":["legacy_quote_agreement_v1","legacy_invoice_subtotal_v1"]},"simulated":{"type":"boolean"},"scope":{"type":"string","enum":["public_fixture","agent_private","live"]},"provider_id":{"type":"string"},"pack_id":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"simulated_calibration_score":{"type":"number"},"simulated_bias_bps":{"type":"number"},"calibration_score":{"type":"number"},"bias_bps":{"type":"number"},"sample_size":{"type":"number"},"public_ranking_updated":{"type":"boolean"},"note":{"type":"string"}},"required":["simulated","provider_id","pack_id","mode","sample_size","public_ranking_updated"]}},"required":["id","quote_id","provider_id","pack_id","mode","source","final_invoice_subtotal","final_invoice_total","currency","deposit_received","outcome_status","settled_at","provider_attested","created_at","replay"],"additionalProperties":false},"Quote":{"type":"object","properties":{"id":{"type":"string"},"pack_id":{"type":"string"},"provider_id":{"type":"string"},"state":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"locked_total_minor":{"type":"integer"},"deposit_minor":{"type":"integer"},"currency":{"type":"string"},"valid_until":{"type":"string","format":"date-time"},"settlement_rail":{"type":"string","enum":["stripe_connect_direct","byo_provider_checkout","none"]},"merchant_of_record":{"type":"string","enum":["provider"]},"platform_fee_minor":{"type":"integer","minimum":0},"estimate_id":{"type":["string","null"]},"stage1_mid":{"type":"integer","minimum":0},"strict_contract":{"$ref":"#/components/schemas/StrictQuoteState"},"locked_quote":{"$ref":"#/components/schemas/LockedQuote"},"revision_reasons":{"type":"array","items":{"type":"string"}},"counter_notes":{"type":["string","null"],"maxLength":2000},"requires_escalation":{"type":"boolean"},"continue_url":{"type":"string","format":"uri"},"quote_lock":{"anyOf":[{"$ref":"#/components/schemas/SignedQuoteLock"},{"type":"null"}]},"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1},"short_id":{"type":"string","minLength":1},"state":{"type":"string","enum":["received","estimated","routed","provider_pending","countered","accepted","held","captured","released","failed"]},"estimate_id":{"type":["string","null"]},"quote_id":{"type":["string","null"]},"request_id":{"type":["string","null"],"description":"Consultation or availability request (req_…), when this receipt tracks one."},"pack_id":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"held_minor":{"type":"integer","minimum":0},"billed_minor":{"type":"integer","minimum":0},"currency":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"failure_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"next_action":{"type":["string","null"]},"created_at":{"type":"integer"},"updated_at":{"type":"integer"}},"required":["id","short_id","state","held_minor","billed_minor","currency","mode","created_at","updated_at"]}},"required":["id","pack_id","provider_id","state","mode","locked_total_minor","deposit_minor","currency","valid_until","settlement_rail","merchant_of_record","platform_fee_minor","estimate_id","stage1_mid","quote_lock"]},"StrictQuoteState":{"type":"object","properties":{"version":{"type":"string","enum":["strict_v1"]},"scope":{"$ref":"#/components/schemas/ScopeBinding"},"offer":{"$ref":"#/components/schemas/ProviderOffer"},"consent":{"allOf":[{"$ref":"#/components/schemas/CustomerConsent"},{"type":"object","properties":{"accepted_at":{"type":"string","format":"date-time"},"request_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["accepted_at","request_hash"],"additionalProperties":false}]}},"required":["version","scope"],"additionalProperties":false},"ScopeBinding":{"type":"object","properties":{"hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"revision":{"type":"integer","exclusiveMinimum":0}},"required":["hash","revision"],"additionalProperties":false},"ProviderOffer":{"type":"object","properties":{"id":{"type":"string","minLength":1},"revision":{"type":"integer","exclusiveMinimum":0},"quote_id":{"type":"string","minLength":1},"provider_id":{"type":"string","minLength":1},"scope":{"$ref":"#/components/schemas/ScopeBinding"},"total_minor":{"type":"integer","minimum":0,"maximum":100000000},"deposit_minor":{"type":"integer","minimum":0,"maximum":100000000},"currency":{"type":"string","pattern":"^[a-z]{3}$"},"expires_at":{"type":"string","format":"date-time"}},"required":["id","revision","quote_id","provider_id","scope","total_minor","deposit_minor","currency","expires_at"],"additionalProperties":false},"CustomerConsent":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":120},"customer_reference":{"type":"string","minLength":1,"maxLength":120},"accepted":{"type":"boolean","enum":[true]}},"required":["id","customer_reference","accepted"],"additionalProperties":false},"LockedQuote":{"type":"object","properties":{"id":{"type":"string"},"pack_id":{"type":"string"},"provider_id":{"type":"string"},"valid_until":{"type":"string","format":"date-time"},"locked_total_minor":{"type":"integer","minimum":0,"maximum":100000000},"deposit_minor":{"type":"integer","minimum":0,"maximum":100000000},"currency":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"state":{"type":"string"},"payment_intent_id":{"type":["string","null"]},"payment_status":{"type":"string"},"fee_minor":{"type":"integer","minimum":0,"maximum":100000000},"settlement_rail":{"type":"string","enum":["stripe_connect_direct","byo_provider_checkout","none"]},"merchant_of_record":{"type":"string","enum":["provider"]},"platform_fee_minor":{"type":"integer","minimum":0,"maximum":100000000},"strict_contract":{"$ref":"#/components/schemas/StrictQuoteState"}},"required":["id","pack_id","provider_id","valid_until","locked_total_minor","deposit_minor","currency","mode","state","payment_intent_id","payment_status","fee_minor","settlement_rail","merchant_of_record","platform_fee_minor"],"additionalProperties":false},"SignedQuoteLock":{"type":"object","properties":{"capability":{"type":"string","enum":["dev.uqp.quoting.quote_lock"]},"version":{"type":"string","enum":["2026-11-05"]},"mode":{"type":"string","enum":["sandbox","live"]},"kid":{"type":"string"},"signature":{"type":"string"},"quote_lock":{"type":"object","properties":{"quote_id":{"type":"string"},"quote_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"intake_summary":{"type":"string"},"scope_exclusions":{"type":"array","items":{"type":"string"}},"quote_expires_at":{"type":"string","format":"date-time"}},"required":["quote_id","quote_hash","intake_summary","scope_exclusions","quote_expires_at"],"additionalProperties":false},"context":{"type":"object","properties":{"valid_until":{"type":"string","format":"date-time"},"locked_total":{"type":"object","properties":{"amount":{"type":"integer","minimum":0,"maximum":100000000},"currency":{"type":"string"}},"required":["amount","currency"]},"deposit_captured":{"type":"object","properties":{"amount":{"type":"integer","minimum":0,"maximum":100000000},"currency":{"type":"string"}},"required":["amount","currency"]},"payment":{"type":"object","properties":{"terms":{"type":"string"}},"required":["terms"]},"ap2_mandate":{},"ucp_checkout_ext":{}},"required":["valid_until","locked_total","deposit_captured","payment"],"additionalProperties":false}},"required":["capability","version","mode","kid","signature","quote_lock","context"],"additionalProperties":false},"StrictQuoteContract":{"type":"object","properties":{"version":{"type":"string","enum":["strict_v1"]},"scope":{"$ref":"#/components/schemas/ScopeBinding"}},"required":["version","scope"],"additionalProperties":false},"AcceptCounterInput":{"anyOf":[{"$ref":"#/components/schemas/StrictAcceptCounterInput"},{"type":"object","properties":{"payment_method":{"type":"string","maxLength":200}},"additionalProperties":false}]},"StrictAcceptCounterInput":{"type":"object","properties":{"consent_mode":{"type":"string","enum":["strict_v1"]},"offer":{"$ref":"#/components/schemas/ProviderOffer"},"consent":{"$ref":"#/components/schemas/CustomerConsent"},"payment_method":{"type":"string","maxLength":200}},"required":["consent_mode","offer","consent"],"additionalProperties":false}},"parameters":{}},"paths":{"/v1/auth/keys":{"post":{"operationId":"mintAgentKey","tags":["Agents"],"security":[{"agentBearer":[]}],"description":"Mint a pack-scoped sandbox key with the owner key. Plaintext is returned once; only a SHA-256 digest and display hints are stored. Pack scope is enforced on estimates and quotes. No balances or top-ups.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintAgentKeyRequest"}}}},"responses":{"201":{"description":"Key minted; plaintext shown once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintedAgentKey"}}}},"403":{"description":"Owner sandbox key required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Active key limit reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}},"get":{"operationId":"listAgentKeys","tags":["Agents"],"security":[{"agentBearer":[]}],"description":"List the owner key and pack-scoped keys (prefix, packs, status). Never returns plaintext or digests.","responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/AgentKey"}},"current_key":{"type":"object","properties":{"key_prefix":{"type":["string","null"]},"key_last4":{"type":["string","null"],"minLength":4,"maxLength":4},"owner_key":{"type":"boolean"},"allowed_packs":{"type":"array","items":{"type":"string"}}},"required":["key_prefix","key_last4","owner_key","allowed_packs"]}},"required":["keys","current_key"],"additionalProperties":{}}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/auth/keys/{id}/revoke":{"post":{"operationId":"revokeAgentKey","tags":["Agents"],"security":[{"agentBearer":[]}],"description":"Revoke one pack-scoped key. The owner key may revoke any key; a scoped key may revoke only itself. Idempotent.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/AgentKey"},"revoked":{"type":"boolean","enum":[true]}},"required":["key","revoked"]}}}},"404":{"description":"Unknown key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/activity":{"get":{"operationId":"listActivity","tags":["Agents"],"security":[{"agentBearer":[]}],"description":"Append-only agent activity ledger: key events, estimates, quotes, deposit holds, captures and releases, and blocked requests. Paginate with before=<created_at>. Non-custodial.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","exclusiveMinimum":0},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","enum":["key_created","key_revoked","estimate_created","quote_created","hold_authorized","deposit_captured","hold_released","request_blocked"]},"required":false,"name":"kind","in":"query"}],"responses":{"200":{"description":"Activity page","content":{"application/json":{"schema":{"type":"object","properties":{"activity":{"type":"array","items":{"$ref":"#/components/schemas/AgentActivity"}},"next_before":{"type":["integer","null"]},"custodial":{"type":"boolean","enum":[false]}},"required":["activity","next_before","custodial"],"additionalProperties":{}}}}}}}},"/v1/auth/setup-keys":{"post":{"operationId":"mintSetupKey","tags":["Agents"],"security":[{"agentBearer":[]}],"description":"Mint a pack-scoped sandbox setup key with the owner key, for pasting into a new agent. It expires 15 minutes after minting unless used; first use starts a 7-day lifetime. Same limits as pack-scoped keys: no key minting, no provider onboarding, pack scope enforced, agent spend policy applies.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintSetupKeyRequest"}}}},"responses":{"201":{"description":"Setup key minted; plaintext shown once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintedAgentKey"}}}},"403":{"description":"Owner sandbox key required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Active key limit reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/auth/keys/owner/roll":{"post":{"operationId":"rollOwnerKey","tags":["Agents"],"security":[{"agentBearer":[]}],"description":"Replace the owner qd_test_ key. The old key stops working immediately; the new plaintext is returned once (redacted on idempotent replay). Scopes, spend policy, pack-scoped keys, OAuth grants and history are kept; expiry is unchanged.","responses":{"200":{"description":"Owner key rolled; plaintext shown once","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolledOwnerKey"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Owner sandbox key required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/auth/live-key/replace":{"post":{"operationId":"replaceLiveKey","tags":["Agents"],"description":"Owner-only (signed-in human): issue a new non-expiring qd_live_ key for a claimed agent; the old one stops working immediately. Plaintext shown once. Agents cannot call this with a bearer key. Verified Better Auth session cookie for the claiming owner, same-origin. Agent bearer keys are rejected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","minLength":1,"maxLength":100}},"required":["agent_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplacedLiveKey"}}}},"401":{"description":"Human session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Invalid origin or unverified owner","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not owned or not claimed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/auth/live-key/revoke":{"post":{"operationId":"revokeLiveKey","tags":["Agents"],"description":"Owner-only (signed-in human): revoke the qd_live_ key and live OAuth tokens for a claimed agent. Idempotent. Verified Better Auth session cookie for the claiming owner, same-origin. Agent bearer keys are rejected.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","minLength":1,"maxLength":100}},"required":["agent_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedLiveKey"}}}},"401":{"description":"Human session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Invalid origin or unverified owner","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not owned or not claimed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/runs/{id}":{"get":{"operationId":"getRun","tags":["Runs"],"security":[{"agentBearer":[]}],"description":"Run summary: every receipt and ledger row tagged with this X-QuoteDev-Run-Id, with authorized/captured/open-hold/billed totals. Send X-QuoteDev-Run-Id on requests to group them; mutating POSTs without one get a generated run id echoed in the response header.","parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Run summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRun"}}}},"404":{"description":"Unknown run for this agent"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}}}}},"/v1/catalog/providers":{"get":{"operationId":"catalogProviders","tags":["Catalog"],"description":"Public, cacheable provider catalog for agent discovery. No auth. Filters: pack, tier, min_calibration, max_p50_approval_seconds, max_median_estimate_ms, deposit_policy, fixture, status; sort/order. unconnected_listings carries unclaimed providers (unverified, not a quote from this provider); cursor pagination. geo is accepted but not applied yet.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"description":"Free-text match on provider id, name, host and pack names/aliases; all terms must match."},"required":false,"description":"Free-text match on provider id, name, host and pack names/aliases; all terms must match.","name":"q","in":"query"},{"schema":{"type":"string","maxLength":120,"description":"Pack id or alias, e.g. tattoo/custom or laser-removal"},"required":false,"description":"Pack id or alias, e.g. tattoo/custom or laser-removal","name":"pack","in":"query"},{"schema":{"type":"string","enum":["A","B","C"]},"required":false,"name":"tier","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Minimum calibration_score (0–1)."},"required":false,"description":"Minimum calibration_score (0–1).","name":"min_calibration","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"description":"Maximum median studio approval time in seconds."},"required":false,"description":"Maximum median studio approval time in seconds.","name":"max_p50_approval_seconds","in":"query"},{"schema":{"type":["number","null"],"minimum":0},"required":false,"name":"max_median_estimate_ms","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":80,"description":"Case-insensitive substring of the deposit policy text, e.g. \"consultation\"."},"required":false,"description":"Case-insensitive substring of the deposit policy text, e.g. \"consultation\".","name":"deposit_policy","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"fixture=false returns only real studios (none are listed yet)."},"required":false,"description":"fixture=false returns only real studios (none are listed yet).","name":"fixture","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/ProviderStatus"},{"description":"unclaimed returns only unconnected_listings (unverified, not a quote from this provider); connected returns only providers."}]},"required":false,"description":"unclaimed returns only unconnected_listings (unverified, not a quote from this provider); connected returns only providers.","name":"status","in":"query"},{"schema":{"type":"string","maxLength":120,"description":"Accepted but not applied yet: location search is disabled in the sandbox catalog."},"required":false,"description":"Accepted but not applied yet: location search is disabled in the sandbox catalog.","name":"geo","in":"query"},{"schema":{"type":"string","enum":["calibration_score","p50_approval_seconds","median_estimate_ms","void_rate","name","relevance"]},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^\\d{1,6}$","description":"Opaque offset cursor from next_cursor."},"required":false,"description":"Opaque offset cursor from next_cursor.","name":"cursor","in":"query"}],"responses":{"200":{"description":"Catalog page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogProviderList"}}}},"422":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/catalog/search":{"get":{"operationId":"catalogSearch","tags":["Catalog"],"description":"Public free-text provider search (q required) with the same filters as /v1/catalog/providers; results carry match_fields and default to relevance order.","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120,"description":"Free-text match on provider id, name, host and pack names/aliases; all terms must match."},"required":false,"description":"Free-text match on provider id, name, host and pack names/aliases; all terms must match.","name":"q","in":"query"},{"schema":{"type":"string","maxLength":120,"description":"Pack id or alias, e.g. tattoo/custom or laser-removal"},"required":false,"description":"Pack id or alias, e.g. tattoo/custom or laser-removal","name":"pack","in":"query"},{"schema":{"type":"string","enum":["A","B","C"]},"required":false,"name":"tier","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"maximum":1,"description":"Minimum calibration_score (0–1)."},"required":false,"description":"Minimum calibration_score (0–1).","name":"min_calibration","in":"query"},{"schema":{"type":["number","null"],"minimum":0,"description":"Maximum median studio approval time in seconds."},"required":false,"description":"Maximum median studio approval time in seconds.","name":"max_p50_approval_seconds","in":"query"},{"schema":{"type":["number","null"],"minimum":0},"required":false,"name":"max_median_estimate_ms","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":80,"description":"Case-insensitive substring of the deposit policy text, e.g. \"consultation\"."},"required":false,"description":"Case-insensitive substring of the deposit policy text, e.g. \"consultation\".","name":"deposit_policy","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"fixture=false returns only real studios (none are listed yet)."},"required":false,"description":"fixture=false returns only real studios (none are listed yet).","name":"fixture","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/ProviderStatus"},{"description":"unclaimed returns only unconnected_listings (unverified, not a quote from this provider); connected returns only providers."}]},"required":false,"description":"unclaimed returns only unconnected_listings (unverified, not a quote from this provider); connected returns only providers.","name":"status","in":"query"},{"schema":{"type":"string","maxLength":120,"description":"Accepted but not applied yet: location search is disabled in the sandbox catalog."},"required":false,"description":"Accepted but not applied yet: location search is disabled in the sandbox catalog.","name":"geo","in":"query"},{"schema":{"type":"string","enum":["calibration_score","p50_approval_seconds","median_estimate_ms","void_rate","name","relevance"]},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","pattern":"^\\d{1,6}$","description":"Opaque offset cursor from next_cursor."},"required":false,"description":"Opaque offset cursor from next_cursor.","name":"cursor","in":"query"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogProviderList"}}}},"422":{"description":"Missing q or invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/catalog/providers/{id}":{"get":{"operationId":"catalogProvider","tags":["Catalog"],"description":"One catalog provider with labels and links. Public and cacheable.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Provider","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/CatalogProvider"},"mode":{"type":"string","enum":["sandbox"]},"fixture_labels":{"type":"boolean","enum":[true]}},"required":["provider","mode","fixture_labels"]}}}},"404":{"description":"Unknown provider","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/provider-listings/validate":{"post":{"operationId":"validateProviderListing","tags":["Provider onboarding"],"security":[{"agentBearer":[]}],"description":"Validate a UQP provider listing (uqp-provider.yaml 2026-11-09, as JSON) without saving. Missing pricing is reported as unknown, never free.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listing":{"type":"object","additionalProperties":{}}},"required":["listing"],"additionalProperties":false}}}},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{"validation":{"$ref":"#/components/schemas/ProviderListingValidation"},"saved":{"type":"boolean","enum":[false]},"mode":{"type":"string","enum":["sandbox"]}},"required":["validation","saved","mode"]}}}},"422":{"description":"Body is not {listing}","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/provider-listings":{"post":{"operationId":"createProviderListing","tags":["Provider onboarding"],"security":[{"agentBearer":[]}],"description":"Create a sandbox draft listing for one provider. Returns review_url once. Drafts may carry validation issues; submit requires none. Never listed in the catalog and never enables live Connect.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listing":{"type":"object","additionalProperties":{}}},"required":["listing"],"additionalProperties":false}}}},"responses":{"201":{"description":"Draft created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListing"}}}},"409":{"description":"Listing exists for this provider","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}},"422":{"description":"Draft needs uqp_provider_version, provider.id and provider.name","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}},"get":{"operationId":"listProviderListings","tags":["Provider onboarding"],"security":[{"agentBearer":[]}],"description":"List this agent's provider listings.","responses":{"200":{"description":"Listings","content":{"application/json":{"schema":{"type":"object","properties":{"listings":{"type":"array","items":{"$ref":"#/components/schemas/ProviderListing"}},"mode":{"type":"string","enum":["sandbox"]}},"required":["listings","mode"]}}}}}}},"/v1/provider-listings/{id}":{"get":{"operationId":"getProviderListing","tags":["Provider onboarding"],"security":[{"agentBearer":[]}],"description":"Listing status, validation, next_actions and the current document.","parameters":[{"schema":{"type":"string","pattern":"^pl_[a-f0-9]{20}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Listing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListing"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}},"put":{"operationId":"updateProviderListing","tags":["Provider onboarding"],"security":[{"agentBearer":[]}],"description":"Replace the draft document. expected_revision must match or 409 revision_conflict. provider.id is immutable.","parameters":[{"schema":{"type":"string","pattern":"^pl_[a-f0-9]{20}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listing":{"type":"object","additionalProperties":{}},"expected_revision":{"type":"integer","exclusiveMinimum":0}},"required":["listing","expected_revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated draft","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListing"}}}},"409":{"description":"Revision conflict or not editable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/provider-listings/{id}/submit":{"post":{"operationId":"submitProviderListing","tags":["Provider onboarding"],"security":[{"agentBearer":[]}],"description":"Submit the given revision for human review. Requires a valid listing. Review is manual; approval never auto-enables live Connect.","parameters":[{"schema":{"type":"string","pattern":"^pl_[a-f0-9]{20}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expected_revision":{"type":"integer","exclusiveMinimum":0}},"required":["expected_revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"In review","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListing"}}}},"409":{"description":"Revision conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}},"422":{"description":"Listing invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/requests":{"post":{"operationId":"createActionRequest","tags":["Requests"],"security":[{"agentBearer":[]}],"description":"Ask a provider for a consultation (provider review, no price) or availability (date window, no price). Sandbox only. No customer contact fields. Missing details return 422 missing_fields with suggested_user_questions. Public fixtures answer availability with simulated slots.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequestCreate"}}}},"responses":{"201":{"description":"Request created with receipt","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"403":{"description":"Live key or pack scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}}},"required":["error"]}}}},"404":{"description":"Unknown provider","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}}},"required":["error"]}}}},"422":{"description":"Missing or invalid fields","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}}},"required":["error"]}}}},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}}}},"get":{"operationId":"listActionRequests","tags":["Requests"],"security":[{"agentBearer":[]}],"description":"List this agent's consultation and availability requests.","responses":{"200":{"description":"Requests","content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"$ref":"#/components/schemas/ActionRequest"}},"mode":{"type":"string","enum":["sandbox"]}},"required":["requests","mode"]}}}},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}}}}},"/v1/requests/{id}":{"get":{"operationId":"getActionRequest","tags":["Requests"],"security":[{"agentBearer":[]}],"description":"Status, lifecycle, history, next_actions and receipt. Non-terminal requests expire after 7 days.","parameters":[{"schema":{"type":"string","pattern":"^req_[a-f0-9]{24}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}}},"required":["error"]}}}},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}}}}},"/v1/requests/{id}/cancel":{"post":{"operationId":"cancelActionRequest","tags":["Requests"],"security":[{"agentBearer":[]}],"description":"Withdraw an open request. Idempotent once cancelled.","parameters":[{"schema":{"type":"string","pattern":"^req_[a-f0-9]{24}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"409":{"description":"Already closed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}}},"required":["error"]}}}}}}},"/v1/requests/{id}/simulate":{"post":{"operationId":"simulateActionRequest","tags":["Requests"],"security":[{"agentBearer":[]}],"description":"Sandbox fixtures only: simulate the provider decision to test lifecycle branches.","parameters":[{"schema":{"type":"string","pattern":"^req_[a-f0-9]{24}$"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","enum":["in_review","accepted","declined","answered","unavailable"]},"note":{"type":"string","maxLength":300}},"required":["outcome"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionRequest"}}}},"403":{"description":"Not a fixture","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}},"suggested_user_questions":{"type":"array","items":{"type":"string"}}},"required":["error"]}}}}}}},"/v1/reports":{"post":{"operationId":"createReport","tags":["Reports"],"security":[{"agentBearer":[]}],"description":"File a report or dispute about a quote, receipt or consultation/availability request you own. category is one of price_above_quote, invoice_mismatch, hold_not_released, unauthorized_hold, duplicate_hold, service_not_provided, provider_no_show, customer_no_show, quality_issue, safety_concern, listing_inaccurate, other; disputes (price_above_quote, invoice_mismatch, hold_not_released, unauthorized_hold, duplicate_hold, service_not_provided) must reference a quote and may carry disputed_amount_minor up to the locked total. Filing never moves money or starts a chargeback. No customer contact details.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreate"}}}},"responses":{"201":{"description":"Report filed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"404":{"description":"Target not found for this key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}},"409":{"description":"Too many open reports for this target","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}},"422":{"description":"Invalid report","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}},"get":{"operationId":"listReports","tags":["Reports"],"security":[{"agentBearer":[]}],"description":"List your reports (optionally by quote_id or receipt_id) plus the category codes.","parameters":[{"schema":{"type":"string"},"required":false,"name":"quote_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"receipt_id","in":"query"}],"responses":{"200":{"description":"Reports","content":{"application/json":{"schema":{"type":"object","properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/Report"}},"categories":{"type":"array","items":{"type":"string"}},"dispute_categories":{"type":"array","items":{"type":"string"}}},"required":["reports","categories","dispute_categories"]}}}}}}},"/v1/reports/{id}":{"get":{"operationId":"getReport","tags":["Reports"],"security":[{"agentBearer":[]}],"description":"Report status, linked IDs and next_actions.","parameters":[{"schema":{"type":"string","pattern":"^rpt_[a-f0-9]{24}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/reports/{id}/withdraw":{"post":{"operationId":"withdrawReport","tags":["Reports"],"security":[{"agentBearer":[]}],"description":"Withdraw an open report. Idempotent once withdrawn.","parameters":[{"schema":{"type":"string","pattern":"^rpt_[a-f0-9]{24}$"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Withdrawn","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"409":{"description":"Already closed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error"]}}}}}}},"/v1/catalog/listings/{id}":{"get":{"operationId":"catalogListing","tags":["Catalog"],"description":"One unconnected (unclaimed) provider listing: public facts only, unverified, not a quote from this provider. No logo, no prices, no holds.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Listing","content":{"application/json":{"schema":{"type":"object","properties":{"listing":{"$ref":"#/components/schemas/UnconnectedListing"}},"required":["listing"]}}}},"404":{"description":"Unknown or hidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/listings/{id}/opt-out":{"post":{"operationId":"optOutListing","tags":["Catalog"],"description":"Public takedown/opt-out for an unclaimed listing. Hides it immediately and suppresses re-adding. No auth; rate-limited; send no contact details.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}},"additionalProperties":false}}}},"responses":{"200":{"description":"Hidden","content":{"application/json":{"schema":{"type":"object","properties":{"listing_id":{"type":"string"},"status":{"type":"string","enum":["hidden"]},"message":{"type":"string"}},"required":["listing_id","status","message"]}}}},"404":{"description":"Unknown listing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/listings/{id}/claim":{"get":{"operationId":"listingClaimPage","tags":["Claims"],"description":"Human claim page (HTML, noindex) linked as links.claim on every listing.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Claim page","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Unknown listing"}}}},"/v1/listings/{id}/claims":{"post":{"operationId":"startListingClaim","tags":["Claims"],"description":"Start a claim. method domain returns a public challenge plus a one-time claim_token; manual queues operator review. email and sms return 409 channel_pending_decision until a sender/vendor is chosen. A claim on an already-claimed listing is a dispute (manual review).","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["domain","manual","email","sms"]}},"required":["method"]}}}},"responses":{"201":{"description":"Claim started","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"409":{"description":"Channel pending or domain unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid method","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/listings/{id}/claims/{claim}/verify":{"post":{"operationId":"verifyListingClaim","tags":["Claims"],"description":"Verify the domain challenge (https://host/.well-known/quote-dev-verify.txt or DNS TXT _quote-dev.host). Returns a 24-hour claim_session and an illustrative rate-card prefill.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"claim","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"claim_token":{"type":"string"}},"required":["claim_token"]}}}},"responses":{"200":{"description":"Verified","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"401":{"description":"Bad token","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Challenge not found yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/listings/{id}/rate-card":{"put":{"operationId":"putListingRateCard","tags":["Claims"],"description":"Set the provider's own rate per pack (Bearer claim_session). First save marks the listing claimed. Holds stay unavailable until the provider connects their own Stripe.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pack_id":{"type":"string"},"rate_minor":{"type":"integer","exclusiveMinimum":0},"minimum_minor":{"type":["integer","null"],"minimum":0}},"required":["pack_id","rate_minor"]}}}},"responses":{"200":{"description":"Saved","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"401":{"description":"claim_session required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid rate card","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"postListingRateCard","tags":["Claims"],"description":"Form-friendly alias of PUT /v1/listings/{id}/rate-card.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Saved"}}}},"/v1/listings/{id}/requests":{"post":{"operationId":"sendListingRequest","tags":["Claims"],"security":[{"agentBearer":[]}],"description":"Send an intake to a claimed provider (with the person's OK) for one-tap approve/counter/decline via a signed, single-use, 7-day link. Delivery is pending the sender decision; nothing is sent today.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pack_id":{"type":"string"},"factors":{"type":"object","additionalProperties":{}}},"required":["pack_id","factors"]}}}},"responses":{"201":{"description":"Request created","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"409":{"description":"Listing not claimed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/listings/requests/{rid}":{"get":{"operationId":"getListingRequest","tags":["Claims"],"security":[{"agentBearer":[]}],"description":"Read a provider request outcome (awaiting_provider | approved | countered | declined | expired).","parameters":[{"schema":{"type":"string"},"required":true,"name":"rid","in":"path"}],"responses":{"200":{"description":"Request","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}},"404":{"description":"Unknown","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/v1/provider-links/{token}":{"get":{"operationId":"providerLinkPage","tags":["Claims"],"description":"One-tap provider page (HTML, no login). Requires r, e, s query parameters from the signed link.","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Page","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"operationId":"providerLinkDecision","tags":["Claims"],"description":"Record approve, counter (counter_minor or counter_usd) or decline. Single-use; a second use returns the recorded outcome. Never moves money.","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"responses":{"200":{"description":"Recorded"},"409":{"description":"Already answered"},"410":{"description":"Expired"}}}},"/v1/auth/agent-register":{"post":{"operationId":"registerAgent","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterRequest"}}}},"responses":{"201":{"description":"Test key returned once. No human gate.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterResponse"}}}},"400":{"description":"Invalid registration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"429":{"description":"Rate limited; inspect Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}}}}},"/v1/auth/claim/{code}":{"get":{"operationId":"claimPage","tags":["Agents"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Human claim instructions. GET has no side effects.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Unknown or expired claim","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}}}},"post":{"operationId":"claimAgent","tags":["Agents"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"code","in":"path"}],"responses":{"200":{"description":"Claimed by matching authenticated human","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["claimed"]},"mode":{"type":"string","enum":["sandbox"]}},"required":["status","mode"]}}}},"401":{"description":"Authentication required or expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"404":{"description":"Unknown or expired claim","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"409":{"description":"Already claimed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"429":{"description":"Rate limited; inspect Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}}}}},"/v1/auth/agent-status":{"get":{"operationId":"agentStatus","tags":["Agents"],"security":[{"agentBearer":[]}],"responses":{"200":{"description":"Claim status. Live sandbox key is returned exactly once.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","claimed","already_retrieved"]},"mode":{"type":"string","enum":["sandbox"]},"api_key":{"type":"string"},"key_prefix":{"type":"string"},"key_last4":{"type":["string","null"],"minLength":4,"maxLength":4},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"],"description":"null: the qd_live_ key does not expire; the owner revokes or replaces it (TAT-459)."}},"required":["status","mode"]}}}},"401":{"description":"Authentication required or expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"429":{"description":"Rate limited; inspect Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}}}}},"/v1/estimates":{"post":{"operationId":"estimateDryRun","tags":["Estimates"],"security":[{"agentBearer":[]}],"description":"Sandbox estimate across connected providers, or with listing_id for an unclaimed listing a labeled ballpark plus handoff (kind: ballpark; unverified, not a quote from this provider; no hold).","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Recommended on every mutating POST (required on POST /v1/quotes). Same key + same body within 24h replays the stored response with Idempotent-Replayed: true; same key + different body returns 409 idempotency_payload_mismatch."},"required":false,"description":"Recommended on every mutating POST (required on POST /v1/quotes). Same key + same body within 24h replays the stored response with Idempotent-Replayed: true; same key + different body returns 409 idempotency_payload_mismatch.","name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Groups requests into a run; read totals at GET /v1/runs/{id}. Mutating POSTs without one receive a generated run id in the response header."},"required":false,"description":"Groups requests into a run; read totals at GET /v1/runs/{id}. Mutating POSTs without one receive a generated run id in the response header.","name":"X-QuoteDev-Run-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateRequest"}}}},"responses":{"200":{"description":"Deterministic sandbox preview; no funds moved. With listing_id: BallparkResponse.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RoutedEstimateResponse"},{"$ref":"#/components/schemas/BallparkResponse"}]}}}},"401":{"description":"Authentication required or expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"404":{"description":"Unknown listing_id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}},"422":{"description":"Supply missing factors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateValidationError"}}}},"429":{"description":"Rate limited; inspect Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"retry_after":{"type":"number"}},"required":["error"]}}}}}}},"/v1/packs":{"get":{"operationId":"listPacks","tags":["Discovery"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"pack","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pack_id","in":"query"},{"schema":{"type":"string","enum":["A","B","C"]},"required":false,"name":"tier","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"active","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"sandbox","in":"query"},{"schema":{"type":"string","enum":["sandbox","live","active"]},"required":false,"name":"mode","in":"query"}],"responses":{"200":{"description":"Sandbox pack schemas and synthetic calibration metrics","content":{"application/json":{"schema":{"type":"object","properties":{"packs":{"type":"array","items":{"$ref":"#/components/schemas/SandboxPack"}},"mode":{"type":"string","enum":["sandbox"]},"fixture":{"type":"boolean","enum":[true]}},"required":["packs","mode","fixture"]}}}}}}},"/v1/providers":{"get":{"operationId":"listProviders","tags":["Discovery"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"pack","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pack_id","in":"query"},{"schema":{"type":"string","enum":["A","B","C"]},"required":false,"name":"tier","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"active","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"sandbox","in":"query"},{"schema":{"type":"string","enum":["sandbox","live","active"]},"required":false,"name":"mode","in":"query"}],"responses":{"200":{"description":"Explicit sandbox fixture providers; all telemetry is synthetic","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"$ref":"#/components/schemas/SandboxProvider"}},"unconnected_listings":{"type":"array","items":{"$ref":"#/components/schemas/UnconnectedListing"},"description":"Unclaimed listings: public facts only, unverified, not a quote from this provider; no holds."},"mode":{"type":"string","enum":["sandbox"]},"fixture":{"type":"boolean","enum":[true]}},"required":["providers","mode","fixture"]}}}}}}},"/v1/quotes/{id}/outcome":{"post":{"operationId":"recordQuoteOutcome","tags":["Closed-loop telemetry"],"security":[{"agentBearer":[]}],"description":"Provider owner attestation, or the quote’s own agent in sandbox. Supply Idempotency-Key or external_reference_id. API submissions use source custom.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"Idempotency-Key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"final_invoice_subtotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"final_invoice_service_subtotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"final_invoice_total":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"actual_duration_minutes":{"type":"number","minimum":0},"actual_hours":{"type":"number","minimum":0,"maximum":150119987579016.53},"sessions_completed":{"type":"integer","minimum":0},"actual_sessions":{"type":"integer","minimum":0},"deposit_received":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"boolean"}]},"outcome_status":{"type":"string","enum":["completed","cancelled","no_show","disputed"]},"settled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"integer","minimum":0}]},"external_reference_id":{"type":"string","minLength":1,"maxLength":200}},"required":["final_invoice_total","currency","deposit_received","outcome_status","settled_at"],"additionalProperties":false}}}},"responses":{"200":{"description":"Identical outcome replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeReceipt"}}}},"201":{"description":"Outcome persisted and calibration recomputed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeReceipt"}}}},"400":{"description":"Invalid outcome or missing replay identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Invalid credential or webhook signature","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Provider attestation required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Quote or provider not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Replay identity used with a different payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid outcome; inspect missing_fields for actionable corrections","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error","message","missing_fields"]}}}}}}},"/v1/webhooks/outcomes/{source}":{"post":{"operationId":"receiveOutcomeWebhook","tags":["Closed-loop telemetry"],"description":"HMAC-SHA256 over <unix timestamp>.<raw body>, with a 300-second tolerance. Supply Idempotency-Key or external_reference_id; no external payment/CRM calls are made.","parameters":[{"schema":{"type":"string","enum":["stripe","square","crm","custom"]},"required":true,"name":"source","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"Idempotency-Key","in":"header"},{"schema":{"type":"string","minLength":1},"required":true,"name":"X-QuoteDev-Provider","in":"header"},{"schema":{"type":"string","pattern":"^t=\\d+,v1=[a-fA-F0-9]{64}$"},"required":true,"name":"X-QuoteDev-Signature","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"final_invoice_subtotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"final_invoice_service_subtotal":{"type":"integer","minimum":0,"maximum":9007199254740991},"final_invoice_total":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$"},"actual_duration_minutes":{"type":"number","minimum":0},"actual_hours":{"type":"number","minimum":0,"maximum":150119987579016.53},"sessions_completed":{"type":"integer","minimum":0},"actual_sessions":{"type":"integer","minimum":0},"deposit_received":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"boolean"}]},"outcome_status":{"type":"string","enum":["completed","cancelled","no_show","disputed"]},"settled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"integer","minimum":0}]},"external_reference_id":{"type":"string","minLength":1,"maxLength":200},"quote_id":{"type":"string","minLength":1,"maxLength":200}},"required":["final_invoice_total","currency","deposit_received","outcome_status","settled_at","quote_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Identical outcome replay","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeReceipt"}}}},"201":{"description":"Outcome persisted and calibration recomputed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeReceipt"}}}},"400":{"description":"Invalid outcome or missing replay identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Invalid credential or webhook signature","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Provider attestation required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Quote or provider not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Replay identity used with a different payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid outcome; inspect missing_fields for actionable corrections","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"missing_fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"description":{"type":"string"}},"required":["field","description"]}}},"required":["error","message","missing_fields"]}}}}}}},"/v1/providers/{id}/calibration":{"get":{"operationId":"getProviderCalibration","tags":["Closed-loop telemetry"],"description":"PII-free metrics partitioned by mode and pack; defaults to live and the * pack rollup. A zero sample size is not observed calibration.","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["sandbox","live"]},"required":false,"name":"mode","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pack","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pack_id","in":"query"}],"responses":{"200":{"description":"Closed-loop metrics or explicitly labeled fixture fallback","content":{"application/json":{"schema":{"type":"object","properties":{"provider_id":{"type":"string","minLength":1,"maxLength":200},"pack_id":{"type":"string","minLength":1,"maxLength":200},"mode":{"type":"string","enum":["sandbox","live"]},"calibration_score":{"type":"number","minimum":0,"maximum":1},"calibration_metric":{"type":"string","enum":["legacy_quote_agreement_v1","legacy_invoice_subtotal_v1"]},"bias_bps":{"type":"integer"},"p50_approval_seconds":{"type":"number","minimum":0},"counter_rate":{"type":"number","minimum":0,"maximum":1},"void_rate":{"type":"number","minimum":0,"maximum":1},"dispute_rate":{"type":"number","minimum":0,"maximum":1},"completed_outcomes_count":{"type":"integer","minimum":0},"sample_size":{"type":"integer","minimum":0},"source":{"type":"string","enum":["closed_loop","sandbox_fixture"]},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"integer","minimum":0}]}},"required":["provider_id","pack_id","mode","calibration_score","bias_bps","p50_approval_seconds","counter_rate","void_rate","dispute_rate","completed_outcomes_count","sample_size","source"],"additionalProperties":false}}}},"400":{"description":"Invalid outcome or missing replay identity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Quote or provider not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/quotes":{"post":{"description":"Create manual-capture hold; mandatory Idempotency-Key. Tier A application fee is APPLICATION_FEE_BPS of captured deposits (0% at launch); sandbox/void/uncaptured fee zero.","tags":["M2 quotes"],"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"Idempotency-Key","in":"header"},{"schema":{"type":"string"},"required":false,"name":"X-QuoteDev-Run-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pack_id":{"type":"string","minLength":1,"maxLength":120},"provider_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":120},"minItems":1,"maxItems":2},"locked_total_minor":{"type":"integer","exclusiveMinimum":0,"maximum":100000000},"deposit_minor":{"type":"integer","minimum":0,"maximum":100000000},"strict_contract":{"$ref":"#/components/schemas/StrictQuoteContract"},"settlement_rail":{"type":"string","enum":["stripe_connect_direct","byo_provider_checkout","none"]},"estimate_id":{"type":"string","minLength":1,"maxLength":120},"currency":{"type":"string","pattern":"^[A-Za-z]{3}$","default":"usd"},"payment_method":{"type":"string","maxLength":200},"webhook_url":{"type":"string","format":"uri"}},"required":["pack_id","provider_ids","locked_total_minor","deposit_minor"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful operation"},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}},"get":{"description":"List the authenticated agent quotes.","tags":["M2 quotes"],"responses":{"200":{"description":"Successful operation"},"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/v1/quotes/{id}":{"get":{"description":"Get quote state, hold and signed quote_lock.","tags":["M2 quotes"],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"201":{"description":"Created"},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/v1/quotes/{id}/accept-counter":{"post":{"description":"Consent to revised amounts and authorize a new hold.","tags":["M2 quotes"],"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"Idempotency-Key","in":"header"},{"schema":{"type":"string"},"required":false,"name":"X-QuoteDev-Run-Id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptCounterInput"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"201":{"description":"Created"},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/v1/quotes/{id}/authorize":{"post":{"description":"Authorize deposit; live without payment_method returns escalation.","tags":["M2 quotes"],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"201":{"description":"Created"},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/v1/quotes/{id}/cancel":{"post":{"description":"Void uncaptured hold.","tags":["M2 quotes"],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"201":{"description":"Created"},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/v1/providers/connect":{"post":{"description":"Connect provider pricebook and brand draft; no CRM/POS writes.","tags":["M2 quotes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pack_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":4},"provider_id":{"type":"string","minLength":1,"maxLength":120},"stripe_account_id":{"type":"string","pattern":"^acct_[a-zA-Z0-9]+$"},"crm_location_id":{"type":"string","maxLength":120},"pricebook":{"type":"object","additionalProperties":{},"default":{}},"brand":{"type":"object","additionalProperties":{},"default":{}},"settlement_mode":{"type":"string","enum":["stripe_connect_direct","byo_link","byo_provider_checkout","none"],"default":"stripe_connect_direct"},"byo_checkout_url":{"type":"string","format":"uri"}},"required":["provider_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful operation"},"201":{"description":"Created"},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/v1/providers/quotes/{id}/decision":{"post":{"description":"Approve/counter/decline with expiring provider action token.","tags":["M2 quotes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider_id":{"type":"string","minLength":1,"maxLength":200},"decision":{"type":"string","enum":["approve","counter","decline"]},"token":{"type":"string","minLength":1,"maxLength":4096},"counter_low":{"type":"integer","minimum":0,"maximum":9007199254740991},"counter_mid":{"type":"integer","minimum":0,"maximum":9007199254740991},"counter_high":{"type":"integer","minimum":0,"maximum":9007199254740991},"counter_deposit":{"type":"integer","minimum":0,"maximum":9007199254740991},"locked_total_minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"deposit_minor":{"type":"integer","minimum":0,"maximum":9007199254740991},"revision_reasons":{"type":"array","items":{"type":"string","enum":["cover_up_complexity","placement_surcharge","size_adjustment","minimum_shop_rate","color_saturation_detail","session_count_change","artist_tier_rate","schedule_window","skin_condition","scope_clarification","other"]},"maxItems":11,"default":[]},"notes":{"type":["string","null"],"maxLength":2000}},"required":["provider_id","decision","token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful operation"},"201":{"description":"Created"},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/.well-known/jwks.json":{"get":{"description":"Public Ed25519 signing keys; sandbox fixture key is never live trust.","tags":["M2 quotes"],"responses":{"200":{"description":"Successful operation"},"201":{"description":"Created"},"409":{"description":"Idempotency mismatch or invalid transition"},"422":{"description":"Invalid request"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}},"503":{"description":"Payment/signing configuration unavailable; no silent charge"}}}},"/v1/receipts/{id}":{"get":{"description":"Get unified quote receipt; optional ?wait=0..25 long-poll within Workers limits.","tags":["Receipts"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"maximum":25},"required":false,"name":"wait","in":"query"}],"responses":{"200":{"description":"Receipt","content":{"application/json":{"schema":{"type":"object","properties":{"receipt":{"type":"object","properties":{"id":{"type":"string","minLength":1},"short_id":{"type":"string","minLength":1},"state":{"type":"string","enum":["received","estimated","routed","provider_pending","countered","accepted","held","captured","released","failed"]},"estimate_id":{"type":["string","null"]},"quote_id":{"type":["string","null"]},"request_id":{"type":["string","null"],"description":"Consultation or availability request (req_…), when this receipt tracks one."},"pack_id":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"held_minor":{"type":"integer","minimum":0},"billed_minor":{"type":"integer","minimum":0},"currency":{"type":"string"},"mode":{"type":"string","enum":["sandbox","live"]},"failure_stage":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"next_action":{"type":["string","null"]},"created_at":{"type":"integer"},"updated_at":{"type":"integer"}},"required":["id","short_id","state","held_minor","billed_minor","currency","mode","created_at","updated_at"]}},"required":["receipt"]}}}},"404":{"description":"Not found"},"429":{"description":"Rate limited. Wait Retry-After seconds before retrying.","headers":{"Retry-After":{"schema":{"type":"string"},"required":true}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["rate_limited"]},"retry_after":{"type":"integer","exclusiveMinimum":0},"message":{"type":"string"}},"required":["error","retry_after"]}}}}}}},"/v1/auth/spend-policy":{"get":{"description":"Non-custodial per-key deposit-authorization ceilings (no balances/top-ups).","tags":["Spend limits"],"responses":{"200":{"description":"Spend policy","content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string"},"max_deposit_authorization_minor":{"type":"integer","exclusiveMinimum":0},"daily_deposit_authorization_ceiling_minor":{"type":"integer","exclusiveMinimum":0},"monthly_deposit_authorization_ceiling_minor":{"type":"integer","exclusiveMinimum":0},"allowed_packs":{"type":"array","items":{"type":"string"}},"api_rate_limit_per_minute":{"type":"integer","exclusiveMinimum":0},"custodial":{"type":"boolean","enum":[false]},"note":{"type":"string"}},"required":["agent_id","max_deposit_authorization_minor","daily_deposit_authorization_ceiling_minor","monthly_deposit_authorization_ceiling_minor","allowed_packs","api_rate_limit_per_minute","custodial","note"]}}}}}},"put":{"description":"Update non-custodial spend ceilings for this API key.","tags":["Spend limits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"max_deposit_authorization_minor":{"type":"integer","exclusiveMinimum":0},"daily_deposit_authorization_ceiling_minor":{"type":"integer","exclusiveMinimum":0},"monthly_deposit_authorization_ceiling_minor":{"type":"integer","exclusiveMinimum":0},"allowed_packs":{"type":"array","items":{"type":"string"}},"api_rate_limit_per_minute":{"type":"integer","exclusiveMinimum":0}}}}}},"responses":{"200":{"description":"Updated spend policy","content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string"},"max_deposit_authorization_minor":{"type":"integer","exclusiveMinimum":0},"daily_deposit_authorization_ceiling_minor":{"type":"integer","exclusiveMinimum":0},"monthly_deposit_authorization_ceiling_minor":{"type":"integer","exclusiveMinimum":0},"allowed_packs":{"type":"array","items":{"type":"string"}},"api_rate_limit_per_minute":{"type":"integer","exclusiveMinimum":0},"custodial":{"type":"boolean","enum":[false]},"note":{"type":"string"}},"required":["agent_id","max_deposit_authorization_minor","daily_deposit_authorization_ceiling_minor","monthly_deposit_authorization_ceiling_minor","allowed_packs","api_rate_limit_per_minute","custodial","note"]}}}},"422":{"description":"Invalid policy"}}}},"/v1/partner/bounties":{"get":{"tags":["Partners"],"description":"Read-only partner bounty ledger. Live captured deposits only; sandbox keys return no earnings. Payouts are isolated from the deposit rail.","responses":{"200":{"description":"Partner summary and currency-separated earnings"},"401":{"description":"Invalid API key"}}}},"/v1/auth/human/sign-up/email":{"post":{"tags":["Human sessions"],"description":"Better Auth email/password session foundation. Email verification is operator-provisioned in M0; no email is sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":12},"name":{"type":"string"}},"required":["email","password"]}}}},"responses":{"200":{"description":"Authenticated session cookie and user","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","additionalProperties":{}},"token":{"type":"string"}},"required":["user"]}}}},"400":{"description":"Invalid credentials or registration"}}}},"/v1/auth/human/sign-in/email":{"post":{"tags":["Human sessions"],"description":"Better Auth email/password session foundation. Email verification is operator-provisioned in M0; no email is sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":12},"name":{"type":"string"}},"required":["email","password"]}}}},"responses":{"200":{"description":"Authenticated session cookie and user","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","additionalProperties":{}},"token":{"type":"string"}},"required":["user"]}}}},"400":{"description":"Invalid credentials or registration"}}}},"/v1/auth/human/get-session":{"get":{"tags":["Human sessions"],"responses":{"200":{"description":"Current authenticated session or null"}}}},"/v1/auth/human/sign-out":{"post":{"tags":["Human sessions"],"responses":{"200":{"description":"Session ended"}}}},"/.well-known/ucp":{"get":{"operationId":"discover","tags":["Discovery"],"responses":{"200":{"description":"UCP 2026-08-25 discovery","content":{"application/json":{"schema":{"type":"object","additionalProperties":{}}}}}}}},"/oauth/token":{"post":{"operationId":"oauthToken","tags":["OAuth"],"summary":"Exchange an authorization/device code or rotate a refresh token","description":"Authorization-code and device grants require S256 PKCE. Request offline_access during authorization or device authorization to opt into refresh tokens. Each refresh consumes its token and returns a replacement. The family expires 30 days after initial issuance or at agent expiry, whichever is earlier; rotation never extends it. Access tokens last at most one hour, capped by agent/family expiry. Reuse returns invalid_grant and revokes the entire family, including access tokens. Refresh scope may only narrow; serialize refreshes and securely replace stored credentials.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"oneOf":[{"type":"object","properties":{"grant_type":{"type":"string","enum":["authorization_code"]},"client_id":{"type":"string"},"code":{"type":"string"},"redirect_uri":{"type":"string"},"resource":{"type":"string"},"code_verifier":{"type":"string"}},"required":["grant_type","client_id","code","redirect_uri","resource","code_verifier"]},{"type":"object","properties":{"grant_type":{"type":"string","enum":["urn:ietf:params:oauth:grant-type:device_code"]},"client_id":{"type":"string"},"device_code":{"type":"string"},"code_verifier":{"type":"string"}},"required":["grant_type","client_id","device_code","code_verifier"]},{"type":"object","properties":{"grant_type":{"type":"string","enum":["refresh_token"]},"client_id":{"type":"string"},"refresh_token":{"type":"string"},"scope":{"type":"string","description":"Omit to retain scopes, or supply a nonempty space-delimited subset. Scopes cannot expand."}},"required":["grant_type","client_id","refresh_token"]}]}}}},"responses":{"200":{"description":"Scoped bearer token and optional rotating refresh token","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string"},"refresh_token":{"type":"string","description":"Issued only when offline_access was consented to, or on refresh rotation. Store the replacement atomically; never reuse a consumed token."}},"required":["access_token","token_type","expires_in","scope"]}}}},"400":{"description":"invalid_request, invalid_grant, invalid_scope, unsupported_grant_type, authorization_pending, slow_down, access_denied, or expired_token. On slow_down increase polling interval by five seconds.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/oauth/revoke":{"post":{"operationId":"oauthRevoke","tags":["OAuth"],"summary":"Revoke an access token or refresh-token family","description":"Public clients send client_id and token. Access-token prefixes take precedence over token_type_hint; refresh-token prefixes select family revocation even with an incorrect hint. Otherwise token_type_hint=refresh_token selects refresh lookup. Refresh revocation invalidates the whole family and its access tokens. Unknown tokens return 200 without disclosing whether they exist.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"token":{"type":"string"},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]}},"required":["client_id","token"]}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"token":{"type":"string"},"token_type_hint":{"type":"string","enum":["access_token","refresh_token"]}},"required":["client_id","token"]}}}},"responses":{"200":{"description":"Revoked or unknown token"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/oauth/register":{"post":{"operationId":"oauthRegister","tags":["OAuth"],"summary":"Register a public OAuth client","description":"Exact redirect URIs are required for authorization_code. Device-only clients may omit them. Register refresh_token in grant_types when planning offline access. Issuance is governed by owner consent to offline_access in the authorization request, not by registration of refresh_token. Client authentication is none.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string"},"maxItems":10,"default":[]},"client_name":{"type":"string","maxLength":100},"token_endpoint_auth_method":{"type":"string","enum":["none"],"default":"none"},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code","urn:ietf:params:oauth:grant-type:device_code","refresh_token"]},"minItems":1,"default":["authorization_code"],"description":"Register refresh_token alongside authorization_code and/or the device grant. Authorization-code clients require exact redirect URIs."}}}}}},"responses":{"201":{"description":"Registered public client","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string"},"maxItems":10,"default":[]},"client_name":{"type":"string","maxLength":100},"token_endpoint_auth_method":{"type":"string","enum":["none"],"default":"none"},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code","urn:ietf:params:oauth:grant-type:device_code","refresh_token"]},"minItems":1,"default":["authorization_code"],"description":"Register refresh_token alongside authorization_code and/or the device grant. Authorization-code clients require exact redirect URIs."},"client_id":{"type":"string"},"response_types":{"type":"array","items":{"type":"string","enum":["code"]}}},"required":["client_id","response_types"]}}}},"400":{"description":"Invalid client metadata","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/oauth/device_authorization":{"post":{"operationId":"oauthDeviceAuthorization","tags":["OAuth"],"summary":"Start a PKCE device grant","description":"Include offline_access in scope to request refresh tokens after owner approval. Poll /oauth/token no faster than interval seconds. Device codes are single-use and expire after ten minutes.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"scope":{"type":"string"},"resource":{"type":"string"},"code_challenge":{"type":"string"},"code_challenge_method":{"type":"string","enum":["S256"]}},"required":["client_id","scope","resource","code_challenge","code_challenge_method"]}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"scope":{"type":"string"},"resource":{"type":"string"},"code_challenge":{"type":"string"},"code_challenge_method":{"type":"string","enum":["S256"]}},"required":["client_id","scope","resource","code_challenge","code_challenge_method"]}}}},"responses":{"200":{"description":"Device authorization challenge","content":{"application/json":{"schema":{"type":"object","properties":{"device_code":{"type":"string"},"user_code":{"type":"string"},"verification_uri":{"type":"string"},"verification_uri_complete":{"type":"string"},"expires_in":{"type":"integer"},"interval":{"type":"integer"}},"required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"]}}}},"400":{"description":"Invalid request, client, scope, or resource","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"operationId":"oauthAuthorizationServerMetadata","tags":["OAuth"],"summary":"Discover OAuth endpoints, grants, and scopes","responses":{"200":{"description":"Authorization-server metadata","content":{"application/json":{"schema":{"type":"object","properties":{"issuer":{"type":"string"},"authorization_endpoint":{"type":"string"},"token_endpoint":{"type":"string"},"registration_endpoint":{"type":"string"},"device_authorization_endpoint":{"type":"string"},"revocation_endpoint":{"type":"string"},"grant_types_supported":{"type":"array","items":{"type":"string","enum":["authorization_code","urn:ietf:params:oauth:grant-type:device_code","refresh_token"]}},"scopes_supported":{"type":"array","items":{"type":"string","enum":["packs:read","estimates:write","quotes:read","quotes:dry_run","quotes:write","offline_access"]}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string","enum":["none"]}},"revocation_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string","enum":["none"]}},"response_types_supported":{"type":"array","items":{"type":"string","enum":["code"]}},"response_modes_supported":{"type":"array","items":{"type":"string","enum":["query"]}},"code_challenge_methods_supported":{"type":"array","items":{"type":"string","enum":["S256"]}},"service_documentation":{"type":"string"},"client_id_metadata_document_supported":{"type":"boolean","enum":[false]}},"required":["issuer","authorization_endpoint","token_endpoint","registration_endpoint","device_authorization_endpoint","revocation_endpoint","grant_types_supported","scopes_supported","token_endpoint_auth_methods_supported","revocation_endpoint_auth_methods_supported","response_types_supported","response_modes_supported","code_challenge_methods_supported","service_documentation","client_id_metadata_document_supported"]}}}}}}}},"webhooks":{}}