{
  "openapi": "3.0.3",
  "info": {
    "title": "API de livrare: Rivil Site (public)",
    "version": "1.0.0",
    "description": "Conținut public, doar citire, plus trimiterea formularelor. Autentificare: Authorization Bearer cu cheia site-ului."
  },
  "servers": [
    {
      "url": "https://erp.rivil.app/api/site/v1"
    }
  ],
  "security": [
    {
      "SiteKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "SiteKey": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "MediaItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "thumb_url": {
            "type": "string",
            "nullable": true
          },
          "width": {
            "type": "integer",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "nullable": true
          },
          "alt": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string"
          },
          "file_type": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/types": {
      "get": {
        "summary": "Tipurile site-ului și câmpurile lor",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/taxonomies": {
      "get": {
        "summary": "Taxonomiile site-ului",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/terms": {
      "get": {
        "summary": "Termenii unei taxonomii",
        "parameters": [
          {
            "name": "taxonomy",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Limba răspunsului. Ce nu e tradus vine în limba principală."
          },
          {
            "name": "populate",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Câmpuri de încărcat complet, de exemplu hero,autor.poza sau *. Cel mult două niveluri de relații."
          },
          {
            "name": "fields",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Doar aceste câmpuri, de exemplu title,hero. Corpul apare în liste doar dacă îl ceri."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/menus": {
      "get": {
        "summary": "Meniurile, cu legăturile rezolvate",
        "parameters": [
          {
            "name": "key",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Limba răspunsului. Ce nu e tradus vine în limba principală."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/settings": {
      "get": {
        "summary": "Paginile unice ale site-ului",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Limba răspunsului. Ce nu e tradus vine în limba principală."
          },
          {
            "name": "populate",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Câmpuri de încărcat complet, de exemplu hero,autor.poza sau *. Cel mult două niveluri de relații."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/redirects": {
      "get": {
        "summary": "Redirecturile site-ului",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "summary": "Căutare în conținutul publicat, în toate limbile site-ului",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Limba răspunsului. Ce nu e tradus vine în limba principală."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/linked/{id}": {
      "get": {
        "summary": "Intrările care leagă o intrare, din orice tip și câmp",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "field",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Limba răspunsului. Ce nu e tradus vine în limba principală."
          },
          {
            "name": "populate",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Câmpuri de încărcat complet, de exemplu hero,autor.poza sau *. Cel mult două niveluri de relații."
          },
          {
            "name": "fields",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Doar aceste câmpuri, de exemplu title,hero. Corpul apare în liste doar dacă îl ceri."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/sitemap": {
      "get": {
        "summary": "Adresele publice ale site-ului",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "4XX": {
            "description": "Eroare",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/types.ts": {
      "get": {
        "summary": "Tipuri TypeScript pentru câmpurile site-ului",
        "responses": {
          "200": {
            "description": "Text",
            "content": {
              "text/plain": {}
            }
          }
        }
      }
    },
    "/forms/{key}": {
      "post": {
        "summary": "Trimite un formular de pe site. Cererea se salvează, iar dacă firma are CRM ajunge și acolo",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "fields": {
                    "type": "object"
                  },
                  "page": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Primit"
          },
          "4XX": {
            "description": "Eroare"
          }
        }
      }
    }
  }
}