{
  "openapi": "3.1.0",
  "info": {
    "title": "Aldhahbiya Technology Public API",
    "version": "1.0.0",
    "description": "Public, read-mostly API of Aldhahbiya Technology (https://gtiraq.com). No authentication is required for the endpoints listed here. Write endpoints must only be used on behalf of a real user with their consent. Admin endpoints are intentionally not documented.",
    "contact": {
      "name": "Aldhahbiya Technology",
      "email": "info@gtiraq.com",
      "url": "https://gtiraq.com/contact"
    }
  },
  "externalDocs": {
    "description": "Human-readable documentation",
    "url": "https://gtiraq.com/docs/api.md"
  },
  "servers": [
    {
      "url": "https://api.gtiraq.com/api"
    }
  ],
  "tags": [
    {
      "name": "Content"
    },
    {
      "name": "Company"
    },
    {
      "name": "Careers"
    },
    {
      "name": "Forms"
    },
    {
      "name": "MCP"
    },
    {
      "name": "System"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "System"
        ],
        "operationId": "getHealth",
        "summary": "Service health",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "degraded"
                      ]
                    },
                    "database": {
                      "type": "boolean"
                    },
                    "time": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Degraded"
          }
        }
      }
    },
    "/blog": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "listBlogPosts",
        "summary": "List / search published blog articles",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Free-text search in titles and content",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Exact category",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number (default 1)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size (default 10, max 500)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "posts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BlogPost"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/blog/categories": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "listBlogCategories",
        "summary": "Blog categories",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "nameEn": {
                        "type": "string"
                      },
                      "nameAr": {
                        "type": "string"
                      },
                      "nameKu": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/blog/{slug}": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "getBlogPost",
        "summary": "Get one published article",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Article slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlogPost"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/faq": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "listFaqs",
        "summary": "Published FAQs",
        "parameters": [
          {
            "name": "department",
            "in": "query",
            "required": false,
            "description": "Department filter (e.g. General, Energy)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Faq"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/downloads": {
      "get": {
        "tags": [
          "Content"
        ],
        "operationId": "listDownloads",
        "summary": "Catalogs, manuals, drivers and datasheets",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Category",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "description": "Brand",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search text",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/team": {
      "get": {
        "tags": [
          "Company"
        ],
        "operationId": "listTeam",
        "summary": "Active team members",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/team/{slug}": {
      "get": {
        "tags": [
          "Company"
        ],
        "operationId": "getTeamMember",
        "summary": "Team member digital business card",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Member slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/departments": {
      "get": {
        "tags": [
          "Company"
        ],
        "operationId": "listDepartments",
        "summary": "Departments with direct contacts",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Department"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/product-contacts": {
      "get": {
        "tags": [
          "Company"
        ],
        "operationId": "listProductContacts",
        "summary": "Sales specialist per product category",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/careers/jobs": {
      "get": {
        "tags": [
          "Careers"
        ],
        "operationId": "listJobs",
        "summary": "Open job positions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Job"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/careers/jobs/{id}": {
      "get": {
        "tags": [
          "Careers"
        ],
        "operationId": "getJob",
        "summary": "One job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Job id",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/careers/apply": {
      "post": {
        "tags": [
          "Careers"
        ],
        "operationId": "applyForJob",
        "summary": "Apply for an open job (with the candidate's consent)",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "jobId",
                  "name",
                  "email",
                  "phone"
                ],
                "properties": {
                  "jobId": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "coverLetter": {
                    "type": "string"
                  },
                  "cv": {
                    "type": "string",
                    "format": "binary",
                    "description": "PDF/DOC/DOCX, max 10 MB"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Application received"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/contact": {
      "post": {
        "tags": [
          "Forms"
        ],
        "operationId": "sendContactMessage",
        "summary": "Send a message to the team (on behalf of a real user)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Full name"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Phone number"
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject"
                  },
                  "message": {
                    "type": "string",
                    "description": "Message"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Message received"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/callbacks": {
      "post": {
        "tags": [
          "Forms"
        ],
        "operationId": "requestCallback",
        "summary": "Ask the team to call the user back",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "phone"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Full name"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Phone number"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "message": {
                    "type": "string",
                    "description": "What the user needs"
                  },
                  "department": {
                    "type": "string",
                    "description": "Department name"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Request received"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/faq/ask": {
      "post": {
        "tags": [
          "Forms"
        ],
        "operationId": "askQuestion",
        "summary": "Submit a question to be answered and published",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "question"
                ],
                "properties": {
                  "question": {
                    "type": "string",
                    "description": "The question"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "phone": {
                    "type": "string",
                    "description": "Phone"
                  },
                  "department": {
                    "type": "string",
                    "description": "Department"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Question received"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/newsletter/subscribe": {
      "post": {
        "tags": [
          "Forms"
        ],
        "operationId": "subscribeNewsletter",
        "summary": "Subscribe an email to news and offers (with consent)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subscribed"
          },
          "201": {
            "description": "Subscribed"
          },
          "400": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "MCP"
        ],
        "operationId": "mcp",
        "summary": "Model Context Protocol endpoint (JSON-RPC 2.0, Streamable HTTP, read-only tools)",
        "externalDocs": {
          "url": "https://gtiraq.com/.well-known/mcp/server-card.json"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "const": "2.0"
                  },
                  "id": {},
                  "method": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "202": {
            "description": "Notification accepted"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Error": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "BlogPost": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "titleEn": {
            "type": "string"
          },
          "titleAr": {
            "type": "string"
          },
          "titleKu": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "contentEn": {
            "type": "string",
            "description": "HTML"
          },
          "contentAr": {
            "type": "string"
          },
          "contentKu": {
            "type": "string"
          },
          "excerpt": {
            "type": "string"
          },
          "excerptAr": {
            "type": "string"
          },
          "excerptKu": {
            "type": "string"
          },
          "featuredImage": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "tags": {
            "type": "string"
          },
          "author": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Faq": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "questionEn": {
            "type": "string"
          },
          "questionAr": {
            "type": "string"
          },
          "questionKu": {
            "type": "string"
          },
          "answerEn": {
            "type": "string"
          },
          "answerAr": {
            "type": "string"
          },
          "answerKu": {
            "type": "string"
          },
          "department": {
            "type": "string"
          }
        }
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "titleEn": {
            "type": "string"
          },
          "titleAr": {
            "type": "string"
          },
          "titleKu": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "requirements": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "full-time",
              "part-time",
              "contract"
            ]
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Department": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "nameEn": {
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameKu": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "whatsapp": {
            "type": "string"
          }
        }
      }
    }
  }
}
