{
  "components": {
    "schemas": {
      "AddSeatsRequest": {
        "properties": {
          "additional_seats": {
            "title": "Additional Seats",
            "type": "integer"
          }
        },
        "required": [
          "additional_seats"
        ],
        "title": "AddSeatsRequest",
        "type": "object"
      },
      "AddSeatsResponse": {
        "properties": {
          "extra_seats": {
            "title": "Extra Seats",
            "type": "integer"
          },
          "seat_limit": {
            "title": "Seat Limit",
            "type": "integer"
          }
        },
        "required": [
          "extra_seats",
          "seat_limit"
        ],
        "title": "AddSeatsResponse",
        "type": "object"
      },
      "AffectedRepository": {
        "description": "A repository affected by a change to the source repository.",
        "properties": {
          "confidence": {
            "title": "Confidence",
            "type": "number"
          },
          "depth": {
            "title": "Depth",
            "type": "integer"
          },
          "full_path": {
            "title": "Full Path",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "full_path",
          "depth",
          "confidence"
        ],
        "title": "AffectedRepository",
        "type": "object"
      },
      "ApiKeyResponse": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Key"
          },
          "last_used_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "prefix": {
            "title": "Prefix",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "last_used_at",
          "created_at",
          "revoked_at"
        ],
        "title": "ApiKeyResponse",
        "type": "object"
      },
      "ArtifactConsumer": {
        "description": "A repository that consumes an artifact.",
        "properties": {
          "import_count": {
            "default": 1,
            "title": "Import Count",
            "type": "integer"
          },
          "is_latest": {
            "title": "Is Latest",
            "type": "boolean"
          },
          "repository": {
            "$ref": "#/components/schemas/ArtifactConsumerRepo"
          },
          "source_file": {
            "title": "Source File",
            "type": "string"
          },
          "source_line": {
            "title": "Source Line",
            "type": "integer"
          },
          "version_constraint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version Constraint"
          }
        },
        "required": [
          "repository",
          "version_constraint",
          "source_file",
          "source_line",
          "is_latest"
        ],
        "title": "ArtifactConsumer",
        "type": "object"
      },
      "ArtifactConsumerRepo": {
        "description": "Minimal repository reference embedded in a consumer row.",
        "properties": {
          "full_path": {
            "title": "Full Path",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "full_path"
        ],
        "title": "ArtifactConsumerRepo",
        "type": "object"
      },
      "ArtifactConsumersResponse": {
        "description": "All consumers of a specific artifact.",
        "properties": {
          "artifact": {
            "$ref": "#/components/schemas/ArtifactResponse"
          },
          "consumers": {
            "items": {
              "$ref": "#/components/schemas/ArtifactConsumer"
            },
            "title": "Consumers",
            "type": "array"
          },
          "consumers_lagging": {
            "title": "Consumers Lagging",
            "type": "integer"
          },
          "consumers_on_latest": {
            "title": "Consumers On Latest",
            "type": "integer"
          },
          "latest_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Version"
          },
          "total_consumers": {
            "title": "Total Consumers",
            "type": "integer"
          }
        },
        "required": [
          "artifact",
          "consumers",
          "total_consumers",
          "consumers_on_latest",
          "consumers_lagging",
          "latest_version"
        ],
        "title": "ArtifactConsumersResponse",
        "type": "object"
      },
      "ArtifactResponse": {
        "description": "An artifact (Docker image, Python package, Terraform module, etc.).",
        "properties": {
          "artifact_type": {
            "title": "Artifact Type",
            "type": "string"
          },
          "connected_org_id": {
            "format": "uuid",
            "title": "Connected Org Id",
            "type": "string"
          },
          "consumer_count": {
            "default": 0,
            "title": "Consumer Count",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_orphan": {
            "default": false,
            "title": "Is Orphan",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "registry_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registry Url"
          },
          "source_repository": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ArtifactSourceRepo"
              },
              {
                "type": "null"
              }
            ]
          },
          "source_repository_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Repository Id"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "id",
          "connected_org_id",
          "artifact_type",
          "name",
          "source_repository_id",
          "registry_url",
          "version",
          "created_at",
          "updated_at"
        ],
        "title": "ArtifactResponse",
        "type": "object"
      },
      "ArtifactSourceRepo": {
        "description": "Minimal representation of the repository that produces an artifact.",
        "properties": {
          "full_path": {
            "title": "Full Path",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "full_path"
        ],
        "title": "ArtifactSourceRepo",
        "type": "object"
      },
      "ArtifactVersionEntry": {
        "description": "A specific version of an artifact seen across the org.",
        "properties": {
          "consumer_count": {
            "title": "Consumer Count",
            "type": "integer"
          },
          "version_constraint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version Constraint"
          }
        },
        "required": [
          "version_constraint",
          "consumer_count"
        ],
        "title": "ArtifactVersionEntry",
        "type": "object"
      },
      "AttachPaymentMethodRequest": {
        "properties": {
          "payment_method_id": {
            "title": "Payment Method Id",
            "type": "string"
          },
          "set_as_default": {
            "default": true,
            "title": "Set As Default",
            "type": "boolean"
          }
        },
        "required": [
          "payment_method_id"
        ],
        "title": "AttachPaymentMethodRequest",
        "type": "object"
      },
      "AttachPaymentMethodResponse": {
        "properties": {
          "is_default": {
            "title": "Is Default",
            "type": "boolean"
          },
          "payment_method": {
            "$ref": "#/components/schemas/PaymentMethodInfo"
          }
        },
        "required": [
          "payment_method",
          "is_default"
        ],
        "title": "AttachPaymentMethodResponse",
        "type": "object"
      },
      "BillingHistoryEvent": {
        "properties": {
          "amount": {
            "title": "Amount",
            "type": "integer"
          },
          "created": {
            "format": "date-time",
            "title": "Created",
            "type": "string"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "description": {
            "title": "Description",
            "type": "string"
          },
          "hosted_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hosted Url"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "pdf_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pdf Url"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "type": {
            "enum": [
              "invoice",
              "credit_note"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "created",
          "amount",
          "currency",
          "status",
          "description",
          "hosted_url",
          "pdf_url"
        ],
        "title": "BillingHistoryEvent",
        "type": "object"
      },
      "BillingHistoryResponse": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/BillingHistoryEvent"
            },
            "title": "Events",
            "type": "array"
          },
          "has_more": {
            "title": "Has More",
            "type": "boolean"
          },
          "next_credit_note_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Credit Note Cursor"
          },
          "next_invoice_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Invoice Cursor"
          }
        },
        "required": [
          "events",
          "has_more"
        ],
        "title": "BillingHistoryResponse",
        "type": "object"
      },
      "BillingStatusResponse": {
        "properties": {
          "billing_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Email"
          },
          "billing_period_end": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Period End"
          },
          "can_manage_subscription": {
            "title": "Can Manage Subscription",
            "type": "boolean"
          },
          "cancel_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancel At"
          },
          "extra_seats": {
            "title": "Extra Seats",
            "type": "integer"
          },
          "over_org_limit": {
            "title": "Over Org Limit",
            "type": "boolean"
          },
          "over_repo_limit": {
            "title": "Over Repo Limit",
            "type": "boolean"
          },
          "over_seat_limit": {
            "title": "Over Seat Limit",
            "type": "boolean"
          },
          "plan": {
            "title": "Plan",
            "type": "string"
          },
          "seat_count": {
            "title": "Seat Count",
            "type": "integer"
          },
          "seat_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seat Limit"
          },
          "stripe_enabled": {
            "title": "Stripe Enabled",
            "type": "boolean"
          },
          "subscription_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Status"
          },
          "trial_ends_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Trial Ends At"
          }
        },
        "required": [
          "plan",
          "subscription_status",
          "seat_count",
          "seat_limit",
          "extra_seats",
          "trial_ends_at",
          "billing_email",
          "billing_period_end",
          "stripe_enabled",
          "over_seat_limit",
          "over_org_limit",
          "over_repo_limit",
          "can_manage_subscription",
          "cancel_at"
        ],
        "title": "BillingStatusResponse",
        "type": "object"
      },
      "BillingUsageResponse": {
        "properties": {
          "billing_period_end": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Billing Period End"
          },
          "extra_seats": {
            "title": "Extra Seats",
            "type": "integer"
          },
          "features": {
            "additionalProperties": {
              "type": "boolean"
            },
            "title": "Features",
            "type": "object"
          },
          "org_connections": {
            "$ref": "#/components/schemas/UsageResource"
          },
          "plan": {
            "title": "Plan",
            "type": "string"
          },
          "repos": {
            "$ref": "#/components/schemas/UsageResource"
          },
          "seats": {
            "$ref": "#/components/schemas/UsageResource"
          },
          "subscription_status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subscription Status"
          }
        },
        "required": [
          "plan",
          "repos",
          "seats",
          "extra_seats",
          "org_connections",
          "features",
          "subscription_status",
          "billing_period_end"
        ],
        "title": "BillingUsageResponse",
        "type": "object"
      },
      "CancelPreviewResponse": {
        "description": "Pending charges that will be billed on the final cycle invoice if not waived.\n\n``pending_total`` includes credits (negative items); ``pending_items`` shows\nonly positive lines so the UI surfaces what the user will actually pay.",
        "properties": {
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "next_invoice_date": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Invoice Date"
          },
          "pending_items": {
            "items": {
              "$ref": "#/components/schemas/PendingInvoiceItem"
            },
            "title": "Pending Items",
            "type": "array"
          },
          "pending_total": {
            "title": "Pending Total",
            "type": "integer"
          }
        },
        "required": [
          "pending_total",
          "pending_items",
          "next_invoice_date",
          "currency"
        ],
        "title": "CancelPreviewResponse",
        "type": "object"
      },
      "CancelSubscriptionRequest": {
        "properties": {
          "reason": {
            "anyOf": [
              {
                "enum": [
                  "too_expensive",
                  "missing_feature",
                  "switching_competitor",
                  "no_longer_needed",
                  "other"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "reason_text": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason Text"
          },
          "waive_pending_charges": {
            "default": false,
            "title": "Waive Pending Charges",
            "type": "boolean"
          }
        },
        "title": "CancelSubscriptionRequest",
        "type": "object"
      },
      "CancelSubscriptionResponse": {
        "properties": {
          "cancel_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cancel At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "waived_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Waived Count"
          },
          "waived_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Waived Total"
          }
        },
        "required": [
          "status",
          "cancel_at"
        ],
        "title": "CancelSubscriptionResponse",
        "type": "object"
      },
      "ChangePasswordBody": {
        "properties": {
          "new_password": {
            "title": "New Password",
            "type": "string"
          },
          "old_password": {
            "title": "Old Password",
            "type": "string"
          }
        },
        "required": [
          "old_password",
          "new_password"
        ],
        "title": "ChangePasswordBody",
        "type": "object"
      },
      "ChangePlanPreviewResponse": {
        "properties": {
          "coupon_applies_to_target": {
            "default": true,
            "title": "Coupon Applies To Target",
            "type": "boolean"
          },
          "coupon_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon Id"
          },
          "coupon_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coupon Name"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "next_invoice_amount": {
            "title": "Next Invoice Amount",
            "type": "integer"
          },
          "next_invoice_date": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Invoice Date"
          },
          "next_invoice_proration": {
            "title": "Next Invoice Proration",
            "type": "integer"
          },
          "next_invoice_recurring": {
            "title": "Next Invoice Recurring",
            "type": "integer"
          },
          "promotion_code_applied": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promotion Code Applied"
          },
          "prorated_today": {
            "title": "Prorated Today",
            "type": "integer"
          },
          "target_plan": {
            "title": "Target Plan",
            "type": "string"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/ChangePlanPreviewWarning"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "target_plan",
          "prorated_today",
          "next_invoice_recurring",
          "next_invoice_proration",
          "next_invoice_amount",
          "next_invoice_date",
          "currency",
          "promotion_code_applied",
          "warnings"
        ],
        "title": "ChangePlanPreviewResponse",
        "type": "object"
      },
      "ChangePlanPreviewWarning": {
        "properties": {
          "current_count": {
            "title": "Current Count",
            "type": "integer"
          },
          "new_limit": {
            "title": "New Limit",
            "type": "integer"
          },
          "overflow": {
            "title": "Overflow",
            "type": "integer"
          },
          "type": {
            "enum": [
              "org_disconnect_required",
              "member_eviction_required"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "type",
          "overflow",
          "new_limit",
          "current_count"
        ],
        "title": "ChangePlanPreviewWarning",
        "type": "object"
      },
      "ChangePlanRequest": {
        "properties": {
          "member_ids_to_evict": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Ids To Evict"
          },
          "plan": {
            "enum": [
              "team",
              "business"
            ],
            "title": "Plan",
            "type": "string"
          },
          "promotion_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Promotion Code"
          }
        },
        "required": [
          "plan"
        ],
        "title": "ChangePlanRequest",
        "type": "object"
      },
      "ChangePlanResponse": {
        "properties": {
          "plan": {
            "title": "Plan",
            "type": "string"
          }
        },
        "required": [
          "plan"
        ],
        "title": "ChangePlanResponse",
        "type": "object"
      },
      "CheckoutResponse": {
        "properties": {
          "checkout_url": {
            "title": "Checkout Url",
            "type": "string"
          }
        },
        "required": [
          "checkout_url"
        ],
        "title": "CheckoutResponse",
        "type": "object"
      },
      "ConnectedOrgCreate": {
        "description": "Request body for registering a new connected org.\n\nTwo mutually exclusive auth modes:\n  PAT mode   \u2014 provide url + access_token (power users, self-hosted)\n  OAuth mode \u2014 provide oauth_org_login (uses the user's linked identity token)",
        "properties": {
          "access_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Access Token"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "oauth_org_login": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth Org Login"
          },
          "platform": {
            "default": "gitlab",
            "title": "Platform",
            "type": "string"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "required": [
          "name"
        ],
        "title": "ConnectedOrgCreate",
        "type": "object"
      },
      "ConnectedOrgResponse": {
        "description": "Response schema for a connected org (list/get endpoints).",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "heuristic_patterns": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Heuristic Patterns"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "initial_scan_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Scan Id"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "platform": {
            "title": "Platform",
            "type": "string"
          },
          "platform_id": {
            "title": "Platform Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspace_id",
          "platform",
          "platform_id",
          "name",
          "url",
          "created_at",
          "updated_at"
        ],
        "title": "ConnectedOrgResponse",
        "type": "object"
      },
      "ConnectedOrgUpdate": {
        "description": "Request body for PUT /connected-orgs/{id}.\n\nAll fields are optional \u2014 only fields explicitly set are applied.\n`platform`, `platform_id`, and `url` are immutable (data-lineage identity);\nto change them, disconnect and register a new org.\n\n`access_token` rotates the stored PAT. It is rejected for OAuth-registered\norgs (see handler) to keep the org\u2194identity invariant intact. Validated\nagainst the org's existing platform via `_validate_pat_format`.",
        "properties": {
          "access_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Access Token"
          },
          "heuristic_patterns": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Heuristic Patterns"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "ConnectedOrgUpdate",
        "type": "object"
      },
      "CreateApiKeyBody": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateApiKeyBody",
        "type": "object"
      },
      "CreateInvitationBody": {
        "properties": {
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "expires_in_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Days"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "max_uses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Uses"
          },
          "role": {
            "default": "member",
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "kind"
        ],
        "title": "CreateInvitationBody",
        "type": "object"
      },
      "CreateWorkspaceBody": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateWorkspaceBody",
        "type": "object"
      },
      "CreateWorkspaceWithCheckoutBody": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "plan": {
            "title": "Plan",
            "type": "string"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          }
        },
        "required": [
          "name",
          "plan"
        ],
        "title": "CreateWorkspaceWithCheckoutBody",
        "type": "object"
      },
      "CreateWorkspaceWithCheckoutResponse": {
        "properties": {
          "checkout_url": {
            "title": "Checkout Url",
            "type": "string"
          },
          "workspace_id": {
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "workspace_id",
          "checkout_url"
        ],
        "title": "CreateWorkspaceWithCheckoutResponse",
        "type": "object"
      },
      "DeleteAccountBody": {
        "properties": {
          "password": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Password"
          }
        },
        "title": "DeleteAccountBody",
        "type": "object"
      },
      "DependencyInfo": {
        "description": "A single dependency declaration from a repo's latest scan.",
        "properties": {
          "confidence": {
            "title": "Confidence",
            "type": "number"
          },
          "dependency_type": {
            "title": "Dependency Type",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "raw_reference": {
            "title": "Raw Reference",
            "type": "string"
          },
          "resolved": {
            "title": "Resolved",
            "type": "boolean"
          },
          "source_file": {
            "title": "Source File",
            "type": "string"
          },
          "source_line": {
            "title": "Source Line",
            "type": "integer"
          },
          "target_artifact_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Artifact Id"
          },
          "target_repository_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Repository Id"
          },
          "target_repository_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Repository Name"
          },
          "version_constraint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version Constraint"
          }
        },
        "required": [
          "id",
          "dependency_type",
          "raw_reference",
          "version_constraint",
          "source_file",
          "source_line",
          "resolved",
          "confidence"
        ],
        "title": "DependencyInfo",
        "type": "object"
      },
      "EmailVerifyBody": {
        "properties": {
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token"
        ],
        "title": "EmailVerifyBody",
        "type": "object"
      },
      "GraphEdge": {
        "description": "A directed dependency edge between two repos.",
        "properties": {
          "confidence": {
            "title": "Confidence",
            "type": "number"
          },
          "dependency_type": {
            "title": "Dependency Type",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "target": {
            "title": "Target",
            "type": "string"
          },
          "version_constraint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version Constraint"
          }
        },
        "required": [
          "id",
          "source",
          "target",
          "dependency_type",
          "version_constraint",
          "confidence"
        ],
        "title": "GraphEdge",
        "type": "object"
      },
      "GraphNode": {
        "description": "A repository node in the dependency graph.",
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "label": {
            "title": "Label",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "default": {},
            "title": "Metadata",
            "type": "object"
          },
          "type": {
            "default": "repository",
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "label"
        ],
        "title": "GraphNode",
        "type": "object"
      },
      "GraphResponse": {
        "description": "Full dependency graph for an organization (G6 compatible).",
        "properties": {
          "edges": {
            "items": {
              "$ref": "#/components/schemas/GraphEdge"
            },
            "title": "Edges",
            "type": "array"
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/GraphNode"
            },
            "title": "Nodes",
            "type": "array"
          }
        },
        "required": [
          "nodes",
          "edges"
        ],
        "title": "GraphResponse",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HealthSummary": {
        "description": "Aggregate health indicators.",
        "properties": {
          "consumers_lagging": {
            "title": "Consumers Lagging",
            "type": "integer"
          },
          "consumers_on_latest": {
            "title": "Consumers On Latest",
            "type": "integer"
          },
          "unresolved_declarations": {
            "title": "Unresolved Declarations",
            "type": "integer"
          }
        },
        "required": [
          "consumers_on_latest",
          "consumers_lagging",
          "unresolved_declarations"
        ],
        "title": "HealthSummary",
        "type": "object"
      },
      "ImpactResponse": {
        "description": "Full downstream impact of changing a repository.",
        "properties": {
          "affected_repositories": {
            "items": {
              "$ref": "#/components/schemas/AffectedRepository"
            },
            "title": "Affected Repositories",
            "type": "array"
          },
          "max_depth_reached": {
            "title": "Max Depth Reached",
            "type": "integer"
          },
          "source_repository": {
            "additionalProperties": true,
            "title": "Source Repository",
            "type": "object"
          },
          "total_affected": {
            "title": "Total Affected",
            "type": "integer"
          }
        },
        "required": [
          "source_repository",
          "affected_repositories",
          "total_affected",
          "max_depth_reached"
        ],
        "title": "ImpactResponse",
        "type": "object"
      },
      "InvitationPreviewResponse": {
        "properties": {
          "inviter_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inviter Name"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "workspace_name": {
            "title": "Workspace Name",
            "type": "string"
          }
        },
        "required": [
          "workspace_name",
          "inviter_name",
          "role"
        ],
        "title": "InvitationPreviewResponse",
        "type": "object"
      },
      "InvitationResponse": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "title": "Kind",
            "type": "string"
          },
          "max_uses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Uses"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token"
          },
          "use_count": {
            "title": "Use Count",
            "type": "integer"
          },
          "workspace_id": {
            "format": "uuid",
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "workspace_id",
          "email",
          "role",
          "kind",
          "use_count",
          "max_uses",
          "expires_at",
          "created_at"
        ],
        "title": "InvitationResponse",
        "type": "object"
      },
      "InvoiceInfo": {
        "properties": {
          "amount_paid": {
            "title": "Amount Paid",
            "type": "integer"
          },
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "date": {
            "format": "date-time",
            "title": "Date",
            "type": "string"
          },
          "hosted_invoice_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hosted Invoice Url"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "invoice_pdf": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invoice Pdf"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "date",
          "amount_paid",
          "currency",
          "status",
          "hosted_invoice_url",
          "invoice_pdf"
        ],
        "title": "InvoiceInfo",
        "type": "object"
      },
      "LastScanSummary": {
        "description": "Summary of the most recent scan.",
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "errors": {
            "title": "Errors",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "repos_scanned": {
            "title": "Repos Scanned",
            "type": "integer"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "completed_at",
          "repos_scanned",
          "errors"
        ],
        "title": "LastScanSummary",
        "type": "object"
      },
      "LoginBody": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "password": {
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "title": "LoginBody",
        "type": "object"
      },
      "MeResponse": {
        "properties": {
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "current_tos_version": {
            "default": "2026-06-01",
            "title": "Current Tos Version",
            "type": "string"
          },
          "current_workspace_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Workspace Id"
          },
          "deletion_scheduled_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deletion Scheduled At"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "email_verified": {
            "default": false,
            "title": "Email Verified",
            "type": "boolean"
          },
          "full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "has_password": {
            "default": false,
            "title": "Has Password",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_login_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          },
          "linked_providers": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Linked Providers",
            "type": "array"
          },
          "onboarding_completed": {
            "default": false,
            "title": "Onboarding Completed",
            "type": "boolean"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          },
          "tos_accepted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tos Accepted At"
          },
          "tos_enforcement_date": {
            "default": "2026-06-15",
            "title": "Tos Enforcement Date",
            "type": "string"
          },
          "tos_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tos Version"
          },
          "workspaces": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Workspaces",
            "type": "array"
          }
        },
        "required": [
          "id",
          "email",
          "full_name",
          "avatar_url",
          "last_login_at",
          "workspaces",
          "current_workspace_id",
          "role"
        ],
        "title": "MeResponse",
        "type": "object"
      },
      "MemberResponse": {
        "properties": {
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "joined_at": {
            "format": "date-time",
            "title": "Joined At",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "user_id": {
            "format": "uuid",
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "email",
          "full_name",
          "avatar_url",
          "role",
          "joined_at"
        ],
        "title": "MemberResponse",
        "type": "object"
      },
      "OAuthOrgInfo": {
        "description": "A GitHub org or GitLab group accessible via the user's linked OAuth identity.",
        "properties": {
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "login": {
            "title": "Login",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "scannable": {
            "default": false,
            "title": "Scannable",
            "type": "boolean"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "login",
          "name",
          "url"
        ],
        "title": "OAuthOrgInfo",
        "type": "object"
      },
      "OrgStats": {
        "description": "Per-connected-org stats payload (scoped to one connected org).\n\nArtifact-count semantics:\n  - ``total_artifacts`` / ``artifact_type_breakdown`` count **consumed** artifacts\n    only and apply canonical-name dedup (e.g. ``ghcr.io/foo/bar`` and ``foo/bar``\n    collapse to one logical artifact). Invariant:\n    ``sum(artifact_type_breakdown.values()) == total_artifacts``.\n  - ``total_artifact_rows`` / ``orphan_artifact_count`` are raw row counts that\n    match what ``GET /connected-orgs/{id}/artifacts`` returns \u2014 no dedup, no\n    consumed-only filter. ``total_artifact_rows - orphan_artifact_count`` is the\n    raw count of artifacts with at least one consumer.",
        "properties": {
          "artifact_type_breakdown": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Artifact Type Breakdown",
            "type": "object"
          },
          "dependency_type_breakdown": {
            "additionalProperties": {
              "type": "integer"
            },
            "title": "Dependency Type Breakdown",
            "type": "object"
          },
          "health": {
            "$ref": "#/components/schemas/HealthSummary"
          },
          "last_scan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LastScanSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "orphan_artifact_count": {
            "title": "Orphan Artifact Count",
            "type": "integer"
          },
          "total_artifact_rows": {
            "title": "Total Artifact Rows",
            "type": "integer"
          },
          "total_artifacts": {
            "title": "Total Artifacts",
            "type": "integer"
          },
          "total_dependencies": {
            "title": "Total Dependencies",
            "type": "integer"
          },
          "total_repositories": {
            "title": "Total Repositories",
            "type": "integer"
          }
        },
        "required": [
          "total_repositories",
          "total_dependencies",
          "total_artifacts",
          "orphan_artifact_count",
          "total_artifact_rows",
          "dependency_type_breakdown",
          "artifact_type_breakdown",
          "last_scan",
          "health"
        ],
        "title": "OrgStats",
        "type": "object"
      },
      "PasswordResetConfirmBody": {
        "properties": {
          "new_password": {
            "title": "New Password",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token",
          "new_password"
        ],
        "title": "PasswordResetConfirmBody",
        "type": "object"
      },
      "PasswordResetRequestBody": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "PasswordResetRequestBody",
        "type": "object"
      },
      "PaymentInfoResponse": {
        "properties": {
          "invoices": {
            "items": {
              "$ref": "#/components/schemas/InvoiceInfo"
            },
            "title": "Invoices",
            "type": "array"
          },
          "payment_method": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PaymentMethodInfo"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "payment_method",
          "invoices"
        ],
        "title": "PaymentInfoResponse",
        "type": "object"
      },
      "PaymentMethodInfo": {
        "properties": {
          "brand": {
            "title": "Brand",
            "type": "string"
          },
          "exp_month": {
            "title": "Exp Month",
            "type": "integer"
          },
          "exp_year": {
            "title": "Exp Year",
            "type": "integer"
          },
          "last4": {
            "title": "Last4",
            "type": "string"
          }
        },
        "required": [
          "brand",
          "last4",
          "exp_month",
          "exp_year"
        ],
        "title": "PaymentMethodInfo",
        "type": "object"
      },
      "PendingInvoiceItem": {
        "description": "A queued (uninvoiced) Stripe invoice item \u2014 typically a proration.",
        "properties": {
          "amount": {
            "title": "Amount",
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "period_end": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period End"
          },
          "period_start": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Period Start"
          }
        },
        "required": [
          "id",
          "description",
          "amount",
          "period_start",
          "period_end"
        ],
        "title": "PendingInvoiceItem",
        "type": "object"
      },
      "PlanCatalogResponse": {
        "properties": {
          "plans": {
            "items": {
              "$ref": "#/components/schemas/PlanPriceInfo"
            },
            "title": "Plans",
            "type": "array"
          },
          "stripe_enabled": {
            "title": "Stripe Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "stripe_enabled",
          "plans"
        ],
        "title": "PlanCatalogResponse",
        "type": "object"
      },
      "PlanPriceInfo": {
        "properties": {
          "base_price_amount": {
            "default": 0,
            "title": "Base Price Amount",
            "type": "integer"
          },
          "base_price_currency": {
            "default": "usd",
            "title": "Base Price Currency",
            "type": "string"
          },
          "base_price_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Price Id"
          },
          "features": {
            "default": "",
            "title": "Features",
            "type": "string"
          },
          "included_seats": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Included Seats"
          },
          "max_org_connections": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Org Connections"
          },
          "max_repos": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Repos"
          },
          "plan_key": {
            "title": "Plan Key",
            "type": "string"
          },
          "seat_addon_amount": {
            "default": 0,
            "title": "Seat Addon Amount",
            "type": "integer"
          },
          "seat_addon_currency": {
            "default": "usd",
            "title": "Seat Addon Currency",
            "type": "string"
          },
          "seat_addon_price_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Seat Addon Price Id"
          }
        },
        "required": [
          "plan_key"
        ],
        "title": "PlanPriceInfo",
        "type": "object"
      },
      "PortalResponse": {
        "properties": {
          "portal_url": {
            "title": "Portal Url",
            "type": "string"
          }
        },
        "required": [
          "portal_url"
        ],
        "title": "PortalResponse",
        "type": "object"
      },
      "ProvidersResponse": {
        "properties": {
          "providers": {
            "items": {
              "type": "string"
            },
            "title": "Providers",
            "type": "array"
          }
        },
        "required": [
          "providers"
        ],
        "title": "ProvidersResponse",
        "type": "object"
      },
      "RegisterBody": {
        "properties": {
          "email": {
            "format": "email",
            "title": "Email",
            "type": "string"
          },
          "full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "password": {
            "title": "Password",
            "type": "string"
          },
          "tos_accepted": {
            "title": "Tos Accepted",
            "type": "boolean"
          },
          "workspace_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Workspace Name"
          }
        },
        "required": [
          "email",
          "password",
          "tos_accepted"
        ],
        "title": "RegisterBody",
        "type": "object"
      },
      "RemoveSeatsRequest": {
        "properties": {
          "member_ids_to_evict": {
            "anyOf": [
              {
                "items": {
                  "format": "uuid",
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Member Ids To Evict"
          },
          "seats_to_remove": {
            "title": "Seats To Remove",
            "type": "integer"
          }
        },
        "required": [
          "seats_to_remove"
        ],
        "title": "RemoveSeatsRequest",
        "type": "object"
      },
      "RemoveSeatsResponse": {
        "properties": {
          "extra_seats": {
            "title": "Extra Seats",
            "type": "integer"
          },
          "seat_limit": {
            "title": "Seat Limit",
            "type": "integer"
          }
        },
        "required": [
          "extra_seats",
          "seat_limit"
        ],
        "title": "RemoveSeatsResponse",
        "type": "object"
      },
      "RepositoryContextArtifact": {
        "description": "Slim artifact summary embedded in the repo context bundle.",
        "properties": {
          "artifact_type": {
            "title": "Artifact Type",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "id",
          "artifact_type",
          "name",
          "version"
        ],
        "title": "RepositoryContextArtifact",
        "type": "object"
      },
      "RepositoryContextResponse": {
        "description": "Single-call context bundle for AI coding agents.\n\nCombines the repo row (with freshness fields), capped lists of direct\ndependents + dependencies, and the artifacts this repo produces. For full\npagination of dependents/dependencies use the dedicated endpoints; for\ntransitive blast radius use ``/repositories/{id}/impact``.",
        "properties": {
          "artifacts": {
            "items": {
              "$ref": "#/components/schemas/RepositoryContextArtifact"
            },
            "title": "Artifacts",
            "type": "array"
          },
          "dependencies": {
            "items": {
              "$ref": "#/components/schemas/DependencyInfo"
            },
            "title": "Dependencies",
            "type": "array"
          },
          "dependencies_total": {
            "title": "Dependencies Total",
            "type": "integer"
          },
          "dependents": {
            "items": {
              "$ref": "#/components/schemas/DependencyInfo"
            },
            "title": "Dependents",
            "type": "array"
          },
          "dependents_total": {
            "title": "Dependents Total",
            "type": "integer"
          },
          "repository": {
            "$ref": "#/components/schemas/RepositoryResponse"
          }
        },
        "required": [
          "repository",
          "dependencies",
          "dependencies_total",
          "dependents",
          "dependents_total",
          "artifacts"
        ],
        "title": "RepositoryContextResponse",
        "type": "object"
      },
      "RepositoryResponse": {
        "description": "Basic repository record.",
        "properties": {
          "archived": {
            "title": "Archived",
            "type": "boolean"
          },
          "clone_url": {
            "title": "Clone Url",
            "type": "string"
          },
          "connected_org_id": {
            "format": "uuid",
            "title": "Connected Org Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "default_branch": {
            "title": "Default Branch",
            "type": "string"
          },
          "full_path": {
            "title": "Full Path",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "last_activity_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity At"
          },
          "last_commit_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Commit Sha"
          },
          "last_scanned_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Scanned At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "platform_id": {
            "title": "Platform Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "connected_org_id",
          "platform_id",
          "name",
          "full_path",
          "clone_url",
          "default_branch",
          "last_scanned_at",
          "last_commit_sha",
          "last_activity_at",
          "archived",
          "created_at"
        ],
        "title": "RepositoryResponse",
        "type": "object"
      },
      "ResumeSubscriptionResponse": {
        "properties": {
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "ResumeSubscriptionResponse",
        "type": "object"
      },
      "ScanResponse": {
        "description": "Full scan record.",
        "properties": {
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "connected_org_id": {
            "format": "uuid",
            "title": "Connected Org Id",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "errors": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Errors"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "scan_type": {
            "title": "Scan Type",
            "type": "string"
          },
          "scanned_repos": {
            "title": "Scanned Repos",
            "type": "integer"
          },
          "skipped_repos": {
            "title": "Skipped Repos",
            "type": "integer"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "total_repos": {
            "title": "Total Repos",
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "connected_org_id",
          "status",
          "scan_type",
          "total_repos",
          "scanned_repos",
          "skipped_repos",
          "errors",
          "started_at",
          "completed_at",
          "created_at",
          "updated_at"
        ],
        "title": "ScanResponse",
        "type": "object"
      },
      "ScanTriggerRequest": {
        "description": "Optional request body for POST /organizations/{org_id}/scans.",
        "properties": {
          "scan_type": {
            "default": "incremental",
            "title": "Scan Type",
            "type": "string"
          }
        },
        "title": "ScanTriggerRequest",
        "type": "object"
      },
      "ScanTriggerResponse": {
        "description": "Returned immediately after a scan is queued.",
        "properties": {
          "message": {
            "title": "Message",
            "type": "string"
          },
          "scan_id": {
            "format": "uuid",
            "title": "Scan Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "scan_id",
          "status",
          "message"
        ],
        "title": "ScanTriggerResponse",
        "type": "object"
      },
      "SeatChangePreviewResponse": {
        "properties": {
          "currency": {
            "title": "Currency",
            "type": "string"
          },
          "next_invoice_amount": {
            "title": "Next Invoice Amount",
            "type": "integer"
          },
          "next_invoice_date": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Invoice Date"
          },
          "next_invoice_proration": {
            "title": "Next Invoice Proration",
            "type": "integer"
          },
          "next_invoice_recurring": {
            "title": "Next Invoice Recurring",
            "type": "integer"
          },
          "prorated_today": {
            "title": "Prorated Today",
            "type": "integer"
          },
          "seat_delta": {
            "title": "Seat Delta",
            "type": "integer"
          }
        },
        "required": [
          "seat_delta",
          "prorated_today",
          "next_invoice_recurring",
          "next_invoice_proration",
          "next_invoice_amount",
          "next_invoice_date",
          "currency"
        ],
        "title": "SeatChangePreviewResponse",
        "type": "object"
      },
      "SetPasswordBody": {
        "properties": {
          "new_password": {
            "title": "New Password",
            "type": "string"
          }
        },
        "required": [
          "new_password"
        ],
        "title": "SetPasswordBody",
        "type": "object"
      },
      "SetupIntentResponse": {
        "properties": {
          "client_secret": {
            "title": "Client Secret",
            "type": "string"
          },
          "publishable_key": {
            "title": "Publishable Key",
            "type": "string"
          }
        },
        "required": [
          "client_secret",
          "publishable_key"
        ],
        "title": "SetupIntentResponse",
        "type": "object"
      },
      "TransferOwnershipBody": {
        "properties": {
          "new_owner_user_id": {
            "format": "uuid",
            "title": "New Owner User Id",
            "type": "string"
          }
        },
        "required": [
          "new_owner_user_id"
        ],
        "title": "TransferOwnershipBody",
        "type": "object"
      },
      "UpdateMeBody": {
        "properties": {
          "current_password": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Password"
          },
          "email": {
            "anyOf": [
              {
                "format": "email",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "full_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Full Name"
          },
          "onboarding_completed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Onboarding Completed"
          }
        },
        "title": "UpdateMeBody",
        "type": "object"
      },
      "UpdateRoleBody": {
        "properties": {
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "UpdateRoleBody",
        "type": "object"
      },
      "UsageResource": {
        "description": "(used, limit) pair where limit=None means unlimited.",
        "properties": {
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit"
          },
          "used": {
            "title": "Used",
            "type": "integer"
          }
        },
        "required": [
          "used",
          "limit"
        ],
        "title": "UsageResource",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "WorkspaceResponse": {
        "description": "Response schema for a workspace.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "plan": {
            "title": "Plan",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "plan",
          "created_at",
          "updated_at"
        ],
        "title": "WorkspaceResponse",
        "type": "object"
      },
      "WorkspaceUpdate": {
        "description": "Request body for PUT /workspaces/{id}.",
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "regenerate_slug": {
            "default": false,
            "title": "Regenerate Slug",
            "type": "boolean"
          }
        },
        "title": "WorkspaceUpdate",
        "type": "object"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      },
      "HTTPBearer": {
        "description": "API key as Bearer token (rfm_live_... prefix)",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Change Impact Engine for multi-repo systems",
    "title": "Riftmap",
    "version": "1.3.5"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/artifacts/{artifact_id}": {
      "get": {
        "description": "Get a single artifact by ID, with consumer_count + is_orphan populated.",
        "operationId": "get_artifact_api_v1_artifacts__artifact_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "artifact_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Artifact Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get a single artifact by ID, with consumer count and orphan flag.",
        "tags": [
          "artifacts"
        ]
      }
    },
    "/api/v1/artifacts/{artifact_id}/consumers": {
      "get": {
        "description": "List all repos consuming this artifact, with their pinned versions.",
        "operationId": "get_artifact_consumers_api_v1_artifacts__artifact_id__consumers_get",
        "parameters": [
          {
            "in": "path",
            "name": "artifact_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Artifact Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtifactConsumersResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List repositories consuming this artifact, with pinned versions.",
        "tags": [
          "artifacts"
        ]
      }
    },
    "/api/v1/artifacts/{artifact_id}/versions": {
      "get": {
        "description": "List all versions of this artifact seen across the connected org, with consumer counts.",
        "operationId": "get_artifact_versions_api_v1_artifacts__artifact_id__versions_get",
        "parameters": [
          {
            "in": "path",
            "name": "artifact_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Artifact Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ArtifactVersionEntry"
                  },
                  "title": "Response Get Artifact Versions Api V1 Artifacts  Artifact Id  Versions Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Artifact Versions",
        "tags": [
          "artifacts"
        ]
      }
    },
    "/api/v1/auth/accept-tos": {
      "post": {
        "description": "Record that the current user accepts the current Terms of Service.\n\nCalled when a user accepts an updated ToS via the in-app banner or the /accept-terms\nblocking page. Updates tos_accepted_at and tos_version on the user record.\n\nReturns the accepted version and timestamp so the frontend can update state immediately\nwithout a full /auth/me refetch.",
        "operationId": "accept_tos_api_v1_auth_accept_tos_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Accept Tos Api V1 Auth Accept Tos Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Accept Tos",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/account/cancel-deletion": {
      "post": {
        "description": "Cancel a pending account deletion during the 30-day grace period.\n\nRequires re-authentication \u2014 all sessions are revoked when deletion is scheduled,\nso the user must log in again. A valid session JWT is proof of re-authentication.",
        "operationId": "cancel_account_deletion_api_v1_auth_account_cancel_deletion_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Cancel Account Deletion Api V1 Auth Account Cancel Deletion Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel Account Deletion",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/account/delete": {
      "post": {
        "description": "Schedule account deletion with a 30-day GDPR grace period.\n\nInstead of immediately hard-deleting, this sets deletion_scheduled_at = now()+30 days,\nrevokes all active sessions (forces re-authentication), and returns 202.\nA Celery Beat task runs daily and performs the actual hard-delete once the grace period\nexpires. Users can cancel by re-authenticating and calling POST /auth/account/cancel-deletion.\n\nCascade behaviour (applied at hard-delete time):\n- Workspaces where user is the sole member are deleted entirely (including Stripe customer).\n- Workspaces where user is the sole owner but has other members \u2192 409 (transfer first).\n- Workspaces where there are other owners \u2192 user's membership removed; workspace survives.",
        "operationId": "delete_account_api_v1_auth_account_delete_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAccountBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Account",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/email/verify": {
      "post": {
        "description": "Consume a signed email-verification token and mark the account as verified.",
        "operationId": "verify_email_api_v1_auth_email_verify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailVerifyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Verify Email Api V1 Auth Email Verify Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Email",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/email/verify/resend": {
      "post": {
        "description": "Resend the verification email to the currently logged-in user.",
        "operationId": "resend_verification_email_api_v1_auth_email_verify_resend_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Resend Verification Email Api V1 Auth Email Verify Resend Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resend Verification Email",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "description": "Email/password login. Sets httponly auth cookies.",
        "operationId": "login_api_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Login",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "description": "Log out the current user and revoke their session.",
        "operationId": "logout_api_v1_auth_logout_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Logout Api V1 Auth Logout Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Logout",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "description": "Return the current user, their workspaces, and role in the current workspace.",
        "operationId": "get_me_api_v1_auth_me_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Me",
        "tags": [
          "auth"
        ]
      },
      "patch": {
        "description": "Update the current user's profile (full_name, email, onboarding_completed).",
        "operationId": "update_me_api_v1_auth_me_patch",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Me",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/oauth/{provider}/callback": {
      "get": {
        "description": "Handle the OAuth callback: exchange code \u2192 tokens, find/create user, set session.",
        "operationId": "oauth_callback_api_v1_auth_oauth__provider__callback_get",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "title": "Code",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "title": "State",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Oauth Callback",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/oauth/{provider}/start": {
      "get": {
        "description": "Generate OAuth state + PKCE, cache in Redis, redirect to provider.",
        "operationId": "oauth_start_api_v1_auth_oauth__provider__start_get",
        "parameters": [
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "redirect_to",
            "required": false,
            "schema": {
              "default": "/",
              "title": "Redirect To",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Oauth Start",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/password/change": {
      "post": {
        "description": "Change password, invalidate all other sessions, re-issue access token for current session.",
        "operationId": "change_password_api_v1_auth_password_change_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Change Password Api V1 Auth Password Change Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Change Password",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/password/reset/confirm": {
      "post": {
        "description": "Verify a reset token and set a new password.",
        "operationId": "confirm_password_reset_api_v1_auth_password_reset_confirm_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetConfirmBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Confirm Password Reset Api V1 Auth Password Reset Confirm Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Confirm Password Reset",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/password/reset/request": {
      "post": {
        "description": "Send a password reset link. Always returns 200 (silent on missing email).",
        "operationId": "request_password_reset_api_v1_auth_password_reset_request_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Request Password Reset Api V1 Auth Password Reset Request Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Request Password Reset",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/password/set": {
      "post": {
        "description": "Set a password for an OAuth-only account that has no password yet.\n\nFails with 400 if the user already has a password \u2014 use /password/change instead.",
        "operationId": "set_password_api_v1_auth_password_set_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPasswordBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Set Password Api V1 Auth Password Set Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Password",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/providers": {
      "get": {
        "description": "Return the list of enabled OAuth providers (used by the frontend to render login buttons).",
        "operationId": "list_providers_api_v1_auth_providers_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvidersResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "List Providers",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "description": "Refresh the access token using the refresh cookie. Rotates the refresh token.\n\nImplements refresh-token reuse detection (SEC-20260420-006). Each session row\ncarries ``used_at`` (set on rotation) and ``replaced_by_id`` (forward chain\nlink). If a client presents a token whose row has ``used_at`` set, the token\nis being replayed \u2014 either by an attacker who stole the cookie before the\nlegitimate client rotated it, or by a buggy client retrying the same token.\nEither way we burn the entire rotation family so a stolen cookie is worth\nat most one rotation cycle and the theft is loud.",
        "operationId": "refresh_token_api_v1_auth_refresh_post",
        "parameters": [
          {
            "in": "cookie",
            "name": "riftmap_refresh",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Refresh"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Refresh Token Api V1 Auth Refresh Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh Token",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "description": "Create a new user account and their initial workspace.",
        "operationId": "register_api_v1_auth_register_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register",
        "tags": [
          "auth"
        ]
      }
    },
    "/api/v1/billing/plans": {
      "get": {
        "description": "Return available plan pricing and limits from Stripe (cached 1 hour).\n\nAccessible to any authenticated user so it works during workspace creation.\nFalls back to hardcoded defaults when Stripe is not configured or unreachable.",
        "operationId": "get_plan_catalog_api_v1_billing_plans_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanCatalogResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Plan Catalog",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/connected-orgs": {
      "get": {
        "description": "List all connected orgs in the authenticated workspace.",
        "operationId": "list_connected_orgs_api_v1_connected_orgs_get",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ConnectedOrgResponse"
                  },
                  "title": "Response List Connected Orgs Api V1 Connected Orgs Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Connected Orgs",
        "tags": [
          "connected-orgs"
        ]
      },
      "post": {
        "description": "Add a new connected org and automatically trigger a full scan.\n\nAccepts two auth modes:\n  - PAT mode:   body contains url + access_token\n  - OAuth mode: body contains oauth_org_login (uses the user's linked identity token)\n\nA full scan is automatically queued after the org is created. The response\nincludes ``initial_scan_id`` which can be used to poll scan progress via\nGET /api/v1/scans/{scan_id}.",
        "operationId": "create_connected_org_api_v1_connected_orgs_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectedOrgCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectedOrgResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Connected Org",
        "tags": [
          "connected-orgs"
        ]
      }
    },
    "/api/v1/connected-orgs/{connected_org_id}": {
      "delete": {
        "description": "Delete a connected org.\n\nCascade-deletes all associated repositories, scans, and artifacts, and\nremoves the encrypted token from the database.\n\nNote: platform-side token revocation is NOT performed automatically.\nUsers should revoke the GitHub/GitLab PAT or OAuth token manually\nafter disconnecting (see GitHub token settings or GitLab token settings).",
        "operationId": "delete_connected_org_api_v1_connected_orgs__connected_org_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Connected Org",
        "tags": [
          "connected-orgs"
        ]
      },
      "get": {
        "description": "Get a single connected org by ID.",
        "operationId": "get_connected_org_api_v1_connected_orgs__connected_org_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectedOrgResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Connected Org",
        "tags": [
          "connected-orgs"
        ]
      },
      "put": {
        "description": "Update mutable connected org settings.\n\nEditable fields: `name`, `heuristic_patterns`, and `access_token` (PAT rotation).\nImmutable: `platform`, `platform_id`, `url` \u2014 disconnect and re-register to change.\n\nToken rotation is rejected (409) for OAuth-registered orgs because the stored\ntoken is a copy of the user's linked identity. Rotating here would silently\ndesync the org from the identity.",
        "operationId": "update_connected_org_api_v1_connected_orgs__connected_org_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectedOrgUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectedOrgResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Connected Org",
        "tags": [
          "connected-orgs"
        ]
      }
    },
    "/api/v1/connected-orgs/{connected_org_id}/artifacts": {
      "get": {
        "description": "List all known artifacts in a connected org, including orphans.\n\nEach response row carries ``consumer_count`` + ``is_orphan``. Orphans are\nartifacts the org produces but nothing in the org consumes \u2014 valuable\ndead-weight signal, not noise.\n\nPaginated via ``limit`` / ``offset`` query params (default 100, max 500).\n``X-Total-Count`` response header carries the unfiltered row count.",
        "operationId": "list_artifacts_api_v1_connected_orgs__connected_org_id__artifacts_get",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum items to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum items to return.",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Items to skip.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Items to skip.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ArtifactResponse"
                  },
                  "title": "Response List Artifacts Api V1 Connected Orgs  Connected Org Id  Artifacts Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List artifacts (Docker images, packages, modules) produced in a connected org.",
        "tags": [
          "artifacts"
        ]
      }
    },
    "/api/v1/connected-orgs/{connected_org_id}/graph": {
      "get": {
        "description": "Return the dependency graph for a connected org.\n\nWithout ``root``: full graph for the org.\n\nWith ``root=<repo_id>``: subgraph anchored at that repo, including up to\n``depth`` hops in both directions (upstream + downstream). Designed for AI\ncoding agents that want a focused neighbourhood instead of the whole org.\n\nNodes are repositories; edges are resolved dependencies from the most\nrecent completed scan. Format is G6-compatible.",
        "operationId": "get_graph_api_v1_connected_orgs__connected_org_id__graph_get",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "description": "Optional repository ID to anchor a subgraph view. When set, the response is limited to the root plus its upstream and downstream neighbours within ``depth`` hops. Omit for the full org graph.",
            "in": "query",
            "name": "root",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional repository ID to anchor a subgraph view. When set, the response is limited to the root plus its upstream and downstream neighbours within ``depth`` hops. Omit for the full org graph.",
              "title": "Root"
            }
          },
          {
            "description": "BFS depth from ``root`` in each direction. Ignored when ``root`` is omitted.",
            "in": "query",
            "name": "depth",
            "required": false,
            "schema": {
              "default": 2,
              "description": "BFS depth from ``root`` in each direction. Ignored when ``root`` is omitted.",
              "maximum": 10,
              "minimum": 1,
              "title": "Depth",
              "type": "integer"
            }
          },
          {
            "description": "Minimum edge confidence to traverse during subgraph BFS. Ignored when ``root`` is omitted.",
            "in": "query",
            "name": "min_confidence",
            "required": false,
            "schema": {
              "default": 0.8,
              "description": "Minimum edge confidence to traverse during subgraph BFS. Ignored when ``root`` is omitted.",
              "maximum": 1.0,
              "minimum": 0.0,
              "title": "Min Confidence",
              "type": "number"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GraphResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get the dependency graph (full org or subgraph anchored at a repo).",
        "tags": [
          "graph"
        ]
      }
    },
    "/api/v1/connected-orgs/{connected_org_id}/repositories": {
      "get": {
        "description": "List all repositories discovered in a connected org.\n\nPaginated via ``limit`` / ``offset`` query params (default 100, max 500).\n``X-Total-Count`` response header carries the unfiltered row count.",
        "operationId": "list_repositories_api_v1_connected_orgs__connected_org_id__repositories_get",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum items to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum items to return.",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Items to skip.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Items to skip.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RepositoryResponse"
                  },
                  "title": "Response List Repositories Api V1 Connected Orgs  Connected Org Id  Repositories Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List repositories discovered in a connected org.",
        "tags": [
          "repositories"
        ]
      }
    },
    "/api/v1/connected-orgs/{connected_org_id}/scans": {
      "get": {
        "description": "List all scans for a connected org, newest first.\n\nPaginated via ``limit`` / ``offset`` query params (default 100, max 500).\n``X-Total-Count`` response header carries the unfiltered row count.",
        "operationId": "list_scans_api_v1_connected_orgs__connected_org_id__scans_get",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum items to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum items to return.",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Items to skip.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Items to skip.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ScanResponse"
                  },
                  "title": "Response List Scans Api V1 Connected Orgs  Connected Org Id  Scans Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Scans",
        "tags": [
          "scans"
        ]
      },
      "post": {
        "description": "Trigger a new scan for a connected org.\n\nAccepts an optional JSON body with ``scan_type``: ``\"incremental\"`` (default)\nskips repos unchanged since the last scan; ``\"full\"`` re-scans every repo.\nCreates a Scan record immediately (status=pending) and dispatches\nthe scan to a Celery worker. Poll GET /scans/{scan_id} for progress.",
        "operationId": "trigger_scan_api_v1_connected_orgs__connected_org_id__scans_post",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScanTriggerRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanTriggerResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Trigger Scan",
        "tags": [
          "scans"
        ]
      }
    },
    "/api/v1/connected-orgs/{connected_org_id}/stats": {
      "get": {
        "description": "Aggregate statistics for a single connected org (per-org drill-down).",
        "operationId": "get_connected_org_stats_api_v1_connected_orgs__connected_org_id__stats_get",
        "parameters": [
          {
            "in": "path",
            "name": "connected_org_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Connected Org Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgStats"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Connected Org Stats",
        "tags": [
          "connected-orgs"
        ]
      }
    },
    "/api/v1/invitations/{token}": {
      "get": {
        "description": "Preview an invitation (workspace name, inviter, role) before accepting.",
        "operationId": "preview_invitation_api_v1_invitations__token__get",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationPreviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Preview Invitation",
        "tags": [
          "invitations"
        ]
      }
    },
    "/api/v1/invitations/{token}/accept": {
      "post": {
        "description": "Accept an invitation. User must be authenticated (session or API key).",
        "operationId": "accept_invitation_api_v1_invitations__token__accept_post",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Accept Invitation Api V1 Invitations  Token  Accept Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Accept Invitation",
        "tags": [
          "invitations"
        ]
      }
    },
    "/api/v1/repositories/lookup": {
      "get": {
        "description": "Resolve an agent-supplied identifier to a Riftmap repository row.\n\nDesigned for AI coding agents and CI integrations: an agent in\n``github.com/myorg/repo`` can ask Riftmap for the matching repository\nwithout enumerating the workspace. **Pass exactly one of ``url`` or\n``full_path``** \u2014 passing both, neither, or any other parameter\n(e.g. ``clone_url=``, ``name=``, ``repo=``) returns 400. The parameter\nis named ``url`` (not ``clone_url``) even though it accepts what most\nplatforms call a \"clone URL\".\n\nURL matching first attempts a normalised ``clone_url`` match, then falls\nback to the ``org/repo`` segment of the URL against ``full_path``. Returns\n409 if more than one repo matches; 404 if none.",
        "operationId": "lookup_repository_api_v1_repositories_lookup_get",
        "parameters": [
          {
            "description": "Git remote URL (https or ssh form, with or without `.git` suffix). Example: `https://github.com/myorg/repo`. **The parameter is named `url`, not `clone_url`** \u2014 a common agent guess that returns 400. Mutually exclusive with `full_path`.",
            "in": "query",
            "name": "url",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Git remote URL (https or ssh form, with or without `.git` suffix). Example: `https://github.com/myorg/repo`. **The parameter is named `url`, not `clone_url`** \u2014 a common agent guess that returns 400. Mutually exclusive with `full_path`.",
              "title": "Url"
            }
          },
          {
            "description": "Repository full path within its host. Example: `myorg/repo`. Case-insensitive. Mutually exclusive with `url`.",
            "in": "query",
            "name": "full_path",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Repository full path within its host. Example: `myorg/repo`. Case-insensitive. Mutually exclusive with `url`.",
              "title": "Full Path"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resolve a clone URL or org/repo slug to a repository (pass exactly one of `url` or `full_path`).",
        "tags": [
          "repositories"
        ]
      }
    },
    "/api/v1/repositories/{repo_id}": {
      "get": {
        "description": "Get a single repository by ID.",
        "operationId": "get_repository_api_v1_repositories__repo_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "repo_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Repo Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get a single repository by ID, including freshness fields.",
        "tags": [
          "repositories"
        ]
      }
    },
    "/api/v1/repositories/{repo_id}/context": {
      "get": {
        "description": "Return the repo, capped direct dependents/dependencies, and artifacts in one call.\n\n**This is the recommended second call** for AI coding agents auditing a\nrepo (after ``/repositories/lookup`` resolves the ID). One request\ncollapses what would otherwise be three or four. The freshness fields on\n``repository`` (``last_scanned_at``, ``last_activity_at``,\n``last_commit_sha``, ``archived``) let the agent decide whether to trust\nthe data or trigger a rescan.\n\nDirect dependents and dependencies are capped at 100 rows each; the\n``dependencies_total`` and ``dependents_total`` fields carry the post-dedup\ncount so the agent knows when to paginate via the dedicated\n``/dependencies`` and ``/dependents`` endpoints. For transitive blast\nradius (multi-hop downstream), call ``/repositories/{id}/impact`` after\nthis \u2014 it is deliberately *not* bundled here because not every agent flow\nneeds it.",
        "operationId": "get_repository_context_api_v1_repositories__repo_id__context_get",
        "parameters": [
          {
            "in": "path",
            "name": "repo_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Repo Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryContextResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Recommended first hydration call after `/lookup`: repo + capped deps + capped dependents + artifacts in one round-trip.",
        "tags": [
          "repositories"
        ]
      }
    },
    "/api/v1/repositories/{repo_id}/dependencies": {
      "get": {
        "description": "Get all dependency declarations from this repo's latest scan.\n\nPaginated via ``limit`` / ``offset`` (default 100, max 500). ``X-Total-Count``\ncarries the post-dedup total so agents know whether to fetch additional pages.",
        "operationId": "get_dependencies_api_v1_repositories__repo_id__dependencies_get",
        "parameters": [
          {
            "in": "path",
            "name": "repo_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Repo Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum items to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum items to return.",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Items to skip.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Items to skip.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DependencyInfo"
                  },
                  "title": "Response Get Dependencies Api V1 Repositories  Repo Id  Dependencies Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List the dependency declarations this repository makes.",
        "tags": [
          "repositories"
        ]
      }
    },
    "/api/v1/repositories/{repo_id}/dependents": {
      "get": {
        "description": "Get all repos that directly depend on this repository, with dependency details.\n\nPaginated via ``limit`` / ``offset`` (default 100, max 500). ``X-Total-Count``\ncarries the post-dedup total of upstream caller declarations.",
        "operationId": "get_dependents_api_v1_repositories__repo_id__dependents_get",
        "parameters": [
          {
            "in": "path",
            "name": "repo_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Repo Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum items to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum items to return.",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Items to skip.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Items to skip.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DependencyInfo"
                  },
                  "title": "Response Get Dependents Api V1 Repositories  Repo Id  Dependents Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List the repositories that directly depend on this repository.",
        "tags": [
          "repositories"
        ]
      }
    },
    "/api/v1/repositories/{repo_id}/impact": {
      "get": {
        "description": "Get the full downstream impact of changing this repository.\n\nReturns all repositories that depend on this one, directly or transitively,\nup to ``max_depth`` hops away. Use this before publishing a breaking change.\n\n**Repo-level scope, not file-scoped.** This endpoint computes a BFS over\nrepo-to-repo dependency edges; it does **not** trace specific files, jobs,\nor symbols within the source repo. There is no ``path``, ``paths``,\n``file``, or ``job`` query parameter \u2014 agents asking \"who consumes file X\nin repo Y\" should call ``/repositories/{id}/dependents`` and then grep the\nconsumer repos directly, since per-file edges aren't stored in the graph.\nUnknown query parameters are silently ignored by FastAPI, which can mask\nhallucinated filter names \u2014 if a filter doesn't appear in this signature,\nit's not honoured.\n\nFor artifact-level consumers (who pulls Docker image / Helm chart /\nTerraform module X and at what version), use ``/artifacts/{id}/consumers``\ninstead \u2014 that endpoint *is* version-aware.",
        "operationId": "repository_impact_api_v1_repositories__repo_id__impact_get",
        "parameters": [
          {
            "in": "path",
            "name": "repo_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Repo Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum BFS depth (hops from the source repo). Range 1\u201320, default 10.",
            "in": "query",
            "name": "max_depth",
            "required": false,
            "schema": {
              "default": 10,
              "description": "Maximum BFS depth (hops from the source repo). Range 1\u201320, default 10.",
              "maximum": 20,
              "minimum": 1,
              "title": "Max Depth",
              "type": "integer"
            }
          },
          {
            "description": "Minimum edge confidence to traverse. Default 0.8 excludes heuristic findings (0.4\u20130.7) and only follows deterministic dependency edges. Set to 0.0 to include all edges.",
            "in": "query",
            "name": "min_confidence",
            "required": false,
            "schema": {
              "default": 0.8,
              "description": "Minimum edge confidence to traverse. Default 0.8 excludes heuristic findings (0.4\u20130.7) and only follows deterministic dependency edges. Set to 0.0 to include all edges.",
              "maximum": 1.0,
              "minimum": 0.0,
              "title": "Min Confidence",
              "type": "number"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpactResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Transitive downstream blast radius (repo-level BFS). NOT file-path scoped \u2014 accepts only `max_depth` + `min_confidence`.",
        "tags": [
          "impact"
        ]
      }
    },
    "/api/v1/scans/{scan_id}": {
      "get": {
        "description": "Get the current status and progress of a scan.",
        "operationId": "get_scan_api_v1_scans__scan_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "scan_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scan Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Scan",
        "tags": [
          "scans"
        ]
      }
    },
    "/api/v1/scans/{scan_id}/cancel": {
      "post": {
        "description": "Cancel a pending or running scan.\n\nSets the scan status to 'cancelled' immediately. The Celery worker checks\nthis flag at each repository boundary and stops gracefully.",
        "operationId": "cancel_scan_api_v1_scans__scan_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "scan_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Scan Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel Scan",
        "tags": [
          "scans"
        ]
      }
    },
    "/api/v1/webhooks/stripe": {
      "post": {
        "description": "Handle Stripe webhook events idempotently.",
        "operationId": "stripe_webhook_api_v1_webhooks_stripe_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Stripe Webhook Api V1 Webhooks Stripe Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Stripe Webhook",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces": {
      "get": {
        "description": "Return all workspaces the authenticated user is a member of.\n\nFor API key auth: returns the single workspace the key belongs to (total always 1).\nPaginated via ``limit`` / ``offset`` query params (default 100, max 500).\n``X-Total-Count`` response header carries the unfiltered row count.",
        "operationId": "list_workspaces_api_v1_workspaces_get",
        "parameters": [
          {
            "description": "Maximum items to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum items to return.",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Items to skip.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Items to skip.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceResponse"
                  },
                  "title": "Response List Workspaces Api V1 Workspaces Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Workspaces",
        "tags": [
          "workspaces"
        ]
      },
      "post": {
        "description": "Create a new workspace for the current user and make them Owner.\n\nEach user may own at most one free workspace. If they already own a free\nworkspace, they must subscribe to a paid plan before creating another.",
        "operationId": "create_workspace_api_v1_workspaces_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Workspace",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v1/workspaces/create-with-checkout": {
      "post": {
        "description": "Create a new workspace and immediately open a Stripe Checkout session for it.\n\nUsed when the caller already owns a free workspace and wants to create\nan additional paid workspace. The workspace is provisioned with plan=\"free\"\nfirst; the webhook handler upgrades it to the chosen plan once Stripe\nconfirms payment.\n\nRequires: session auth, Stripe enabled.",
        "operationId": "create_workspace_with_checkout_api_v1_workspaces_create_with_checkout_post",
        "parameters": [
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWorkspaceWithCheckoutBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWorkspaceWithCheckoutResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Workspace With Checkout",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}": {
      "delete": {
        "description": "Delete a workspace. Owner only. Hard delete \u2014 cascades to everything.",
        "operationId": "delete_workspace_api_v1_workspaces__workspace_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Workspace",
        "tags": [
          "workspaces"
        ]
      },
      "get": {
        "description": "Get a single workspace by ID (404 if not the caller's).",
        "operationId": "get_workspace_api_v1_workspaces__workspace_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Workspace",
        "tags": [
          "workspaces"
        ]
      },
      "put": {
        "description": "Update workspace name/slug. Requires Admin or Owner.",
        "operationId": "update_workspace_api_v1_workspaces__workspace_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Workspace",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/api-key/regenerate": {
      "post": {
        "description": "[Deprecated] Rotate API key. Use POST /workspaces/{id}/api-keys instead.",
        "operationId": "regenerate_api_key_api_v1_workspaces__workspace_id__api_key_regenerate_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Regenerate Api Key Api V1 Workspaces  Workspace Id  Api Key Regenerate Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Regenerate Api Key",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/api-keys": {
      "get": {
        "description": "List API keys for the workspace. Never returns the raw key value.",
        "operationId": "list_api_keys_api_v1_workspaces__workspace_id__api_keys_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyResponse"
                  },
                  "title": "Response List Api Keys Api V1 Workspaces  Workspace Id  Api Keys Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Api Keys",
        "tags": [
          "api-keys"
        ]
      },
      "post": {
        "description": "Create a new API key. Returns the plaintext key once \u2014 store it now.",
        "operationId": "create_api_key_api_v1_workspaces__workspace_id__api_keys_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Api Key",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/api-keys/{key_id}": {
      "delete": {
        "description": "Revoke an API key. Immediately invalidates it.",
        "operationId": "revoke_api_key_api_v1_workspaces__workspace_id__api_keys__key_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "key_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Key Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Api Key",
        "tags": [
          "api-keys"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing": {
      "get": {
        "description": "Return the current billing status for the workspace.",
        "operationId": "get_billing_status_api_v1_workspaces__workspace_id__billing_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingStatusResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Billing Status",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/cancel": {
      "post": {
        "description": "Schedule subscription cancellation at period end and record exit-survey row.\n\nSets ``cancel_at_period_end=true`` on the Stripe subscription. Inserts a row\nin ``subscription_cancellations`` capturing the optional reason + free-text.\nThe row is immutable \u2014 resuming the subscription does NOT delete it; it's an\nevent log, not state.",
        "operationId": "cancel_subscription_api_v1_workspaces__workspace_id__billing_cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelSubscriptionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Cancel Subscription",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/cancel/preview": {
      "get": {
        "description": "Return the queued (uninvoiced) Stripe invoice items for this workspace's customer.\n\nUsed by ``CancelPanel`` to surface orphan prorations BEFORE the user confirms\ncancellation \u2014 a queued $134 charge from a prior plan-switch will still flush\nonto the final cycle invoice unless explicitly waived via\n``cancel?waive_pending_charges=true``.\n\nImplementation note: uses ``InvoiceItem.list(pending=True)`` directly rather\nthan ``Invoice.create_preview`` because the latter conflates renewal recurring\nline items with prorations and requires brittle line-flag classification on\nStripe API ``2025-03-31.basil`` (see comment on ``preview_change_plan``).",
        "operationId": "preview_cancel_api_v1_workspaces__workspace_id__billing_cancel_preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelPreviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Preview pending charges that will bill on the final invoice if not waived",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/change-plan": {
      "post": {
        "description": "Switch between Team and Business plans on an existing subscription.\n\nReplaces the base plan subscription item in Stripe and removes any seat\nadd-ons (extra_seats resets to 0 \u2014 re-add after switching if needed).\n\nPre-flight checks (409 with structured body):\n- ``org_disconnect_required``: target plan allows fewer org connections than\n  are currently connected.  Disconnect excess orgs first, then retry.\n- ``member_eviction_required``: target plan's included seats are fewer than\n  the current member count.  Supply ``member_ids_to_evict`` (exactly the\n  overflow count) to proceed atomically.",
        "operationId": "change_plan_api_v1_workspaces__workspace_id__billing_change_plan_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangePlanResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Change Plan",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/change-plan/preview": {
      "get": {
        "description": "Preview the proration and recurring-amount impact of switching plans.\n\nRead-only: does not mutate Stripe state or workspace state. Warnings mirror\nthe 409 conflicts that ``change_plan`` would raise (org overflow, member\noverflow) so the frontend can surface them before the user commits.",
        "operationId": "preview_change_plan_api_v1_workspaces__workspace_id__billing_change_plan_preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "target_plan",
            "required": true,
            "schema": {
              "enum": [
                "team",
                "business"
              ],
              "title": "Target Plan",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "promotion_code",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Promotion Code"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangePlanPreviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Preview Change Plan",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/checkout": {
      "post": {
        "description": "Create a Stripe Checkout session for plan upgrade.",
        "operationId": "create_checkout_session_api_v1_workspaces__workspace_id__billing_checkout_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Body",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Checkout Session",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/history": {
      "get": {
        "description": "Return a unified, date-desc list of invoices and credit notes for the workspace.\n\nReturns up to 50 of each kind per page. Each source (invoices, credit notes)\npaginates independently via Stripe's native ``starting_after`` cursor; callers\nthread the returned ``next_invoice_cursor`` / ``next_credit_note_cursor`` back\nas query params to fetch the next page. ``has_more`` is true when either\ncursor is non-null. Proration line items are embedded in their parent invoice\ndescription \u2014 they are NOT emitted as standalone events.",
        "operationId": "get_billing_history_api_v1_workspaces__workspace_id__billing_history_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "invoice_cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Invoice Cursor"
            }
          },
          {
            "in": "query",
            "name": "credit_note_cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Credit Note Cursor"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingHistoryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Billing History",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/payment-info": {
      "get": {
        "description": "Return the workspace's default payment method and recent invoices from Stripe.",
        "operationId": "get_payment_info_api_v1_workspaces__workspace_id__billing_payment_info_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentInfoResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Payment Info",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/payment-methods": {
      "post": {
        "description": "Attach a confirmed PaymentMethod to the customer and optionally set as default.\n\nCalled after Stripe Elements ``confirmSetup`` resolves on the frontend. We\nattach synchronously (rather than waiting for the ``payment_method.attached``\nwebhook) so the UI can render the new card immediately after the modal closes.",
        "operationId": "attach_payment_method_api_v1_workspaces__workspace_id__billing_payment_methods_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachPaymentMethodRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachPaymentMethodResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Attach Payment Method",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/payment-methods/setup-intent": {
      "post": {
        "description": "Create a Stripe SetupIntent for in-app card collection via Stripe Elements.\n\nReturns the SetupIntent ``client_secret`` plus the publishable key bound to\nthe backend's Stripe environment, so the frontend never needs a ``VITE_``\nenv var for the publishable key (and can't drift from the backend's mode).",
        "operationId": "create_setup_intent_api_v1_workspaces__workspace_id__billing_payment_methods_setup_intent_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupIntentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Setup Intent",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/portal": {
      "post": {
        "description": "Create a Stripe Customer Portal session for managing subscription.",
        "operationId": "create_portal_session_api_v1_workspaces__workspace_id__billing_portal_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Portal Session",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/resume": {
      "post": {
        "description": "Clear ``cancel_at_period_end`` on a subscription pending cancellation.\n\nThe webhook handler for ``customer.subscription.updated`` will clear\n``workspace.cancel_at`` when Stripe echoes the change; we also clear it\noptimistically here so the UI banner disappears immediately.",
        "operationId": "resume_subscription_api_v1_workspaces__workspace_id__billing_resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResumeSubscriptionResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resume Subscription",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/seats": {
      "delete": {
        "description": "Remove extra seat add-ons from the existing subscription.\n\nReduces the seat add-on quantity by ``seats_to_remove``. Cannot go below\nzero extra seats. If the quantity reaches zero the add-on line item is\nremoved from the subscription entirely.\n\nWhen the reduction would put the workspace over the new seat limit, the\ncaller must supply ``member_ids_to_evict`` \u2014 exactly as many IDs as the\noverflow count.  If they are not supplied, the endpoint returns 409 with\n``type=\"member_eviction_required\"`` and the full list of evictable members\n(non-owners, sorted newest-first) so the frontend can render a picker.\n\nThe Stripe item modification and the member removals are committed together\nso the workspace is never left in a partially-updated state.",
        "operationId": "remove_seats_api_v1_workspaces__workspace_id__billing_seats_delete",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveSeatsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveSeatsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Seats",
        "tags": [
          "billing"
        ]
      },
      "post": {
        "description": "Add extra seat add-ons to the existing subscription.",
        "operationId": "add_seats_api_v1_workspaces__workspace_id__billing_seats_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddSeatsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddSeatsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Seats",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/seats/preview": {
      "get": {
        "description": "Preview the proration and recurring-amount impact of adding or removing seat add-ons.\n\n``seat_delta`` is signed \u2014 positive = adding, negative = removing. Mirrors\nthe ``change-plan/preview`` contract so ``AddSeatsPanel`` / ``RemoveSeatsPanel``\ncan render the same \"What you'll pay\" breakdown before the user confirms.\n\nRead-only: does not mutate Stripe or workspace state.",
        "operationId": "preview_seat_change_api_v1_workspaces__workspace_id__billing_seats_preview_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "seat_delta",
            "required": true,
            "schema": {
              "title": "Seat Delta",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SeatChangePreviewResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Preview Seat Change",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/billing/usage": {
      "get": {
        "description": "Return detailed resource usage vs. plan limits for the workspace.",
        "operationId": "get_billing_usage_api_v1_workspaces__workspace_id__billing_usage_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingUsageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Billing Usage",
        "tags": [
          "billing"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/export": {
      "get": {
        "description": "GDPR right-to-portability export for a workspace.\n\nReturns a JSON file containing all workspace data. Secrets are redacted:\naccess_token_encrypted is omitted from connected orgs, and key_hash is\nomitted from API keys (only the safe prefix is included).\n\nRate limited to 1 export per workspace per hour.\nRequires Owner or Admin role.",
        "operationId": "export_workspace_api_v1_workspaces__workspace_id__export_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Export Workspace",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/invitations": {
      "get": {
        "description": "List active invitations for a workspace.",
        "operationId": "list_invitations_api_v1_workspaces__workspace_id__invitations_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/InvitationResponse"
                  },
                  "title": "Response List Invitations Api V1 Workspaces  Workspace Id  Invitations Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Invitations",
        "tags": [
          "invitations"
        ]
      },
      "post": {
        "description": "Create an invitation (email or copyable link).",
        "operationId": "create_invitation_api_v1_workspaces__workspace_id__invitations_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Invitation",
        "tags": [
          "invitations"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/invitations/{invitation_id}": {
      "delete": {
        "description": "Revoke an invitation.",
        "operationId": "revoke_invitation_api_v1_workspaces__workspace_id__invitations__invitation_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invitation_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Invitation Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Invitation",
        "tags": [
          "invitations"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/leave": {
      "post": {
        "description": "Leave a workspace. Cannot leave as the last Owner \u2014 transfer ownership first.",
        "operationId": "leave_workspace_api_v1_workspaces__workspace_id__leave_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Leave Workspace",
        "tags": [
          "memberships"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/members": {
      "get": {
        "description": "List all members of a workspace. Any member can access.\n\nPaginated via ``limit`` / ``offset`` query params (default 100, max 500).\n``X-Total-Count`` response header carries the unfiltered row count.",
        "operationId": "list_members_api_v1_workspaces__workspace_id__members_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "description": "Maximum items to return.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "description": "Maximum items to return.",
              "maximum": 500,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Items to skip.",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "description": "Items to skip.",
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MemberResponse"
                  },
                  "title": "Response List Members Api V1 Workspaces  Workspace Id  Members Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Members",
        "tags": [
          "memberships"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/members/{user_id}": {
      "delete": {
        "description": "Remove a member. Cannot remove the last Owner or self (use /leave).",
        "operationId": "remove_member_api_v1_workspaces__workspace_id__members__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Member",
        "tags": [
          "memberships"
        ]
      },
      "patch": {
        "description": "Change a member's role. Cannot demote the last Owner.",
        "operationId": "update_member_role_api_v1_workspaces__workspace_id__members__user_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Member Role",
        "tags": [
          "memberships"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/oauth-orgs/{provider}": {
      "get": {
        "description": "List GitHub orgs or GitLab groups accessible via the user's linked OAuth identity.\n\nUsed by the frontend org-picker so users can connect an org without pasting a PAT.\nRequires session auth \u2014 the token lives on the user's identity row, not the workspace.",
        "operationId": "list_oauth_orgs_api_v1_workspaces__workspace_id__oauth_orgs__provider__get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "title": "Provider",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OAuthOrgInfo"
                  },
                  "title": "Response List Oauth Orgs Api V1 Workspaces  Workspace Id  Oauth Orgs  Provider  Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Oauth Orgs",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/stats": {
      "get": {
        "description": "Aggregate statistics across all connected orgs in the workspace.",
        "operationId": "get_workspace_stats_api_v1_workspaces__workspace_id__stats_get",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgStats"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Workspace Stats",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/api/v1/workspaces/{workspace_id}/transfer": {
      "post": {
        "description": "Transfer ownership to another member. Caller is demoted to Admin; target is promoted to Owner.\n\nRequires session auth \u2014 API keys cannot transfer ownership (no user identity to demote).",
        "operationId": "transfer_ownership_api_v1_workspaces__workspace_id__transfer_post",
        "parameters": [
          {
            "in": "path",
            "name": "workspace_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Workspace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Workspace-Id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Workspace-Id"
            }
          },
          {
            "in": "cookie",
            "name": "riftmap_access",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Riftmap Access"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferOwnershipBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Transfer Ownership Api V1 Workspaces  Workspace Id  Transfer Post",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          },
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Transfer Ownership",
        "tags": [
          "workspaces"
        ]
      }
    },
    "/health": {
      "get": {
        "description": "Liveness probe \u2014 always returns 200 if the process is up.\n\nSuitable for Railway / Docker HEALTHCHECK and load-balancer pings.\nDoes not perform any subsystem checks so it never leaks internal\nhostnames, DSN fragments, or exception details.  Use /health/detailed\n(admin-gated) for rich subsystem diagnostics, or /ready (public)\nfor a strict ready-to-serve check.",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health",
        "tags": [
          "meta"
        ]
      }
    },
    "/health/detailed": {
      "get": {
        "description": "Detailed subsystem health \u2014 requires admin API key (X-API-Key header).\n\nVerifies database, Redis broker, Redis state, Celery workers, Redis\nmemory pressure, and clone-directory disk space.  Rich exception details\nare written to the application log at WARN/ERROR level and are NOT\nincluded in the HTTP response body \u2014 the body only carries \"ok\",\n\"warning: <summary>\", or \"degraded\" per subsystem.",
        "operationId": "health_detailed_health_detailed_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Health Detailed",
        "tags": [
          "meta"
        ]
      }
    },
    "/ready": {
      "get": {
        "description": "Readiness probe \u2014 public, unauthenticated.\n\nReturns 200 only when Postgres, both Redis DBs, and at least one\nCelery worker are reachable. Returns 503 with the failing subsystem\nnames ({\"status\": \"not_ready\", \"failed\": [...]}). Subsystem-level\n*detail* (hostnames, exceptions) is logged via structlog and never\nreturned in the body.\n\nIntended for Betterstack / external monitoring. **Do not** wire this\nas Railway's container healthcheck \u2014 a 30 s Redis blip would restart\nthe API. See docs/deployment/external-monitoring.md.",
        "operationId": "ready_ready_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Ready",
        "tags": [
          "meta"
        ]
      }
    }
  }
}
