{
  "openapi": "3.1.0",
  "info": {
    "title": "Procora public agent knowledge API",
    "version": "1.0.0",
    "description": "Read-only public facts. No customer writes, paid scans or messages. Source review is not provider acceptance."
  },
  "servers": [
    {
      "url": "https://procora.ai/agent-api/v1"
    }
  ],
  "paths": {
    "/capabilities": {
      "get": {
        "operationId": "get_capabilities",
        "summary": "Read public capabilities",
        "parameters": [
          {
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "da"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public source facts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "format": "uri"
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited; retry after 60 seconds",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Unavailable; retry after 30 seconds",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/integrations": {
      "get": {
        "operationId": "get_integrations",
        "summary": "Read public integrations",
        "parameters": [
          {
            "in": "query",
            "name": "lang",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "da"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public source facts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "format": "uri"
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited; retry after 60 seconds",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Unavailable; retry after 30 seconds",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/projects": {
      "get": {
        "operationId": "get_saved_projects",
        "summary": "Read owned projects after explicit OAuth consent",
        "security": [
          {
            "procoraAgent": [
              "procora:projects:read"
            ]
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Owned retained public-source evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, revoked or wrong-resource token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Project not accessible or expired",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/audits": {
      "get": {
        "operationId": "get_saved_audits",
        "summary": "Read owned audits after explicit OAuth consent",
        "security": [
          {
            "procoraAgent": [
              "procora:audits:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Owned retained public-source evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing, expired, revoked or wrong-resource token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Project not accessible or expired",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "procoraAgent": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://procora.ai/agent-oauth/authorize",
            "tokenUrl": "https://procora.ai/agent-oauth/token",
            "scopes": {
              "procora:projects:read": "Read owned project identifiers",
              "procora:audits:read": "Read saved public-source audit evidence"
            }
          }
        }
      }
    }
  }
}
