{
  "openapi": "3.1.0",
  "info": {
    "title": "Конституция агента — API",
    "version": "1.0.0",
    "description": "Открытый API только для чтения: текст Конституции агента, отдельные статьи, реестр и журнал поправок. Без ключей и лимитов. Лицензия текста CC BY 4.0.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    },
    "contact": {
      "name": "ООО «САРМАТЕХ»",
      "email": "info@a2aprotocol.ru"
    }
  },
  "servers": [
    {
      "url": "https://xn----8sbalkoao1agd1bnbgj5cxk.xn--p1ai"
    }
  ],
  "paths": {
    "/api/v1/constitution.json": {
      "get": {
        "operationId": "getConstitution",
        "summary": "Полный текст текущей версии",
        "responses": {
          "200": {
            "description": "Текст Конституции",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "title",
                    "version",
                    "sections"
                  ],
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "published": {
                      "type": "string",
                      "format": "date"
                    },
                    "sections": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/articles/{n}.json": {
      "get": {
        "operationId": "getArticle",
        "summary": "Одна статья по номеру",
        "parameters": [
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 47
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Статья",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "n": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 47
                    },
                    "title": {
                      "type": "string"
                    },
                    "section": {
                      "type": "string"
                    },
                    "text": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "version": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Нет такой статьи"
          }
        }
      }
    },
    "/api/v1/registry.json": {
      "get": {
        "operationId": "getRegistry",
        "summary": "Реестр присоединившихся организаций",
        "responses": {
          "200": {
            "description": "Реестр",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "type": "string",
                      "format": "date"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "org": {
                            "type": "string"
                          },
                          "inn": {
                            "type": "string"
                          },
                          "site": {
                            "type": "string"
                          },
                          "level": {
                            "type": "string",
                            "enum": [
                              "K1",
                              "K2",
                              "K3",
                              "K4"
                            ]
                          },
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "removed"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/journal.json": {
      "get": {
        "operationId": "getJournal",
        "summary": "Журнал поправок и ответы редакции",
        "responses": {
          "200": {
            "description": "Журнал",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "type": "string",
                      "format": "date"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "format": "date"
                          },
                          "article": {
                            "type": "string"
                          },
                          "author": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "review",
                              "accepted",
                              "partial",
                              "rejected"
                            ]
                          },
                          "answer": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/agent-passport.schema.json": {
      "get": {
        "operationId": "getPassportSchema",
        "summary": "JSON Schema паспорта ИИ-агента (формат 0.1)",
        "responses": {
          "200": {
            "description": "JSON Schema",
            "content": {
              "application/schema+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/passport-example.json": {
      "get": {
        "operationId": "getPassportExample",
        "summary": "Пример паспорта ИИ-агента",
        "responses": {
          "200": {
            "description": "Пример",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/agent-constitution.schema.json": {
      "get": {
        "operationId": "getDeclarationSchema",
        "summary": "JSON Schema файла agent-constitution.json",
        "responses": {
          "200": {
            "description": "JSON Schema",
            "content": {
              "application/schema+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}