{
  "components": {
    "schemas": {
      "connectors.Connector": {
        "properties": {
          "auth_type": {
            "description": "Authentication method for the provider connection (e.g. `api_token`, `oauth`).",
            "example": "api_token",
            "type": "string"
          },
          "collection": {
            "description": "Default collection partition for synced objects. Canonical name; mirrors the deprecated `sub_tenant_id` alias.",
            "example": "team_docs",
            "type": "string"
          },
          "connector_id": {
            "description": "Connector this resource belongs to.",
            "example": "conn_abc123",
            "type": "string"
          },
          "credential_ref": {
            "description": "Internal reference to the stored credential record.",
            "example": "cred_1a2b3c",
            "type": "string"
          },
          "database": {
            "description": "Database/Collection are the canonical v2 names for the deprecated\ntenant_id/sub_tenant_id wire fields. They mirror the same values so a v2\nclient sees the canonical names on responses while a legacy client keeps\nreading tenant_id/sub_tenant_id. Not persisted (dynamodbav:\"-\"): the store\nbuilds items from tenant_id/sub_tenant_id and mirrors these on load. They\nare populated at every construction point (toConnector, connectorFromItem)\nrather than via MarshalJSON so Temporal's JSON data converter round-trips\nConnector activity inputs without spuriously populating them.",
            "example": "acme_corp",
            "type": "string"
          },
          "deployment_id": {
            "description": "Internal deployment context for this connector.",
            "example": "deploy_1234",
            "type": "string"
          },
          "last_attempted_sync_at": {
            "description": "RFC3339 timestamp of the most recent sync attempt (successful or not).",
            "example": "2026-07-02T17:00:00Z",
            "type": "string"
          },
          "last_error": {
            "description": "Error message from the most recent failed sync, empty string when no error.",
            "example": "",
            "type": "string"
          },
          "last_successful_sync_at": {
            "description": "RFC3339 timestamp of the last successful sync completion.",
            "example": "2026-07-02T17:00:00Z",
            "type": "string"
          },
          "name": {
            "description": "Human-readable label for this connector.",
            "example": "general",
            "type": "string"
          },
          "needs_reauth": {
            "description": "NeedsReauth is set by MOVEIT's OAuth refresh sweep when the provider has\nrejected the connector's refresh token (`invalid_grant` — expired, revoked,\nor, for a provider with single-use tokens, already spent).\n\nIt is deliberately distinct from LastError, which records a *sync* failure.\nThis is the one failure class no amount of retrying resolves: the stored\ngrant is gone and only the tenant can mint a new one. Surfacing it as its\nown field is what lets a client show \"reconnect\" instead of a generic\n\"sync failed\", and the sweep clears it automatically on the next successful\nrotation, so a client can trust the absence of the flag as much as its\npresence.\n\nOnly ever set on OAuth-bundle connectors. A connector authenticated with a\nstatic token or with client credentials (X posts: see the `client_id` /\n`client_secret` inputs on tap-twitter) has no refresh token and therefore\ncannot reach this state at all — which is the reason to prefer that shape\nwhere a provider offers it.",
            "example": true,
            "type": "boolean"
          },
          "needs_reauth_at": {
            "type": "string"
          },
          "needs_reauth_reason": {
            "type": "string"
          },
          "next_sync_at": {
            "description": "RFC3339 timestamp when the next scheduled sync will run.",
            "example": "2026-07-02T18:00:00Z",
            "type": "string"
          },
          "org_id": {
            "description": "Organization that owns this resource.",
            "example": "org_1a2b3c",
            "type": "string"
          },
          "plan": {
            "description": "Subscription plan this connector runs under.",
            "example": "pro",
            "type": "string"
          },
          "provider": {
            "description": "External provider being synced (e.g. `slack`, `github`, `linear`, `notion`, `gmail`).",
            "example": "slack",
            "type": "string"
          },
          "provider_account_scope": {
            "description": "Identifier for the external account (e.g. Slack workspace ID, GitHub org name). Must be distinct across connectors for the same provider.",
            "example": "T12345ACME",
            "type": "string"
          },
          "status": {
            "description": "Lifecycle status of the connector (e.g. `active`, `paused`, `error`).",
            "example": "completed",
            "type": "string"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "Default collection partition for synced objects. Deprecated — use `collection`.",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "sync_engine": {
            "description": "SyncEngine is \"classic\" (default, empty treated as classic) or \"moveit\".\nSee the SyncEngine* constants; the scheduler branches on it.",
            "type": "string"
          },
          "sync_interval_seconds": {
            "description": "How frequently the scheduler triggers incremental syncs, in seconds. Bounded per provider; send 0 or omit to use the provider default. Change it later with PATCH /connectors/{id}.",
            "example": 3600,
            "type": "integer"
          },
          "sync_status": {
            "description": "Current sync operation state (e.g. `idle`, `running`).",
            "example": "idle",
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "Database that receives synced data. Deprecated — use `database`.",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          },
          "user_id": {
            "description": "User that created or owns this resource.",
            "example": "user_alex",
            "type": "string"
          }
        },
        "type": "object"
      },
      "connectors.Resource": {
        "properties": {
          "additional_metadata": {
            "additionalProperties": {},
            "description": "AdditionalMetadata is merged into the additional_metadata (document\nmetadata) layer of every object synced from this resource. User-supplied\nkeys are shallow-merged as the base; provider-generated fields are\napplied on top and always win on conflict.",
            "example": {
              "author": "ada",
              "doc_version": 3
            },
            "type": "object"
          },
          "backfill_chunk_interval_seconds": {
            "description": "BackfillChunkIntervalSeconds is the pacing interval persisted at configure\ntime so the scheduler can thread it into each chunk's workflow input.",
            "example": 86400,
            "type": "integer"
          },
          "backfill_next_chunk_at": {
            "description": "BackfillNextChunkAt is the RFC3339 time the next chunk becomes due. The\nbackfill workflow processes one chunk then sets this to now+interval and\nexits; the connector scheduler starts the next chunk once it passes.",
            "type": "string"
          },
          "backfill_oldest": {
            "description": "BackfillOldest is an RFC3339 timestamp marking the oldest boundary remaining\nfor async historical backfill. Empty means backfill is complete or not needed.",
            "example": "2026-06-01T00:00:00Z",
            "type": "string"
          },
          "backfill_status": {
            "description": "BackfillStatus gates the sparse ResourcesByBackfillNextChunkAt GSI: it is\nset to BackfillStatusActive while a historical backfill is in progress and\nremoved when it completes, so only actively-backfilling resources appear in\nthe scheduler's due query. Pacing between chunks is driven by that scheduler\n(see BackfillNextChunkAt), not by an in-workflow sleep.",
            "type": "string"
          },
          "collection_override": {
            "description": "Routes this resource's synced objects into a specific collection, overriding the connector's. Canonical name; mirrors the deprecated `sub_tenant_id_override` alias.",
            "type": "string"
          },
          "connector_id": {
            "description": "Connector this resource belongs to.",
            "example": "conn_abc123",
            "type": "string"
          },
          "database_override": {
            "description": "DatabaseOverride/CollectionOverride are the canonical v2 names for the\ndeprecated tenant_id_override/sub_tenant_id_override wire fields. Empty\nmeans the resource inherits the connector's database/collection, exactly\nas the deprecated fields do. Not persisted (dynamodbav:\"-\"): mirrored from\nthe tenant_id_override/sub_tenant_id_override values at construction time.",
            "type": "string"
          },
          "display_name": {
            "description": "Human-readable name for this resource.",
            "example": "general",
            "type": "string"
          },
          "filters": {
            "additionalProperties": {},
            "description": "Provider-specific filters applied during sync (e.g. `{\"lookback_days\": 30}`).",
            "example": {
              "channel": "general"
            },
            "type": "object"
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Metadata is merged into the tenant metadata layer of every object synced\nfrom this resource. User-supplied keys are shallow-merged as the base;\nsystem defaults (connector_id, provider) are applied on top so they\nalways win on conflict — user keys extend the map but cannot override\nsystem-set fields.",
            "example": {
              "department": "finance",
              "priority": 7
            },
            "type": "object"
          },
          "provider_cursor": {
            "description": "Bookmark of the last synced position. Non-empty value confirms the first sync has run.",
            "example": "1699999999.000100",
            "type": "string"
          },
          "provider_metadata": {
            "additionalProperties": {},
            "description": "Additional provider-supplied metadata for this resource.",
            "example": {
              "workspace_id": "T12345ACME"
            },
            "type": "object"
          },
          "resource_id": {
            "description": "Resource identifier from the Discover endpoint.",
            "example": "C0123456789",
            "type": "string"
          },
          "resource_type": {
            "description": "Type of resource within the provider (e.g. `channel`, `repo`, `linear_team`).",
            "example": "channel",
            "type": "string"
          },
          "status": {
            "description": "Current sync state of this resource (e.g. `active`, `paused`).",
            "example": "completed",
            "type": "string"
          },
          "sub_tenant_id_override": {
            "deprecated": true,
            "description": "Overrides the connector-level collection for objects synced from this resource.",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_id_override": {
            "deprecated": true,
            "description": "Overrides the connector-level database for objects synced from this resource. Deprecated.",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "dashboard.PaginationMeta": {
        "properties": {
          "has_next": {
            "description": "Whether a next page exists.",
            "example": true,
            "type": "boolean"
          },
          "has_previous": {
            "description": "Whether a previous page exists.",
            "example": false,
            "type": "boolean"
          },
          "page": {
            "description": "Current page number (1-indexed).",
            "example": 1,
            "type": "integer"
          },
          "page_size": {
            "description": "Number of items per page.",
            "example": 50,
            "type": "integer"
          },
          "total": {
            "description": "Total number of items across all pages.",
            "example": 128,
            "type": "integer"
          },
          "total_pages": {
            "description": "Total number of pages.",
            "example": 3,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "feedback.GroundTruth": {
        "properties": {
          "answer": {
            "description": "Answer is the response the caller expected — the text a correct system\nwould have produced from the retrieved context.",
            "maxLength": 8000,
            "type": "string"
          },
          "source_ids": {
            "description": "SourceIDs are the ingested source IDs that actually contain the answer,\nas returned in query results and accepted by /context endpoints.",
            "example": [
              "HydraDoc1234",
              "HydraDoc4567"
            ],
            "items": {
              "maxLength": 256,
              "type": "string"
            },
            "maxItems": 100,
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "feedback.Rating": {
        "enum": [
          "positive",
          "negative",
          "neutral"
        ],
        "type": "string",
        "x-enum-varnames": [
          "RatingPositive",
          "RatingNegative",
          "RatingNeutral"
        ]
      },
      "feedback.Source": {
        "enum": [
          "user",
          "agent"
        ],
        "type": "string",
        "x-enum-varnames": [
          "SourceUser",
          "SourceAgent"
        ]
      },
      "feedback.SubmitRequest": {
        "anyOf": [
          {
            "properties": {
              "feedback": {
                "minLength": 1,
                "pattern": "\\S"
              }
            },
            "required": [
              "feedback"
            ]
          },
          {
            "properties": {
              "ground_truth": {
                "anyOf": [
                  {
                    "properties": {
                      "answer": {
                        "minLength": 1,
                        "pattern": "\\S"
                      }
                    },
                    "required": [
                      "answer"
                    ]
                  },
                  {
                    "properties": {
                      "source_ids": {
                        "contains": {
                          "minLength": 1,
                          "pattern": "\\S"
                        }
                      }
                    },
                    "required": [
                      "source_ids"
                    ]
                  }
                ]
              }
            },
            "required": [
              "ground_truth"
            ]
          }
        ],
        "dependentSchemas": {
          "collection": {
            "anyOf": [
              {
                "required": [
                  "database"
                ]
              },
              {
                "required": [
                  "tenant_id"
                ]
              }
            ]
          },
          "sub_tenant_id": {
            "anyOf": [
              {
                "required": [
                  "database"
                ]
              },
              {
                "required": [
                  "tenant_id"
                ]
              }
            ]
          }
        },
        "properties": {
          "collection": {
            "description": "Optional collection scope for this feedback. A collection is scoped to a database, so `database` must be sent alongside it; sending `collection` on its own is rejected. If you also send the deprecated `sub_tenant_id`, the two must carry the same value — they name one thing, and conflicting values are rejected rather than one silently winning.",
            "example": "team_docs",
            "minLength": 1,
            "type": "string"
          },
          "database": {
            "description": "Optional database scope for this feedback. If you also send the deprecated `tenant_id`, the two must carry the same value — they name one thing, and conflicting values are rejected rather than one silently winning.",
            "example": "acme_corp",
            "minLength": 1,
            "type": "string"
          },
          "feedback": {
            "description": "Free-text comment describing what was right or wrong about the results. Required unless `ground_truth` is supplied.",
            "maxLength": 8000,
            "type": "string"
          },
          "ground_truth": {
            "$ref": "#/components/schemas/feedback.GroundTruth",
            "description": "What you already know the right answer to be, when you know it. Supply an expected `answer`, the `source_ids` that contain it, or both — at least one is required if the field is present. Machine-checkable, so it is a stronger signal than a comment: submit it alone and `feedback` becomes optional.",
            "example": {
              "source_ids": [
                "HydraDoc1234",
                "HydraDoc4567"
              ]
            }
          },
          "metadata": {
            "additionalProperties": {
              "maxLength": 512,
              "type": "string"
            },
            "description": "Free-form key-value context stored alongside the feedback (e.g. agent name, conversation or eval-run ID).",
            "example": {
              "agent": "support-bot",
              "conversation": "c-8891"
            },
            "maxProperties": 20,
            "propertyNames": {
              "maxLength": 64
            },
            "type": "object"
          },
          "rating": {
            "$ref": "#/components/schemas/feedback.Rating",
            "description": "Optional overall judgement: `positive`, `negative`, or `neutral`. Omit to send a comment with no rating."
          },
          "request_id": {
            "description": "The `request_id` from `response.meta` of the query this feedback is about. Required — it is what links the feedback to the query that ran.",
            "example": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
            "format": "uuid",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/feedback.Source",
            "description": "Who is submitting: `user` (default) or `agent`."
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "Deprecated — use `collection`. Still accepted, and may be sent alongside `collection` during a migration only if both carry the same value; conflicting values are rejected with 400.",
            "example": "sub_tenant_4567",
            "minLength": 1,
            "type": "string",
            "x-deprecated": "true",
            "x-deprecated-since": "2.0.1"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "Deprecated — use `database`. Still accepted, and may be sent alongside `database` during a migration only if both carry the same value; conflicting values are rejected with 400.",
            "example": "tenant_1234",
            "minLength": 1,
            "type": "string",
            "x-deprecated": "true",
            "x-deprecated-since": "2.0.1"
          }
        },
        "required": [
          "request_id"
        ],
        "type": "object"
      },
      "feedback.SubmitResponse": {
        "properties": {
          "created_at": {
            "description": "RFC3339 timestamp when the feedback was recorded.",
            "example": "2026-07-02T10:00:00Z",
            "type": "string"
          },
          "feedback_id": {
            "description": "Unique identifier assigned to this feedback submission.",
            "type": "string"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "recorded": {
            "description": "Whether the feedback was durably stored.",
            "example": true,
            "type": "boolean"
          },
          "request_id": {
            "description": "The query request ID this feedback was recorded against.",
            "example": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
            "type": "string"
          }
        },
        "type": "object"
      },
      "fetch.V2SourceFetchResponse": {
        "properties": {
          "content": {
            "description": "Extracted text content of the source document.",
            "example": "# Q4 Report\n\nRevenue grew 23% quarter over quarter.",
            "type": "string"
          },
          "content_base64": {
            "description": "Base64-encoded binary content, for binary file types.",
            "type": "string"
          },
          "content_type": {
            "description": "MIME type of the source (e.g. `application/pdf`, `text/plain`).",
            "example": "application/pdf",
            "type": "string"
          },
          "error": {
            "description": "Error message, empty string on success.",
            "example": "",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "inferred_content": {
            "description": "LLM-generated summary of the source content.",
            "example": "Summary: Q4 revenue rose 23% QoQ, driven by enterprise expansion.",
            "type": "string"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "presigned_url": {
            "description": "Time-limited download URL for the original file.",
            "example": "https://storage.hydradb.com/sources/HydraDoc1234?sig=...",
            "type": "string"
          },
          "size_bytes": {
            "description": "File size in bytes.",
            "example": 20480,
            "type": "integer"
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "github_com_hydradb_hydradb-application_internal_service.MetadataEditResult": {
        "properties": {
          "additional_metadata_keys": {
            "description": "Additional metadata keys included in the update request.",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "chunk_rows_matched": {
            "description": "Number of MongoDB chunk rows matched by the source update.",
            "example": 1,
            "type": "integer"
          },
          "chunk_rows_modified": {
            "description": "Number of MongoDB chunk rows modified by the source update.",
            "example": 1,
            "type": "integer"
          },
          "collection": {
            "description": "Collection that contained the source. Canonical name; mirrors the deprecated `sub_tenant_id` alias.",
            "example": "team_docs",
            "type": "string"
          },
          "database": {
            "description": "Owning database. Canonical name; mirrors the deprecated `tenant_id` alias.",
            "example": "acme_corp",
            "type": "string"
          },
          "database_metadata_keys": {
            "description": "Database metadata keys included in the update request. Canonical name; `tenant_metadata_keys` is a deprecated alias.",
            "example": [
              "department",
              "priority"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "milvus_rows_synced": {
            "deprecated": true,
            "description": "deprecated: use vector_rows_synced",
            "example": 1,
            "type": "integer",
            "x-deprecated": "true"
          },
          "milvus_sync_required": {
            "deprecated": true,
            "description": "Deprecated: use vector_sync_required / vector_synced / vector_rows_synced.\nRetained as additive aliases for existing clients; carry the same values.",
            "example": true,
            "type": "boolean",
            "x-deprecated": "true"
          },
          "milvus_synced": {
            "deprecated": true,
            "description": "deprecated: use vector_synced",
            "example": true,
            "type": "boolean",
            "x-deprecated": "true"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "deprecated: use collection",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "deprecated: use database",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_metadata_keys": {
            "deprecated": true,
            "description": "deprecated: use database_metadata_keys",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false,
            "x-deprecated": "true"
          },
          "updated": {
            "description": "Whether the source metadata was updated.",
            "example": true,
            "type": "boolean"
          },
          "vector_rows_synced": {
            "description": "Number of chunk rows synced to the vector store when sync was required.",
            "example": 1,
            "type": "integer"
          },
          "vector_sync_required": {
            "description": "Vendor-neutral vector-sync signal (PRO-1185): the canonical field must not\nname the vector store. The milvus_* fields below are deprecated aliases kept\nfor backward compatibility (additive change, not a rename) and carry the same\nvalues; they are slated for removal in a future major version.",
            "example": true,
            "type": "boolean"
          },
          "vector_synced": {
            "description": "Whether the vector store metadata sync completed. Present when sync was required.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "graph.Entity": {
        "properties": {
          "entity_id": {
            "description": "Unique identifier for this entity in the graph.",
            "example": "entity_1a2b",
            "type": "string"
          },
          "identifier": {
            "description": "NO omitempty — serialize as null",
            "example": "Acme Corp",
            "type": "string"
          },
          "name": {
            "description": "Human-readable label for this resource.",
            "example": "general",
            "type": "string"
          },
          "namespace": {
            "description": "Namespace grouping for the entity (e.g. `organization`, `person`).",
            "example": "organization",
            "type": "string"
          },
          "provider": {
            "description": "Provider is the source app the entity's evidence chunk came from (e.g.\n\"slack\", \"google\", \"intercom\"), read from the owning Source node's\napp_provider. Empty string when the evidence has no app source (plain\ndocument / web ingest). Consumed by the dashboard to render a connector\nlogo inside the graph node.",
            "example": "slack",
            "type": "string"
          },
          "type": {
            "description": "Entity type label (e.g. `knowledge`, `person`, `organization`).",
            "example": "knowledge",
            "type": "string"
          }
        },
        "type": "object"
      },
      "graph.GraphRelationsResponse": {
        "properties": {
          "is_truncated": {
            "description": "Whether the response was truncated due to the result limit.",
            "example": false,
            "type": "boolean"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "next_cursor": {
            "description": "NO omitempty",
            "example": 0.5,
            "type": "number"
          },
          "relations": {
            "description": "Array of triplet groups with evidence for each relationship.",
            "example": [
              {
                "chunk_id": "HydraEmbeddings123_0",
                "relations": [
                  {
                    "canonical_predicate": "works_at",
                    "chunk_id": "HydraEmbeddings123_0",
                    "confidence": 0.92,
                    "context": "Ada joined Acme Corp in 2024 as a staff engineer.",
                    "raw_predicate": "is employed by",
                    "relationship_id": "rel_1234",
                    "source_entity_id": "entity_1a2b",
                    "target_entity_id": "entity_3c4d",
                    "temporal_details": "since 2024",
                    "timestamp": "2026-07-02T10:00:00Z"
                  }
                ],
                "source": {
                  "entity_id": "entity_1a2b",
                  "identifier": "Acme Corp",
                  "name": "general",
                  "namespace": "organization",
                  "provider": "slack",
                  "type": "knowledge"
                },
                "target": {
                  "entity_id": "entity_1a2b",
                  "identifier": "Acme Corp",
                  "name": "general",
                  "namespace": "organization",
                  "provider": "slack",
                  "type": "knowledge"
                }
              }
            ],
            "items": {
              "$ref": "#/components/schemas/graph.TripletWithEvidence"
            },
            "type": "array",
            "uniqueItems": false
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "graph.RelationEvidence": {
        "properties": {
          "canonical_predicate": {
            "description": "Normalized predicate for the relationship (e.g. `works_at`, `depends_on`).",
            "example": "works_at",
            "type": "string"
          },
          "chunk_id": {
            "description": "NO omitempty",
            "example": "HydraEmbeddings123_0",
            "type": "string"
          },
          "confidence": {
            "description": "Confidence score, from 0 to 1.",
            "example": 0.92,
            "type": "number"
          },
          "context": {
            "description": "Verbatim passage from the source that evidences the relationship.",
            "example": "Ada joined Acme Corp in 2024 as a staff engineer.",
            "type": "string"
          },
          "raw_predicate": {
            "description": "As-extracted predicate before normalization.",
            "example": "is employed by",
            "type": "string"
          },
          "relationship_id": {
            "description": "Unique identifier for this relationship instance.",
            "example": "rel_1234",
            "type": "string"
          },
          "source_entity_id": {
            "description": "NO omitempty",
            "example": "entity_1a2b",
            "type": "string"
          },
          "target_entity_id": {
            "description": "NO omitempty",
            "example": "entity_3c4d",
            "type": "string"
          },
          "temporal_details": {
            "description": "NO omitempty",
            "example": "since 2024",
            "type": "string"
          },
          "timestamp": {
            "description": "RFC3339 timestamp associated with this item.",
            "example": "2026-07-02T10:00:00Z",
            "type": "string"
          }
        },
        "type": "object"
      },
      "graph.TripletWithEvidence": {
        "properties": {
          "chunk_id": {
            "description": "Chunk that provides evidence for this relation.",
            "example": "HydraEmbeddings123_0",
            "type": "string"
          },
          "relations": {
            "description": "Evidence entries for this relationship triplet.",
            "example": [
              {
                "canonical_predicate": "works_at",
                "chunk_id": "HydraEmbeddings123_0",
                "confidence": 0.92,
                "context": "Ada joined Acme Corp in 2024 as a staff engineer.",
                "raw_predicate": "is employed by",
                "relationship_id": "rel_1234",
                "source_entity_id": "entity_1a2b",
                "target_entity_id": "entity_3c4d",
                "temporal_details": "since 2024",
                "timestamp": "2026-07-02T10:00:00Z"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/graph.RelationEvidence"
            },
            "type": "array",
            "uniqueItems": false
          },
          "source": {
            "$ref": "#/components/schemas/graph.Entity",
            "example": {
              "entity_id": "entity_1a2b",
              "identifier": "Acme Corp",
              "name": "general",
              "namespace": "organization",
              "provider": "slack",
              "type": "knowledge"
            }
          },
          "target": {
            "$ref": "#/components/schemas/graph.Entity",
            "example": {
              "entity_id": "entity_1a2b",
              "identifier": "Acme Corp",
              "name": "general",
              "namespace": "organization",
              "provider": "slack",
              "type": "knowledge"
            }
          }
        },
        "type": "object"
      },
      "handler.Envelope-feedback_SubmitResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/feedback.SubmitResponse",
            "example": {
              "created_at": "2026-07-02T10:00:00Z",
              "message": "Success",
              "recorded": true,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-fetch_V2SourceFetchResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/fetch.V2SourceFetchResponse",
            "example": {
              "content": "# Q4 Report\n\nRevenue grew 23% quarter over quarter.",
              "content_type": "application/pdf",
              "error": "",
              "id": "HydraDoc1234",
              "inferred_content": "Summary: Q4 revenue rose 23% QoQ, driven by enterprise expansion.",
              "message": "Success",
              "presigned_url": "https://storage.hydradb.com/sources/HydraDoc1234?sig=...",
              "size_bytes": 20480,
              "success": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-github_com_hydradb_hydradb-application_internal_service_MetadataEditResult": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/github_com_hydradb_hydradb-application_internal_service.MetadataEditResult",
            "example": {
              "chunk_rows_matched": 1,
              "chunk_rows_modified": 1,
              "collection": "team_docs",
              "database": "acme_corp",
              "database_metadata_keys": [
                "department",
                "priority"
              ],
              "id": "HydraDoc1234",
              "milvus_rows_synced": 1,
              "milvus_sync_required": true,
              "milvus_synced": true,
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234",
              "updated": true,
              "vector_rows_synced": 1,
              "vector_sync_required": true,
              "vector_synced": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-graph_GraphRelationsResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/graph.GraphRelationsResponse",
            "example": {
              "is_truncated": false,
              "message": "Success",
              "next_cursor": 0.5,
              "relations": [
                {
                  "chunk_id": "HydraEmbeddings123_0",
                  "relations": [
                    {
                      "canonical_predicate": "works_at",
                      "chunk_id": "HydraEmbeddings123_0",
                      "confidence": 0.92,
                      "context": "Ada joined Acme Corp in 2024 as a staff engineer.",
                      "raw_predicate": "is employed by",
                      "relationship_id": "rel_1234",
                      "source_entity_id": "entity_1a2b",
                      "target_entity_id": "entity_3c4d",
                      "temporal_details": "since 2024",
                      "timestamp": "2026-07-02T10:00:00Z"
                    }
                  ],
                  "source": {
                    "entity_id": "entity_1a2b",
                    "identifier": "Acme Corp",
                    "name": "general",
                    "namespace": "organization",
                    "provider": "slack",
                    "type": "knowledge"
                  },
                  "target": {
                    "entity_id": "entity_1a2b",
                    "identifier": "Acme Corp",
                    "name": "general",
                    "namespace": "organization",
                    "provider": "slack",
                    "type": "knowledge"
                  }
                }
              ],
              "success": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-ingestion_V2BatchProcessingStatus": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ingestion.V2BatchProcessingStatus",
            "example": {
              "statuses": [
                {
                  "error_code": "",
                  "error_message": "",
                  "id": "HydraDoc1234",
                  "indexing_status": "completed",
                  "message": "Source processed successfully.",
                  "success": true
                }
              ]
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-ingestion_V2SourceUploadResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ingestion.V2SourceUploadResponse",
            "example": {
              "failed_count": 0,
              "message": "Success",
              "results": [
                {
                  "error": "",
                  "filename": "policy.pdf",
                  "id": "HydraDoc1234",
                  "relations_created": 5,
                  "status": "queued"
                }
              ],
              "success": true,
              "success_count": 2
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-list_V2SourceListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/list.V2SourceListResponse",
            "example": {
              "inner": {
                "message": "Success",
                "pagination": {
                  "has_next": true,
                  "has_previous": false,
                  "page": 1,
                  "page_size": 50,
                  "total": 128,
                  "total_pages": 3
                },
                "success": true,
                "total": 128
              }
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-search_V2RetrievalResult": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/search.V2RetrievalResult",
            "example": {
              "additional_context": "The user is a senior engineer onboarding to the platform.",
              "chunks": [
                {
                  "additional_metadata": {
                    "author": "ada",
                    "doc_version": 3
                  },
                  "chunk_content": "HydraDB supports hybrid retrieval across knowledge and memories.",
                  "chunk_uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
                  "collection": "team_docs",
                  "extra_context_ids": [
                    "HydraEmbeddings123_2",
                    "HydraEmbeddings123_3"
                  ],
                  "id": "HydraDoc1234",
                  "layout": "text",
                  "metadata": {
                    "department": "finance",
                    "priority": 7
                  },
                  "relevancy_score": 0.87,
                  "source_last_updated_time": "2026-07-02T12:30:00Z",
                  "source_title": "Project Phoenix Overview",
                  "source_type": "file",
                  "source_upload_time": "2026-07-02T10:00:00Z",
                  "sub_tenant_id": "sub_tenant_4567"
                }
              ],
              "graph_context": {
                "chunk_id_to_group_ids": {
                  "HydraEmbeddings123_0": [
                    "grp_1234"
                  ]
                },
                "chunk_relations": [
                  {
                    "combined_context": "Acme Corp deploys HydraDB in production for context retrieval.",
                    "group_id": "grp_1234",
                    "relevancy_score": 0.87,
                    "source_chunk_ids": [
                      "HydraEmbeddings123_0",
                      "HydraEmbeddings123_1"
                    ],
                    "triplets": [
                      {
                        "relation": {
                          "confidence": 0.92,
                          "predicate": "works_at"
                        },
                        "source": {
                          "entity_id": "entity_1a2b",
                          "name": "Ada",
                          "type": "person"
                        },
                        "target": {
                          "entity_id": "entity_3c4d",
                          "name": "Acme Corp",
                          "type": "organization"
                        }
                      }
                    ]
                  }
                ],
                "query_paths": [
                  {
                    "combined_context": "Acme Corp deploys HydraDB in production for context retrieval.",
                    "group_id": "grp_1234",
                    "relevancy_score": 0.87,
                    "source_chunk_ids": [
                      "HydraEmbeddings123_0",
                      "HydraEmbeddings123_1"
                    ],
                    "triplets": [
                      {
                        "relation": {
                          "confidence": 0.92,
                          "predicate": "works_at"
                        },
                        "source": {
                          "entity_id": "entity_1a2b",
                          "name": "Ada",
                          "type": "person"
                        },
                        "target": {
                          "entity_id": "entity_3c4d",
                          "name": "Acme Corp",
                          "type": "organization"
                        }
                      }
                    ]
                  }
                ]
              },
              "sources": [
                {
                  "additional_metadata": {
                    "author": "ada",
                    "doc_version": 3
                  },
                  "app_external_id": "C0123456789",
                  "app_kind": "slack",
                  "app_provider": "slack",
                  "collection": "team_docs",
                  "description": "Internal overview of the Project Phoenix rollout.",
                  "id": "HydraDoc1234",
                  "metadata": {
                    "department": "finance",
                    "priority": 7
                  },
                  "sub_tenant_id": "sub_tenant_4567",
                  "timestamp": "2026-07-02T10:00:00Z",
                  "title": "Project Phoenix Overview",
                  "type": "knowledge",
                  "url": "https://docs.hydradb.com/phoenix"
                }
              ],
              "temporal_duration": {
                "approximate": true,
                "days": 1,
                "from": {
                  "chunk_id": "HydraEmbeddings123_0",
                  "event_end": 1,
                  "event_start": 1,
                  "relationship_id": "rel_1234",
                  "source_id": "HydraDoc1234",
                  "status": "completed"
                },
                "pairing_confidence": 0.5,
                "to": {
                  "chunk_id": "HydraEmbeddings123_0",
                  "event_end": 1,
                  "event_start": 1,
                  "relationship_id": "rel_1234",
                  "source_id": "HydraDoc1234",
                  "status": "completed"
                }
              },
              "temporal_facts": [
                {
                  "chunk_id": "HydraEmbeddings123_0",
                  "event_end": 1,
                  "event_start": 1,
                  "relationship_id": "rel_1234",
                  "source_id": "HydraDoc1234",
                  "status": "completed"
                }
              ],
              "temporal_filter": {
                "applied": true,
                "chunk_scope": 1,
                "degraded": true,
                "matched_facts": 1,
                "mode": "thinking",
                "promoted": 1,
                "truncated": true
              }
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-sources_MemoryDeleteResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/sources.MemoryDeleteResponse",
            "example": {
              "deleted_count": 1,
              "message": "Success",
              "results": [
                {
                  "deleted": true,
                  "error": "",
                  "id": "HydraDoc1234"
                }
              ],
              "success": true,
              "user_memory_deleted": 1
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-tenants_InfraStatusResponseV2": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/tenants.InfraStatusResponseV2",
            "example": {
              "database": "acme_corp",
              "infra": {
                "graph_status": true,
                "ready_for_ingestion": true,
                "scheduler_status": true,
                "vectorstore_status": {
                  "knowledge": true,
                  "memories": true
                }
              },
              "message": "Success",
              "org_id": "org_1a2b3c",
              "tenant_id": "tenant_1234"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-tenants_SubTenantIdsResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/tenants.SubTenantIdsResponse",
            "example": {
              "collections": [
                "team_docs",
                "engineering"
              ],
              "message": "Success",
              "sub_tenant_ids": [
                "sub_tenant_4567",
                "sub_tenant_8901"
              ]
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-tenants_TenantCreateAcceptedResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/tenants.TenantCreateAcceptedResponse",
            "example": {
              "database": "acme_corp",
              "message": "Success",
              "status": "completed",
              "tenant_id": "tenant_1234"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-tenants_TenantDeleteResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/tenants.TenantDeleteResponse",
            "example": {
              "database": "acme_corp",
              "message": "Success",
              "status": "completed",
              "tenant_id": "tenant_1234"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-tenants_TenantIdsResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/tenants.TenantIdsResponse",
            "example": {
              "databases": [
                "acme_corp",
                "research_kb"
              ],
              "failed_databases": [
                {
                  "database": "acme_corp",
                  "error": "",
                  "tenant_id": "tenant_1234"
                }
              ],
              "failed_tenant_ids": [
                {
                  "database": "acme_corp",
                  "error": "",
                  "tenant_id": "tenant_1234"
                }
              ],
              "message": "Success",
              "tenant_ids": [
                "tenant_1234",
                "tenant_5678"
              ]
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-tenants_TenantStatsResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/tenants.TenantStatsResponse",
            "example": {
              "database": "acme_corp",
              "knowledge_collection": {
                "row_count": 1280
              },
              "memory_collection": {
                "row_count": 1280
              },
              "message": "Success",
              "tenant_id": "tenant_1234"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_DeliveryItem": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.DeliveryItem",
            "example": {
              "attempts": 1,
              "created_at": "2026-07-02T10:00:00Z",
              "delivery_id": "dlv_9f8e7d6c",
              "doc_id": "HydraDoc1234",
              "error_code": "",
              "error_message": "",
              "event_type": "indexing.status_changed",
              "indexing_status": "completed",
              "status": "completed",
              "updated_at": "2026-07-02T10:00:05Z"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_DeliveryListResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.DeliveryListResponse",
            "example": {
              "count": 12,
              "deliveries": [
                {
                  "attempts": 1,
                  "created_at": "2026-07-02T10:00:00Z",
                  "delivery_id": "dlv_9f8e7d6c",
                  "doc_id": "HydraDoc1234",
                  "error_code": "",
                  "error_message": "",
                  "event_type": "indexing.status_changed",
                  "indexing_status": "completed",
                  "status": "completed",
                  "updated_at": "2026-07-02T10:00:05Z"
                }
              ],
              "next_cursor": "eyJvZmZzZXQiOjUwfQ=="
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_RetryResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.RetryResponse",
            "example": {
              "delivery_id": "dlv_9f8e7d6c",
              "message": "Success",
              "queued": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_SigningSecretResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.SigningSecretResponse",
            "example": {
              "generated": true,
              "message": "Success",
              "signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_WebhookDeleteResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.WebhookDeleteResponse",
            "example": {
              "deleted": true,
              "message": "Success"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_WebhookGetResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.WebhookGetResponse",
            "example": {
              "event_types": [
                "indexing.status_changed"
              ],
              "registered": true,
              "signing_secret_configured": true,
              "url": "https://docs.hydradb.com/phoenix"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_WebhookRegisterResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.WebhookRegisterResponse",
            "example": {
              "event_types": [
                "indexing.status_changed"
              ],
              "message": "Success",
              "registered": true,
              "signing_secret": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
              "signing_secret_configured": true,
              "url": "https://docs.hydradb.com/phoenix"
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.Envelope-webhooks_WebhookTestResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/webhooks.WebhookTestResponse",
            "example": {
              "delivered": true,
              "message": "Success",
              "status_code": 200
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.responseMeta",
            "example": {
              "collection": "team_docs",
              "database": "acme_corp",
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
              "source_type": "file",
              "sub_tenant_id": "sub_tenant_4567",
              "tenant_id": "tenant_1234"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.ErrorDetail": {
        "properties": {
          "deprecated": {
            "description": "Whether this response concerns a deprecated field or route.",
            "example": true,
            "type": "boolean"
          },
          "deprecated_field": {
            "description": "The deprecated field name.",
            "example": "tenant_id",
            "type": "string"
          },
          "error_code": {
            "description": "Machine-readable error classification code.",
            "example": "VALIDATION_ERROR",
            "type": "string"
          },
          "message": {
            "description": "Human-readable description of the error.",
            "example": "Request validation failed",
            "type": "string"
          },
          "preferred_field": {
            "description": "The canonical replacement for the deprecated field.",
            "example": "database",
            "type": "string"
          },
          "success": {
            "description": "Always false for error responses.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.ErrorEnvelope-sources_MemoryDeleteResponse": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/sources.MemoryDeleteResponse",
            "example": {
              "deleted_count": 1,
              "message": "Success",
              "results": [
                {
                  "deleted": true,
                  "error": "",
                  "id": "HydraDoc1234"
                }
              ],
              "success": true,
              "user_memory_deleted": 1
            }
          },
          "detail": {
            "$ref": "#/components/schemas/handler.ErrorDetail",
            "example": {
              "deprecated": true,
              "deprecated_field": "tenant_id",
              "error_code": "VALIDATION_ERROR",
              "message": "Request validation failed",
              "preferred_field": "database",
              "success": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.ErrorMeta",
            "example": {
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.ErrorMeta": {
        "properties": {
          "api_version": {
            "type": "string"
          },
          "latency_ms": {
            "example": 12.3,
            "type": "number"
          },
          "request_id": {
            "description": "Unique identifier for this request, useful for support and tracing.",
            "example": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
            "type": "string"
          }
        },
        "type": "object"
      },
      "handler.ErrorResponse": {
        "properties": {
          "data": {},
          "detail": {
            "$ref": "#/components/schemas/handler.ErrorDetail",
            "description": "Structured error detail with code, message, and deprecation hints.",
            "example": {
              "deprecated": true,
              "deprecated_field": "tenant_id",
              "error_code": "VALIDATION_ERROR",
              "message": "Request validation failed",
              "preferred_field": "database",
              "success": true
            }
          },
          "error": {
            "$ref": "#/components/schemas/handler.apiError",
            "description": "Error message, empty string on success.",
            "example": {
              "code": "DATABASE_NOT_FOUND",
              "message": "Database not found"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/handler.ErrorMeta",
            "example": {
              "latency_ms": 12.3,
              "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d"
            }
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.apiError": {
        "properties": {
          "code": {
            "description": "Machine-readable error code (e.g. `DATABASE_NOT_FOUND`).",
            "example": "DATABASE_NOT_FOUND",
            "type": "string"
          },
          "message": {
            "description": "Human-readable description of the error.",
            "example": "Database not found",
            "type": "string"
          }
        },
        "type": "object"
      },
      "handler.catalogConnector": {
        "properties": {
          "category": {
            "type": "string"
          },
          "is_alpha": {
            "example": true,
            "type": "boolean"
          },
          "is_beta": {
            "example": true,
            "type": "boolean"
          },
          "moveit_support": {
            "example": true,
            "type": "boolean"
          },
          "provider": {
            "description": "External provider being synced (e.g. `slack`, `github`, `linear`, `notion`, `gmail`).",
            "example": "slack",
            "type": "string"
          },
          "rank": {
            "description": "Rank is the dashboard display order (lower first); null means unranked.",
            "example": 1,
            "type": "integer"
          },
          "supported": {
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.configureReq": {
        "properties": {
          "backfill_chunk_interval_seconds": {
            "description": "Internal interval for async backfill paging.",
            "example": 86400,
            "type": "integer"
          },
          "lookback_days": {
            "description": "How far back the first sync fetches historical data. Only applies to the initial sync — subsequent syncs are incremental from the last cursor.",
            "example": 30,
            "type": "integer"
          },
          "resources": {
            "description": "Resources to activate for this connector. Each item corresponds to one entry from the Discover endpoint.",
            "example": [
              {
                "additional_metadata": {
                  "author": "ada",
                  "doc_version": 3
                },
                "collection": "team_docs",
                "database": "acme_corp",
                "metadata": {
                  "department": "finance",
                  "priority": 7
                },
                "name": "general",
                "resource_id": "C0123456789",
                "resource_type": "channel"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/handler.resourceMapping"
            },
            "type": "array",
            "uniqueItems": false
          },
          "table_configs": {
            "description": "TableConfigs carries per-table replication settings for MOVEIT\nconnectors whose tap reads a `table_configs` credential input (bigquery).\nConfigure merges them into the stored credential bundle before the first\nsync, so the mode chosen at selection time governs every sync from the\nstart. Optional; rejected for non-MOVEIT engines.",
            "items": {
              "$ref": "#/components/schemas/handler.tableConfigEntry"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "required": [
          "resources"
        ],
        "type": "object"
      },
      "handler.configureResponse": {
        "properties": {
          "backfill": {
            "example": true,
            "type": "boolean"
          },
          "configured": {
            "example": 1,
            "type": "integer"
          },
          "connector_id": {
            "description": "Connector this resource belongs to.",
            "example": "conn_abc123",
            "type": "string"
          },
          "meta": {
            "$ref": "#/components/schemas/handler.configureResponseMeta"
          }
        },
        "type": "object"
      },
      "handler.configureResponseMeta": {
        "properties": {
          "deprecation": {
            "items": {
              "$ref": "#/components/schemas/handler.deprecationNotice"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "handler.connectorCatalogResponse": {
        "properties": {
          "connectors": {
            "example": [
              {
                "is_alpha": true,
                "is_beta": true,
                "moveit_support": true,
                "provider": "slack",
                "rank": 1,
                "supported": true
              }
            ],
            "items": {
              "$ref": "#/components/schemas/handler.catalogConnector"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "handler.connectorCreateReq": {
        "properties": {
          "auth_type": {
            "description": "Authentication method for the provider connection (e.g. `api_token`, `oauth`).",
            "example": "api_token",
            "type": "string"
          },
          "collection": {
            "description": "Default collection partition for synced objects. Deprecated alias: `sub_tenant_id`.",
            "example": "team_docs",
            "type": "string"
          },
          "credentials": {
            "additionalProperties": {},
            "description": "Provider-specific credentials (typically `{\"api_token\": \"...\"}` or `{\"access_token\": \"...\"}`).",
            "example": {
              "api_token": "xoxb-..."
            },
            "type": "object"
          },
          "database": {
            "description": "Database/Collection are the canonical v2 names; TenantID/SubTenantID are\ntheir deprecated aliases, reconciled by the TenantAliases middleware before\nbinding so TenantID is always populated. Neither is marked binding:required\n(mirroring TenantCreateRequest): a caller may send either spelling, and the\ntenant scope is validated downstream by resolveTenant. Requiring tenant_id\nhere would force the generated SDK to demand the deprecated field.",
            "example": "acme_corp",
            "type": "string"
          },
          "deployment_id": {
            "description": "Internal deployment context for this connector.",
            "example": "deploy_1234",
            "type": "string"
          },
          "name": {
            "description": "Human-readable label for this connector.",
            "example": "general",
            "type": "string"
          },
          "plan": {
            "description": "Subscription plan this connector runs under.",
            "example": "pro",
            "type": "string"
          },
          "provider": {
            "description": "External provider being synced (e.g. `slack`, `github`, `linear`, `notion`, `gmail`).",
            "example": "slack",
            "type": "string"
          },
          "provider_account_scope": {
            "description": "Identifier for the external account (e.g. Slack workspace ID, GitHub org name). Must be distinct across connectors for the same provider.",
            "example": "T12345ACME",
            "type": "string"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "deprecated: use collection",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "sync_engine": {
            "description": "SyncEngine selects the sync pipeline: \"classic\" (default) or \"moveit\".",
            "type": "string"
          },
          "sync_interval_seconds": {
            "description": "How frequently the scheduler triggers incremental syncs, in seconds. Bounded per provider; send 0 or omit to use the provider default. Change it later with PATCH /connectors/{id}.",
            "example": 3600,
            "type": "integer"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "deprecated: use database",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "handler.connectorDeleteResponse": {
        "properties": {
          "connector_id": {
            "description": "Connector this resource belongs to.",
            "example": "conn_abc123",
            "type": "string"
          },
          "deleted": {
            "description": "Whether this specific item was deleted.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.connectorListResponse": {
        "properties": {
          "connectors": {
            "example": [
              {
                "auth_type": "api_token",
                "collection": "team_docs",
                "connector_id": "conn_abc123",
                "credential_ref": "cred_1a2b3c",
                "database": "acme_corp",
                "deployment_id": "deploy_1234",
                "last_attempted_sync_at": "2026-07-02T17:00:00Z",
                "last_error": "",
                "last_successful_sync_at": "2026-07-02T17:00:00Z",
                "name": "general",
                "needs_reauth": true,
                "next_sync_at": "2026-07-02T18:00:00Z",
                "org_id": "org_1a2b3c",
                "plan": "pro",
                "provider": "slack",
                "provider_account_scope": "T12345ACME",
                "status": "completed",
                "sub_tenant_id": "sub_tenant_4567",
                "sync_interval_seconds": 3600,
                "sync_status": "idle",
                "tenant_id": "tenant_1234",
                "user_id": "user_alex"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/connectors.Connector"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "handler.connectorResourcesResponse": {
        "properties": {
          "resources": {
            "example": [
              {
                "additional_metadata": {
                  "author": "ada",
                  "doc_version": 3
                },
                "backfill_chunk_interval_seconds": 86400,
                "backfill_oldest": "2026-06-01T00:00:00Z",
                "connector_id": "conn_abc123",
                "display_name": "general",
                "filters": {
                  "channel": "general"
                },
                "metadata": {
                  "department": "finance",
                  "priority": 7
                },
                "provider_cursor": "1699999999.000100",
                "provider_metadata": {
                  "workspace_id": "T12345ACME"
                },
                "resource_id": "C0123456789",
                "resource_type": "channel",
                "status": "completed"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/connectors.Resource"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "handler.connectorSyncResponse": {
        "properties": {
          "run_id": {
            "type": "string"
          },
          "workflow_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "handler.connectorUpdateReq": {
        "properties": {
          "credentials": {
            "additionalProperties": {},
            "description": "Provider-specific credentials (typically `{\"api_token\": \"...\"}` or `{\"access_token\": \"...\"}`).",
            "example": {
              "api_token": "xoxb-..."
            },
            "type": "object"
          },
          "sync_interval_seconds": {
            "description": "How frequently the scheduler triggers incremental syncs, in seconds. Bounded per provider; send 0 or omit to use the provider default. Change it later with PATCH /connectors/{id}.",
            "example": 3600,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "handler.connectorUpdateResponse": {
        "properties": {
          "connector_id": {
            "description": "Connector this resource belongs to.",
            "example": "conn_abc123",
            "type": "string"
          },
          "credentials_updated": {
            "description": "CredentialsUpdated reports that the stored credential bundle was\nre-written (and any needs-reauth flag cleared) by this request.",
            "example": true,
            "type": "boolean"
          },
          "max_sync_interval_seconds": {
            "description": "Largest sync_interval_seconds this connector's provider allows.",
            "example": 604800,
            "type": "integer"
          },
          "min_sync_interval_seconds": {
            "description": "Smallest sync_interval_seconds this connector's provider allows. Values below it are rejected, never clamped.",
            "example": 300,
            "type": "integer"
          },
          "next_sync_at": {
            "description": "RFC3339 timestamp when the next scheduled sync will run.",
            "example": "2026-07-02T18:00:00Z",
            "type": "string"
          },
          "sync_interval_seconds": {
            "description": "How frequently the scheduler triggers incremental syncs, in seconds. Bounded per provider; send 0 or omit to use the provider default. Change it later with PATCH /connectors/{id}.",
            "example": 3600,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "handler.contextMetadataUpdateRequest": {
        "properties": {
          "additional_metadata": {
            "additionalProperties": {},
            "description": "Free-form key-value pairs to merge into the source's `additional_metadata`. The only accepted spelling for document metadata on this endpoint. Capped at 1 KiB, measured on the compact JSON encoding of the whole map in UTF-8 bytes — keys, quotes, commas and braces count toward the budget. Over-cap returns 400 with the actual byte count.",
            "example": {
              "author": "ada",
              "doc_version": 3
            },
            "type": "object"
          },
          "collection": {
            "description": "Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).",
            "example": "team_docs",
            "type": "string"
          },
          "database": {
            "description": "Database/Collection are the canonical v2 names; TenantID/SubTenantID are\ntheir deprecated aliases. The TenantAliases middleware reconciles them in\nthe request body before binding, so the handler reads TenantID/SubTenantID.",
            "example": "acme_corp",
            "type": "string"
          },
          "database_metadata": {
            "additionalProperties": {},
            "description": "Schema-backed metadata fields to merge into the source's `metadata` (database metadata). Canonical name; `tenant_metadata` is a deprecated alias. Capped at 16 KiB, measured on the compact JSON encoding of the whole map in UTF-8 bytes — keys, quotes, commas and braces count toward the budget. Over-cap returns 400 with the actual byte count.",
            "example": {
              "department": "legal",
              "priority": 7
            },
            "type": "object"
          },
          "document_metadata": {
            "additionalProperties": {},
            "deprecated": true,
            "description": "Not accepted on this endpoint. Sending any non-null value returns 400 (`document_metadata is not accepted; use additional_metadata`), regardless of size. Use `additional_metadata` instead. Accepted as an alias on /context/ingest only.",
            "type": "object",
            "x-deprecated": "true"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "deprecated: use collection",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "deprecated: use database",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_metadata": {
            "additionalProperties": {},
            "deprecated": true,
            "description": "Deprecated alias for `database_metadata`, still accepted here; `database_metadata` wins when both are sent. Capped at 16 KiB, measured on the compact JSON encoding of the whole map in UTF-8 bytes — keys, quotes, commas and braces count toward the budget. Over-cap returns 400 with the actual byte count.",
            "example": {
              "department": "legal",
              "priority": 7
            },
            "type": "object",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "handler.credentialsUpdateResponse": {
        "properties": {
          "connector_id": {
            "description": "Connector this resource belongs to.",
            "example": "conn_abc123",
            "type": "string"
          },
          "updated": {
            "description": "Whether the source metadata was updated.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "handler.deprecationNotice": {
        "properties": {
          "deprecated": {
            "description": "Whether this response concerns a deprecated field or route.",
            "example": true,
            "type": "boolean"
          },
          "deprecated_field": {
            "description": "The deprecated field name.",
            "example": "tenant_id",
            "type": "string"
          },
          "deprecated_since": {
            "description": "API version when the field was deprecated.",
            "example": "2.0.1",
            "type": "string"
          },
          "message": {
            "description": "Migration guidance message.",
            "example": "tenant_id is deprecated; use database instead.",
            "type": "string"
          },
          "preferred_field": {
            "description": "The canonical replacement for the deprecated field.",
            "example": "database",
            "type": "string"
          }
        },
        "type": "object"
      },
      "handler.discoverPreviewReq": {
        "properties": {
          "auth_type": {
            "description": "Authentication method for the provider connection (e.g. `api_token`, `oauth`).",
            "example": "api_token",
            "type": "string"
          },
          "credentials": {
            "additionalProperties": {},
            "description": "Provider-specific credentials (typically `{\"api_token\": \"...\"}` or `{\"access_token\": \"...\"}`).",
            "example": {
              "api_token": "xoxb-..."
            },
            "type": "object"
          },
          "provider": {
            "description": "External provider being synced (e.g. `slack`, `github`, `linear`, `notion`, `gmail`).",
            "example": "slack",
            "type": "string"
          }
        },
        "required": [
          "credentials",
          "provider"
        ],
        "type": "object"
      },
      "handler.discoverResponseBody": {
        "properties": {
          "has_more": {
            "example": true,
            "type": "boolean"
          },
          "next_cursor": {
            "description": "Opaque pagination cursor for the next page; null or absent when no more pages.",
            "example": "eyJvZmZzZXQiOjUwfQ==",
            "type": "string"
          },
          "provider": {
            "description": "External provider being synced (e.g. `slack`, `github`, `linear`, `notion`, `gmail`).",
            "example": "slack",
            "type": "string"
          },
          "resources": {
            "example": [
              {
                "id": "HydraDoc1234",
                "metadata": {
                  "department": "finance",
                  "priority": 7
                },
                "name": "general",
                "resource_type": "channel"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/handler.discoveredResourceDTO"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "handler.discoveredResourceDTO": {
        "properties": {
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "example": {
              "department": "finance",
              "priority": 7
            },
            "type": "object"
          },
          "name": {
            "description": "Human-readable label for this resource.",
            "example": "general",
            "type": "string"
          },
          "resource_type": {
            "description": "Type of resource within the provider (e.g. `channel`, `repo`, `linear_team`).",
            "example": "channel",
            "type": "string"
          }
        },
        "type": "object"
      },
      "handler.metadataSchemaUpdateResponse": {
        "properties": {
          "added_fields": {
            "description": "Names of the metadata schema fields successfully added.",
            "example": [
              "region",
              "summary_label"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "database": {
            "description": "Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).",
            "example": "acme_corp",
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "example": "acme_corp",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "handler.providerListResponse": {
        "properties": {
          "providers": {
            "example": [
              {
                "is_alpha": true,
                "is_beta": true,
                "moveit_support": true,
                "provider": "slack",
                "rank": 1,
                "supported": true
              }
            ],
            "items": {
              "$ref": "#/components/schemas/handler.catalogConnector"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "handler.resourceCreateReq": {
        "properties": {
          "additional_metadata": {
            "additionalProperties": {},
            "description": "Key-value pairs merged into document metadata on every synced object from this resource. Capped at 1 KiB, measured on the compact JSON encoding of the whole map in UTF-8 bytes — keys, quotes, commas and braces count toward the budget. The cap is applied when synced objects are ingested, not to this request.",
            "example": {
              "author": "ada",
              "doc_version": 3
            },
            "type": "object"
          },
          "collection_override": {
            "type": "string"
          },
          "database_override": {
            "type": "string"
          },
          "display_name": {
            "description": "Human-readable name for this resource.",
            "example": "general",
            "type": "string"
          },
          "filters": {
            "additionalProperties": {},
            "description": "Provider-specific filters applied during sync (e.g. `{\"lookback_days\": 30}`).",
            "example": {
              "channel": "general"
            },
            "type": "object"
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Key-value pairs merged into tenant metadata on every synced object from this resource. Capped at 16 KiB, measured on the compact JSON encoding of the whole map in UTF-8 bytes — keys, quotes, commas and braces count toward the budget. The cap is applied when synced objects are ingested, not to this request.",
            "example": {
              "department": "finance",
              "priority": 7
            },
            "type": "object"
          },
          "provider_metadata": {
            "additionalProperties": {},
            "description": "Additional provider-supplied metadata for this resource.",
            "example": {
              "workspace_id": "T12345ACME"
            },
            "type": "object"
          },
          "resource_id": {
            "description": "Resource identifier from the Discover endpoint.",
            "example": "C0123456789",
            "type": "string"
          },
          "resource_type": {
            "description": "Type of resource within the provider (e.g. `channel`, `repo`, `linear_team`).",
            "example": "channel",
            "type": "string"
          },
          "sub_tenant_id_override": {
            "deprecated": true,
            "description": "deprecated: use collection_override",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_id_override": {
            "deprecated": true,
            "description": "DatabaseOverride/CollectionOverride are the canonical v2 names;\nTenantIDOverride/SubTenantIDOverride are their deprecated aliases.",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "required": [
          "resource_id"
        ],
        "type": "object"
      },
      "handler.resourceDeleteResponse": {
        "properties": {
          "connector_id": {
            "description": "Connector this resource belongs to.",
            "example": "conn_abc123",
            "type": "string"
          },
          "deleted": {
            "description": "Whether this specific item was deleted.",
            "example": true,
            "type": "boolean"
          },
          "resource_id": {
            "description": "Resource identifier from the Discover endpoint.",
            "example": "C0123456789",
            "type": "string"
          }
        },
        "type": "object"
      },
      "handler.resourceMapping": {
        "properties": {
          "additional_metadata": {
            "additionalProperties": {},
            "description": "AdditionalMetadata is merged into the additional_metadata layer of every\nobject synced from this resource. Provider-generated fields take precedence.",
            "example": {
              "author": "ada",
              "doc_version": 3
            },
            "type": "object"
          },
          "collection": {
            "description": "Collection is the canonical v2 name for the per-resource sub-tenant\noverride: routes synced objects from this resource into a specific\ncollection. Empty means the resource inherits the connector collection.\nSubTenantID is the deprecated alias for this field, reconciled by\nConfigure before toResource runs.",
            "example": "team_docs",
            "type": "string"
          },
          "database": {
            "description": "Database is the canonical v2 name for the per-resource tenant override:\nroutes synced objects from this resource into a specific database.\nEmpty means the resource inherits the connector database. TenantID is the\ndeprecated alias for this field, reconciled by Configure before\ntoResource runs.",
            "example": "acme_corp",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Metadata is merged into the tenant metadata layer of every object synced\nfrom this resource. System fields (connector_id, provider) take precedence.",
            "example": {
              "department": "finance",
              "priority": 7
            },
            "type": "object"
          },
          "name": {
            "description": "Display name for this resource.",
            "example": "general",
            "type": "string"
          },
          "resource_id": {
            "description": "Resource identifier from the Discover endpoint.",
            "example": "C0123456789",
            "type": "string"
          },
          "resource_type": {
            "description": "Type of resource within the provider (e.g. `channel`, `repo`, `linear_team`).",
            "example": "channel",
            "type": "string"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "Routes synced objects from this resource into a specific sub-tenant\npartition. Overrides the connector-level sub_tenant_id. Deprecated: use\ncollection.",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "sync_mode": {
            "description": "SyncMode is the per-resource update strategy for taps that support one\n(today: attio objects/lists). \"rescan\" (default) re-reads the full set\nevery sync — the only way edits are seen on APIs with no updated_at.\n\"new_only\" bounds each scan to the sync window and stops paging at its\nfloor — cheap, and an explicit opt-in to not seeing edits until\nwebhooks land. Stored in the resource's filters and carried to the tap\non every window.",
            "enum": [
              "rescan",
              "new_only"
            ],
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "Optional per-resource tenant override (for \"route specific resources to\ndifferent tenants\"). Empty means the resource inherits the connector\ntenant. Deprecated: use database.",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "required": [
          "resource_id"
        ],
        "type": "object"
      },
      "handler.responseMeta": {
        "properties": {
          "api_version": {
            "description": "APIVersion echoes the version of the API that served the request (PRO-1209),\nsourced from reqmeta.APIVersion — the same value carried by OpenAPI\ninfo.version and /health — so a client always knows which API version\nproduced a response. Always present (no omitempty).",
            "type": "string"
          },
          "collection": {
            "description": "Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).",
            "example": "team_docs",
            "type": "string"
          },
          "database": {
            "description": "Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).",
            "example": "acme_corp",
            "type": "string"
          },
          "deprecation": {
            "description": "Deprecation lists any migration nudges that apply to this request — the\ncaller used a legacy /tenants route, a legacy tenant_id/sub_tenant_id field,\nor the deprecated sub_tenant_ids selector. It is a non-breaking signal (the\nstatus code is unchanged); omitempty keeps it absent for fully-migrated\nrequests. A list so independent deprecations coexist without clobbering.",
            "items": {
              "$ref": "#/components/schemas/handler.deprecationNotice"
            },
            "type": "array",
            "uniqueItems": false
          },
          "latency_ms": {
            "description": "Server-side processing time in milliseconds.",
            "example": 12.3,
            "type": "number"
          },
          "request_id": {
            "description": "Unique identifier for this request, useful for support and tracing.",
            "example": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
            "type": "string"
          },
          "source_type": {
            "description": "Type of the parent source (e.g. `file`, `slack`, `notion`).",
            "example": "file",
            "type": "string"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_id": {
            "deprecated": true,
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "handler.tableConfigEntry": {
        "properties": {
          "change_history": {
            "type": "string"
          },
          "replication_key": {
            "type": "string"
          },
          "table": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ingestion.SourceStatus": {
        "enum": [
          "queued",
          "processing",
          "completed",
          "failed"
        ],
        "type": "string",
        "x-enum-varnames": [
          "SourceStatusQueued",
          "SourceStatusProcessing",
          "SourceStatusCompleted",
          "SourceStatusFailed"
        ]
      },
      "ingestion.V2BatchProcessingStatus": {
        "properties": {
          "statuses": {
            "description": "Per-source indexing status results.",
            "example": [
              {
                "error_code": "",
                "error_message": "",
                "id": "HydraDoc1234",
                "indexing_status": "completed",
                "message": "Source processed successfully.",
                "success": true
              }
            ],
            "items": {
              "$ref": "#/components/schemas/ingestion.V2ProcessingStatus"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "ingestion.V2ProcessingStatus": {
        "properties": {
          "error_code": {
            "description": "Machine-readable code for the indexing failure, empty string on success.",
            "example": "",
            "type": "string"
          },
          "error_message": {
            "description": "Human-readable description of the indexing failure, empty string on success.",
            "example": "",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "indexing_status": {
            "description": "Current processing state: `queued`, `processing`, `completed`, or `failed`.",
            "example": "completed",
            "type": "string"
          },
          "message": {
            "description": "Human-readable status description.",
            "example": "Source processed successfully.",
            "type": "string"
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ingestion.V2SourceUploadResponse": {
        "properties": {
          "failed_count": {
            "description": "Number of uploaded files that failed to queue.",
            "example": 0,
            "type": "integer"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "results": {
            "description": "Per-item results.",
            "example": [
              {
                "error": "",
                "filename": "policy.pdf",
                "id": "HydraDoc1234",
                "relations_created": 5,
                "status": "queued"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/ingestion.V2SourceUploadResultItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          },
          "success_count": {
            "description": "Number of files successfully queued for processing.",
            "example": 2,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ingestion.V2SourceUploadResultItem": {
        "properties": {
          "error": {
            "description": "Error message for this file, empty string on success.",
            "example": "",
            "type": "string"
          },
          "error_code": {
            "description": "Machine-readable error classification code.",
            "type": "string"
          },
          "filename": {
            "description": "Original filename as submitted.",
            "example": "policy.pdf",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "relations_created": {
            "description": "Number of graph relations extracted from this file.",
            "example": 5,
            "type": "integer"
          },
          "relations_error": {
            "description": "Error message from relation extraction, if any.",
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ingestion.SourceStatus",
            "description": "Current lifecycle or processing state."
          }
        },
        "type": "object"
      },
      "list.ContentFilter": {
        "properties": {
          "additional_metadata": {
            "additionalProperties": {},
            "description": "Filters /context/list by document/additional metadata. Example: {\"author\": \"ada\"}.",
            "example": {
              "author": "ada"
            },
            "type": "object"
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Filters /context/list by tenant/source metadata. Example: {\"department\": \"finance\"}.",
            "example": {
              "department": "finance"
            },
            "type": "object"
          },
          "source_fields": {
            "additionalProperties": {},
            "description": "SourceFields filters by well-known source fields such as title, type,\ndescription, url, and timestamp.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "list.SourceListResponse": {
        "properties": {
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "pagination": {
            "$ref": "#/components/schemas/dashboard.PaginationMeta",
            "example": {
              "has_next": true,
              "has_previous": false,
              "page": 1,
              "page_size": 50,
              "total": 128,
              "total_pages": 3
            }
          },
          "sources": {
            "description": "Retrieved knowledge sources or memories for this page.",
            "items": {
              "additionalProperties": {},
              "type": "object"
            },
            "type": "array",
            "uniqueItems": false
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          },
          "total": {
            "description": "Total number of items across all pages.",
            "example": 128,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "list.V2ListContentRequest": {
        "properties": {
          "collection": {
            "description": "Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).",
            "example": "team_docs",
            "type": "string"
          },
          "database": {
            "description": "Database/Collection are the canonical v2 names; TenantID/SubTenantID are\ntheir deprecated aliases (reconciled here in UnmarshalJSON and centrally by\nthe TenantAliases middleware).",
            "example": "acme_corp",
            "type": "string"
          },
          "filters": {
            "$ref": "#/components/schemas/list.ContentFilter",
            "example": {
              "additional_metadata": {
                "author": "ada"
              },
              "metadata": {
                "department": "finance"
              }
            }
          },
          "ids": {
            "description": "When provided, only items with these IDs are returned. Pagination and filters still apply.",
            "example": [
              "HydraDoc1234",
              "HydraDoc4567"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "include_fields": {
            "description": "Field projection — only the listed fields plus id, database, collection are returned. Only applies to type=knowledge.",
            "example": [
              "id",
              "title",
              "type"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "page": {
            "description": "Current page number (1-indexed).",
            "example": 1,
            "type": "integer"
          },
          "page_size": {
            "description": "Number of items per page.",
            "example": 50,
            "type": "integer"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "deprecated: use collection",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "deprecated: use database",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          },
          "type": {
            "description": "Bucket to list: `knowledge` (default) or `memory`.",
            "enum": [
              "knowledge",
              "memory"
            ],
            "example": "knowledge",
            "type": "string"
          }
        },
        "type": "object"
      },
      "list.V2SourceListResponse": {
        "properties": {
          "inner": {
            "$ref": "#/components/schemas/list.SourceListResponse",
            "example": {
              "message": "Success",
              "pagination": {
                "has_next": true,
                "has_previous": false,
                "page": 1,
                "page_size": 50,
                "total": 128,
                "total_pages": 3
              },
              "success": true,
              "total": 128
            }
          }
        },
        "type": "object"
      },
      "search.GraphContext": {
        "description": "GraphContext is omitted entirely when graph_context is disabled on the\nrequest (pointer + omitempty), so the response carries no graph slice\ninstead of an empty-but-present object.",
        "properties": {
          "chunk_id_to_group_ids": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "description": "Mapping from chunk ID to the relation group IDs it participates in.",
            "example": {
              "HydraEmbeddings123_0": [
                "grp_1234"
              ]
            },
            "type": "object"
          },
          "chunk_relations": {
            "description": "Scored relation paths relevant to the query, grouped by chunk.",
            "example": [
              {
                "combined_context": "Acme Corp deploys HydraDB in production for context retrieval.",
                "group_id": "grp_1234",
                "relevancy_score": 0.87,
                "source_chunk_ids": [
                  "HydraEmbeddings123_0",
                  "HydraEmbeddings123_1"
                ],
                "triplets": [
                  {
                    "relation": {
                      "confidence": 0.92,
                      "predicate": "works_at"
                    },
                    "source": {
                      "entity_id": "entity_1a2b",
                      "name": "Ada",
                      "type": "person"
                    },
                    "target": {
                      "entity_id": "entity_3c4d",
                      "name": "Acme Corp",
                      "type": "organization"
                    }
                  }
                ]
              }
            ],
            "items": {
              "$ref": "#/components/schemas/search.ScoredPathResponse"
            },
            "type": "array",
            "uniqueItems": false
          },
          "query_paths": {
            "description": "Scored relation paths ranked by relevance to the query.",
            "example": [
              {
                "combined_context": "Acme Corp deploys HydraDB in production for context retrieval.",
                "group_id": "grp_1234",
                "relevancy_score": 0.87,
                "source_chunk_ids": [
                  "HydraEmbeddings123_0",
                  "HydraEmbeddings123_1"
                ],
                "triplets": [
                  {
                    "relation": {
                      "confidence": 0.92,
                      "predicate": "works_at"
                    },
                    "source": {
                      "entity_id": "entity_1a2b",
                      "name": "Ada",
                      "type": "person"
                    },
                    "target": {
                      "entity_id": "entity_3c4d",
                      "name": "Acme Corp",
                      "type": "organization"
                    }
                  }
                ]
              }
            ],
            "items": {
              "$ref": "#/components/schemas/search.ScoredPathResponse"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "search.MetadataFilters": {
        "additionalProperties": {},
        "description": "Filters results by source metadata. Top-level keys target tenant metadata (for example department, priority, active, or tags). Nested additional_metadata keys target document metadata. Separate keys are ANDed. A scalar value is an exact match; an array means match ANY one of the listed values (OR) - there is no ALL/AND operator within a single key. Arrays are supported on VARCHAR fields only: an array passed for a declared field of any other type is rejected with 400 VALIDATION_ERROR. Size limits: each list may hold at most 500 values, and the whole metadata_filters object is capped at 64 KiB measured on its compact JSON encoding in UTF-8 bytes (keys and punctuation count). Exceeding either returns 400 naming the offending key or the actual byte count.",
        "example": {
          "active": true,
          "additional_metadata": {
            "author": "ada"
          },
          "department": "finance",
          "priority": 7,
          "tags": [
            "alpha",
            "beta"
          ]
        },
        "type": "object"
      },
      "search.Operator": {
        "enum": [
          "or",
          "and",
          "phrase"
        ],
        "type": "string",
        "x-enum-varnames": [
          "OperatorOr",
          "OperatorAnd",
          "OperatorPhrase"
        ]
      },
      "search.PathTriplet": {
        "properties": {
          "relation": {
            "additionalProperties": {},
            "description": "Relation properties including predicate and confidence score.",
            "example": {
              "confidence": 0.92,
              "predicate": "works_at"
            },
            "type": "object"
          },
          "source": {
            "additionalProperties": {},
            "description": "Source entity of the relationship.",
            "example": {
              "entity_id": "entity_1a2b",
              "name": "Ada",
              "type": "person"
            },
            "type": "object"
          },
          "target": {
            "additionalProperties": {},
            "description": "Target entity of the relationship.",
            "example": {
              "entity_id": "entity_3c4d",
              "name": "Acme Corp",
              "type": "organization"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "search.QueryBy": {
        "enum": [
          "hybrid",
          "text"
        ],
        "type": "string",
        "x-enum-varnames": [
          "QueryByHybrid",
          "QueryByText"
        ]
      },
      "search.QueryRequest": {
        "properties": {
          "additional_context": {
            "description": "Optional context string prepended to the query to improve retrieval relevance.",
            "example": "The user is a senior engineer onboarding to the platform.",
            "type": "string"
          },
          "alpha": {
            "description": "Weighting balance between dense and sparse retrieval in hybrid mode. `\"auto\"` lets HydraDB choose; a number from 0 (full BM25) to 1 (full dense) sets it explicitly."
          },
          "collection": {
            "description": "Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).",
            "example": "team_docs",
            "type": "string"
          },
          "collections": {
            "description": "Preferred /query scope selector. Send either a list of collection IDs for equal normalized weighting, or an object mapping collection ID to a positive relative ranking weight with at most one decimal place. Do not send together with the deprecated sub_tenant_ids or sub_tenant_id.",
            "example": [
              "team_docs",
              "engineering"
            ],
            "oneOf": [
              {
                "example": [
                  "finance",
                  "legal"
                ],
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              {
                "additionalProperties": {
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.1,
                  "type": "number"
                },
                "example": {
                  "finance": 1.5,
                  "legal": 0.8
                },
                "maxProperties": 100,
                "minProperties": 1,
                "type": "object"
              }
            ],
            "x-preferred": true
          },
          "database": {
            "description": "Database is the canonical v2 name for the tenant scope. TenantID is its\ndeprecated alias and remains fully accepted. The TenantAliases middleware\nreconciles the two before binding, so TenantID is always populated and the\nhandler reads it; Database/Collection are carried only for docs/OpenAPI.",
            "example": "acme_corp",
            "type": "string"
          },
          "graph_context": {
            "description": "Whether to include graph context in the response. Defaults to true for /query when omitted.",
            "example": true,
            "type": "boolean"
          },
          "graph_vector_prune": {
            "description": "GraphVectorPrune switches the graph-connected-chunks lane from \"fetch\ngraph-selected chunks and let the fusion reranker sort them out\" to \"fetch\na wider graph-selected candidate pool, then rank that pool by Milvus vector\nsimilarity, fully replacing the final chunk list.\" Works in either fast or\nthinking mode. Default false preserves existing behavior. Also gated\nserver-side by a repo-level config flag (SearchService's\ngraphVectorPruneEnabled) — if that flag is off, this is forced to false\nregardless of what the request sets, so a deployment can disable the\nmechanism without any client-side change.",
            "example": true,
            "type": "boolean"
          },
          "graph_vector_prune_spacy_entities": {
            "description": "GraphVectorPruneSpacyEntities: when GraphVectorPrune is also set, swaps the\ngraph lane's entity-extraction source from the default LLM-based extractor\nto a local spaCy subprocess (faster, no network round trip, but a\nnarrower/mismatched entity vocabulary versus the graph's own LLM-extracted\nnode names). No-op if GraphVectorPrune is false (including when forced\nfalse by the server-level flag) or no spaCy extractor was configured at\nstartup.",
            "example": true,
            "type": "boolean"
          },
          "ids": {
            "description": "IDs optionally scopes retrieval to specific source ids. The v2 wire field is\n`ids` (matching /context/list); empty means search the whole corpus. Applied\nas a Milvus `source_id in [...]` pre-filter that is preserved across the\nmetadata zero-result retry, so a source-scoped search that matches nothing\nreturns nothing rather than silently widening to the whole corpus.",
            "example": [
              "HydraDoc1234",
              "HydraDoc4567"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "max_results": {
            "description": "Maximum number of chunks to return.",
            "example": 10,
            "type": "integer"
          },
          "metadata_filters": {
            "$ref": "#/components/schemas/search.MetadataFilters"
          },
          "mode": {
            "$ref": "#/components/schemas/search.RecallMode",
            "example": "thinking"
          },
          "num_related_chunks": {
            "description": "Number of adjacent chunks to pull alongside each matched chunk for additional context.",
            "example": 3,
            "type": "integer"
          },
          "operator": {
            "$ref": "#/components/schemas/search.Operator",
            "example": "and"
          },
          "query": {
            "description": "Natural-language search query.",
            "example": "Which mode does the user prefer?",
            "type": "string"
          },
          "query_apps": {
            "description": "Whether to include app-aware knowledge retrieval. Applies to knowledge hybrid queries.",
            "example": true,
            "type": "boolean"
          },
          "query_by": {
            "$ref": "#/components/schemas/search.QueryBy",
            "description": "Retrieval method to use for the query.",
            "example": "hybrid"
          },
          "query_forceful_relations": {
            "description": "Whether to force relation expansion for graph-aware query retrieval. Defaults to true when omitted.",
            "example": true,
            "type": "boolean"
          },
          "recency_bias": {
            "description": "Recency boost applied to ranking. 0 disables it; higher values favour more recent sources.",
            "example": 0.2,
            "type": "number"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "Deprecated for /query (since 2.0.1). Use collection for a single scope or collections for multiple. Backwards-compatible and will be removed in a future version. Do not send together with a multi-scope selector.",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated-since": "2.0.1"
          },
          "sub_tenant_ids": {
            "deprecated": true,
            "description": "Deprecated for /query (since 2.0.1). Use collections instead; it accepts the same list or weighted-object shape. Backwards-compatible and will be removed in a future version. Do not send together with collections.",
            "example": [
              "sub_tenant_4567",
              "sub_tenant_8901"
            ],
            "oneOf": [
              {
                "example": [
                  "finance",
                  "legal"
                ],
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              {
                "additionalProperties": {
                  "exclusiveMinimum": 0,
                  "multipleOf": 0.1,
                  "type": "number"
                },
                "example": {
                  "finance": 1.5,
                  "legal": 0.8
                },
                "maxProperties": 100,
                "minProperties": 1,
                "type": "object"
              }
            ],
            "x-deprecated": "true",
            "x-deprecated-since": "2.0.1"
          },
          "temporal_intent": {
            "$ref": "#/components/schemas/search.TemporalIntentOverride",
            "example": {
              "duration_to_now": true,
              "mode": "thinking"
            }
          },
          "temporal_now": {
            "description": "TemporalNow optionally anchors \"now\" for temporal reasoning (ISO-8601).\nCallers replaying past conversations (or backfilling) must supply it or\nto-now durations and recency windows resolve against the server's wall\nclock (LongMemEval measured 0 exact to-now durations from this alone).",
            "type": "string"
          },
          "temporal_reasoning": {
            "description": "TemporalReasoning activates the temporal read path: the query is classified\ninto a temporal mode (current/as-of/range/upcoming...), matching edge-level\ntemporal facts are resolved from the edge_temporal store and ride back on\nthe response (temporal_facts / temporal_duration / temporal_filter).\nCONTRACT: chunk ranking is NEVER altered — ON returns the same chunks as\nOFF; the layer is additive payload + computed answers only (rank shaping\nmeasured net-negative on BEAM/LongMemEval/TEMPO; see temporal_filters.go).\nOptional; ON by default — pass temporal_reasoning:false to disable.\nResolved by GetTemporalReasoningOrDefault (ownership rule).",
            "example": true,
            "type": "boolean"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "deprecated: use database",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          },
          "type": {
            "$ref": "#/components/schemas/search.SourceType",
            "description": "Corpus to query: knowledge, memory, or all."
          }
        },
        "type": "object"
      },
      "search.RecallMode": {
        "enum": [
          "fast",
          "thinking",
          "auto"
        ],
        "type": "string",
        "x-enum-varnames": [
          "RecallModeFast",
          "RecallModeThinking",
          "RecallModeAuto"
        ]
      },
      "search.ScoredPathResponse": {
        "properties": {
          "combined_context": {
            "description": "Merged text from all chunk passages in this relation path.",
            "example": "Acme Corp deploys HydraDB in production for context retrieval.",
            "type": "string"
          },
          "group_id": {
            "description": "Unique identifier for this relation group.",
            "example": "grp_1234",
            "type": "string"
          },
          "relevancy_score": {
            "description": "Relevance score for this item against the query.",
            "example": 0.87,
            "type": "number"
          },
          "source_chunk_ids": {
            "description": "IDs of the chunks that contribute to this relation path.",
            "example": [
              "HydraEmbeddings123_0",
              "HydraEmbeddings123_1"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "triplets": {
            "description": "Knowledge-graph triplets that make up this relation path.",
            "example": [
              {
                "relation": {
                  "confidence": 0.92,
                  "predicate": "works_at"
                },
                "source": {
                  "entity_id": "entity_1a2b",
                  "name": "Ada",
                  "type": "person"
                },
                "target": {
                  "entity_id": "entity_3c4d",
                  "name": "Acme Corp",
                  "type": "organization"
                }
              }
            ],
            "items": {
              "$ref": "#/components/schemas/search.PathTriplet"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "search.SourceInfo": {
        "properties": {
          "additional_metadata": {
            "additionalProperties": {},
            "description": "Per-document free-form metadata.",
            "example": {
              "author": "ada",
              "doc_version": 3
            },
            "type": "object"
          },
          "app_external_id": {
            "description": "Provider-assigned identifier for this source (e.g. Slack channel ID).",
            "example": "C0123456789",
            "type": "string"
          },
          "app_kind": {
            "description": "App-source fields (populated when the source comes from an app integration).\nDefault null on the wire when absent.",
            "example": "slack",
            "type": "string"
          },
          "app_provider": {
            "description": "Provider name for app-sourced items (e.g. `slack`, `github`).",
            "example": "slack",
            "type": "string"
          },
          "collection": {
            "description": "Collection this source belongs to. Canonical name; mirrors the deprecated `sub_tenant_id` alias.",
            "example": "team_docs",
            "type": "string"
          },
          "description": {
            "description": "Human-readable description of the source.",
            "example": "Internal overview of the Project Phoenix rollout.",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Pydantic aliases (see VectorStoreChunk). Source metadata defaults to {} on\nthe wire (Python default_factory=dict), unlike chunk metadata which is null.",
            "example": {
              "department": "finance",
              "priority": 7
            },
            "type": "object"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "deprecated: use collection",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "timestamp": {
            "description": "RFC3339 timestamp associated with this item.",
            "example": "2026-07-02T10:00:00Z",
            "type": "string"
          },
          "title": {
            "description": "Title or name of the source.",
            "example": "Project Phoenix Overview",
            "type": "string"
          },
          "type": {
            "description": "Source content category (e.g. `knowledge`, `memory`).",
            "example": "knowledge",
            "type": "string"
          },
          "url": {
            "description": "URL to the original source, if available.",
            "example": "https://docs.hydradb.com/phoenix",
            "type": "string"
          }
        },
        "type": "object"
      },
      "search.SourceType": {
        "description": "Source is the wire field `type` (Python QueryRequest.source has alias=\"type\").\nSourceLegacy accepts the pre-rename `source` key (Python populate_by_name=True\nkeeps the field name valid on input); resolveSourceAlias folds it into Source.",
        "enum": [
          "knowledge",
          "memory",
          "all"
        ],
        "type": "string",
        "x-enum-varnames": [
          "SourceKnowledge",
          "SourceMemory",
          "SourceAll"
        ]
      },
      "search.TemporalDuration": {
        "description": "TemporalDuration is the computed event-duration answer, when resolved.",
        "properties": {
          "approximate": {
            "description": "Approximate is set when either endpoint's granularity is coarser than a\nday (month/year brackets) — the day count is then a floor-to-floor\nestimate, not an exact span; consumers should not present it as exact.",
            "example": true,
            "type": "boolean"
          },
          "days": {
            "example": 1,
            "type": "integer"
          },
          "from": {
            "$ref": "#/components/schemas/search.TemporalFact",
            "example": {
              "chunk_id": "HydraEmbeddings123_0",
              "event_end": 1,
              "event_start": 1,
              "relationship_id": "rel_1234",
              "source_id": "HydraDoc1234",
              "status": "completed"
            }
          },
          "from_date": {
            "type": "string"
          },
          "pairing_confidence": {
            "description": "PairingConfidence is the normalized pair-scorer margin (0..1); low values\nmean the endpoints were weakly anchored to the question. Durations whose\nendpoints share no entity token with the question are suppressed\nentirely (P4: a wrong confident day count misleads answerers).",
            "example": 0.5,
            "type": "number"
          },
          "to": {
            "$ref": "#/components/schemas/search.TemporalFact",
            "example": {
              "chunk_id": "HydraEmbeddings123_0",
              "event_end": 1,
              "event_start": 1,
              "relationship_id": "rel_1234",
              "source_id": "HydraDoc1234",
              "status": "completed"
            }
          },
          "to_date": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "search.TemporalFact": {
        "properties": {
          "chunk_id": {
            "description": "Chunk that provides evidence for this relation.",
            "example": "HydraEmbeddings123_0",
            "type": "string"
          },
          "date_precision": {
            "description": "DatePrecision is the resolution of the resolved dates: \"day\", \"month\",\n\"year\" (coarser-than-day dates are floored to bracket starts).",
            "type": "string"
          },
          "event_end": {
            "example": 1,
            "type": "integer"
          },
          "event_start": {
            "example": 1,
            "type": "integer"
          },
          "evidence_phrase": {
            "description": "EvidencePhrase is the verbatim source phrase the dates were resolved\nfrom (e.g. \"today\", \"two weeks ago\").",
            "type": "string"
          },
          "fact_type": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "relation": {
            "type": "string"
          },
          "relationship_id": {
            "description": "Unique identifier for this relationship instance.",
            "example": "rel_1234",
            "type": "string"
          },
          "source_id": {
            "example": "HydraDoc1234",
            "type": "string"
          },
          "status": {
            "description": "Current lifecycle or processing state.",
            "example": "completed",
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "search.TemporalFilterInfo": {
        "description": "TemporalFilter reports what the temporal layer did for this request.",
        "properties": {
          "applied": {
            "example": true,
            "type": "boolean"
          },
          "chunk_scope": {
            "example": 1,
            "type": "integer"
          },
          "degraded": {
            "description": "Degraded is true when the fact lookup FAILED (as opposed to matching\nnothing) — callers must not read an empty payload as \"no temporal facts\nexist\" when this is set.",
            "example": true,
            "type": "boolean"
          },
          "matched_facts": {
            "example": 1,
            "type": "integer"
          },
          "mode": {
            "example": "thinking",
            "type": "string"
          },
          "promoted": {
            "example": 1,
            "type": "integer"
          },
          "scope": {
            "description": "Scope reports how the chunk scope was applied: \"soft\" (bounded ranking\npromotion) or \"\" (no scope). Hard scoping was removed after TEMPO.",
            "type": "string"
          },
          "truncated": {
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "search.TemporalIntentOverride": {
        "description": "TemporalIntent (EXPERIMENTAL) lets the caller supply the classification\n(mode/window/phrases) directly, bypassing the regex classifier — for\nagents whose own LLM already understands the query, and for non-English\nqueries. Invalid overrides fall back to the classifier.",
        "properties": {
          "cutoff": {
            "type": "string"
          },
          "duration_to_now": {
            "example": true,
            "type": "boolean"
          },
          "event_phrases": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "mode": {
            "example": "thinking",
            "type": "string"
          },
          "window_end": {
            "type": "string"
          },
          "window_start": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "search.V2Chunk": {
        "properties": {
          "additional_metadata": {
            "additionalProperties": {},
            "description": "Pydantic aliases (see VectorStoreChunk): document_metadata→additional_metadata,\ntenant_metadata→metadata. FastAPI serializes by_alias, so the wire uses the aliases.",
            "example": {
              "author": "ada",
              "doc_version": 3
            },
            "type": "object"
          },
          "chunk_content": {
            "description": "Text content of this chunk.",
            "example": "HydraDB supports hybrid retrieval across knowledge and memories.",
            "type": "string"
          },
          "chunk_uuid": {
            "description": "Unique identifier for this individual chunk.",
            "example": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
            "type": "string"
          },
          "collection": {
            "description": "Collection this chunk belongs to. Canonical name; mirrors the deprecated `sub_tenant_id` alias.",
            "example": "team_docs",
            "type": "string"
          },
          "extra_context_ids": {
            "description": "IDs of adjacent chunks pulled in as surrounding context.",
            "example": [
              "HydraEmbeddings123_2",
              "HydraEmbeddings123_3"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "layout": {
            "description": "Layout classification for this chunk (e.g. `text`, `table`, `image`).",
            "example": "text",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {},
            "description": "Schema-backed tenant metadata attached to the source.",
            "example": {
              "department": "finance",
              "priority": 7
            },
            "type": "object"
          },
          "relevancy_score": {
            "description": "Relevance score for this item against the query.",
            "example": 0.87,
            "type": "number"
          },
          "source_last_updated_time": {
            "description": "RFC3339 timestamp when the source was last modified.",
            "example": "2026-07-02T12:30:00Z",
            "type": "string"
          },
          "source_title": {
            "description": "Title of the parent source document.",
            "example": "Project Phoenix Overview",
            "type": "string"
          },
          "source_type": {
            "description": "Type of the parent source (e.g. `file`, `slack`, `notion`).",
            "example": "file",
            "type": "string"
          },
          "source_upload_time": {
            "description": "RFC3339 timestamp when the source was ingested.",
            "example": "2026-07-02T10:00:00Z",
            "type": "string"
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "deprecated: use collection",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "search.V2RetrievalResult": {
        "properties": {
          "additional_context": {
            "additionalProperties": {
              "$ref": "#/components/schemas/search.V2Chunk"
            },
            "description": "Map of chunk ID to chunk content for sources declared as related by the author (query_forceful_relations).",
            "example": "The user is a senior engineer onboarding to the platform.",
            "type": "object"
          },
          "chunks": {
            "description": "Retrieved and ranked chunks from the knowledge store or memories.",
            "example": [
              {
                "additional_metadata": {
                  "author": "ada",
                  "doc_version": 3
                },
                "chunk_content": "HydraDB supports hybrid retrieval across knowledge and memories.",
                "chunk_uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
                "collection": "team_docs",
                "extra_context_ids": [
                  "HydraEmbeddings123_2",
                  "HydraEmbeddings123_3"
                ],
                "id": "HydraDoc1234",
                "layout": "text",
                "metadata": {
                  "department": "finance",
                  "priority": 7
                },
                "relevancy_score": 0.87,
                "source_last_updated_time": "2026-07-02T12:30:00Z",
                "source_title": "Project Phoenix Overview",
                "source_type": "file",
                "source_upload_time": "2026-07-02T10:00:00Z",
                "sub_tenant_id": "sub_tenant_4567"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/search.V2Chunk"
            },
            "type": "array",
            "uniqueItems": false
          },
          "graph_context": {
            "$ref": "#/components/schemas/search.GraphContext",
            "example": {
              "chunk_id_to_group_ids": {
                "HydraEmbeddings123_0": [
                  "grp_1234"
                ]
              },
              "chunk_relations": [
                {
                  "combined_context": "Acme Corp deploys HydraDB in production for context retrieval.",
                  "group_id": "grp_1234",
                  "relevancy_score": 0.87,
                  "source_chunk_ids": [
                    "HydraEmbeddings123_0",
                    "HydraEmbeddings123_1"
                  ],
                  "triplets": [
                    {
                      "relation": {
                        "confidence": 0.92,
                        "predicate": "works_at"
                      },
                      "source": {
                        "entity_id": "entity_1a2b",
                        "name": "Ada",
                        "type": "person"
                      },
                      "target": {
                        "entity_id": "entity_3c4d",
                        "name": "Acme Corp",
                        "type": "organization"
                      }
                    }
                  ]
                }
              ],
              "query_paths": [
                {
                  "combined_context": "Acme Corp deploys HydraDB in production for context retrieval.",
                  "group_id": "grp_1234",
                  "relevancy_score": 0.87,
                  "source_chunk_ids": [
                    "HydraEmbeddings123_0",
                    "HydraEmbeddings123_1"
                  ],
                  "triplets": [
                    {
                      "relation": {
                        "confidence": 0.92,
                        "predicate": "works_at"
                      },
                      "source": {
                        "entity_id": "entity_1a2b",
                        "name": "Ada",
                        "type": "person"
                      },
                      "target": {
                        "entity_id": "entity_3c4d",
                        "name": "Acme Corp",
                        "type": "organization"
                      }
                    }
                  ]
                }
              ]
            }
          },
          "sources": {
            "description": "Deduplicated source-level metadata for all returned chunks.",
            "example": [
              {
                "additional_metadata": {
                  "author": "ada",
                  "doc_version": 3
                },
                "app_external_id": "C0123456789",
                "app_kind": "slack",
                "app_provider": "slack",
                "collection": "team_docs",
                "description": "Internal overview of the Project Phoenix rollout.",
                "id": "HydraDoc1234",
                "metadata": {
                  "department": "finance",
                  "priority": 7
                },
                "sub_tenant_id": "sub_tenant_4567",
                "timestamp": "2026-07-02T10:00:00Z",
                "title": "Project Phoenix Overview",
                "type": "knowledge",
                "url": "https://docs.hydradb.com/phoenix"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/search.SourceInfo"
            },
            "type": "array",
            "uniqueItems": false
          },
          "temporal_duration": {
            "$ref": "#/components/schemas/search.TemporalDuration",
            "example": {
              "approximate": true,
              "days": 1,
              "from": {
                "chunk_id": "HydraEmbeddings123_0",
                "event_end": 1,
                "event_start": 1,
                "relationship_id": "rel_1234",
                "source_id": "HydraDoc1234",
                "status": "completed"
              },
              "pairing_confidence": 0.5,
              "to": {
                "chunk_id": "HydraEmbeddings123_0",
                "event_end": 1,
                "event_start": 1,
                "relationship_id": "rel_1234",
                "source_id": "HydraDoc1234",
                "status": "completed"
              }
            }
          },
          "temporal_facts": {
            "description": "TemporalFacts surface the matched edge-level temporal facts when\ntemporal_reasoning was requested; omitted otherwise.",
            "example": [
              {
                "chunk_id": "HydraEmbeddings123_0",
                "event_end": 1,
                "event_start": 1,
                "relationship_id": "rel_1234",
                "source_id": "HydraDoc1234",
                "status": "completed"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/search.TemporalFact"
            },
            "type": "array",
            "uniqueItems": false
          },
          "temporal_filter": {
            "$ref": "#/components/schemas/search.TemporalFilterInfo",
            "example": {
              "applied": true,
              "chunk_scope": 1,
              "degraded": true,
              "matched_facts": 1,
              "mode": "thinking",
              "promoted": 1,
              "truncated": true
            }
          }
        },
        "type": "object"
      },
      "sources.MemoryDeleteResponse": {
        "properties": {
          "deleted_count": {
            "description": "Total number of items successfully deleted.",
            "example": 1,
            "type": "integer"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "results": {
            "description": "Per-item results.",
            "example": [
              {
                "deleted": true,
                "error": "",
                "id": "HydraDoc1234"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/sources.SourceDeleteResultItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "success": {
            "description": "Whether the request succeeded.",
            "example": true,
            "type": "boolean"
          },
          "user_memory_deleted": {
            "description": "Number of memory items deleted.",
            "example": 1,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "sources.SourceDeleteResultItem": {
        "properties": {
          "deleted": {
            "description": "Whether this specific item was deleted.",
            "example": true,
            "type": "boolean"
          },
          "error": {
            "description": "Error message for this item, empty string on success.",
            "example": "",
            "type": "string"
          },
          "id": {
            "description": "Unique identifier for this resource.",
            "example": "HydraDoc1234",
            "type": "string"
          }
        },
        "type": "object"
      },
      "sources.V2SourceDeleteRequest": {
        "properties": {
          "collection": {
            "description": "Collection scope. Defaults to the default collection when omitted. Formerly `sub_tenant_id`; the `sub_tenant_id` alias is still accepted (deprecated).",
            "example": "team_docs",
            "type": "string"
          },
          "database": {
            "description": "Database/Collection are the canonical v2 names; TenantID/SubTenantID are\ntheir deprecated aliases, reconciled by the TenantAliases middleware before\nbinding so TenantID is always populated.",
            "example": "acme_corp",
            "type": "string"
          },
          "ids": {
            "description": "IDs of the sources or memories to delete.",
            "example": [
              "HydraDoc1234",
              "HydraDoc4567"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "sub_tenant_id": {
            "deprecated": true,
            "description": "deprecated: use collection",
            "example": "sub_tenant_4567",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "deprecated: use database",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          },
          "type": {
            "description": "Bucket to delete from: `knowledge` (default) or `memory`.",
            "enum": [
              "knowledge",
              "memory"
            ],
            "example": "knowledge",
            "type": "string"
          }
        },
        "type": "object"
      },
      "tenants.CollectionStats": {
        "properties": {
          "row_count": {
            "description": "Total number of indexed rows in this collection.",
            "example": 1280,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "tenants.CustomPropertyDefinition": {
        "properties": {
          "data_type": {
            "$ref": "#/components/schemas/tenants.MilvusDataType",
            "description": "Milvus data type for this metadata field.",
            "example": "VARCHAR"
          },
          "enable_dense_embedding": {
            "description": "Whether to enable semantic (dense) embedding search on this field.",
            "example": true,
            "type": "boolean"
          },
          "enable_match": {
            "description": "Whether to enable exact-match filtering on this field.",
            "example": true,
            "type": "boolean"
          },
          "enable_sparse_embedding": {
            "description": "Whether to enable BM25 (sparse) embedding search on this field.",
            "example": false,
            "type": "boolean"
          },
          "max_length": {
            "description": "Maximum string length in bytes for VARCHAR fields.",
            "example": 256,
            "type": "integer"
          },
          "name": {
            "description": "Field name. Immutable after database creation.",
            "example": "category",
            "type": "string"
          }
        },
        "type": "object"
      },
      "tenants.FailedTenant": {
        "properties": {
          "database": {
            "description": "Database identifier that failed provisioning.",
            "example": "acme_corp",
            "type": "string"
          },
          "error": {
            "description": "Error message explaining why the database failed.",
            "example": "",
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.InfraStatusResponseV2": {
        "properties": {
          "database": {
            "description": "Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).",
            "example": "acme_corp",
            "type": "string"
          },
          "infra": {
            "$ref": "#/components/schemas/tenants.InfraV2",
            "example": {
              "graph_status": true,
              "ready_for_ingestion": true,
              "scheduler_status": true,
              "vectorstore_status": {
                "knowledge": true,
                "memories": true
              }
            }
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "org_id": {
            "description": "Organization that owns this resource.",
            "example": "org_1a2b3c",
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.InfraV2": {
        "properties": {
          "graph_status": {
            "description": "Whether the graph store is healthy for this database.",
            "example": true,
            "type": "boolean"
          },
          "ready_for_ingestion": {
            "description": "Derived readiness flag: true only when scheduler_status, graph_status, and both vectorstore_status.knowledge and vectorstore_status.memories are true — i.e. the database is fully provisioned and ready to accept ingestion and serve queries. Database creation is asynchronous, so poll GET /databases/status until this is true before ingesting or querying.",
            "example": true,
            "type": "boolean"
          },
          "scheduler_status": {
            "description": "Whether the sync scheduler is healthy for this database.",
            "example": true,
            "type": "boolean"
          },
          "vectorstore_status": {
            "$ref": "#/components/schemas/tenants.VectorstoreStatusV2",
            "example": {
              "knowledge": true,
              "memories": true
            }
          }
        },
        "type": "object"
      },
      "tenants.MilvusDataType": {
        "enum": [
          "BOOL",
          "INT8",
          "INT16",
          "INT32",
          "INT64",
          "FLOAT",
          "DOUBLE",
          "VARCHAR",
          "JSON",
          "ARRAY"
        ],
        "type": "string",
        "x-enum-varnames": [
          "DataTypeBool",
          "DataTypeInt8",
          "DataTypeInt16",
          "DataTypeInt32",
          "DataTypeInt64",
          "DataTypeFloat",
          "DataTypeDouble",
          "DataTypeVarchar",
          "DataTypeJSON",
          "DataTypeArray"
        ]
      },
      "tenants.SubTenantIdsResponse": {
        "properties": {
          "collections": {
            "description": "List of collection identifiers for this database.",
            "example": [
              "team_docs",
              "engineering"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "sub_tenant_ids": {
            "deprecated": true,
            "description": "Deprecated alias for `collections`.",
            "example": [
              "sub_tenant_4567",
              "sub_tenant_8901"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false,
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.TenantCreateAcceptedResponse": {
        "properties": {
          "database": {
            "description": "Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).",
            "example": "acme_corp",
            "type": "string"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "status": {
            "description": "Current lifecycle or processing state.",
            "example": "completed",
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.TenantCreateRequest": {
        "properties": {
          "database": {
            "description": "Database is the canonical v2 name; TenantID is its deprecated alias and\nremains fully accepted. The TenantAliases middleware reconciles them before\nthis binds, so TenantID is always populated.",
            "example": "acme_corp",
            "type": "string"
          },
          "database_metadata_schema": {
            "description": "Defines database-level metadata fields for exact-match filtering and semantic/BM25 search. Canonical name; `tenant_metadata_schema` is a deprecated alias. Schema field names are immutable after database creation.",
            "example": [
              {
                "data_type": "VARCHAR",
                "enable_dense_embedding": true,
                "enable_match": true,
                "enable_sparse_embedding": false,
                "max_length": 256,
                "name": "category"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/tenants.CustomPropertyDefinition"
            },
            "type": "array",
            "uniqueItems": false
          },
          "embeddings_dimension": {
            "description": "Override for the embedding vector dimension. Default: 1536.",
            "example": 1536,
            "type": "integer"
          },
          "is_embeddings_tenant": {
            "description": "Internal flag for embedding-only databases.",
            "example": false,
            "type": "boolean"
          },
          "tenant_id": {
            "deprecated": true,
            "description": "deprecated: use database",
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          },
          "tenant_metadata_schema": {
            "deprecated": true,
            "description": "deprecated: use database_metadata_schema",
            "items": {
              "$ref": "#/components/schemas/tenants.CustomPropertyDefinition"
            },
            "type": "array",
            "uniqueItems": false,
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.TenantDeleteResponse": {
        "properties": {
          "database": {
            "description": "Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).",
            "example": "acme_corp",
            "type": "string"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "status": {
            "description": "Current lifecycle or processing state.",
            "example": "completed",
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.TenantIdsResponse": {
        "properties": {
          "databases": {
            "description": "List of database identifiers.",
            "example": [
              "acme_corp",
              "research_kb"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "failed_databases": {
            "description": "Databases that failed provisioning, with error details.",
            "example": [
              {
                "database": "acme_corp",
                "error": "",
                "tenant_id": "tenant_1234"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/tenants.FailedTenant"
            },
            "type": "array",
            "uniqueItems": false
          },
          "failed_tenant_ids": {
            "deprecated": true,
            "description": "Deprecated alias for `failed_databases`.",
            "example": [
              {
                "database": "acme_corp",
                "error": "",
                "tenant_id": "tenant_1234"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/tenants.FailedTenant"
            },
            "type": "array",
            "uniqueItems": false,
            "x-deprecated": "true"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "tenant_ids": {
            "deprecated": true,
            "description": "Deprecated alias for `databases`.",
            "example": [
              "tenant_1234",
              "tenant_5678"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false,
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.TenantMetadataSchemaUpdateRequest": {
        "properties": {
          "add_fields": {
            "description": "New metadata schema fields to add to the database. Additive only — no deletes, renames, or type changes.",
            "example": [
              {
                "data_type": "VARCHAR",
                "enable_dense_embedding": true,
                "enable_match": true,
                "enable_sparse_embedding": false,
                "max_length": 256,
                "name": "category"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/tenants.CustomPropertyDefinition"
            },
            "type": "array",
            "uniqueItems": false
          }
        },
        "type": "object"
      },
      "tenants.TenantStatsResponse": {
        "properties": {
          "database": {
            "description": "Owning database. Formerly `tenant_id`; the `tenant_id` alias is still accepted (deprecated).",
            "example": "acme_corp",
            "type": "string"
          },
          "knowledge_collection": {
            "$ref": "#/components/schemas/tenants.CollectionStats",
            "example": {
              "row_count": 1280
            }
          },
          "memory_collection": {
            "$ref": "#/components/schemas/tenants.CollectionStats",
            "example": {
              "row_count": 1280
            }
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "tenant_id": {
            "deprecated": true,
            "example": "tenant_1234",
            "type": "string",
            "x-deprecated": "true"
          }
        },
        "type": "object"
      },
      "tenants.VectorstoreStatusV2": {
        "properties": {
          "knowledge": {
            "description": "Whether the knowledge vector store is healthy.",
            "example": true,
            "type": "boolean"
          },
          "memories": {
            "description": "Whether the memories vector store is healthy.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "webhooks.DeliveryItem": {
        "properties": {
          "attempts": {
            "description": "Number of delivery attempts made.",
            "example": 1,
            "type": "integer"
          },
          "created_at": {
            "description": "RFC3339 timestamp when this item was created.",
            "example": "2026-07-02T10:00:00Z",
            "type": "string"
          },
          "delivery_id": {
            "description": "Unique identifier for this webhook delivery attempt.",
            "example": "dlv_9f8e7d6c",
            "type": "string"
          },
          "doc_id": {
            "description": "Source ID that triggered this delivery.",
            "example": "HydraDoc1234",
            "type": "string"
          },
          "error_code": {
            "description": "Machine-readable error code, empty string on success.",
            "example": "",
            "type": "string"
          },
          "error_message": {
            "description": "Human-readable error description, empty string on success.",
            "example": "",
            "type": "string"
          },
          "event_type": {
            "description": "Event that triggered this delivery (e.g. `indexing.status_changed`).",
            "example": "indexing.status_changed",
            "type": "string"
          },
          "indexing_status": {
            "description": "Current processing state: `queued`, `processing`, `completed`, or `failed`.",
            "example": "completed",
            "type": "string"
          },
          "status": {
            "description": "Current delivery status (e.g. `completed`, `failed`, `permanently_failed`).",
            "example": "completed",
            "type": "string"
          },
          "updated_at": {
            "description": "RFC3339 timestamp of the most recent update.",
            "example": "2026-07-02T10:00:05Z",
            "type": "string"
          },
          "webhook_url": {
            "description": "Endpoint this delivery was aimed at. Attributes history to the endpoint\nthat was registered when the delivery was created, rather than to whatever\nis registered now, so a changed URL does not inherit the old one's failures.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.DeliveryListResponse": {
        "properties": {
          "count": {
            "description": "Total number of items returned.",
            "example": 12,
            "type": "integer"
          },
          "deliveries": {
            "description": "List of webhook delivery attempt records.",
            "example": [
              {
                "attempts": 1,
                "created_at": "2026-07-02T10:00:00Z",
                "delivery_id": "dlv_9f8e7d6c",
                "doc_id": "HydraDoc1234",
                "error_code": "",
                "error_message": "",
                "event_type": "indexing.status_changed",
                "indexing_status": "completed",
                "status": "completed",
                "updated_at": "2026-07-02T10:00:05Z"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/webhooks.DeliveryItem"
            },
            "type": "array",
            "uniqueItems": false
          },
          "next_cursor": {
            "description": "Opaque pagination cursor for the next page; null or absent when no more pages.",
            "example": "eyJvZmZzZXQiOjUwfQ==",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.RetryResponse": {
        "properties": {
          "delivery_id": {
            "description": "Unique identifier for this webhook delivery attempt.",
            "example": "dlv_9f8e7d6c",
            "type": "string"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "queued": {
            "description": "Whether the retry was successfully queued.",
            "example": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "webhooks.SigningSecretRequest": {
        "properties": {
          "signing_secret": {
            "description": "Secret used to sign webhook payloads. Deliveries carry `X-HydraDB-Signature: sha256=\u003chex\u003e`, the HMAC-SHA256 of the raw request body keyed by this secret. Minimum 16 characters when you supply your own; omit it and one is generated for you. On registration, omitting this field preserves any existing secret - to disable signing, call DELETE /webhooks/indexing/signing-secret.",
            "example": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.SigningSecretResponse": {
        "properties": {
          "generated": {
            "description": "Whether the returned secret was generated by HydraDB rather than supplied by you.",
            "example": true,
            "type": "boolean"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "signing_secret": {
            "description": "Secret used to sign webhook payloads. Deliveries carry `X-HydraDB-Signature: sha256=\u003chex\u003e`, the HMAC-SHA256 of the raw request body keyed by this secret. Minimum 16 characters when you supply your own; omit it and one is generated for you. On registration, omitting this field preserves any existing secret - to disable signing, call DELETE /webhooks/indexing/signing-secret.",
            "example": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.WebhookDeleteResponse": {
        "properties": {
          "deleted": {
            "description": "Whether this specific item was deleted.",
            "example": true,
            "type": "boolean"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.WebhookGetResponse": {
        "properties": {
          "event_types": {
            "description": "Event types to subscribe to (e.g. `[\"indexing.status_changed\"]`).",
            "example": [
              "indexing.status_changed"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "registered": {
            "description": "Whether a webhook is registered for this API key.",
            "example": true,
            "type": "boolean"
          },
          "signing_secret_configured": {
            "description": "Whether a signing secret has been configured for payload verification.",
            "example": true,
            "type": "boolean"
          },
          "url": {
            "description": "Registered endpoint URL that receives webhook event deliveries.",
            "example": "https://docs.hydradb.com/phoenix",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.WebhookRegisterRequest": {
        "properties": {
          "event_types": {
            "description": "Event types to subscribe to (e.g. `[\"indexing.status_changed\"]`).",
            "example": [
              "indexing.status_changed"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "generate_signing_secret": {
            "description": "Generate a signing secret as part of this request, so registering and enabling signing are one atomic operation. The secret is returned once on the response and cannot be retrieved later. Mutually exclusive with `signing_secret`.",
            "example": true,
            "type": "boolean"
          },
          "signing_secret": {
            "description": "Secret used to sign webhook payloads. Deliveries carry `X-HydraDB-Signature: sha256=\u003chex\u003e`, the HMAC-SHA256 of the raw request body keyed by this secret. Minimum 16 characters when you supply your own; omit it and one is generated for you. On registration, omitting this field preserves any existing secret - to disable signing, call DELETE /webhooks/indexing/signing-secret.",
            "example": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
            "type": "string"
          },
          "url": {
            "description": "Endpoint URL to deliver webhook events to.",
            "example": "https://docs.hydradb.com/phoenix",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.WebhookRegisterResponse": {
        "properties": {
          "event_types": {
            "description": "Event types to subscribe to (e.g. `[\"indexing.status_changed\"]`).",
            "example": [
              "indexing.status_changed"
            ],
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": false
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "registered": {
            "description": "Whether a webhook is registered for this API key.",
            "example": true,
            "type": "boolean"
          },
          "signing_secret": {
            "description": "Secret used to sign webhook payloads. Deliveries carry `X-HydraDB-Signature: sha256=\u003chex\u003e`, the HMAC-SHA256 of the raw request body keyed by this secret. Minimum 16 characters when you supply your own; omit it and one is generated for you. On registration, omitting this field preserves any existing secret - to disable signing, call DELETE /webhooks/indexing/signing-secret.",
            "example": "whsec_EXAMPLE_ONLY_THIS_IS_NOT_A_REAL_SIGNING_KEY",
            "type": "string"
          },
          "signing_secret_configured": {
            "description": "Whether a signing secret has been configured for payload verification.",
            "example": true,
            "type": "boolean"
          },
          "url": {
            "description": "Registered endpoint URL that receives webhook event deliveries.",
            "example": "https://docs.hydradb.com/phoenix",
            "type": "string"
          }
        },
        "type": "object"
      },
      "webhooks.WebhookTestResponse": {
        "properties": {
          "delivered": {
            "description": "Whether the test delivery was accepted by the endpoint.",
            "example": true,
            "type": "boolean"
          },
          "message": {
            "description": "Human-readable result message.",
            "example": "Success",
            "type": "string"
          },
          "status_code": {
            "description": "HTTP status code returned by the webhook endpoint.",
            "example": 200,
            "type": "integer"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "bearerFormat": "API key",
        "description": "API key sent as a Bearer token: \"Bearer prefix.secret\"",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "externalDocs": {
    "description": "",
    "url": ""
  },
  "info": {
    "contact": {
      "email": "support@hydradb.com",
      "name": "HydraDB Support"
    },
    "description": "HydraDB Application API — knowledge ingestion, search, and memory management.",
    "license": {
      "name": "Proprietary"
    },
    "title": "HydraDB Application API",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/connector-catalog": {
      "get": {
        "description": "List every provider in the supported_connectors control-plane table (availability, sync engine, maturity, category) for the dashboard connector catalog.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.connectorCatalogResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "List the connector catalog",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-method-name": "catalog"
      }
    },
    "/connector-discovery": {
      "post": {
        "description": "List a provider's resources directly from supplied credentials, before creating a connector. Passing cursor or limit opts into pagination (currently Notion only): the response then adds next_cursor and has_more, a page may hold fewer than limit resources, and clients must continue while has_more is true. Without either param the full resource list is returned.",
        "parameters": [
          {
            "description": "Opaque pagination cursor from a previous response's next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max resources per page, 1-100 (values above 100 are clamped)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.discoverPreviewReq"
              }
            }
          },
          "description": "Provider and credentials",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.discoverResponseBody"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Preview provider resources",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "discover_preview"
      }
    },
    "/connectors": {
      "get": {
        "description": "List all connectors for the authenticated org, optionally filtered by provider.",
        "parameters": [
          {
            "description": "Filter by provider",
            "in": "query",
            "name": "provider",
            "schema": {
              "example": "slack",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.connectorListResponse"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List connectors",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "list"
      },
      "post": {
        "description": "Create a connector for a provider and store its credentials.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.connectorCreateReq"
              }
            }
          },
          "description": "Connector configuration",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectors.Connector"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a connector",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "create"
      }
    },
    "/connectors/providers": {
      "get": {
        "description": "Without ?id: returns every supported connector with its availability, maturity, category, and sync engine (the connector catalog). With ?id=\u003cprovider\u003e: returns what that provider stores and how to use it — indexed_object_types (the streams that become searchable documents), searchable_fields (rendered into the indexed text), filterable_fields (each with the exact filter_key to pass in a query's metadata_filters), the credential_schema for connecting it, and setup_guide (present for providers whose configuration goes beyond the credential schema — e.g. bigquery's per-table cursor/change-history settings and the one-time ALTER statement they may require).",
        "parameters": [
          {
            "description": "Provider name (e.g. slack, gmail). Omit to list all.",
            "in": "query",
            "name": "id",
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.providerListResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "summary": "List supported providers, or describe one in detail",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-method-name": "listProviders"
      }
    },
    "/connectors/{id}": {
      "delete": {
        "description": "Delete a connector, its resources, and stored credentials.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.connectorDeleteResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete a connector",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "delete"
      },
      "get": {
        "description": "Fetch a single connector by ID.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectors.Connector"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a connector",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "get"
      },
      "patch": {
        "description": "Update a connector's mutable settings. `sync_interval_seconds` sets the cadence at which the scheduler starts incremental syncs: the allowed range is provider-aware and returned in the response; values outside it are rejected rather than clamped; 0 resets to the provider default; changing it re-anchors the next sync so a shorter cadence takes effect immediately. `credentials` reconnects the connector in place: send the provider's full credential set (what create accepts); supplied keys replace their stored values, other stored keys survive, the bundle is re-validated against the provider's credential schema, and a pending needs-reauth flag is cleared — the connector keeps its id, resources, and sync cursors.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.connectorUpdateReq"
              }
            }
          },
          "description": "Connector update request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.connectorUpdateResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update a connector",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "update"
      }
    },
    "/connectors/{id}/configure": {
      "post": {
        "description": "Save the selected resources for a connector and trigger initial sync/backfill.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.configureReq"
              }
            }
          },
          "description": "Resource selection and sync options",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.configureResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Configure connector resources",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "configure"
      }
    },
    "/connectors/{id}/credentials": {
      "patch": {
        "description": "Internal endpoint. It is not callable with a customer API key and always returns 403 for external callers. Persists a rotated refresh_token for OAuth-bundle connectors: providers that rotate the refresh token on each exchange invalidate the previously stored one, so the new token must be written back or the next sync fails with invalid_grant. Only refresh_token is merged onto the current stored credential bundle and re-encrypted under the connector's identity context; credentials are never returned. It has no automated caller and is disabled by default: until an operator enables it, every call returns 500.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.credentialsUpdateResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "summary": "Rotate a connector's stored OAuth refresh token (internal use only)",
        "tags": [
          "connectors"
        ]
      }
    },
    "/connectors/{id}/discover": {
      "get": {
        "description": "List a connected provider's resources using the connector's stored credentials. Passing cursor or limit opts into pagination (currently Notion only): the response then adds next_cursor and has_more, a page may hold fewer than limit resources, and clients must continue while has_more is true. Without either param the full resource list is returned.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max resources per page, 1-100 (values above 100 are clamped)",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.discoverResponseBody"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Gateway"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Discover connector resources",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "discover"
      }
    },
    "/connectors/{id}/resources": {
      "get": {
        "description": "List the configured resources for a connector.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.connectorResourcesResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List connector resources",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "list_resources"
      },
      "post": {
        "description": "Add a resource mapping to a connector.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.resourceCreateReq"
              }
            }
          },
          "description": "Resource configuration",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/connectors.Resource"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a connector resource",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "create_resource"
      }
    },
    "/connectors/{id}/resources/{resource_id}": {
      "delete": {
        "description": "Remove a resource mapping from a connector.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          },
          {
            "description": "Resource ID",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "schema": {
              "example": "C0123456789",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.resourceDeleteResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete a connector resource",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "delete_resource"
      }
    },
    "/connectors/{id}/sync": {
      "post": {
        "description": "Start a manual sync workflow for a connector.",
        "parameters": [
          {
            "description": "Connector ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.connectorSyncResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Trigger a connector sync",
        "tags": [
          "connectors"
        ],
        "x-fern-sdk-group-name": "connectors",
        "x-fern-sdk-method-name": "sync"
      }
    },
    "/context": {
      "delete": {
        "description": "Delete one or more knowledge sources or memories by ID.\n\nBy default this endpoint answers 200 for every outcome, including a delete\nthat removed nothing — check `data.deleted_count` and `data.results` rather\nthan the status code.\n\nSend `X-HydraDB-Delete-Status: strict` to opt in to honest status codes: a\ndelete that did not happen then answers 404/409/500 and never 200. This is\nthe recommended mode for new integrations. On those failures the response\n`data` still carries the same `results` / `deleted_count` payload a 200\ncarries, so per-id outcomes stay readable either way.\n\nThe default is expected to become strict in a future release, at which\npoint `X-HydraDB-Delete-Status: legacy` keeps the unconditional 200 for a\ncaller that is not ready.",
        "parameters": [
          {
            "description": "Selects the status behaviour for this request. `strict` opts in to honest 404/409/500 codes when the delete did not happen; `legacy` forces the unconditional 200. Omitted, the server default applies — currently `legacy`.",
            "in": "header",
            "name": "X-HydraDB-Delete-Status",
            "schema": {
              "enum": [
                "strict",
                "legacy"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/sources.V2SourceDeleteRequest"
              }
            }
          },
          "description": "Delete request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-sources_MemoryDeleteResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorEnvelope-sources_MemoryDeleteResponse"
                }
              }
            },
            "description": "Strict mode only. No source matched the given ids; `data` carries the same results/deleted_count payload a 200 carries"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorEnvelope-sources_MemoryDeleteResponse"
                }
              }
            },
            "description": "Strict mode only. Source is still indexing; retry after ingestion completes (see Retry-After). `data` carries the same results/deleted_count payload a 200 carries"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorEnvelope-sources_MemoryDeleteResponse"
                }
              }
            },
            "description": "Strict mode only. A store failed to delete the source; the delete is retryable. `data` carries the same results/deleted_count payload a 200 carries"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete documents or memories",
        "tags": [
          "context"
        ],
        "x-fern-sdk-group-name": "context",
        "x-fern-sdk-method-name": "delete"
      }
    },
    "/context/ingest": {
      "post": {
        "description": "Ingest knowledge documents or memories for a tenant.",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "app_knowledge": {
                    "description": "App-knowledge items as a JSON array (type=knowledge). Per item, `metadata` is capped at 16 KiB and `additional_metadata` at 1 KiB, measured on the compact JSON encoding of the whole map in UTF-8 bytes (keys and punctuation count). The deprecated `tenant_metadata` / `document_metadata` spellings are accepted here and held to the same caps. Over-cap returns 400 with the actual byte count.",
                    "title": "app_knowledge",
                    "type": "string"
                  },
                  "collection": {
                    "title": "collection",
                    "type": "string"
                  },
                  "database": {
                    "title": "database",
                    "type": "string"
                  },
                  "document_metadata": {
                    "description": "Per-document metadata as a JSON array (type=knowledge). Per item, `metadata` is capped at 16 KiB and `additional_metadata` at 1 KiB. Both caps are measured on the compact JSON encoding of the whole map in UTF-8 bytes, so keys, quotes, commas and braces count toward the budget. Over-cap returns 400 with the actual byte count.",
                    "title": "document_metadata",
                    "type": "string"
                  },
                  "documents": {
                    "format": "binary",
                    "title": "documents",
                    "type": "string"
                  },
                  "graph_payload": {
                    "title": "graph_payload",
                    "type": "string"
                  },
                  "memories": {
                    "description": "Memory items as a JSON array (type=memory). Per item, `metadata` is capped at 16 KiB and `additional_metadata` at 1 KiB, measured on the compact JSON encoding of the whole map in UTF-8 bytes (keys and punctuation count). Over-cap returns 400 with the actual byte count.",
                    "title": "memories",
                    "type": "string"
                  },
                  "sub_tenant_id": {
                    "deprecated": true,
                    "title": "sub_tenant_id",
                    "type": "string",
                    "x-deprecated": "true"
                  },
                  "tenant_id": {
                    "deprecated": true,
                    "title": "tenant_id",
                    "type": "string",
                    "x-deprecated": "true"
                  },
                  "type": {
                    "default": "knowledge",
                    "enum": [
                      "knowledge",
                      "memory"
                    ],
                    "title": "type",
                    "type": "string"
                  },
                  "upsert": {
                    "default": "true",
                    "title": "upsert",
                    "type": "string"
                  }
                },
                "required": [
                  "database"
                ],
                "type": "object"
              }
            }
          },
          "description": "Content type: 'knowledge' or 'memory' | Database (canonical name for the tenant scope) | Collection (canonical name for the sub-tenant scope) | Deprecated alias for database | Deprecated alias for collection | Upsert existing content (true/false/1/0) | Knowledge files to ingest (repeatable; type=knowledge) | Per-document metadata as a JSON array (type=knowledge). Per item: metadata \u003c= 16 KiB, additional_metadata \u003c= 1 KiB. | App-knowledge items as a JSON array (type=knowledge). Per item: metadata \u003c= 16 KiB, additional_metadata \u003c= 1 KiB. | Memory items as a JSON array (type=memory). Per item: metadata \u003c= 16 KiB, additional_metadata \u003c= 1 KiB. | Optional bring-your-own-graph payload as JSON",
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-ingestion_V2SourceUploadResponse"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Request Entity Too Large"
          },
          "415": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Body is not multipart/form-data (e.g. a JSON body)"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Ingest content",
        "tags": [
          "context"
        ],
        "x-fern-sdk-group-name": "context",
        "x-fern-sdk-method-name": "ingest"
      }
    },
    "/context/inspect": {
      "get": {
        "description": "Fetch a previously ingested source's content, inferred content, and a downloadable URL.",
        "parameters": [
          {
            "description": "Source ID",
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          },
          {
            "description": "Database (canonical name for the tenant scope)",
            "in": "query",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          },
          {
            "description": "Collection (canonical name for the sub-tenant scope)",
            "in": "query",
            "name": "collection",
            "schema": {
              "example": "team_docs",
              "type": "string"
            }
          },
          {
            "description": "Deprecated alias for database",
            "in": "query",
            "name": "tenant_id",
            "schema": {
              "deprecated": true,
              "example": "tenant_1234",
              "type": "string",
              "x-deprecated": "true"
            }
          },
          {
            "description": "Deprecated alias for collection",
            "in": "query",
            "name": "sub_tenant_id",
            "schema": {
              "deprecated": true,
              "example": "sub_tenant_4567",
              "type": "string",
              "x-deprecated": "true"
            }
          },
          {
            "description": "Presigned URL expiry in seconds",
            "in": "query",
            "name": "expiry_seconds",
            "schema": {
              "default": 3600,
              "type": "integer"
            }
          },
          {
            "description": "Fetch mode",
            "in": "query",
            "name": "mode",
            "schema": {
              "example": "thinking",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-fetch_V2SourceFetchResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Fetch document content",
        "tags": [
          "context"
        ],
        "x-fern-sdk-group-name": "context",
        "x-fern-sdk-method-name": "inspect"
      }
    },
    "/context/list": {
      "post": {
        "description": "List knowledge sources or memories (id + metadata) for a tenant.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/list.V2ListContentRequest"
              }
            }
          },
          "description": "List request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-list_V2SourceListResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List documents",
        "tags": [
          "context"
        ],
        "x-fern-sdk-group-name": "context",
        "x-fern-sdk-method-name": "list"
      }
    },
    "/context/relations": {
      "get": {
        "description": "Return knowledge-graph relations for a tenant or a single source.",
        "parameters": [
          {
            "description": "Database (canonical name for the tenant scope)",
            "in": "query",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          },
          {
            "description": "Collection (canonical name for the sub-tenant scope)",
            "in": "query",
            "name": "collection",
            "schema": {
              "example": "team_docs",
              "type": "string"
            }
          },
          {
            "description": "Deprecated alias for database",
            "in": "query",
            "name": "tenant_id",
            "schema": {
              "deprecated": true,
              "example": "tenant_1234",
              "type": "string",
              "x-deprecated": "true"
            }
          },
          {
            "description": "Deprecated alias for collection",
            "in": "query",
            "name": "sub_tenant_id",
            "schema": {
              "deprecated": true,
              "example": "sub_tenant_4567",
              "type": "string",
              "x-deprecated": "true"
            }
          },
          {
            "description": "Source ID (omit for database-wide relations)",
            "in": "query",
            "name": "id",
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          },
          {
            "description": "Corpus type: 'knowledge' or 'memory'",
            "in": "query",
            "name": "type",
            "schema": {
              "enum": [
                "knowledge",
                "memory"
              ],
              "type": "string"
            }
          },
          {
            "description": "Max relations to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 5000,
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-graph_GraphRelationsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get graph relations",
        "tags": [
          "context"
        ],
        "x-fern-sdk-group-name": "context",
        "x-fern-sdk-method-name": "relations"
      }
    },
    "/context/status": {
      "get": {
        "description": "Return the processing status for one or more source IDs.",
        "parameters": [
          {
            "description": "Single source ID",
            "in": "query",
            "name": "id",
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          },
          {
            "description": "One or more source IDs",
            "in": "query",
            "name": "ids",
            "schema": {
              "example": [
                "HydraDoc1234",
                "HydraDoc4567"
              ],
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "Database (canonical name for the tenant scope)",
            "in": "query",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          },
          {
            "description": "Collection (canonical name for the sub-tenant scope)",
            "in": "query",
            "name": "collection",
            "schema": {
              "example": "team_docs",
              "type": "string"
            }
          },
          {
            "description": "Deprecated alias for database",
            "in": "query",
            "name": "tenant_id",
            "schema": {
              "deprecated": true,
              "example": "tenant_1234",
              "type": "string",
              "x-deprecated": "true"
            }
          },
          {
            "description": "Deprecated alias for collection",
            "in": "query",
            "name": "sub_tenant_id",
            "schema": {
              "deprecated": true,
              "example": "sub_tenant_4567",
              "type": "string",
              "x-deprecated": "true"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-ingestion_V2BatchProcessingStatus"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Check processing status",
        "tags": [
          "context"
        ],
        "x-fern-sdk-group-name": "context",
        "x-fern-sdk-method-name": "status"
      }
    },
    "/context/{id}/metadata": {
      "patch": {
        "description": "Merge/upsert database_metadata and additional_metadata for one source. collection is required.",
        "parameters": [
          {
            "description": "Source ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "example": "HydraDoc1234",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/handler.contextMetadataUpdateRequest"
              }
            }
          },
          "description": "Metadata update request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-github_com_hydradb_hydradb-application_internal_service_MetadataEditResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update source metadata",
        "tags": [
          "context"
        ],
        "x-fern-sdk-group-name": "context"
      }
    },
    "/databases": {
      "delete": {
        "description": "Delete a database and all associated data",
        "parameters": [
          {
            "description": "Database identifier to delete",
            "in": "query",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-tenants_TenantDeleteResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete a database",
        "tags": [
          "database-management"
        ],
        "x-fern-sdk-group-name": "databases",
        "x-fern-sdk-method-name": "delete"
      },
      "get": {
        "description": "List all databases for the authenticated user",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-tenants_TenantIdsResponse"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List databases",
        "tags": [
          "database-management"
        ],
        "x-fern-sdk-group-name": "databases",
        "x-fern-sdk-method-name": "list"
      },
      "post": {
        "description": "Create a new database with optional custom metadata schema",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/tenants.TenantCreateRequest"
              }
            }
          },
          "description": "Database creation request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-tenants_TenantCreateAcceptedResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Forbidden"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Create a database",
        "tags": [
          "database-management"
        ],
        "x-fern-sdk-group-name": "databases",
        "x-fern-sdk-method-name": "create"
      }
    },
    "/databases/collections": {
      "get": {
        "description": "List all collections for a given database",
        "parameters": [
          {
            "description": "Database identifier",
            "in": "query",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-tenants_SubTenantIdsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List collections",
        "tags": [
          "database-management"
        ],
        "x-fern-sdk-group-name": "databases",
        "x-fern-sdk-method-name": "collections"
      }
    },
    "/databases/stats": {
      "get": {
        "description": "Get collection statistics for a database",
        "parameters": [
          {
            "description": "Database identifier",
            "in": "query",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-tenants_TenantStatsResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get database statistics",
        "tags": [
          "database-management"
        ],
        "x-fern-sdk-group-name": "databases",
        "x-fern-sdk-method-name": "stats"
      }
    },
    "/databases/status": {
      "get": {
        "description": "Check the infrastructure provisioning status for a database",
        "parameters": [
          {
            "description": "Database identifier",
            "in": "query",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-tenants_InfraStatusResponseV2"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get infrastructure status",
        "tags": [
          "database-management"
        ],
        "x-fern-sdk-group-name": "databases",
        "x-fern-sdk-method-name": "status"
      }
    },
    "/databases/{database}/metadata-schema": {
      "patch": {
        "description": "Add new metadata schema fields to an existing database. Additive only — existing fields cannot be deleted or retyped.",
        "parameters": [
          {
            "description": "Database identifier",
            "in": "path",
            "name": "database",
            "required": true,
            "schema": {
              "example": "acme_corp",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/tenants.TenantMetadataSchemaUpdateRequest"
              }
            }
          },
          "description": "Metadata schema fields to add",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.metadataSchemaUpdateResponse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Update metadata schema",
        "tags": [
          "database-management"
        ],
        "x-fern-sdk-group-name": "databases",
        "x-fern-sdk-method-name": "update_metadata_schema"
      }
    },
    "/feedback": {
      "post": {
        "description": "Record feedback about a query that already ran, correlated by the `request_id` returned in that query's `response.meta.request_id`. Accepts a free-text comment plus an optional positive/negative/neutral rating, and is intended for both end users and agents (`source`). Feeds internal retrieval-quality validation; it does not change the result of the original query.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/feedback.SubmitRequest"
              }
            }
          },
          "description": "Feedback submission",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-feedback_SubmitResponse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Submit feedback for a query",
        "tags": [
          "feedback"
        ],
        "x-fern-sdk-group-name": "feedback",
        "x-fern-sdk-method-name": "submit"
      }
    },
    "/query": {
      "post": {
        "description": "Unified query endpoint that dispatches across type (knowledge/memory/all) and query_by (hybrid/text). Prefer sub_tenant_ids for sub-tenant scoping; legacy sub_tenant_id is deprecated for /query and cannot be sent together with sub_tenant_ids.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/search.QueryRequest"
              }
            }
          },
          "description": "Unified query request",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-search_V2RetrievalResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Unified query",
        "tags": [
          "query"
        ],
        "x-fern-sdk-method-name": "query"
      }
    },
    "/webhooks/indexing": {
      "delete": {
        "description": "Unregister the indexing webhook for this API key.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_WebhookDeleteResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Delete the registered webhook for this API key",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "delete"
      },
      "get": {
        "description": "Get the registered indexing webhook configuration for this API key.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_WebhookGetResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get the registered webhook for this API key",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "get"
      },
      "post": {
        "description": "Register the indexing webhook for this API key's org. Set `generate_signing_secret` to register and enable signing in one request; the secret is returned once on the response. Omitting `signing_secret` preserves any secret already configured - to disable signing, call DELETE /webhooks/indexing/signing-secret.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhooks.WebhookRegisterRequest"
              }
            }
          },
          "description": "Webhook registration request",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_WebhookRegisterResponse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Register a webhook",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "register"
      }
    },
    "/webhooks/indexing/deliveries": {
      "get": {
        "description": "List recent webhook delivery attempts with optional cursor-based pagination.",
        "parameters": [
          {
            "description": "Max deliveries to return",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Pagination cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by delivery status",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_DeliveryListResponse"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List recent webhook delivery attempts",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "list_deliveries"
      }
    },
    "/webhooks/indexing/deliveries/{delivery_id}": {
      "get": {
        "description": "Get a single webhook delivery attempt by ID.",
        "parameters": [
          {
            "description": "Delivery ID",
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "example": "dlv_9f8e7d6c",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_DeliveryItem"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a single webhook delivery attempt",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "get_delivery"
      }
    },
    "/webhooks/indexing/deliveries/{delivery_id}/retry": {
      "post": {
        "description": "Queue a failed or permanently-failed delivery for retry.",
        "parameters": [
          {
            "description": "Delivery ID",
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "example": "dlv_9f8e7d6c",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_RetryResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Retry a failed or permanently failed delivery",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "retry_delivery"
      }
    },
    "/webhooks/indexing/signing-secret": {
      "delete": {
        "description": "Removes the stored signing secret. Deliveries stop carrying the X-HydraDB-Signature header. This is the only way to disable signing - editing a registration never clears the secret.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_WebhookRegisterResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Disable webhook signing",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "clearSigningSecret"
      },
      "post": {
        "description": "Generates a signing secret, or stores one you supply. The plaintext is returned exactly once and cannot be retrieved afterwards. Takes effect immediately, so rotate only once your receiver accepts the new secret.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/webhooks.SigningSecretRequest"
              }
            }
          },
          "description": "Omit the body to have a secret generated for you"
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_SigningSecretResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Generate or set the webhook signing secret",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "setSigningSecret"
      }
    },
    "/webhooks/indexing/test": {
      "post": {
        "description": "Send a test webhook event to the registered endpoint to verify connectivity.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.Envelope-webhooks_WebhookTestResponse"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/handler.ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Send a test webhook delivery",
        "tags": [
          "webhooks"
        ],
        "x-fern-sdk-group-name": "webhooks",
        "x-fern-sdk-method-name": "test"
      }
    }
  },
  "servers": [
    {
      "description": "Production server",
      "url": "https://api.hydradb.com"
    }
  ],
  "x-fern-global-headers": [
    {
      "header": "API-Version",
      "name": "api_version",
      "x-fern-default": "2"
    }
  ]
}