{
  "openapi": "3.0.4",
  "info": {
    "title": "CS Číselníky API",
    "description": "Veřejné API pro poskytování číselníků celním deklarantům",
    "version": "v1"
  },
  "paths": {
    "/api/{nazev}/{format}": {
      "get": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí data číselníku podle jeho identifikátoru ve vybraném formátu",
        "description": "Podporované formáty:\r\n- json\r\n- xml\r\n- csv\r\n            \r\nPříklad:\r\nGET /api/anone/json",
        "parameters": [
          {
            "name": "nazev",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "json"
            }
          },
          {
            "name": "preview",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "platnost",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/xsd": {
      "post": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí definici struktury číselníku",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XSD"
              },
              "example": {
                "nazev": "anone",
                "verze": "1",
                "odberatel": {
                  "nazev": "Skill s.r.o.",
                  "email": "info@skill.cz",
                  "aplikaceNazev": "Ciselniky",
                  "aplikaceVerze": "1.0.0.0"
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/XSD"
              },
              "example": {
                "nazev": "anone",
                "verze": "1",
                "odberatel": {
                  "nazev": "Skill s.r.o.",
                  "email": "info@skill.cz",
                  "aplikaceNazev": "Ciselniky",
                  "aplikaceVerze": "1.0.0.0"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/XSD"
              },
              "example": {
                "nazev": "anone",
                "verze": "1",
                "odberatel": {
                  "nazev": "Skill s.r.o.",
                  "email": "info@skill.cz",
                  "aplikaceNazev": "Ciselniky",
                  "aplikaceVerze": "1.0.0.0"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/sadaverze": {
      "post": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí seznam číselníků, v nichž je k danému okamžiku možné získat data. K požadavku lze přiložit seznam číselníků, které má funkce vyhledat.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SadaVerze"
              },
              "example": {
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SadaVerze"
              },
              "example": {
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SadaVerze"
              },
              "example": {
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí seznam všech verzí struktur číselníků, v nichž je možné k danému okamžiku získat data",
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/sadaverze/{sada}": {
      "get": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí seznam všech verzí struktur číselníků v zadané sadě, v nichž je možné k danému okamžiku získat data",
        "parameters": [
          {
            "name": "sada",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/ciselniky": {
      "post": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Stažení dat jednoho či více číselníků",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataCiselniku"
              },
              "example": {
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ],
                "vystupFormat": 1,
                "vystupKomprese": false,
                "platnostOd": "2025-10-09",
                "platnostDo": "2026-10-09",
                "odberatel": {
                  "nazev": "Skill s.r.o.",
                  "email": "info@skill.cz",
                  "aplikaceNazev": "Ciselniky",
                  "aplikaceVerze": "1"
                }
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DataCiselniku"
              },
              "example": {
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ],
                "vystupFormat": 1,
                "vystupKomprese": false,
                "platnostOd": "2025-10-09",
                "platnostDo": "2026-10-09",
                "odberatel": {
                  "nazev": "Skill s.r.o.",
                  "email": "info@skill.cz",
                  "aplikaceNazev": "Ciselniky",
                  "aplikaceVerze": "1"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DataCiselniku"
              },
              "example": {
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ],
                "vystupFormat": 1,
                "vystupKomprese": false,
                "platnostOd": "2025-10-09",
                "platnostDo": "2026-10-09",
                "odberatel": {
                  "nazev": "Skill s.r.o.",
                  "email": "info@skill.cz",
                  "aplikaceNazev": "Ciselniky",
                  "aplikaceVerze": "1"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/ciselniky/{xsd}": {
      "get": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Stažení dat jednoho číselníku",
        "parameters": [
          {
            "name": "xsd",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vystupFormat",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/VystupFormat"
            }
          },
          {
            "name": "platnostDatOd",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platnostDatDo",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ciselnikVerze",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "odberatelNazev",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "TEST"
            }
          },
          {
            "name": "odberatelEmail",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "TEST"
            }
          },
          {
            "name": "aplikaceNazev",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "TEST"
            }
          },
          {
            "name": "aplikaceVerze",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "TEST"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/sada/zmeny_verze": {
      "post": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí seznam číselníků, kterým přibyla nová verze struktury od daného data. K požadavku lze přiložit seznam číselníků, které má funkce vyhledat",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SadaZmeny"
              },
              "example": {
                "datumZmeny": "2025-10-09",
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SadaZmeny"
              },
              "example": {
                "datumZmeny": "2025-10-09",
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SadaZmeny"
              },
              "example": {
                "datumZmeny": "2025-10-09",
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí seznam všech číselníků, kterým přibyla nová verze struktury od daného data. Lze uvést sadu, vekteré má funkce vyhledávat",
        "parameters": [
          {
            "name": "datumZmeny",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sada",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/sada/zmeny_dat": {
      "post": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí seznam číselníků, ve kterých došlo ke změně dat od daného data a čas",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SadaZmeny"
              },
              "example": {
                "datumZmeny": "2025-10-09",
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SadaZmeny"
              },
              "example": {
                "datumZmeny": "2025-10-09",
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SadaZmeny"
              },
              "example": {
                "datumZmeny": "2025-10-09",
                "ciselniky": [
                  {
                    "nazev": "anone",
                    "verze": [
                      "1"
                    ]
                  },
                  {
                    "nazev": "baleni",
                    "verze": [
                      "2"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Ciselniky"
        ],
        "summary": "Vrátí seznam číselníků, ve kterých došlo ke změně dat od daného data a času",
        "parameters": [
          {
            "name": "datumZmeny",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sada",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/Home": {
      "get": {
        "tags": [
          "Home"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/": {
      "get": {
        "tags": [
          "Skill.GRC.Ciselniky.API"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Ciselnik": {
        "type": "object",
        "properties": {
          "nazev": {
            "type": "string",
            "nullable": true
          },
          "verze": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DataCiselniku": {
        "type": "object",
        "properties": {
          "ciselniky": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ciselnik"
            },
            "nullable": true
          },
          "vystupFormat": {
            "$ref": "#/components/schemas/VystupFormat"
          },
          "vystupKomprese": {
            "type": "boolean"
          },
          "platnostOd": {
            "type": "string",
            "nullable": true
          },
          "platnostDo": {
            "type": "string",
            "nullable": true
          },
          "odberatel": {
            "$ref": "#/components/schemas/Odberatel"
          }
        },
        "additionalProperties": false
      },
      "Odberatel": {
        "type": "object",
        "properties": {
          "nazev": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "aplikaceNazev": {
            "type": "string",
            "nullable": true
          },
          "aplikaceVerze": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "SadaVerze": {
        "type": "object",
        "properties": {
          "ciselniky": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ciselnik"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SadaZmeny": {
        "type": "object",
        "properties": {
          "datumZmeny": {
            "type": "string",
            "nullable": true
          },
          "ciselniky": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ciselnik"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "VystupFormat": {
        "enum": [
          0,
          1,
          2,
          3
        ],
        "type": "integer",
        "format": "int32"
      },
      "XSD": {
        "type": "object",
        "properties": {
          "nazev": {
            "type": "string",
            "nullable": true
          },
          "verze": {
            "type": "string",
            "nullable": true
          },
          "odberatel": {
            "$ref": "#/components/schemas/Odberatel"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "tags": [
    {
      "name": "Ciselniky"
    },
    {
      "name": "Home"
    },
    {
      "name": "Skill.GRC.Ciselniky.API"
    }
  ]
}