{
  "openapi": "3.1.0",
  "info": {
    "title": "PARLEY public API",
    "summary": "Public product and demo API for PARLEY political intelligence on parleytech.com",
    "description": "Unauthenticated site API for agents and developers. Use it to read PARLEY product metadata and to file a demo request. Tenant parliamentary feeds are not exposed here.",
    "version": "1.0.0",
    "contact": {
      "name": "PARLEY by DAAT",
      "email": "hello@daat.cloud",
      "url": "https://www.parleytech.com/developers"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://www.parleytech.com/privacy"
    }
  },
  "servers": [
    {
      "url": "https://www.parleytech.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Meta",
      "description": "Liveness and machine-readable contracts"
    },
    {
      "name": "Product",
      "description": "Public PARLEY product description"
    },
    {
      "name": "Leads",
      "description": "Demo requests handled by DAAT humans"
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "Meta"
        ],
        "summary": "Service health",
        "description": "Returns liveness for the public PARLEY site API. Use this before other calls.",
        "responses": {
          "200": {
            "description": "API is reachable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/product": {
      "get": {
        "operationId": "getProduct",
        "tags": [
          "Product"
        ],
        "summary": "PARLEY product record",
        "description": "Typed product metadata for function calling: name, speed claims, audiences, and links to docs.",
        "responses": {
          "200": {
            "description": "Product record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/coverage": {
      "get": {
        "operationId": "getCoverage",
        "tags": [
          "Product"
        ],
        "summary": "Monitored source types",
        "description": "Lists the categories of public sources PARLEY monitors. Does not return live legislative payloads.",
        "responses": {
          "200": {
            "description": "Coverage list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverageResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contact": {
      "get": {
        "operationId": "getContact",
        "tags": [
          "Meta"
        ],
        "summary": "Public contact record",
        "description": "Email, demo URL, and postal locality for PARLEY / DAAT.",
        "responses": {
          "200": {
            "description": "Contact record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/demo-requests": {
      "post": {
        "operationId": "createDemoRequest",
        "tags": [
          "Leads"
        ],
        "summary": "Create a demo request",
        "description": "Validates a JSON demo request and returns a receipt. A DAAT person follows up by email. Required fields: name, email, organization.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DemoRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DemoRequestReceipt"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Body was not JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiSpec",
        "tags": [
          "Meta"
        ],
        "summary": "OpenAPI document",
        "description": "Returns this specification so agents can bind function calls.",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HealthResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "service",
          "version"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "service": {
            "type": "string",
            "example": "parley-public-api"
          },
          "version": {
            "type": "string",
            "example": "1.0.0"
          }
        }
      },
      "Product": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description",
          "tagline",
          "alertsMinutes",
          "reportsMinutes",
          "audiences",
          "docs"
        ],
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "parley"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "tagline": {
            "type": "string"
          },
          "alertsMinutes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "min",
              "max"
            ],
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              }
            }
          },
          "reportsMinutes": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "min",
              "max"
            ],
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              }
            }
          },
          "audiences": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "CoverageResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sources"
        ],
        "properties": {
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SourceType"
            }
          }
        }
      },
      "SourceType": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "description"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Contact": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "url",
          "address"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "meet": {
            "type": "string",
            "format": "uri"
          },
          "address": {
            "$ref": "#/components/schemas/PostalAddress"
          }
        }
      },
      "PostalAddress": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "addressLocality",
          "addressRegion",
          "addressCountry"
        ],
        "properties": {
          "addressLocality": {
            "type": "string"
          },
          "addressRegion": {
            "type": "string"
          },
          "addressCountry": {
            "type": "string"
          }
        }
      },
      "DemoRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "email",
          "organization"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "organization": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "role": {
            "type": "string",
            "maxLength": 200
          },
          "message": {
            "type": "string",
            "maxLength": 4000
          }
        }
      },
      "DemoRequestReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status",
          "message"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "accepted"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "message",
              "hint",
              "status"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              },
              "status": {
                "type": "integer"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              },
              "docs": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}
