{
  "openapi": "3.1.0",
  "info": {
    "title": "FastAPI",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/healthcheck": {
      "get": {
        "summary": "Healthcheck",
        "operationId": "healthcheck_v1_healthcheck_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/companies/{company_identifier}": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Lookup Company Profile",
        "description": "Look up the canonical enriched Extruct company profile for a known company UUID or domain. Company Lookup currently consumes 0 credits, while successful and accepted lookups still appear in usage analytics.",
        "operationId": "get_company_by_identifier_v1_companies__company_identifier__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "company_identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Company Identifier"
            },
            "description": "Company UUID or domain."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyProfileAPIResponse"
                }
              }
            }
          },
          "202": {
            "description": "Company enrichment is in progress. Retry the same lookup later.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyLookupEnrichingResponse"
                }
              }
            }
          },
          "404": {
            "description": "Company profile is not available or the identifier is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPExceptionDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/companies/search": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Search Companies",
        "description": "Find companies using a natural-language query. Use `filters` (JSON string) to narrow results by size, country, city, and founded year range.",
        "operationId": "search_companies_v1_companies_search_get",
        "deprecated": true,
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Search query",
              "title": "Q"
            },
            "description": "Search query"
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "JSON string of SearchFilters. Supported keys only: include.size/country/city, exclude.size/country/city/domains, range.founded.min/max."
            },
            "description": "JSON string of SearchFilters. Supported keys only: include.size/country/city, exclude.size/country/city/domains, range.founded.min/max.",
            "example": "{\"include\":{\"country\":[\"United States\"],\"size\":[\"51-200\"]},\"range\":{\"founded\":{\"min\":2018}}}"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanySearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "search"
        ],
        "summary": "Search Companies",
        "description": "POST variant of company search. Send `filters` as a JSON object (not a string). Use this when an `exclude.domains` list is too large for a GET URL.",
        "operationId": "search_companies_post_v1_companies_search_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanySearchPostInput",
                "examples": [
                  {
                    "q": "payments infrastructure",
                    "filters": {
                      "include": {
                        "country": [
                          "United States"
                        ]
                      },
                      "exclude": {
                        "domains": [
                          "stripe.com",
                          "adyen.com"
                        ]
                      }
                    },
                    "pagination": {
                      "offset": 0,
                      "limit": 20
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanySearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/companies/{company_identifier}/similar": {
      "get": {
        "tags": [
          "search"
        ],
        "summary": "Find Similar Companies",
        "description": "Find companies similar to a reference company (UUID or domain). Use the same `filters` contract as semantic search to narrow by size, country, city, and founded year range.",
        "operationId": "find_similar_companies_v1_companies__company_identifier__similar_get",
        "deprecated": true,
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "company_identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Company Identifier"
            },
            "description": "Reference company UUID or domain."
          },
          {
            "name": "filters",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "JSON string of SearchFilters. Supported keys only: include.size/country/city, exclude.size/country/city/domains, range.founded.min/max."
            },
            "description": "JSON string of SearchFilters. Supported keys only: include.size/country/city, exclude.size/country/city/domains, range.founded.min/max.",
            "example": "{\"include\":{\"country\":[\"United States\"],\"size\":[\"51-200\"]},\"range\":{\"founded\":{\"min\":2018}}}"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyLookalikeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "search"
        ],
        "summary": "Find Similar Companies",
        "description": "POST variant of lookalike search. Send `filters` as a JSON object (not a string). Use this when an `exclude.domains` list is too large for a GET URL.",
        "operationId": "find_similar_companies_post_v1_companies__company_identifier__similar_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "company_identifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Company Identifier"
            },
            "description": "Reference company UUID or domain."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyLookalikePostInput",
                "examples": [
                  {
                    "filters": {
                      "exclude": {
                        "domains": [
                          "stripe.com",
                          "adyen.com"
                        ]
                      }
                    },
                    "pagination": {
                      "offset": 0,
                      "limit": 20
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyLookalikeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables": {
      "post": {
        "tags": [
          "tables"
        ],
        "summary": "Create Table",
        "operationId": "create_table_v1_tables_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTableInput-Input",
                "examples": [
                  {
                    "name": "Supercharged Research",
                    "kind": "company",
                    "column_configs": [
                      {
                        "kind": "agent",
                        "name": "Company Description",
                        "key": "description",
                        "value": {
                          "agent_type": "research_pro",
                          "prompt": "Research the company {company_name} ({company_website}) and provide a short description.",
                          "output_format": "text"
                        }
                      }
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableHeaderOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "tables"
        ],
        "summary": "List Tables",
        "description": "List root tables visible to the authenticated user.\n\nSupports filtering by table kind, ownership scope, free-text search, and tags. Results can be sorted by creation time, name, or row count.",
        "operationId": "list_tables_v1_tables_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TableKind"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by table kind"
            },
            "description": "Filter by table kind"
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Scope"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by ownership: personal returns the caller's own tables; organization returns all tables visible within the caller's organization, including the caller's own tables."
            },
            "description": "Filter by ownership: personal returns the caller's own tables; organization returns all tables visible within the caller's organization, including the caller's own tables."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Case-insensitive search across table names and descriptions."
            },
            "description": "Case-insensitive search across table names and descriptions."
          },
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Repeat this parameter to match tables with any of the provided tags."
            },
            "description": "Repeat this parameter to match tables with any of the provided tags."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "-created_at",
                    "created_at",
                    "name",
                    "-name",
                    "num_rows",
                    "-num_rows"
                  ]
                },
                {
                  "type": "null"
                }
              ],
              "description": "Sort order for the returned tables."
            },
            "description": "Sort order for the returned tables."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Number of matching tables to skip."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100,
                  "default": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum number of tables to return. Defaults to 50. Maximum 100."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "headers": {
              "x-extruct-pagination-total": {
                "schema": {
                  "type": "integer"
                },
                "description": "Total number of matching tables."
              },
              "x-extruct-pagination-total-pages": {
                "schema": {
                  "type": "integer"
                },
                "description": "Total number of pages for the current limit."
              },
              "x-extruct-pagination-limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "Applied page size."
              },
              "x-extruct-pagination-offset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Applied pagination offset."
              },
              "x-extruct-pagination-page": {
                "schema": {
                  "type": "integer"
                },
                "description": "Current 1-based page number."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TableListItemOutput"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "detail"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}": {
      "get": {
        "tags": [
          "tables"
        ],
        "summary": "Get Table",
        "description": "Get table header and status.",
        "operationId": "get_table_v1_tables__table_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableHeaderWithStatusOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "tables"
        ],
        "summary": "Update Table",
        "description": "Update table metadata.",
        "operationId": "update_table_v1_tables__table_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTableInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableHeaderOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "tables"
        ],
        "summary": "Delete Table",
        "description": "Delete table by ID.",
        "operationId": "delete_table_v1_tables__table_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableHeaderOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}/clone": {
      "post": {
        "tags": [
          "tables"
        ],
        "summary": "Clone Table",
        "description": "Clone table by ID.\n\nOnly allowed to admin users, from admin users, or users within same organization.\nAlways clones the entire table hierarchy (parent and child tables).\nIf schema_only=True, only schemas are cloned without data.\nIf schema_only=False, creates an identical duplicate with all row relationships preserved.",
        "operationId": "clone_table_v1_tables__table_id__clone_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          },
          {
            "name": "schema_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Schema Only"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableHeaderOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}/rows": {
      "post": {
        "tags": [
          "tables"
        ],
        "summary": "Create Table Rows",
        "description": "Append new rows with input data to the table.",
        "operationId": "create_table_rows_v1_tables__table_id__rows_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTableRowsInput",
                "examples": [
                  {
                    "rows": [
                      {
                        "data": {
                          "input": "https://extruct.ai"
                        }
                      },
                      {
                        "data": {
                          "input": "https://openai.com"
                        }
                      }
                    ],
                    "run": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RowDataOutputSchema-Output"
                  },
                  "title": "Response Create Table Rows V1 Tables  Table Id  Rows Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "tables"
        ],
        "summary": "Update Table Rows",
        "description": "Update existing rows & create new ones with input data in the table.",
        "operationId": "update_table_rows_v1_tables__table_id__rows_patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTableRowsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RowDataOutputSchema-Output"
                  },
                  "title": "Response Update Table Rows V1 Tables  Table Id  Rows Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "tables"
        ],
        "summary": "Delete Table Rows",
        "description": "Delete rows by ID.",
        "operationId": "delete_table_rows_v1_tables__table_id__rows_delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteTableRowsInput"
              },
              "example": {
                "rows": [
                  "11111111-1111-1111-1111-111111111111",
                  "22222222-2222-2222-2222-222222222222"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Response Delete Table Rows V1 Tables  Table Id  Rows Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}/rows/{row_id}": {
      "get": {
        "tags": [
          "tables"
        ],
        "summary": "Get Table Row",
        "operationId": "get_table_row_v1_tables__table_id__rows__row_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          },
          {
            "name": "row_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Row Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RowDataOutputWithStatusSchema"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}/columns": {
      "post": {
        "tags": [
          "tables"
        ],
        "summary": "Create Table Columns",
        "description": "Create new columns in the table.",
        "operationId": "create_table_columns_v1_tables__table_id__columns_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTableColumnsInput",
                "examples": [
                  {
                    "column_configs": [
                      {
                        "kind": "agent",
                        "name": "Company Description",
                        "key": "description",
                        "value": {
                          "agent_type": "research_pro",
                          "prompt": "Research the company {input} and provide a short description.",
                          "output_format": "text"
                        }
                      },
                      {
                        "kind": "agent",
                        "name": "Company Linkedin URL",
                        "key": "linkedin_url",
                        "value": {
                          "agent_type": "research_pro",
                          "prompt": "Find linkedin profile URL of the company {input}",
                          "output_format": "url"
                        }
                      },
                      {
                        "kind": "agent",
                        "name": "Company Linkedin Data",
                        "key": "linkedin_data",
                        "value": {
                          "agent_type": "linkedin",
                          "prompt": "{linkedin_url}",
                          "output_format": "text"
                        }
                      },
                      {
                        "kind": "agent",
                        "name": "Linkedin Activity Summary",
                        "key": "linkedin_activity",
                        "value": {
                          "agent_type": "llm",
                          "prompt": "Based on the company Linkedin profile data, summarize the recent activity as a bulleted list with names, dates and links. Data: {linkedin_data}",
                          "output_format": "text"
                        }
                      }
                    ],
                    "insert_after": true
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ColumnOutputSchema"
                  },
                  "title": "Response Create Table Columns V1 Tables  Table Id  Columns Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}/columns/{column_id}": {
      "patch": {
        "tags": [
          "tables"
        ],
        "summary": "Update Table Column",
        "description": "Update a column in the table.",
        "operationId": "update_table_column_v1_tables__table_id__columns__column_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          },
          {
            "name": "column_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Column Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/InputColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/AgentColumnConfig-Input"
                  },
                  {
                    "$ref": "#/components/schemas/CriterionGradeColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/PeopleFinderColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/DiscoveryScoresColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/CompanyNameColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/CompanyWebsiteColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/CompanyProfileColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/EmailFinderColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/PhoneFinderColumnConfig"
                  },
                  {
                    "$ref": "#/components/schemas/ReverseEmailLookupColumnConfig"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ColumnOutputSchema"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "tables"
        ],
        "summary": "Delete Table Column",
        "description": "Delete column by ID.",
        "operationId": "delete_table_column_v1_tables__table_id__columns__column_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          },
          {
            "name": "column_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Column Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ColumnOutputSchema"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}/data": {
      "get": {
        "tags": [
          "tables"
        ],
        "summary": "Get Table Data",
        "description": "Get table data with streaming response to handle large tables.",
        "operationId": "get_table_data_v1_tables__table_id__data_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableDataOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tables/{table_id}/run": {
      "post": {
        "tags": [
          "tables"
        ],
        "summary": "Run Table",
        "description": "Initiate a table run, optionally for a selected range of rows and/or columns.",
        "operationId": "run_table_v1_tables__table_id__run_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TableRunParamsInput",
                "default": {
                  "mode": "new"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableRunOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/discovery_tasks": {
      "post": {
        "tags": [
          "company-discovery"
        ],
        "summary": "Create Discovery Task",
        "operationId": "create_discovery_task_v1_discovery_tasks_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscoveryTaskInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryTaskOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "company-discovery"
        ],
        "summary": "List Discovery Tasks",
        "operationId": "list_discovery_tasks_v1_discovery_tasks_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DiscoveryTaskOutput"
                  },
                  "title": "Response List Discovery Tasks V1 Discovery Tasks Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/discovery_tasks/{task_id}": {
      "get": {
        "tags": [
          "company-discovery"
        ],
        "summary": "Get Discovery Task",
        "operationId": "get_discovery_task_v1_discovery_tasks__task_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryTaskOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/discovery_tasks/{task_id}/resume": {
      "post": {
        "tags": [
          "company-discovery"
        ],
        "summary": "Resume Discovery Task",
        "operationId": "resume_discovery_task_v1_discovery_tasks__task_id__resume_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResumeDiscoveryTaskInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryTaskOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/discovery_tasks/{task_id}/results": {
      "get": {
        "tags": [
          "company-discovery"
        ],
        "summary": "Get Discovery Task Results",
        "operationId": "get_discovery_task_results_v1_discovery_tasks__task_id__results_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Task Id"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryTaskResultsOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user": {
      "get": {
        "tags": [
          "user"
        ],
        "summary": "Get Extruct User",
        "operationId": "get_extruct_user_v1_user_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserOutput"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/deep_research_tasks": {
      "post": {
        "tags": [
          "deep-research"
        ],
        "summary": "Create Deep Research Task",
        "description": "Create an asynchronous Deep Research task about a company, a person, or a team. Requires a Pro plan and the full depth budget in available credits.",
        "operationId": "create_deep_research_task_v1_deep_research_tasks_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeepResearchTaskInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepResearchTaskOutput"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Detail includes error (insufficient_credits or plan_required), action, and for credit shortfalls required_credits and available_credits."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "503": {
            "description": "Scheduling unavailable. No task was created; safe to retry."
          }
        }
      },
      "get": {
        "tags": [
          "deep-research"
        ],
        "summary": "List Deep Research Tasks",
        "description": "List the authenticated user's Deep Research tasks, newest first.",
        "operationId": "list_deep_research_tasks_v1_deep_research_tasks_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size; defaults to 50.",
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DeepResearchTaskOutput"
                  },
                  "title": "Response List Deep Research Tasks V1 Deep Research Tasks Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/deep_research_tasks/{task_id}": {
      "get": {
        "tags": [
          "deep-research"
        ],
        "summary": "Get Deep Research Task",
        "description": "Get a Deep Research task, including the report once status is done.",
        "operationId": "get_deep_research_task_v1_deep_research_tasks__task_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Task Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepResearchTaskOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CompanySearchResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/CompanySearchResult"
            },
            "type": "array",
            "title": "Results",
            "description": "Search results"
          },
          "request": {
            "$ref": "#/components/schemas/SearchRequestInfo",
            "description": "Request parameters echo"
          }
        },
        "type": "object",
        "required": [
          "results",
          "request"
        ],
        "title": "CompanySearchResponse",
        "description": "Semantic search response wrapper."
      },
      "CompanyLookalikeResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/CompanySearchResult"
            },
            "type": "array",
            "title": "Results",
            "description": "Search results"
          },
          "request": {
            "$ref": "#/components/schemas/LookalikeRequestInfo",
            "description": "Request parameters echo"
          },
          "reference_company": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanySearchResult"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reference company for lookalike searches"
          }
        },
        "type": "object",
        "required": [
          "results",
          "request"
        ],
        "title": "CompanyLookalikeResponse",
        "description": "Lookalike search response wrapper."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "CreateTableInput-Input": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "default": "Untitled Table"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/TableKind",
            "default": "company"
          },
          "column_configs": {
            "anyOf": [
              {
                "items": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/InputColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/AgentColumnConfig-Input"
                    },
                    {
                      "$ref": "#/components/schemas/CriterionGradeColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/PeopleFinderColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/DiscoveryScoresColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/CompanyNameColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/CompanyWebsiteColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/CompanyProfileColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/EmailFinderColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/PhoneFinderColumnConfig"
                    },
                    {
                      "$ref": "#/components/schemas/ReverseEmailLookupColumnConfig"
                    }
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Column configurations."
          }
        },
        "type": "object",
        "title": "CreateTableInput"
      },
      "TableHeaderOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Table ID."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Table creation time."
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Table name."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Table description."
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Table tags."
          },
          "kind": {
            "$ref": "#/components/schemas/TableKind",
            "description": "Table type."
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ColumnOutputSchema"
            },
            "type": "array",
            "title": "Columns",
            "description": "Table columns configurations."
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerInfo"
          },
          "child_relationships": {
            "items": {
              "$ref": "#/components/schemas/TableRelationshipOutput"
            },
            "type": "array",
            "title": "Child Relationships",
            "description": "Child table relationships."
          },
          "parent_relationships": {
            "items": {
              "$ref": "#/components/schemas/TableRelationshipOutput"
            },
            "type": "array",
            "title": "Parent Relationships",
            "description": "Parent table relationships."
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "name",
          "kind",
          "columns",
          "owner"
        ],
        "title": "TableHeaderOutput"
      },
      "TableView": {
        "type": "string",
        "enum": [
          "full",
          "minimal"
        ],
        "title": "TableView"
      },
      "TableKind": {
        "type": "string",
        "enum": [
          "generic",
          "company",
          "people"
        ],
        "title": "TableKind"
      },
      "Scope": {
        "type": "string",
        "enum": [
          "personal",
          "organization"
        ],
        "title": "Scope",
        "description": "Ownership scope for filtering resources"
      },
      "TableMinimalOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/TableKind"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "updated_at",
          "user_id",
          "name",
          "description",
          "tags",
          "kind",
          "scope"
        ],
        "title": "TableMinimalOutput",
        "description": "Minimal table info for dropdowns/selectors. Single query, no relationships."
      },
      "TableFullOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/TableKind"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "num_rows": {
            "type": "integer",
            "title": "Num Rows",
            "description": "Number of rows."
          },
          "num_child_tables": {
            "type": "integer",
            "title": "Num Child Tables",
            "description": "Number of child tables associated with this table.",
            "default": 0
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerInfo"
          },
          "num_discovery_tasks": {
            "type": "integer",
            "title": "Num Discovery Tasks",
            "description": "Number of discovery tasks associated with this table.",
            "default": 0
          },
          "num_discovery_results": {
            "type": "integer",
            "title": "Num Discovery Results",
            "description": "Total number of search results across all discovery tasks for this table.",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "updated_at",
          "user_id",
          "name",
          "description",
          "tags",
          "kind",
          "scope",
          "num_rows",
          "owner"
        ],
        "title": "TableFullOutput",
        "description": "Full table info - includes computed fields and relationships."
      },
      "TableListItemOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/TableKind"
          },
          "settings": {
            "$ref": "#/components/schemas/TableSettings"
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerInfo"
          },
          "num_rows": {
            "type": "integer",
            "title": "Num Rows"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "updated_at",
          "name",
          "description",
          "tags",
          "kind",
          "settings",
          "scope",
          "owner",
          "num_rows"
        ],
        "title": "TableListItemOutput",
        "description": "Table list item returned by GET /v1/tables."
      },
      "TableHeaderWithStatusOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Table ID."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Table creation time."
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Table name."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Table description."
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Table tags."
          },
          "kind": {
            "$ref": "#/components/schemas/TableKind",
            "description": "Table type."
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ColumnOutputSchema"
            },
            "type": "array",
            "title": "Columns",
            "description": "Table columns configurations."
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerInfo"
          },
          "child_relationships": {
            "items": {
              "$ref": "#/components/schemas/TableRelationshipOutput"
            },
            "type": "array",
            "title": "Child Relationships",
            "description": "Child table relationships."
          },
          "parent_relationships": {
            "items": {
              "$ref": "#/components/schemas/TableRelationshipOutput"
            },
            "type": "array",
            "title": "Parent Relationships",
            "description": "Parent table relationships."
          },
          "status": {
            "$ref": "#/components/schemas/TableStatus-Output"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "name",
          "kind",
          "columns",
          "owner",
          "status"
        ],
        "title": "TableHeaderWithStatusOutput"
      },
      "UpdateTableInput": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New table name to set, if provided."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "New table description to set, if provided."
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "New table tags to set, if provided."
          },
          "columns_order": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "New order of column IDs, if provided."
          }
        },
        "type": "object",
        "title": "UpdateTableInput"
      },
      "CreateTableRowsInput": {
        "properties": {
          "rows": {
            "items": {
              "$ref": "#/components/schemas/RowDataSchema"
            },
            "type": "array",
            "title": "Rows"
          },
          "run": {
            "type": "boolean",
            "title": "Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rows"
        ],
        "title": "CreateTableRowsInput"
      },
      "DeleteTableRowsInput": {
        "properties": {
          "rows": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Rows",
            "description": "List of row IDs to delete."
          }
        },
        "type": "object",
        "required": [
          "rows"
        ],
        "title": "DeleteTableRowsInput"
      },
      "RowDataOutputSchema-Output": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Row creation time."
          },
          "parent_row_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the parent row, if any."
          },
          "company_profile_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the linked company profile."
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/TableCellDataSchema"
            },
            "type": "object",
            "title": "Data"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional metadata"
          },
          "parent_data": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/TableCellDataSchema"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Data from the parent row, if requested and available."
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at"
        ],
        "title": "RowDataOutputSchema"
      },
      "UpdateTableRowsInput": {
        "properties": {
          "rows": {
            "items": {
              "$ref": "#/components/schemas/UpdateRowSchema"
            },
            "type": "array",
            "title": "Rows"
          },
          "run": {
            "type": "boolean",
            "title": "Run",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "rows"
        ],
        "title": "UpdateTableRowsInput"
      },
      "RowDataOutputWithStatusSchema": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Row creation time."
          },
          "parent_row_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the parent row, if any."
          },
          "company_profile_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "ID of the linked company profile."
          },
          "data": {
            "additionalProperties": {
              "$ref": "#/components/schemas/TableCellDataSchema"
            },
            "type": "object",
            "title": "Data"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional metadata"
          },
          "parent_data": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/TableCellDataSchema"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Data from the parent row, if requested and available."
          },
          "status": {
            "$ref": "#/components/schemas/RunStatus"
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ColumnOutputSchema"
            },
            "type": "array",
            "title": "Columns"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "status",
          "columns"
        ],
        "title": "RowDataOutputWithStatusSchema"
      },
      "CreateTableColumnsInput": {
        "properties": {
          "column_configs": {
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/InputColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/AgentColumnConfig-Input"
                },
                {
                  "$ref": "#/components/schemas/CriterionGradeColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/PeopleFinderColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/DiscoveryScoresColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/CompanyNameColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/CompanyWebsiteColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/CompanyProfileColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/EmailFinderColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/PhoneFinderColumnConfig"
                },
                {
                  "$ref": "#/components/schemas/ReverseEmailLookupColumnConfig"
                }
              ]
            },
            "type": "array",
            "title": "Column Configs"
          },
          "insert_after": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ],
            "description": "Insert new columns after this column id. If true (default), insert in the end. If false, insert in the beginning.",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "column_configs"
        ],
        "title": "CreateTableColumnsInput"
      },
      "ColumnOutputSchema": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InputColumnConfig"
              },
              {
                "$ref": "#/components/schemas/AgentColumnConfig-Output"
              },
              {
                "$ref": "#/components/schemas/CriterionGradeColumnConfig"
              },
              {
                "$ref": "#/components/schemas/PeopleFinderColumnConfig"
              },
              {
                "$ref": "#/components/schemas/DiscoveryScoresColumnConfig"
              },
              {
                "$ref": "#/components/schemas/CompanyNameColumnConfig"
              },
              {
                "$ref": "#/components/schemas/CompanyWebsiteColumnConfig"
              },
              {
                "$ref": "#/components/schemas/CompanyProfileColumnConfig"
              },
              {
                "$ref": "#/components/schemas/EmailFinderColumnConfig"
              },
              {
                "$ref": "#/components/schemas/PhoneFinderColumnConfig"
              },
              {
                "$ref": "#/components/schemas/ReverseEmailLookupColumnConfig"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "config"
        ],
        "title": "ColumnOutputSchema"
      },
      "InputColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "input",
            "title": "Kind",
            "default": "input"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key"
        ],
        "title": "InputColumnConfig"
      },
      "AgentColumnConfig-Input": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "agent",
            "title": "Kind",
            "default": "agent"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "value": {
            "$ref": "#/components/schemas/AgentColumnSchema"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key",
          "value"
        ],
        "title": "AgentColumnConfig"
      },
      "CriterionGradeColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "criterion_grade",
            "title": "Kind",
            "default": "criterion_grade"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "value": {
            "$ref": "#/components/schemas/CriterionGraderAgentSchema"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key",
          "value"
        ],
        "title": "CriterionGradeColumnConfig"
      },
      "PeopleFinderColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "company_people_finder",
            "title": "Kind",
            "default": "company_people_finder"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "value": {
            "$ref": "#/components/schemas/PeopleFinderAgentSchema"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key",
          "value"
        ],
        "title": "PeopleFinderColumnConfig"
      },
      "DiscoveryScoresColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "discovery_scores",
            "title": "Kind",
            "default": "discovery_scores"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "criteria": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/CriterionDefinition"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Criteria definitions keyed by criterion.key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key"
        ],
        "title": "DiscoveryScoresColumnConfig"
      },
      "CompanyNameColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "company_name",
            "title": "Kind",
            "default": "company_name"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key"
        ],
        "title": "CompanyNameColumnConfig",
        "description": "System column for company name - automatically populated from company enrichment."
      },
      "CompanyWebsiteColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "company_website",
            "title": "Kind",
            "default": "company_website"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key"
        ],
        "title": "CompanyWebsiteColumnConfig",
        "description": "System column for company website - automatically populated from company enrichment."
      },
      "CompanyProfileColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "company_profile",
            "title": "Kind",
            "default": "company_profile"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key"
        ],
        "title": "CompanyProfileColumnConfig",
        "description": "System column for complete company profile - automatically populated from company enrichment."
      },
      "EmailFinderColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "email_finder",
            "title": "Kind",
            "default": "email_finder"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key"
        ],
        "title": "EmailFinderColumnConfig",
        "description": "Configuration for email finder columns."
      },
      "PhoneFinderColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "phone_finder",
            "title": "Kind",
            "default": "phone_finder"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key"
        ],
        "title": "PhoneFinderColumnConfig",
        "description": "Configuration for phone finder columns."
      },
      "ReverseEmailLookupColumnConfig": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "reverse_email_lookup",
            "title": "Kind",
            "default": "reverse_email_lookup"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "email_column_key": {
            "type": "string",
            "title": "Email Column Key"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key",
          "email_column_key"
        ],
        "title": "ReverseEmailLookupColumnConfig",
        "description": "Configuration for reverse email lookup columns.\n\nGiven an email address, returns LinkedIn profile data via FullEnrich API."
      },
      "TableDataOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Table ID."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Table creation time."
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Table name."
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Table description."
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Table tags."
          },
          "kind": {
            "$ref": "#/components/schemas/TableKind",
            "description": "Table type."
          },
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ColumnOutputSchema"
            },
            "type": "array",
            "title": "Columns",
            "description": "Table columns configurations."
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerInfo"
          },
          "child_relationships": {
            "items": {
              "$ref": "#/components/schemas/TableRelationshipOutput"
            },
            "type": "array",
            "title": "Child Relationships",
            "description": "Child table relationships."
          },
          "parent_relationships": {
            "items": {
              "$ref": "#/components/schemas/TableRelationshipOutput"
            },
            "type": "array",
            "title": "Parent Relationships",
            "description": "Parent table relationships."
          },
          "status": {
            "$ref": "#/components/schemas/TableStatus-Output"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/RowDataOutputSchema-Output"
            },
            "type": "array",
            "title": "Rows"
          },
          "discovery_tasks": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DiscoveryTaskOutput"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "name",
          "kind",
          "columns",
          "owner",
          "status",
          "rows"
        ],
        "title": "TableDataOutput"
      },
      "TableRunParamsInput": {
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/TableRunExecutionMode",
            "description": "Table run execution mode. NEW (default) - run cells without values; ALL - run all cells; FAILED - run failed cells",
            "default": "new"
          },
          "rows": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "columns": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "TableRunParamsInput"
      },
      "TableRunOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "rows": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "columns": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "num_requested_cells": {
            "type": "integer",
            "title": "Num Requested Cells"
          },
          "mode": {
            "$ref": "#/components/schemas/TableRunExecutionMode"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "status",
          "rows",
          "columns",
          "num_requested_cells",
          "mode"
        ],
        "title": "TableRunOutput"
      },
      "DiscoveryTaskInput": {
        "properties": {
          "query": {
            "type": "string",
            "title": "Query",
            "description": "Ideal description of companies to find"
          },
          "desired_num_results": {
            "type": "integer",
            "maximum": 250.0,
            "minimum": 1.0,
            "title": "Desired Num Results",
            "description": "Target number of results for this task. Maximum is 250.",
            "default": 100
          },
          "table": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TableForDiscoveryTaskInput"
              },
              {
                "type": "null"
              }
            ]
          },
          "auto_data_sources": {
            "type": "boolean",
            "title": "Auto Data Sources",
            "description": "Automatically determine best data sources based on query",
            "default": true
          },
          "data_sources": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DiscoveryDataSource"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Manual data source selection (ignored if auto_data_sources=True)"
          },
          "criteria": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CriterionDefinition"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional criteria for evaluating discovered companies. Each criterion will be graded on a 1-5 scale."
          },
          "exclude_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Domains",
            "description": "Domains (or URLs) of companies the run must not return. Normalized server-side to registered domains."
          },
          "exclude_task_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array",
                "maxItems": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Task Ids",
            "description": "IDs of completed (DONE) Deep Search tasks whose returned companies must be excluded from the run. Up to 100 tasks. Tasks must belong to the caller (or their organization)."
          }
        },
        "type": "object",
        "required": [
          "query"
        ],
        "title": "DiscoveryTaskInput"
      },
      "DiscoveryTaskOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "query": {
            "type": "string",
            "title": "Query"
          },
          "desired_num_results": {
            "type": "integer",
            "title": "Desired Num Results"
          },
          "is_exhausted": {
            "type": "boolean",
            "title": "Is Exhausted",
            "default": false
          },
          "num_results_discovered": {
            "type": "integer",
            "title": "Num Results Discovered",
            "description": "Total number of company candidates discovered from search",
            "default": 0
          },
          "num_results_enriched": {
            "type": "integer",
            "title": "Num Results Enriched",
            "description": "Number of candidates enriched with company profiles",
            "default": 0
          },
          "num_results_evaluated": {
            "type": "integer",
            "title": "Num Results Evaluated",
            "description": "Number of candidates that had criteria evaluation completed",
            "default": 0
          },
          "num_results": {
            "type": "integer",
            "title": "Num Results",
            "description": "Total number of results",
            "default": 0
          },
          "table_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "auto_data_sources": {
            "type": "boolean",
            "title": "Auto Data Sources",
            "default": true
          },
          "data_sources": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DiscoveryDataSource"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "criteria": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CriterionDefinition"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "exclude_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Domains",
            "description": "The resolved, sorted list of registered domains that were excluded from this run (union of `exclude_domains` and the visible results of `exclude_task_ids` at creation time). Capped at 1000."
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "status",
          "query",
          "desired_num_results"
        ],
        "title": "DiscoveryTaskOutput"
      },
      "ResumeDiscoveryTaskInput": {
        "properties": {
          "desired_new_results": {
            "type": "integer",
            "maximum": 250.0,
            "minimum": 0.0,
            "title": "Desired New Results",
            "description": "Additional results requested for an existing task. Limited by the 250-result task cap.",
            "default": 25
          }
        },
        "type": "object",
        "title": "ResumeDiscoveryTaskInput"
      },
      "DiscoveryTaskResultsOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "query": {
            "type": "string",
            "title": "Query"
          },
          "is_exhausted": {
            "type": "boolean",
            "title": "Is Exhausted",
            "default": false
          },
          "desired_num_results": {
            "type": "integer",
            "title": "Desired Num Results"
          },
          "num_results_discovered": {
            "type": "integer",
            "title": "Num Results Discovered",
            "description": "Total number of company candidates discovered from search",
            "default": 0
          },
          "num_results_enriched": {
            "type": "integer",
            "title": "Num Results Enriched",
            "description": "Number of candidates enriched with company profiles",
            "default": 0
          },
          "num_results_evaluated": {
            "type": "integer",
            "title": "Num Results Evaluated",
            "description": "Number of candidates that had criteria evaluation completed",
            "default": 0
          },
          "num_results": {
            "type": "integer",
            "title": "Num Results",
            "description": "Total number of results",
            "default": 0
          },
          "table_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "auto_data_sources": {
            "type": "boolean",
            "title": "Auto Data Sources",
            "default": true
          },
          "data_sources": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DiscoveryDataSource"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "criteria": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CriterionDefinition"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "exclude_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exclude Domains",
            "description": "The resolved, sorted list of registered domains that were excluded from this run."
          },
          "results": {
            "items": {
              "$ref": "#/components/schemas/DiscoveryTaskResultOutput"
            },
            "type": "array",
            "title": "Results"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "status",
          "query",
          "desired_num_results",
          "results"
        ],
        "title": "DiscoveryTaskResultsOutput"
      },
      "AgentColumnConfig-Output": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "agent",
            "title": "Kind",
            "default": "agent"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "key": {
            "type": "string",
            "title": "Key"
          },
          "value": {
            "$ref": "#/components/schemas/AgentColumnSchema"
          }
        },
        "type": "object",
        "required": [
          "name",
          "key",
          "value"
        ],
        "title": "AgentColumnConfig"
      },
      "UserOutput": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "available_credits": {
            "type": "integer",
            "title": "Available Credits"
          },
          "organization_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "organization_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "organization_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "organization_is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "available_credits"
        ],
        "title": "UserOutput"
      },
      "CompanySearchResult": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Company ID"
          },
          "domain": {
            "type": "string",
            "title": "Domain",
            "description": "Company domain"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Company name"
          },
          "short_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Brief company description"
          },
          "full_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Detailed company description"
          },
          "products_services": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Products and services offered"
          },
          "use_cases": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Use cases for products/services"
          },
          "target_audience": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Target customer audience"
          },
          "other_considerations": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional considerations"
          },
          "founding_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Year company was founded"
          },
          "employee_count": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Employee count range"
          },
          "hq_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters country"
          },
          "hq_state_province": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters state/province"
          },
          "hq_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters city"
          },
          "hq_full_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Full headquarters address"
          },
          "social_profiles": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Social media profiles"
          },
          "website_authority": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebsiteAuthority"
              },
              {
                "type": "null"
              }
            ],
            "description": "Website authority metrics"
          },
          "relevance_score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "description": "Relevance score (0-1)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "domain",
          "name"
        ],
        "title": "CompanySearchResult",
        "description": "Individual company search result."
      },
      "FacetCount": {
        "properties": {
          "field_name": {
            "type": "string",
            "title": "Field Name",
            "description": "Name of the faceted field"
          },
          "counts": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Counts",
            "description": "Value counts for this facet"
          },
          "stats": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Statistical summary for numeric facets"
          }
        },
        "type": "object",
        "required": [
          "field_name",
          "counts"
        ],
        "title": "FacetCount",
        "description": "Facet aggregation results."
      },
      "SearchRequestInfo": {
        "properties": {
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Search query text"
          },
          "offset": {
            "type": "integer",
            "title": "Offset",
            "description": "Result offset"
          },
          "limit": {
            "type": "integer",
            "title": "Limit",
            "description": "Results limit"
          },
          "filters": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SearchFilters"
              },
              {
                "type": "null"
              }
            ],
            "description": "Applied filters (SearchFilters object)."
          }
        },
        "type": "object",
        "required": [
          "offset",
          "limit"
        ],
        "title": "SearchRequestInfo",
        "description": "Search request parameters."
      },
      "LookalikeRequestInfo": {
        "properties": {
          "query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Search query text"
          },
          "offset": {
            "type": "integer",
            "title": "Offset",
            "description": "Result offset"
          },
          "limit": {
            "type": "integer",
            "title": "Limit",
            "description": "Results limit"
          },
          "filters": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SearchFilters"
              },
              {
                "type": "null"
              }
            ],
            "description": "Applied filters (SearchFilters object)."
          },
          "reference_company_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Reference company ID for lookalike search"
          }
        },
        "type": "object",
        "required": [
          "offset",
          "limit"
        ],
        "title": "LookalikeRequestInfo",
        "description": "Lookalike search request parameters."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "TableSettings": {
        "properties": {
          "exclude_from_search": {
            "type": "boolean",
            "title": "Exclude From Search",
            "default": false
          }
        },
        "type": "object",
        "title": "TableSettings"
      },
      "OwnerInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email"
        ],
        "title": "OwnerInfo"
      },
      "TableRelationshipOutput": {
        "properties": {
          "table_id": {
            "type": "string",
            "title": "Table Id",
            "description": "ID of the related table"
          },
          "relationship_type": {
            "$ref": "#/components/schemas/TableRelationshipType",
            "description": "Type of relationship"
          }
        },
        "type": "object",
        "required": [
          "table_id",
          "relationship_type"
        ],
        "title": "TableRelationshipOutput"
      },
      "TableStatus-Output": {
        "properties": {
          "num_rows": {
            "type": "integer",
            "title": "Num Rows",
            "description": "Number of rows in the table",
            "default": 0
          },
          "num_output_columns": {
            "type": "integer",
            "title": "Num Output Columns",
            "description": "Number of output columns in the table",
            "default": 0
          },
          "num_input_columns": {
            "type": "integer",
            "title": "Num Input Columns",
            "description": "Number of input columns in the table",
            "default": 0
          },
          "num_cells_completed": {
            "type": "integer",
            "title": "Num Cells Completed",
            "description": "Number of non-input cells that have been completed",
            "default": 0
          },
          "num_cells_in_progress": {
            "type": "integer",
            "title": "Num Cells In Progress",
            "description": "Number of non-input cells that are in progress",
            "default": 0
          },
          "num_columns": {
            "type": "integer",
            "title": "Num Columns",
            "readOnly": true
          },
          "run_status": {
            "$ref": "#/components/schemas/RunStatus",
            "readOnly": true
          }
        },
        "type": "object",
        "required": [
          "num_columns",
          "run_status"
        ],
        "title": "TableStatus"
      },
      "RowDataSchema": {
        "properties": {
          "data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data",
            "description": "column_key -> value"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional metadata"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "RowDataSchema"
      },
      "TableCellDataSchema": {
        "properties": {
          "value": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TableCellStatus"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "value",
          "status"
        ],
        "title": "TableCellDataSchema"
      },
      "UpdateRowSchema": {
        "properties": {
          "data": {
            "additionalProperties": true,
            "type": "object",
            "title": "Data",
            "description": "column_key -> value"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Additional metadata"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "UpdateRowSchema"
      },
      "RunStatus": {
        "type": "string",
        "enum": [
          "running",
          "idle"
        ],
        "title": "RunStatus"
      },
      "AgentColumnSchema": {
        "properties": {
          "agent_type": {
            "$ref": "#/components/schemas/AgentType",
            "default": "research_pro"
          },
          "prompt": {
            "type": "string",
            "title": "Prompt",
            "default": ""
          },
          "output_format": {
            "$ref": "#/components/schemas/AgentOutputFormat",
            "default": "text"
          },
          "labels": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "output_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {},
              {
                "type": "null"
              }
            ]
          },
          "extra_dependencies": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "AgentColumnSchema"
      },
      "CriterionGraderAgentSchema": {
        "properties": {
          "criterion": {
            "type": "string",
            "title": "Criterion"
          }
        },
        "type": "object",
        "required": [
          "criterion"
        ],
        "title": "CriterionGraderAgentSchema"
      },
      "PeopleFinderAgentSchema": {
        "properties": {
          "roles": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Roles"
          },
          "provider": {
            "type": "string",
            "const": "research_pro",
            "title": "Provider",
            "default": "research_pro"
          },
          "max_results": {
            "type": "integer",
            "title": "Max Results",
            "default": 5
          }
        },
        "type": "object",
        "required": [
          "roles"
        ],
        "title": "PeopleFinderAgentSchema"
      },
      "CriterionDefinition": {
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-zA-Z][a-zA-Z0-9_]*$",
            "title": "Key",
            "description": "Unique identifier for this criterion (e.g., \"is_ai_company\")"
          },
          "name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Name",
            "description": "Human-readable name for this criterion (e.g., \"AI Company\")"
          },
          "criterion": {
            "type": "string",
            "maxLength": 500,
            "minLength": 10,
            "title": "Criterion",
            "description": "The actual criterion text to evaluate against companies"
          }
        },
        "type": "object",
        "required": [
          "key",
          "name",
          "criterion"
        ],
        "title": "CriterionDefinition",
        "description": "Definition of a criterion for evaluating companies in discovery tasks"
      },
      "TableRunExecutionMode": {
        "type": "string",
        "enum": [
          "new",
          "all",
          "failed"
        ],
        "title": "TableRunExecutionMode"
      },
      "Status": {
        "type": "string",
        "enum": [
          "created",
          "in_progress",
          "done",
          "failed"
        ],
        "title": "Status"
      },
      "TableForDiscoveryTaskInput": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Table to associate with discovery results"
          },
          "run": {
            "type": "boolean",
            "title": "Run",
            "description": "Run the table after adding the results",
            "default": false
          },
          "columns": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "auto_import": {
            "type": "boolean",
            "title": "Auto Import",
            "description": "Automatically import discovered companies to the table",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "TableForDiscoveryTaskInput"
      },
      "DiscoveryDataSource": {
        "type": "string",
        "enum": [
          "web_search",
          "linkedin",
          "maps"
        ],
        "title": "DiscoveryDataSource"
      },
      "DiscoveryTaskResultOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "task_id": {
            "type": "string",
            "title": "Task Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "company_name": {
            "type": "string",
            "title": "Company Name"
          },
          "company_description": {
            "type": "string",
            "title": "Company Description"
          },
          "company_website": {
            "type": "string",
            "title": "Company Website"
          },
          "company_profile_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "UUID of the linked company profile in the global index"
          },
          "source": {
            "$ref": "#/components/schemas/DiscoveryDataSource",
            "description": "Data source where this company was discovered (WEB_SEARCH, LINKEDIN, etc.)",
            "default": "web_search"
          },
          "relevance": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Relevance score (0-100 scale). When criteria scores exist, this is computed from them."
          },
          "scores": {
            "anyOf": [
              {
                "additionalProperties": {
                  "$ref": "#/components/schemas/CriterionScore"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Evaluation scores for each criterion defined in the discovery task"
          },
          "founding_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Year the company was founded (from company profile)"
          },
          "employee_count": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanySize"
              },
              {
                "type": "null"
              }
            ],
            "description": "Employee size bucket using LinkedIn-style ranges (e.g., SIZE_1_10, SIZE_51_200, SIZE_10000_PLUS)"
          },
          "hq_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters country (from company profile)"
          },
          "hq_state_province": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters state or province (from company profile)"
          },
          "hq_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters city (from company profile)"
          },
          "company_full_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Full description of the company (from company profile)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "task_id",
          "company_name",
          "company_description",
          "company_website",
          "relevance"
        ],
        "title": "DiscoveryTaskResultOutput"
      },
      "WebsiteAuthority": {
        "properties": {
          "score": {
            "type": "integer",
            "title": "Score",
            "description": "Authority score (0-100)"
          },
          "tier": {
            "type": "string",
            "title": "Tier",
            "description": "Authority tier classification"
          },
          "tier_label": {
            "type": "string",
            "title": "Tier Label",
            "description": "Human-readable tier label"
          }
        },
        "type": "object",
        "required": [
          "score",
          "tier",
          "tier_label"
        ],
        "title": "WebsiteAuthority",
        "description": "Website authority scoring details."
      },
      "FilterSet": {
        "type": "object",
        "title": "SearchFilters",
        "description": "Structured filters for search and lookalike endpoints.",
        "additionalProperties": false,
        "properties": {
          "include": {
            "$ref": "#/components/schemas/SearchFiltersInclude"
          },
          "exclude": {
            "$ref": "#/components/schemas/SearchFiltersExclude"
          },
          "range": {
            "$ref": "#/components/schemas/SearchFiltersRange"
          }
        }
      },
      "TableRelationshipType": {
        "type": "string",
        "enum": [
          "company_people"
        ],
        "title": "TableRelationshipType"
      },
      "TableCellStatus": {
        "type": "string",
        "enum": [
          "created",
          "requested",
          "in_progress",
          "done",
          "failed"
        ],
        "title": "TableCellStatus"
      },
      "AgentType": {
        "type": "string",
        "enum": [
          "research",
          "research_pro",
          "research_reasoning",
          "llm",
          "linkedin"
        ],
        "title": "AgentType"
      },
      "AgentOutputFormat": {
        "type": "string",
        "enum": [
          "text",
          "url",
          "number",
          "email",
          "label",
          "json",
          "grade",
          "people",
          "numeric",
          "money",
          "date",
          "phone",
          "select",
          "multiselect"
        ],
        "title": "AgentOutputFormat"
      },
      "CriterionScore": {
        "properties": {
          "grade": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 5.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "description": "Evaluation score on 1-5 scale (1=weak match, 5=strong match), None if evaluation failed"
          },
          "explanation": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "description": "Explanation of why this grade was assigned"
          },
          "sources": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "URLs or references that support this evaluation"
          }
        },
        "type": "object",
        "title": "CriterionScore",
        "description": "Score result from evaluating a criterion"
      },
      "CompanySize": {
        "type": "string",
        "enum": [
          "1-10",
          "11-50",
          "51-200",
          "201-500",
          "501-1000",
          "1001-5000",
          "5001-10000",
          "10001+"
        ],
        "title": "CompanySize",
        "description": "Employee headcount buckets using LinkedIn-style ranges."
      },
      "SearchFiltersInclude": {
        "type": "object",
        "title": "SearchFiltersInclude",
        "description": "Include companies that match these values.",
        "additionalProperties": false,
        "properties": {
          "size": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanySize"
            },
            "description": "Employee size buckets to include."
          },
          "country": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Headquarters countries to include."
          },
          "city": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Headquarters cities to include."
          }
        }
      },
      "SearchFiltersExclude": {
        "type": "object",
        "title": "SearchFiltersExclude",
        "description": "Exclude companies that match these values.",
        "additionalProperties": false,
        "properties": {
          "size": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanySize"
            },
            "description": "Employee size buckets to exclude."
          },
          "country": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Headquarters countries to exclude."
          },
          "city": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Headquarters cities to exclude."
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Company domains or URLs to exclude from results. Normalized to the registered domain server-side; alias-aware; max 1000."
          }
        }
      },
      "FoundedYearRange": {
        "type": "object",
        "title": "FoundedYearRange",
        "description": "Inclusive range bounds for founding year.",
        "additionalProperties": false,
        "properties": {
          "min": {
            "type": "integer",
            "description": "Minimum founding year (inclusive)."
          },
          "max": {
            "type": "integer",
            "description": "Maximum founding year (inclusive)."
          }
        }
      },
      "SearchFiltersRange": {
        "type": "object",
        "title": "SearchFiltersRange",
        "description": "Numeric range constraints.",
        "additionalProperties": false,
        "properties": {
          "founded": {
            "$ref": "#/components/schemas/FoundedYearRange",
            "description": "Filter companies by founding year range."
          }
        }
      },
      "SearchFilters": {
        "type": "object",
        "title": "SearchFilters",
        "description": "Structured filters for search and lookalike endpoints.",
        "additionalProperties": false,
        "properties": {
          "include": {
            "$ref": "#/components/schemas/SearchFiltersInclude"
          },
          "exclude": {
            "$ref": "#/components/schemas/SearchFiltersExclude"
          },
          "range": {
            "$ref": "#/components/schemas/SearchFiltersRange"
          }
        }
      },
      "Pagination": {
        "type": "object",
        "title": "Pagination",
        "additionalProperties": false,
        "properties": {
          "offset": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Number of results to skip."
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Maximum results to return in one response (max 250)."
          }
        }
      },
      "CompanySearchPostInput": {
        "type": "object",
        "title": "CompanySearchPostInput",
        "description": "Request body for POST company search. Send filters as a JSON object.",
        "additionalProperties": false,
        "required": [
          "q"
        ],
        "properties": {
          "q": {
            "type": "string",
            "description": "Search query."
          },
          "filters": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SearchFilters"
              },
              {
                "type": "null"
              }
            ],
            "description": "Structured filters (same contract as the GET filters string)."
          },
          "pagination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Pagination"
              },
              {
                "type": "null"
              }
            ],
            "description": "Offset/limit pagination."
          }
        }
      },
      "CompanyLookalikePostInput": {
        "type": "object",
        "title": "CompanyLookalikePostInput",
        "description": "Request body for POST lookalike search. The reference company is in the path.",
        "additionalProperties": false,
        "properties": {
          "filters": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SearchFilters"
              },
              {
                "type": "null"
              }
            ],
            "description": "Structured filters (same contract as the GET filters string)."
          },
          "pagination": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Pagination"
              },
              {
                "type": "null"
              }
            ],
            "description": "Offset/limit pagination."
          }
        }
      },
      "HTTPExceptionDetail": {
        "properties": {
          "detail": {
            "type": "string",
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "HTTPExceptionDetail"
      },
      "SocialProfiles": {
        "properties": {
          "linkedin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "twitter": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "github": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "crunchbase": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "facebook": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "instagram": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "youtube": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          }
        },
        "type": "object",
        "title": "SocialProfiles",
        "description": "Known social and platform profile URLs."
      },
      "CompanyProfileContext": {
        "properties": {
          "company_name": {
            "type": "string",
            "description": "Official company name without legal entity suffixes",
            "title": "Company Name"
          },
          "domain": {
            "type": "string",
            "description": "Company domain, such as example.com",
            "title": "Domain"
          },
          "domains": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "description": "All known domains for this company, including aliases",
            "title": "Domains"
          },
          "short_description": {
            "type": "string",
            "description": "One-line description",
            "title": "Short Description"
          },
          "full_description": {
            "type": "string",
            "description": "One paragraph description of the company",
            "title": "Full Description"
          },
          "products_services": {
            "type": "string",
            "description": "Detailed offerings and services provided",
            "title": "Products Services"
          },
          "use_cases": {
            "type": "string",
            "description": "Specific scenarios and applications",
            "title": "Use Cases"
          },
          "target_audience": {
            "type": "string",
            "description": "Customer segments and target markets",
            "title": "Target Audience"
          },
          "founding_year": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Year the company was founded",
            "default": null,
            "title": "Founding Year"
          },
          "employee_count": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanySize"
              },
              {
                "type": "null"
              }
            ],
            "description": "Employee headcount bucket",
            "default": null
          },
          "hq_country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters country",
            "default": null,
            "title": "Hq Country"
          },
          "hq_state_province": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters state or province",
            "default": null,
            "title": "Hq State Province"
          },
          "hq_city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Headquarters city",
            "default": null,
            "title": "Hq City"
          },
          "hq_full_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Complete headquarters address if available",
            "default": null,
            "title": "Hq Full Address"
          },
          "other_considerations": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Other important company information",
            "default": null,
            "title": "Other Considerations"
          },
          "social_profiles": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SocialProfiles"
              },
              {
                "type": "null"
              }
            ],
            "description": "Social media and platform profile URLs",
            "default": null
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "description": "Source URLs used for research",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "company_name",
          "domain",
          "short_description",
          "full_description",
          "products_services",
          "use_cases",
          "target_audience"
        ],
        "title": "CompanyProfileContext",
        "description": "Structured context data for an enriched company profile."
      },
      "CompanyProfileAPIResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "domain": {
            "type": "string",
            "title": "Domain"
          },
          "company_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Company Name"
          },
          "context": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompanyProfileContext"
              },
              {
                "type": "null"
              }
            ],
            "description": "Complete company profile context"
          }
        },
        "type": "object",
        "required": [
          "id",
          "domain",
          "company_name",
          "context"
        ],
        "title": "CompanyProfileAPIResponse",
        "description": "Full company profile lookup response."
      },
      "CompanyLookupEnrichingResponse": {
        "properties": {
          "status": {
            "type": "string",
            "const": "enriching",
            "title": "Status",
            "description": "Lookup state. The company profile is being enriched.",
            "default": "enriching"
          },
          "domain": {
            "type": "string",
            "title": "Domain",
            "description": "Canonical domain being enriched."
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Human-readable retry guidance."
          }
        },
        "type": "object",
        "required": [
          "status",
          "domain",
          "message"
        ],
        "title": "CompanyLookupEnrichingResponse",
        "description": "Response returned when company lookup has accepted an enrichment request."
      },
      "DeepResearchSource": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "id",
          "url"
        ],
        "title": "DeepResearchSource",
        "description": "A source available to the report by numeric id."
      },
      "DeepResearchMarkdownReport": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "markdown"
            ],
            "title": "Kind",
            "default": "markdown"
          },
          "markdown": {
            "type": "string",
            "title": "Markdown",
            "description": "Markdown report. Bracketed numbers like [1] cite entries in `sources` by id."
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/DeepResearchSource"
            },
            "type": "array",
            "title": "Sources",
            "description": "Source registry (id -> url) that report citations resolve against."
          },
          "degradation_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Degradation Reasons",
            "description": "Plain-language notes when the report was produced under degraded conditions (early finalization, failed research agents). Empty for a clean run. Show these to the user alongside the report.",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "markdown",
          "sources"
        ],
        "title": "DeepResearchMarkdownReport",
        "description": "Markdown report payload, returned when no output_schema was provided."
      },
      "DeepResearchSchemaReport": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "schema"
            ],
            "title": "Kind",
            "default": "schema"
          },
          "fields": {
            "type": "object",
            "title": "Fields",
            "description": "Structured report values conforming to the task output_schema. Provenance, where the schema opts in, is co-located inside `fields` as Evidenced wrappers (an object with `value`, a `sources` array of URLs, and a `reasoning` string)."
          },
          "degradation_reasons": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Degradation Reasons",
            "description": "Plain-language notes when the report was produced under degraded conditions (early finalization, failed research agents). Empty for a clean run. Show these to the user alongside the report.",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "fields"
        ],
        "title": "DeepResearchSchemaReport",
        "description": "Structured report payload, returned when output_schema was provided."
      },
      "DeepResearchTaskInput": {
        "properties": {
          "brief": {
            "type": "string",
            "maxLength": 20000,
            "minLength": 1,
            "title": "Brief",
            "description": "Free-text research brief about a company, a person, or a team. Write it like a request to a research analyst \u2014 a detailed paragraph naming the target(s), your own context (what you sell or research, who the buyer is), the decision the report should support, and time windows that matter. Detailed, specific briefs reliably produce better reports than one-liners."
          },
          "depth": {
            "type": "string",
            "enum": [
              "medium",
              "high",
              "xhigh"
            ],
            "title": "Depth",
            "description": "Research depth: the maximum research-agent budget (medium=5, high=15, xhigh=25). Each research agent that runs costs 2 credits. Starting a task reserves the full budget in available credits (medium=10, high=30, xhigh=50); only agents that actually run are billed.",
            "default": "medium"
          },
          "output_schema": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Schema",
            "description": "Optional JSON Schema for structured report output; an object schema (type: \"object\"), omit for markdown. Up to 5 levels of nesting and 50 properties, with root #/$defs/<name> for shared definitions. To get sources and reasoning for a value, wrap it as an Evidenced object (value + sources URLs + reasoning); the provenance comes back beside the value."
          }
        },
        "type": "object",
        "required": [
          "brief"
        ],
        "title": "DeepResearchTaskInput"
      },
      "DeepResearchTaskOutput": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "status": {
            "type": "string",
            "enum": [
              "created",
              "in_progress",
              "done",
              "failed"
            ],
            "title": "Status",
            "description": "Task lifecycle: created -> in_progress -> done or failed."
          },
          "brief": {
            "type": "string",
            "title": "Brief"
          },
          "depth": {
            "type": "string",
            "enum": [
              "medium",
              "high",
              "xhigh"
            ],
            "title": "Depth"
          },
          "output_schema": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output Schema"
          },
          "failure_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failure Reason",
            "description": "Why the task failed, when status is failed: a rejected brief (with suggestions for fixing it), insufficient credits mid-run, or an internal error. Failed tasks refund their charges."
          },
          "iterations": {
            "type": "integer",
            "title": "Iterations",
            "description": "Research analysis steps completed so far."
          },
          "agents": {
            "type": "integer",
            "title": "Agents",
            "description": "Research agents completed so far; billing is two credits per agent."
          },
          "sources": {
            "type": "integer",
            "title": "Sources",
            "description": "Unique sources collected across all research agents."
          },
          "report": {
            "anyOf": [
              {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/DeepResearchMarkdownReport"
                  },
                  {
                    "$ref": "#/components/schemas/DeepResearchSchemaReport"
                  }
                ],
                "discriminator": {
                  "propertyName": "kind",
                  "mapping": {
                    "markdown": "#/components/schemas/DeepResearchMarkdownReport",
                    "schema": "#/components/schemas/DeepResearchSchemaReport"
                  }
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "Report",
            "description": "Null until status is done; then a markdown report or, when output_schema was provided, a structured schema report."
          },
          "owner": {
            "$ref": "#/components/schemas/OwnerInfo"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "updated_at",
          "status",
          "brief",
          "depth",
          "iterations",
          "agents",
          "sources",
          "owner"
        ],
        "title": "DeepResearchTaskOutput"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
