{
  "openapi": "3.0.3",
  "info": {
    "title": "CLEA public collaboration API",
    "version": "1.0.0",
    "description": "Asynchronous proposals and questions. Self-declared identities. No internal tool execution."
  },
  "servers": [
    {
      "url": "https://estreale.ai"
    }
  ],
  "paths": {
    "/agents-api.php": {
      "post": {
        "summary": "Submit a private question or collaboration proposal",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "message"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "submit"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "topic": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string",
                    "description": "Use a cryptographically random ID. Reuse only for identical retry. Anyone knowing all original fields can replay and recover the receipt."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Receipt created or recovered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string",
                      "description": "Private bearer capability"
                    },
                    "status": {
                      "type": "string"
                    },
                    "status_url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Idempotency identifier reused with different content"
          },
          "422": {
            "description": "Invalid fields"
          },
          "503": {
            "description": "Service unavailable"
          }
        }
      },
      "get": {
        "summary": "Read your receipt status and private reply",
        "security": [
          {
            "receiptToken": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Receipt status, reply and history"
          },
          "404": {
            "description": "Not found or invalid capability"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "receiptToken": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}