openapi: 3.1.0
info:
  title: GRIP_ins Enterprise API (redacted appendix)
  version: "1.0.0"
  description: |
    Redacted OpenAPI appendix for insurer technical diligence.
    Production base URL: https://intel.synlogica.pl
    Marketing preview (no key): https://risk.synlogica.ai/map/data
    Full contract schemas provided during onboarding.
servers:
  - url: https://intel.synlogica.pl
    description: Production intel-service
security:
  - IntelApiKey: []
components:
  securitySchemes:
    IntelApiKey:
      type: apiKey
      in: header
      name: X-Intel-Api-Key
  schemas:
    GripMapAggregate:
      type: object
      required: [day, countries, chokepoints, product, public]
      properties:
        product:
          type: string
          example: grip-ins-enterprise
        public:
          type: boolean
          example: false
        day:
          type: string
          format: date
        available_days:
          type: array
          items: { type: string, format: date }
        countries:
          type: array
          items: { $ref: "#/components/schemas/GripCountryRow" }
        chokepoints:
          type: array
          items: { $ref: "#/components/schemas/ChokepointRow" }
        sanctioned_count:
          type: integer
        total:
          type: integer
    GripCountryRow:
      type: object
      properties:
        country: { type: string }
        iso2: { type: string }
        iso3: { type: string }
        value: { type: integer, minimum: 0, maximum: 100 }
        baseline: { type: number, description: Enterprise only }
        band: { type: string }
        conflict_score: { type: number, description: Enterprise only }
        sanctioned: { type: boolean }
        trend: { type: string }
        trend_delta: { type: integer }
        reason: { type: string }
    ChokepointRow:
      type: object
      properties:
        name: { type: string }
        lat: { type: number }
        lon: { type: number }
        mode: { type: string, enum: [maritime, airway] }
        risk_level: { type: string, enum: [HIGH, MEDIUM, LOW] }
        notes: { type: string, description: Enterprise only }
    GeoRiskMap:
      type: object
      properties:
        day: { type: string, format: date }
        countries:
          type: array
          items:
            type: object
            properties:
              country: { type: string }
              score: { type: integer }
              recommendation: { type: string, enum: [PROCEED, CAUTION, AVOID] }
paths:
  /api/v1/grip/map:
    get:
      summary: Unified GRIP world map aggregate
      tags: [grip]
      security: [{ IntelApiKey: [] }]
      parameters:
        - name: day
          in: query
          schema: { type: string, format: date }
          description: ISO date; defaults to latest snapshot
      responses:
        "200":
          description: Full aggregate for enterprise clients
          content:
            application/json:
              schema: { $ref: "#/components/schemas/GripMapAggregate" }
        "401":
          description: Missing or invalid API key
  /api/v1/grip/country-risks:
    get:
      summary: GRIP composite per jurisdiction
      tags: [grip]
      security: [{ IntelApiKey: [] }]
      responses:
        "200":
          description: Array of country risk rows
  /api/v1/grip/chokepoints:
    get:
      summary: Maritime and airway chokepoint severity
      tags: [grip]
      security: [{ IntelApiKey: [] }]
      responses:
        "200":
          description: Array of chokepoint rows
  /api/v1/geo/risk-map:
    get:
      summary: Transit score map with PROCEED/CAUTION/AVOID
      tags: [geo]
      security: [{ IntelApiKey: [] }]
      responses:
        "200":
          description: Geo transit map payload
          content:
            application/json:
              schema: { $ref: "#/components/schemas/GeoRiskMap" }
