{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "CompanyProof REST API",
    "version": "2.0.0",
    "description": "Resolve companies, retrieve structured profiles, stream adaptive intelligence, and create durable claim-verification proofs through CompanyProof. All endpoints require a CompanyProof API key.",
    "termsOfService": "https://companyproof.ai/terms"
  },
  "externalDocs": {
    "description": "CompanyProof developer documentation",
    "url": "https://companyproof.ai/docs"
  },
  "servers": [
    {
      "url": "https://companyproof.ai",
      "description": "CompanyProof production API"
    }
  ],
  "tags": [
    {
      "name": "Companies",
      "description": "Deterministic company resolution and structured profile retrieval."
    },
    {
      "name": "Intelligence",
      "description": "Adaptive company intelligence streamed as Server-Sent Events."
    },
    {
      "name": "Verification",
      "description": "Claim verification, evidence, and optional monitoring."
    }
  ],
  "security": [
    {
      "CompanyProofApiKey": []
    }
  ],
  "paths": {
    "/v2/companies/search": {
      "post": {
        "tags": [
          "Companies"
        ],
        "summary": "Resolve companies",
        "description": "Resolve legal entities by name, registration number, or VAT/tax ID and country. This endpoint requires a `cp_live_` key.",
        "operationId": "searchCompanies",
        "x-companyproof-key-environments": [
          "live"
        ],
        "requestBody": {
          "required": true,
          "description": "JSON request body. Maximum size: 32 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanySearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching companies, ranked by identifier match.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanySearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationError"
          },
          "403": {
            "$ref": "#/components/responses/LiveKeyRequired"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "502": {
            "$ref": "#/components/responses/CompanyIntelligenceUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v2/companies/{id}/profile": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Retrieve a company profile",
        "description": "Retrieve a consolidated company profile and independently reported optional enrichment. Profile module payloads remain extensible; use `section_status` to determine availability. This endpoint requires a `cp_live_` key.",
        "operationId": "getCompanyProfile",
        "x-companyproof-key-environments": [
          "live"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "CompanyProof company identifier returned by company search.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The consolidated profile. Optional enrichment may be unavailable without failing the core profile request.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyProfileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationError"
          },
          "403": {
            "$ref": "#/components/responses/LiveKeyRequired"
          },
          "404": {
            "$ref": "#/components/responses/CompanyNotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "502": {
            "$ref": "#/components/responses/CompanyIntelligenceUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v2/intelligence/query": {
      "post": {
        "tags": [
          "Intelligence"
        ],
        "summary": "Stream an intelligence query",
        "description": "Run an adaptive company-intelligence query. A successful response is a Server-Sent Events stream. Known events are `status`, `tool_call`, `tool_result`, `text`, `suggested_actions`, terminal `done`, and terminal `error`; clients must ignore unknown event types for forward compatibility. This endpoint requires a `cp_live_` key.",
        "operationId": "queryCompanyIntelligence",
        "x-companyproof-key-environments": [
          "live"
        ],
        "requestBody": {
          "required": true,
          "description": "JSON request body. Maximum size: 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntelligenceQueryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A Server-Sent Events stream. Parse it with an SSE-compatible client and treat event payloads as adaptive output rather than the stable company-profile schema.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "Cache-Control": {
                "description": "The stream is private, is not cached, and must not be transformed. Additional cache directives may be present.",
                "schema": {
                  "type": "string",
                  "pattern": "(^|.*,\\s*)no-store(\\s*,.*|$)"
                }
              }
            },
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "A standards-compliant Server-Sent Events byte stream."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationError"
          },
          "403": {
            "$ref": "#/components/responses/LiveKeyRequired"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitExceeded"
          },
          "502": {
            "$ref": "#/components/responses/CompanyIntelligenceUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v2/claims/verify": {
      "post": {
        "tags": [
          "Verification"
        ],
        "summary": "Verify company claims",
        "description": "Verify structured claims or extract supported claims from a natural-language answer. One claim credit is reserved per claim. `cp_test_` keys are restricted to the documented CompanyProof sandbox sample; `cp_live_` keys can resolve eligible live company records. Monitoring requires an eligible plan and a live key.",
        "operationId": "verifyCompanyClaims",
        "x-companyproof-key-environments": [
          "test",
          "live"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Recommended for every verification write. A key is scoped to the account and key environment. Reusing it with an identical request replays the stored response; reusing it with a different request returns 409.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9._:-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "JSON request body. Maximum size: 64 KiB.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClaimVerificationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new verification proof was recorded.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/XUsageLimit"
              },
              "X-Usage-Remaining": {
                "$ref": "#/components/headers/XUsageRemaining"
              },
              "X-Usage-Reset": {
                "$ref": "#/components/headers/XUsageReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimVerificationResponse"
                }
              }
            }
          },
          "200": {
            "description": "An existing proof was replayed for an identical idempotent request.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/XRateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/XRateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/XRateLimitReset"
              },
              "X-Usage-Limit": {
                "$ref": "#/components/headers/XUsageLimit"
              },
              "X-Usage-Remaining": {
                "$ref": "#/components/headers/XUsageRemaining"
              },
              "X-Usage-Reset": {
                "$ref": "#/components/headers/XUsageReset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/XRequestId"
              },
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/IdempotentReplayed"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaimVerificationResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InvalidRequest"
          },
          "401": {
            "$ref": "#/components/responses/AuthenticationError"
          },
          "403": {
            "$ref": "#/components/responses/VerificationForbidden"
          },
          "409": {
            "$ref": "#/components/responses/IdempotencyConflict"
          },
          "404": {
            "$ref": "#/components/responses/CompanyNotFound"
          },
          "413": {
            "$ref": "#/components/responses/BodyTooLarge"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMediaType"
          },
          "422": {
            "$ref": "#/components/responses/NoSupportedClaims"
          },
          "429": {
            "$ref": "#/components/responses/VerificationLimitExceeded"
          },
          "502": {
            "$ref": "#/components/responses/VerificationUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "CompanyProofApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "cp_live_… or cp_test_…",
        "description": "Send a CompanyProof API key as `Authorization: Bearer <key>`. Keep keys server-side. Live-only operations reject test keys; test keys can be used only for claim verification against the documented CompanyProof sandbox sample."
      }
    },
    "headers": {
      "XRateLimitLimit": {
        "description": "Request limit for the current 60-second window.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "XRateLimitRemaining": {
        "description": "Requests remaining in the current 60-second window.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "XRateLimitReset": {
        "description": "Unix timestamp in seconds when the request window resets.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "XUsageLimit": {
        "description": "Claim-credit allowance for the active usage period.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "XUsageRemaining": {
        "description": "Claim credits remaining in the active usage period.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "XUsageReset": {
        "description": "Unix timestamp in seconds when the claim-credit allowance resets.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "XRequestId": {
        "description": "Proof identifier for the verification request.",
        "schema": {
          "type": "string"
        }
      },
      "IdempotentReplayed": {
        "description": "Present with value `true` when an existing proof is replayed.",
        "schema": {
          "type": "string",
          "const": "true"
        }
      }
    },
    "responses": {
      "InvalidRequest": {
        "description": "The request body, identifier, path parameter, or idempotency key is invalid.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "AuthenticationError": {
        "description": "The CompanyProof API key is missing, invalid, or revoked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "examples": {
              "missing": {
                "value": {
                  "error": {
                    "code": "authentication_required",
                    "message": "Use a CompanyProof API key in the Authorization header."
                  }
                }
              },
              "invalid": {
                "value": {
                  "error": {
                    "code": "invalid_api_key",
                    "message": "The API key is invalid or revoked."
                  }
                }
              }
            }
          }
        }
      },
      "LiveKeyRequired": {
        "description": "This operation requires a `cp_live_` CompanyProof API key.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": {
                "code": "live_key_required",
                "message": "This operation requires a live CompanyProof API key."
              }
            }
          }
        }
      },
      "VerificationForbidden": {
        "description": "The requested verification is not allowed for the key environment or plan. Test keys are restricted to the CompanyProof sandbox sample; monitoring requires an eligible plan and a live key.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "BodyTooLarge": {
        "description": "The request body exceeds the endpoint limit.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "UnsupportedMediaType": {
        "description": "The request `Content-Type` is not `application/json`.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "RateLimitExceeded": {
        "description": "The request rate limit has been exceeded.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "VerificationLimitExceeded": {
        "description": "The request rate limit or claim-credit allowance has been exceeded.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          },
          "X-Usage-Limit": {
            "$ref": "#/components/headers/XUsageLimit"
          },
          "X-Usage-Remaining": {
            "$ref": "#/components/headers/XUsageRemaining"
          },
          "X-Usage-Reset": {
            "$ref": "#/components/headers/XUsageReset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "IdempotencyConflict": {
        "description": "The idempotency key was previously used with a different request.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NoSupportedClaims": {
        "description": "No supported claims were supplied or extracted.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "CompanyNotFound": {
        "description": "The company profile was not found.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "CompanyIntelligenceUnavailable": {
        "description": "Company intelligence is temporarily unavailable.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "VerificationUnavailable": {
        "description": "Verification could not complete before a verdict was recorded.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          },
          "X-Usage-Limit": {
            "$ref": "#/components/headers/XUsageLimit"
          },
          "X-Usage-Remaining": {
            "$ref": "#/components/headers/XUsageRemaining"
          },
          "X-Usage-Reset": {
            "$ref": "#/components/headers/XUsageReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "The requested CompanyProof service is temporarily unavailable.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/XRateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/XRateLimitRemaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/XRateLimitReset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation safe to display in developer tooling."
              }
            }
          }
        }
      },
      "CountryCode": {
        "type": "string",
        "description": "Uppercase ISO 3166-1 alpha-2 country code.",
        "pattern": "^[A-Z]{2}$",
        "examples": [
          "GB"
        ]
      },
      "CompanySearchRequest": {
        "type": "object",
        "required": [
          "identifier",
          "country"
        ],
        "properties": {
          "identifier_type": {
            "type": "string",
            "enum": [
              "name",
              "registration_number",
              "vat_tax_id"
            ],
            "default": "name"
          },
          "identifier": {
            "type": "string",
            "minLength": 1,
            "description": "Company name, registration number, or VAT/tax ID, matching `identifier_type`."
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "default": 8
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "identifier_type": {
                  "enum": [
                    "registration_number",
                    "vat_tax_id"
                  ]
                }
              },
              "required": [
                "identifier_type"
              ]
            },
            "then": {
              "properties": {
                "identifier": {
                  "maxLength": 80
                }
              }
            },
            "else": {
              "properties": {
                "identifier": {
                  "maxLength": 200
                }
              }
            }
          }
        ]
      },
      "EvidenceReference": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_name",
          "source_url",
          "retrieved_at"
        ],
        "properties": {
          "source_name": {
            "type": "string"
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CompanySearchItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "registration_number",
          "vat_tax_id",
          "country",
          "country_name",
          "status",
          "legal_form",
          "incorporation_date",
          "website",
          "logo_url",
          "evidence"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "registration_number": {
            "type": "string"
          },
          "vat_tax_id": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "country_name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "legal_form": {
            "type": "string"
          },
          "incorporation_date": {
            "type": "string"
          },
          "website": {
            "type": "string"
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "evidence": {
            "$ref": "#/components/schemas/EvidenceReference"
          }
        }
      },
      "CompanySearchResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "companies"
        ],
        "properties": {
          "companies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanySearchItem"
            }
          }
        }
      },
      "CompanyProfileModulePayload": {
        "type": "object",
        "description": "An extensible CompanyProof profile-module payload. A nested module can contain direct data, a provenance wrapper with `data` and `source`, or an embedded `error` when that module is unavailable inside an otherwise successful profile response. Consumers should tolerate new module fields and pin only the fields used by their application.",
        "additionalProperties": true
      },
      "CompanyProfileResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "company_id",
          "profile",
          "enrichment",
          "section_status"
        ],
        "properties": {
          "company_id": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/CompanyProfileModulePayload"
          },
          "enrichment": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CompanyProfileModulePayload"
              },
              {
                "type": "null"
              }
            ]
          },
          "section_status": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "profile",
              "enrichment"
            ],
            "properties": {
              "profile": {
                "type": "string",
                "const": "available"
              },
              "enrichment": {
                "type": "string",
                "enum": [
                  "available",
                  "unavailable"
                ]
              }
            }
          }
        }
      },
      "IntelligenceQueryRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          },
          "mode": {
            "type": "string",
            "enum": [
              "ai",
              "data"
            ],
            "default": "ai"
          }
        }
      },
      "ClaimField": {
        "type": "string",
        "enum": [
          "registered_name",
          "registration_number",
          "status",
          "incorporation_date",
          "vat_number",
          "legal_form"
        ]
      },
      "ClaimInput": {
        "type": "object",
        "required": [
          "field"
        ],
        "properties": {
          "field": {
            "$ref": "#/components/schemas/ClaimField"
          },
          "published": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Published value to verify."
          },
          "expected": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "deprecated": true,
            "description": "Legacy alias for `published`. Prefer `published`."
          }
        },
        "anyOf": [
          {
            "required": [
              "published"
            ]
          },
          {
            "required": [
              "expected"
            ]
          }
        ]
      },
      "VerificationCompanyInput": {
        "type": "object",
        "required": [
          "name",
          "country"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "country": {
            "$ref": "#/components/schemas/CountryCode"
          },
          "registration_number": {
            "type": "string",
            "maxLength": 80
          }
        }
      },
      "ClaimVerificationRequest": {
        "type": "object",
        "required": [
          "company"
        ],
        "properties": {
          "company": {
            "$ref": "#/components/schemas/VerificationCompanyInput"
          },
          "answer": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8000,
            "description": "Natural-language text from which supported claims are extracted."
          },
          "claims": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "$ref": "#/components/schemas/ClaimInput"
            },
            "description": "Structured claims. Send each claim field at most once."
          },
          "monitor": {
            "type": "boolean",
            "default": false,
            "description": "Request monitoring for verified facts. Requires an eligible plan and a `cp_live_` key."
          }
        },
        "oneOf": [
          {
            "required": [
              "answer"
            ],
            "not": {
              "required": [
                "claims"
              ]
            }
          },
          {
            "required": [
              "claims"
            ],
            "not": {
              "required": [
                "answer"
              ]
            }
          }
        ]
      },
      "VerificationCompany": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "registration_number",
          "country"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "registration_number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "ClaimEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_name",
          "source_url",
          "source_record_id",
          "retrieved_at"
        ],
        "properties": {
          "source_name": {
            "type": "string"
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "source_record_id": {
            "type": "string"
          },
          "retrieved_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "VerifiedClaim": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "claim_id",
          "field",
          "published",
          "observed",
          "verdict",
          "explanation",
          "evidence"
        ],
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "field": {
            "$ref": "#/components/schemas/ClaimField"
          },
          "published": {
            "type": "string"
          },
          "observed": {
            "type": [
              "string",
              "null"
            ]
          },
          "verdict": {
            "type": "string",
            "enum": [
              "verified",
              "corrected",
              "unsupported",
              "stale"
            ]
          },
          "explanation": {
            "type": "string"
          },
          "evidence": {
            "$ref": "#/components/schemas/ClaimEvidence"
          }
        }
      },
      "VerificationSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "verified",
          "corrected",
          "stale",
          "unsupported"
        ],
        "properties": {
          "verified": {
            "type": "integer",
            "minimum": 0
          },
          "corrected": {
            "type": "integer",
            "minimum": 0
          },
          "stale": {
            "type": "integer",
            "minimum": 0
          },
          "unsupported": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ClaimVerificationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "proof_id",
          "company",
          "claims",
          "summary",
          "monitoring",
          "latency_ms"
        ],
        "properties": {
          "proof_id": {
            "type": "string"
          },
          "company": {
            "$ref": "#/components/schemas/VerificationCompany"
          },
          "claims": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VerifiedClaim"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/VerificationSummary"
          },
          "monitoring": {
            "type": "string",
            "enum": [
              "active",
              "off"
            ]
          },
          "latency_ms": {
            "type": "integer",
            "minimum": 0
          }
        }
      }
    }
  }
}
