{
  "openapi": "3.1.0",
  "info": {
    "title": "ChatPilot Developer Discovery API",
    "version": "1.0.0",
    "description": "Public, unauthenticated discovery endpoints for ChatPilot's website resources. This specification does not describe the tenant-specific Enterprise integration API.",
    "contact": {
      "name": "ChatPilot",
      "url": "https://wa.me/601173838321"
    }
  },
  "servers": [
    {
      "url": "https://www.runchatpilot.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "ChatPilot developer resources",
    "url": "https://www.runchatpilot.com/developers"
  },
  "tags": [
    {
      "name": "Discovery",
      "description": "Public metadata for agents and developers."
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "operationId": "getDeveloperDiscovery",
        "summary": "Discover ChatPilot developer resources",
        "tags": [
          "Discovery"
        ],
        "responses": {
          "200": {
            "description": "Developer resource links",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiscoveryResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "operationId": "getDiscoveryApiStatus",
        "summary": "Check the discovery API status",
        "tags": [
          "Discovery"
        ],
        "responses": {
          "200": {
            "description": "Current service status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DiscoveryResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "name",
              "description",
              "documentation_url",
              "openapi_url",
              "status_url",
              "agent_index_url"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "documentation_url": {
                "type": "string",
                "format": "uri"
              },
              "openapi_url": {
                "type": "string",
                "format": "uri"
              },
              "status_url": {
                "type": "string",
                "format": "uri"
              },
              "agent_index_url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "StatusResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "service",
              "status"
            ],
            "properties": {
              "service": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "operational"
                ]
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "resolution",
              "documentation_url",
              "openapi_url"
            ],
            "properties": {
              "code": {
                "type": "string",
                "examples": [
                  "RESOURCE_NOT_FOUND"
                ]
              },
              "message": {
                "type": "string"
              },
              "resolution": {
                "type": "string"
              },
              "documentation_url": {
                "type": "string",
                "format": "uri"
              },
              "openapi_url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}
