{
  "openapi" : "3.1.0",
  "components" : {
    "securitySchemes" : {
      "ApiKeyAuth" : {
        "type" : "apiKey",
        "in" : "header",
        "name" : "X-Api-Key",
        "description" : "HTTP API Key authentication using account credentials.\n\n**Format**: `X-Api-Key: YOUR_API_KEY`\n\n**How to obtain credentials**:\n1. Contact Namirial support to create a WhatsApp Gateway account\n2. Receive API key via secure channel\n3. Test credentials in TEST environment first\n\nSee [Authentication documentation](https://docs.namirial.app/products/whatsapp/enterprise-documentation/developer-documentation/authentication) for details."
      },
      "basicAuth" : {
        "type" : "http",
        "scheme" : "basic",
        "description" : "HTTP Basic Authentication using account credentials.\n\n**Format**: `Authorization: Basic base64(username:password)`\n\n**How to obtain credentials**:\n1. Contact Namirial support to create a WhatsApp Gateway account\n2. Receive username and password via secure channel\n3. Test credentials in TEST environment first\n\nSee [Authentication documentation](https://docs.namirial.app/products/whatsapp/enterprise-documentation/developer-documentation/authentication) for details."
      }
    },
    "parameters" : {
      "TemplateIdPath" : {
        "name" : "templateId",
        "in" : "path",
        "required" : true,
        "description" : "Unique identifier of the template.",
        "schema" : {
          "type" : "integer",
          "format" : "int64",
          "example" : 1
        }
      }
    },
    "schemas" : {
      "AddLanguageRequest" : {
        "type" : "object",
        "required" : [ "language", "body" ],
        "properties" : {
          "body" : {
            "description" : "Template body component in the new language.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/BodyComponent"
            } ]
          },
          "footer" : {
            "description" : "Template footer component in the new language.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/FooterComponent"
            } ]
          },
          "language" : {
            "type" : "string",
            "description" : "The new language to add. See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages).",
            "example" : "it"
          },
          "textHeader" : {
            "description" : "Template text header component in the new language.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/TextHeaderComponent"
            } ]
          },
          "urlButtons" : {
            "type" : [ "array", "null" ],
            "items" : {
              "$ref" : "#/components/schemas/UrlButtonTypeComponent"
            },
            "description" : "URL button components for the new language version. Max 2 buttons."
          }
        }
      },
      "CreateTemplateRequest" : {
        "type" : "object",
        "required" : [ "language", "category", "name", "description", "body" ],
        "properties" : {
          "body" : {
            "description" : "Template body component.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/BodyComponent"
            } ]
          },
          "category" : {
            "type" : "string",
            "enum" : [ "UTILITY", "MARKETING", "AUTHENTICATION" ],
            "description" : "Template category. For `AUTHENTICATION` templates, contact Namirial support for the accepted parameters."
          },
          "description" : {
            "type" : "string",
            "description" : "Template description.",
            "example" : "sign a doc using a link"
          },
          "footer" : {
            "description" : "Template footer component.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/FooterComponent"
            } ]
          },
          "language" : {
            "type" : "string",
            "description" : "Default template language. See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages).",
            "example" : "en"
          },
          "name" : {
            "type" : "string",
            "description" : "Template name. Only alphabetic characters and underscores (max 100 characters).",
            "example" : "signature_template"
          },
          "textHeader" : {
            "description" : "Template text header component.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/TextHeaderComponent"
            } ]
          },
          "urlButtons" : {
            "type" : [ "array", "null" ],
            "items" : {
              "$ref" : "#/components/schemas/UrlButtonTypeComponent"
            },
            "description" : "URL button components. Max 2 buttons."
          }
        }
      },
      "BodyComponent" : {
        "type" : "object",
        "description" : "Template body component containing dynamic text parameters.",
        "properties" : {
          "text" : {
            "type" : [ "string", "null" ],
            "description" : "Static body text."
          },
          "parameters" : {
            "type" : [ "array", "null" ],
            "items" : {
              "$ref" : "#/components/schemas/TextTypeParameter"
            },
            "description" : "List of dynamic text parameters to substitute in the template body."
          }
        }
      },
      "ErrorResponse" : {
        "type" : "object",
        "description" : "Error response returned when a request fails.",
        "properties" : {
          "type" : {
            "type" : "string",
            "description" : "Exception type identifier."
          },
          "code" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
          },
          "message" : {
            "type" : "string",
            "description" : "Human-readable error description."
          },
          "errorDetails" : {
            "type" : [ "array", "null" ],
            "items" : {
              "type" : "object",
              "properties" : {
                "field" : {
                  "type" : "string",
                  "description" : "The field that failed validation."
                },
                "message" : {
                  "type" : "string",
                  "description" : "Validation error message."
                }
              }
            },
            "description" : "Additional validation error details, present on constraint violations."
          }
        }
      },
      "FooterComponent" : {
        "type" : "object",
        "description" : "Template footer component.",
        "properties" : {
          "text" : {
            "type" : [ "string", "null" ],
            "description" : "Footer text."
          },
          "codeExpirationMinutes" : {
            "type" : [ "integer", "null" ],
            "format" : "int32",
            "description" : "OTP code expiration time in minutes."
          }
        }
      },
      "ReferenceService" : {
        "type" : "object",
        "description" : "Optional reference object to track messages and associate them with specific services or actions. `service` is required if `action` or `key` are specified.",
        "properties" : {
          "service" : {
            "type" : [ "string", "null" ],
            "maxLength" : 50,
            "description" : "Identifies the product or service sending the message. Required if `action` or `key` are specified."
          },
          "action" : {
            "type" : [ "string", "null" ],
            "maxLength" : 50,
            "description" : "Describes the specific action for the selected service (e.g. `2FA`, `AUTH`)."
          },
          "key" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "description" : "Custom tracking key for internal processes."
          }
        }
      },
      "SendOtpRequest" : {
        "type" : "object",
        "required" : [ "to", "language", "otp", "templateId" ],
        "properties" : {
          "to" : {
            "type" : "string",
            "description" : "Recipient phone number in E.164 format (e.g. `+390000000000`).",
            "example" : "+390000000000"
          },
          "language" : {
            "type" : "string",
            "description" : "Language code of the authentication template to use (e.g. `it`, `en`). See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages). Falls back to the template's default language if not found.",
            "example" : "it"
          },
          "templateId" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "Identifier of the authentication template to use.",
            "minimum" : 0,
            "example" : 1
          },
          "businessRelationId" : {
            "type" : [ "string", "null" ],
            "description" : "Optional One Platform Business Relation ID. If specified, consumption is attributed to this BRI."
          },
          "lra" : {
            "type" : [ "string", "null" ],
            "description" : "Local Registration Authority (LRA) identifier."
          },
          "reference" : {
            "description" : "Optional reference object for tracking. See [Reference Attribute](https://docs.namirial.app/products/sms/enterprise-documentation/developer-documentation/integration-guide/attribute-reference) for details.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/ReferenceService"
            } ]
          },
          "otp" : {
            "type" : "string",
            "minLength" : 1,
            "description" : "The one-time password to include in the message (max 15 characters, as per Meta authentication template restrictions).",
            "example" : "123456"
          }
        }
      },
      "SendRequest" : {
        "type" : "object",
        "required" : [ "to", "language", "templateId" ],
        "properties" : {
          "to" : {
            "type" : "string",
            "description" : "Recipient phone number in E.164 format (e.g. `+390000000000`).",
            "example" : "+390000000000"
          },
          "language" : {
            "type" : "string",
            "description" : "Language code of the template to use (e.g. `it`, `en`). See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages). Falls back to the template's default language if not found.",
            "example" : "it"
          },
          "templateId" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "Identifier of the WhatsApp template to use.",
            "minimum" : 0,
            "example" : 3
          },
          "businessRelationId" : {
            "type" : [ "string", "null" ],
            "description" : "Optional business relation identifier for internal tracking."
          },
          "lra" : {
            "type" : [ "string", "null" ],
            "description" : "Local Registration Authority (LRA) identifier."
          },
          "reference" : {
            "description" : "Optional reference object for tracking. See [Reference Attribute](https://docs.namirial.app/products/sms/enterprise-documentation/developer-documentation/integration-guide/attribute-reference) for details.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/ReferenceService"
            } ]
          },
          "body" : {
            "description" : "Template body component with dynamic parameters. See [Body component](https://docs.namirial.app/products/whatsapp/enterprise-documentation/developer-documentation/api-references/send-message-apis#body-component) for details on how to use placeholders.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/BodyComponent"
            } ]
          },
          "urlButtons" : {
            "type" : [ "array", "null" ],
            "items" : {
              "$ref" : "#/components/schemas/UrlButtonTypeComponent"
            },
            "description" : "List of URL button components with dynamic URL paths."
          }
        }
      },
      "SendResponse" : {
        "type" : "object",
        "description" : "Response returned when a message is sent successfully.",
        "properties" : {
          "messageId" : {
            "type" : "string",
            "description" : "Unique identifier of the sent message.",
            "example" : "3425151601"
          }
        }
      },
      "Template" : {
        "type" : "object",
        "properties" : {
          "body" : {
            "description" : "Template body component.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/BodyComponent"
            } ]
          },
          "urlButtons" : {
            "type" : [ "array", "null" ],
            "items" : {
              "$ref" : "#/components/schemas/UrlButtonTypeComponent"
            },
            "description" : "List of URL button components."
          },
          "footer" : {
            "description" : "Template footer component.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/FooterComponent"
            } ]
          },
          "textHeader" : {
            "description" : "Template text header component.",
            "allOf" : [ {
              "$ref" : "#/components/schemas/TextHeaderComponent"
            } ]
          },
          "language" : {
            "type" : [ "string", "null" ],
            "description" : "Language code of the template (e.g. `it`, `en`). See [supported languages](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages) for the full list of valid values.",
            "example" : "it"
          },
          "status" : {
            "type" : [ "string", "null" ],
            "description" : "Template approval status (e.g. `APPROVED`, `PENDING`, `REJECTED`)."
          },
          "category" : {
            "type" : [ "string", "null" ],
            "enum" : [ "UTILITY", "MARKETING", "AUTHENTICATION" ],
            "description" : "WhatsApp template category."
          },
          "name" : {
            "type" : [ "string", "null" ],
            "description" : "Template name."
          },
          "description" : {
            "type" : [ "string", "null" ],
            "description" : "Template description."
          },
          "templateId" : {
            "type" : [ "string", "null" ],
            "description" : "Unique identifier of the template."
          },
          "default" : {
            "type" : [ "boolean", "null" ],
            "description" : "Whether this is the default language variant for the template."
          }
        }
      },
      "TextHeaderComponent" : {
        "type" : "object",
        "description" : "Template text header component.",
        "properties" : {
          "text" : {
            "type" : [ "string", "null" ],
            "description" : "Header text."
          }
        }
      },
      "TextTypeParameter" : {
        "type" : "object",
        "description" : "A single dynamic text parameter for template substitution.",
        "properties" : {
          "text" : {
            "type" : [ "string", "null" ],
            "description" : "Parameter value to substitute in the template."
          }
        }
      },
      "UrlButtonTypeComponent" : {
        "type" : "object",
        "description" : "URL button component with a dynamic URL path suffix.",
        "properties" : {
          "index" : {
            "type" : [ "integer", "null" ],
            "format" : "int32",
            "description" : "Zero-based index of the URL button in the template."
          },
          "urlPath" : {
            "type" : [ "string", "null" ],
            "description" : "Dynamic path suffix appended to the button's base URL."
          },
          "url" : {
            "type" : [ "string", "null" ],
            "description" : "Full URL override for the button."
          },
          "text" : {
            "type" : [ "string", "null" ],
            "description" : "Button label text."
          }
        }
      }
    }
  },
  "tags" : [ {
    "name" : "Services",
    "description" : "Send WhatsApp messages to end users.",
    "externalDocs" : {
      "description" : "WhatsApp Gateway documentation",
      "url" : "https://docs.namirial.app/products/whatsapp/"
    }
  }, {
    "name" : "Template",
    "description" : "Manage WhatsApp message templates.",
    "externalDocs" : {
      "description" : "WhatsApp Gateway documentation",
      "url" : "https://docs.namirial.app/products/whatsapp/"
    }
  }, {
    "name" : "Public",
    "description" : "Public endpoints. No authentication required.",
    "externalDocs" : {
      "description" : "WhatsApp Gateway documentation",
      "url" : "https://docs.namirial.app/products/whatsapp/"
    }
  } ],
  "paths" : {
    "/api/public/status" : {
      "get" : {
        "summary" : "Check service status",
        "description" : "Returns the current operational status of the WhatsApp Gateway service. No authentication required. The response body is empty — an HTTP 200 indicates the service is up.",
        "operationId" : "getServiceStatus",
        "tags" : [ "Public" ],
        "responses" : {
          "200" : {
            "description" : "Service is operational.",
            "content" : {
              "text/plain" : {
                "schema" : {
                  "type" : "string",
                  "example" : ""
                }
              }
            }
          }
        },
        "security" : [ ]
      }
    },
    "/api/services/send" : {
      "post" : {
        "summary" : "Send a WhatsApp message",
        "description" : "Sends a WhatsApp message to the specified recipient using a pre-approved utility template. Supports body parameters, URL buttons, and an optional reference for tracking. See [Send a message](https://docs.namirial.app/products/whatsapp/enterprise-documentation/developer-documentation/api-references/send-message-apis/send) for details.",
        "operationId" : "sendWhatsAppMessage",
        "tags" : [ "Services" ],
        "requestBody" : {
          "description" : "WhatsApp message request",
          "content" : {
            "application/json" : {
              "example" : {
                "body" : {
                  "parameters" : [ {
                    "text" : "Rome"
                  }, {
                    "text" : "m.rossi"
                  } ]
                },
                "language" : "it",
                "reference" : {
                  "action" : "AUTH",
                  "key" : "ext-key-001",
                  "service" : "DIGITALSIGN"
                },
                "templateId" : 3,
                "to" : "+390000000000",
                "urlButtons" : [ {
                  "index" : 0,
                  "urlPath" : "/my/url/path"
                } ]
              },
              "schema" : {
                "$ref" : "#/components/schemas/SendRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "Message sent successfully.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SendResponse"
                },
                "example" : {
                  "messageId" : "3425151601"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid request — missing or malformed parameters.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidTemplate" : {
                    "summary" : "Invalid template",
                    "value" : {
                      "code" : 7,
                      "message" : "Template not found or not approved",
                      "type" : "InvalidTemplateException"
                    }
                  },
                  "invalidInput" : {
                    "summary" : "Invalid input",
                    "value" : {
                      "code" : 3,
                      "message" : "Parameter 'template' must not be empty and > 0",
                      "type" : "ConstraintViolationException"
                    }
                  },
                  "wrongNumber" : {
                    "summary" : "Wrong destination number",
                    "value" : {
                      "code" : 8,
                      "message" : "NO_VALID_RECIPIENT",
                      "type" : "WrongNumberException"
                    }
                  },
                  "unknownField" : {
                    "summary" : "Unknown field in request body",
                    "value" : {
                      "code" : 3,
                      "message" : "Unknown field in request body",
                      "type" : "UnrecognizedPropertyException"
                    }
                  },
                  "invalidBody" : {
                    "summary" : "Invalid request body (e.g. wrong field type)",
                    "value" : {
                      "code" : 3,
                      "message" : "Invalid request body",
                      "type" : "InvalidFormatException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidCredentials" : {
                    "summary" : "Invalid credentials",
                    "value" : {
                      "code" : 1,
                      "message" : "Invalid credentials",
                      "type" : "AuthenticationFailedException"
                    }
                  },
                  "missingApiKey" : {
                    "summary" : "Missing API key",
                    "value" : {
                      "code" : 9,
                      "message" : "Missing API key",
                      "type" : "MissingApiKeyException"
                    }
                  },
                  "invalidApiKey" : {
                    "summary" : "Invalid API key",
                    "value" : {
                      "code" : 9,
                      "message" : "Invalid API Key",
                      "type" : "InvalidApiKeyException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403" : {
            "description" : "Forbidden — the account does not have the required role.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "forbidden" : {
                    "summary" : "Insufficient role",
                    "value" : {
                      "code" : 6,
                      "message" : "Current role [USER], missing role [ADMIN, TEMPLATE_ADMIN]",
                      "type" : "ForbiddenException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502" : {
            "description" : "Unreadable LinkMobility response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "providerResponse" : {
                    "summary" : "Unreadable LinkMobility response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read LinkMobility response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters" : [ ]
      }
    },
    "/api/services/send-otp" : {
      "post" : {
        "summary" : "Send a WhatsApp OTP message",
        "description" : "Sends a one-time password (OTP) via WhatsApp using a pre-approved authentication template. See [Send an OTP message](https://docs.namirial.app/products/whatsapp/enterprise-documentation/developer-documentation/api-references/send-message-apis/send-otp) for details.",
        "operationId" : "sendWhatsAppOtp",
        "tags" : [ "Services" ],
        "requestBody" : {
          "description" : "WhatsApp OTP request",
          "content" : {
            "application/json" : {
              "example" : {
                "to" : "+390000000000",
                "language" : "it",
                "templateId" : 1,
                "otp" : "123456",
                "reference" : {
                  "service" : "DIGITALSIGN",
                  "action" : "2FA",
                  "key" : "ext-key-002"
                }
              },
              "schema" : {
                "$ref" : "#/components/schemas/SendOtpRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "OTP message sent successfully.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/SendResponse"
                },
                "example" : {
                  "messageId" : "3425151601"
                }
              }
            }
          },
          "400" : {
            "description" : "Invalid request — missing or malformed parameters.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidTemplateId" : {
                    "summary" : "Invalid template ID",
                    "value" : {
                      "code" : 3,
                      "message" : "Template ID not valid",
                      "type" : "ConstraintViolationException"
                    }
                  },
                  "missingOtp" : {
                    "summary" : "Missing OTP code",
                    "value" : {
                      "code" : 3,
                      "message" : "Parameter 'otp' must not be empty",
                      "type" : "ConstraintViolationException"
                    }
                  },
                  "wrongNumber" : {
                    "summary" : "Wrong destination number",
                    "value" : {
                      "code" : 8,
                      "message" : "NO_VALID_RECIPIENT",
                      "type" : "WrongNumberException"
                    }
                  },
                  "templateNotFound" : {
                    "summary" : "Template not found",
                    "value" : {
                      "code" : 7,
                      "message" : "Invalid template",
                      "type" : "InvalidTemplateException"
                    }
                  },
                  "unknownField" : {
                    "summary" : "Unknown field in request body",
                    "value" : {
                      "code" : 3,
                      "message" : "Unknown field in request body",
                      "type" : "UnrecognizedPropertyException"
                    }
                  },
                  "invalidBody" : {
                    "summary" : "Invalid request body (e.g. wrong field type)",
                    "value" : {
                      "code" : 3,
                      "message" : "Invalid request body",
                      "type" : "InvalidFormatException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidCredentials" : {
                    "summary" : "Invalid credentials",
                    "value" : {
                      "code" : 1,
                      "message" : "Invalid credentials",
                      "type" : "AuthenticationFailedException"
                    }
                  },
                  "missingApiKey" : {
                    "summary" : "Missing API key",
                    "value" : {
                      "code" : 9,
                      "message" : "Missing API key",
                      "type" : "MissingApiKeyException"
                    }
                  },
                  "invalidApiKey" : {
                    "summary" : "Invalid API key",
                    "value" : {
                      "code" : 9,
                      "message" : "Invalid API Key",
                      "type" : "InvalidApiKeyException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502" : {
            "description" : "Unreadable LinkMobility response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "providerResponse" : {
                    "summary" : "Unreadable LinkMobility response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read LinkMobility response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters" : [ ]
      }
    },
    "/api/template/create" : {
      "post" : {
        "summary" : "Create a template",
        "description" : "Creates a new WhatsApp message template. Templates must be approved by WhatsApp before they can be used for sending messages.",
        "operationId" : "createTemplate",
        "tags" : [ "Template" ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateTemplateRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "Template created successfully."
          },
          "400" : {
            "description" : "Invalid request.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidCategory" : {
                    "summary" : "Invalid category",
                    "value" : {
                      "type" : "ConstraintViolationException",
                      "code" : 3,
                      "message" : "Allowed category are: UTILITY, MARKETING",
                      "errorDetails" : [ {
                        "field" : "createTemplate.template.validCategory",
                        "message" : "Allowed category are: UTILITY, MARKETING"
                      } ]
                    }
                  },
                  "unknownField" : {
                    "summary" : "Unknown field in request body",
                    "value" : {
                      "code" : 3,
                      "message" : "Unknown field in request body",
                      "type" : "UnrecognizedPropertyException"
                    }
                  },
                  "invalidBody" : {
                    "summary" : "Invalid request body (e.g. wrong field type)",
                    "value" : {
                      "code" : 3,
                      "message" : "Invalid request body",
                      "type" : "InvalidFormatException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials."
          },
          "403" : {
            "description" : "Forbidden — the account is not authorized to perform this operation."
          },
          "502" : {
            "description" : "Meta API error, or unreadable Meta response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "metaError" : {
                    "summary" : "Meta rejected the template",
                    "value" : {
                      "code" : 13,
                      "message" : "Template rejected",
                      "type" : "MetaTemplateException"
                    }
                  },
                  "providerResponse" : {
                    "summary" : "Unreadable Meta response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read Meta response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          }
        },
        "parameters" : [ ]
      }
    },
    "/api/template/{templateId}" : {
      "delete" : {
        "summary" : "Remove a language to a template",
        "description" : "Remove a language variant to an existing template.",
        "operationId" : "removeTemplateLanguage",
        "tags" : [ "Template" ],
        "parameters" : [ {
          "$ref" : "#/components/parameters/TemplateIdPath"
        }, {
          "description" : "Language code of the template (e.g. `it`, `en`).",
          "in" : "query",
          "name" : "language",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Language removed successfully."
          },
          "400" : {
            "description" : "Invalid request.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidLanguage" : {
                    "summary" : "Language code not supported",
                    "value" : {
                      "code" : 3,
                      "message" : "Invalid language code",
                      "type" : "ConstraintViolationException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials."
          },
          "403" : {
            "description" : "Forbidden — the account is not authorized to perform this operation."
          },
          "404" : {
            "description" : "Template not found, or language not present on the template.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "templateNotFound" : {
                    "summary" : "Template not found",
                    "value" : {
                      "code" : 7,
                      "message" : "Template not found",
                      "type" : "InvalidTemplateException"
                    }
                  },
                  "languageDoesNotExist" : {
                    "summary" : "Language not present on template",
                    "value" : {
                      "code" : 14,
                      "message" : "The language 'en' does not exists for template '61'",
                      "type" : "InvalidLanguageException404"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          },
          "502" : {
            "description" : "Meta API error, or unreadable Meta response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "metaError" : {
                    "summary" : "Meta rejected the deletion",
                    "value" : {
                      "code" : 13,
                      "message" : "Template deletion rejected",
                      "type" : "MetaTemplateException"
                    }
                  },
                  "providerResponse" : {
                    "summary" : "Unreadable Meta response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read Meta response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get" : {
        "summary" : "Get a template",
        "description" : "Retrieves a specific template by its ID and language.",
        "operationId" : "getTemplate",
        "tags" : [ "Template" ],
        "parameters" : [ {
          "description" : "Language code of the template (e.g. `it`, `en`). If omitted, the template's default language is returned.",
          "in" : "query",
          "name" : "language",
          "required" : false,
          "schema" : {
            "type" : [ "string", "null" ],
            "example" : "it"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "Template retrieved successfully.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "authenticationTemplate" : {
                    "summary" : "Authentication template",
                    "value" : {
                      "body" : {
                        "parameters" : [ {
                          "text" : "123456"
                        } ],
                        "text" : "*{{1}}* è il tuo codice di verifica. Per garantire la tua sicurezza, ti consigliamo di non condividere questo codice."
                      },
                      "category" : "AUTHENTICATION",
                      "default" : false,
                      "description" : "auth",
                      "footer" : {
                        "codeExpirationMinutes" : 10,
                        "text" : "Scade tra 10 minuti."
                      },
                      "language" : "it",
                      "name" : "authentication_template",
                      "status" : "APPROVED",
                      "templateId" : "1",
                      "urlButtons" : [ {
                        "index" : 0,
                        "text" : "Copia codice",
                        "url" : "https://www.whatsapp.com/otp/code/?otp_type=COPY_CODE&code_expiration_minutes=10&code=otp{{1}}",
                        "urlPath" : "123456"
                      } ]
                    }
                  },
                  "utilityTemplate" : {
                    "summary" : "Utility template",
                    "value" : {
                      "body" : {
                        "text" : "Questa notifica conferma che il plugin è stato configurato correttamente."
                      },
                      "category" : "UTILITY",
                      "default" : false,
                      "description" : "Test notification",
                      "language" : "it",
                      "name" : "example_utility_template",
                      "status" : "APPROVED",
                      "templateId" : "2",
                      "textHeader" : {
                        "text" : "Notifica di prova"
                      },
                      "urlButtons" : [ ]
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/Template"
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidCredentials" : {
                    "summary" : "Invalid credentials",
                    "value" : {
                      "code" : 1,
                      "message" : "Invalid credentials",
                      "type" : "AuthenticationFailedException"
                    }
                  },
                  "missingApiKey" : {
                    "summary" : "Missing API key",
                    "value" : {
                      "code" : 9,
                      "message" : "Missing API key",
                      "type" : "MissingApiKeyException"
                    }
                  },
                  "invalidApiKey" : {
                    "summary" : "Invalid API key",
                    "value" : {
                      "code" : 9,
                      "message" : "Invalid API Key",
                      "type" : "InvalidApiKeyException"
                    }
                  }
                }
              }
            }
          },
          "403" : {
            "description" : "Forbidden — the account does not have the required role.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "forbidden" : {
                    "summary" : "Insufficient role",
                    "value" : {
                      "code" : 6,
                      "message" : "Current role [USER], missing role [ADMIN, TEMPLATE_ADMIN]",
                      "type" : "ForbiddenException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404" : {
            "description" : "Template not found, or language not present on the template.",
            "content" : {
              "application/json" : {
                "example" : {
                  "type" : "UnavailableTemplateException",
                  "code" : 7,
                  "message" : "Invalid template"
                }
              }
            }
          },
          "502" : {
            "description" : "Unreadable Meta response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "providerResponse" : {
                    "summary" : "Unreadable Meta response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read Meta response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post" : {
        "summary" : "Edit a template",
        "description" : "Apply changes to an existing template.",
        "operationId" : "editTemplate",
        "tags" : [ "Template" ],
        "requestBody" : {
          "description" : "",
          "content" : {
            "application/json" : {
              "example" : {
                "body" : {
                  "parameters" : [ {
                    "text" : "string"
                  } ],
                  "text" : "string"
                },
                "category" : "UTILITY",
                "description" : "sign a doc using a link",
                "footer" : {
                  "codeExpirationMinutes" : 1073741824,
                  "text" : "string"
                },
                "language" : "en",
                "name" : "signature_template",
                "textHeader" : {
                  "text" : "string"
                },
                "urlButtons" : [ {
                  "index" : 1073741824,
                  "text" : "string",
                  "url" : "string",
                  "urlPath" : "string"
                } ]
              },
              "schema" : {
                "$ref" : "#/components/schemas/CreateTemplateRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "Language added successfully."
          },
          "400" : {
            "description" : "Invalid request.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidLanguage" : {
                    "summary" : "Language not supported by Meta",
                    "value" : {
                      "code" : 12,
                      "message" : "Invalid parameter",
                      "type" : "ClientWebApplicationException"
                    }
                  },
                  "unknownField" : {
                    "summary" : "Unknown field in request body",
                    "value" : {
                      "code" : 3,
                      "message" : "Unknown field in request body",
                      "type" : "UnrecognizedPropertyException"
                    }
                  },
                  "invalidBody" : {
                    "summary" : "Invalid request body (e.g. wrong field type)",
                    "value" : {
                      "code" : 3,
                      "message" : "Invalid request body",
                      "type" : "InvalidFormatException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials."
          },
          "403" : {
            "description" : "Forbidden — the account is not authorized to perform this operation."
          },
          "404" : {
            "description" : "Template not found.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example" : {
                    "value" : {
                      "code" : 7,
                      "message" : "Template not found",
                      "type" : "InvalidTemplateException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          },
          "502" : {
            "description" : "Meta API error, or unreadable Meta response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "metaError" : {
                    "summary" : "Meta rejected the edit",
                    "value" : {
                      "code" : 13,
                      "message" : "Template edit rejected",
                      "type" : "MetaTemplateException"
                    }
                  },
                  "providerResponse" : {
                    "summary" : "Unreadable Meta response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read Meta response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "parameters" : [ {
        "$ref" : "#/components/parameters/TemplateIdPath"
      } ]
    },
    "/api/template/{templateId}/all" : {
      "delete" : {
        "summary" : "Remove a template and all its languages",
        "description" : "Removes a template and all its language variants.",
        "operationId" : "removeTemplate",
        "tags" : [ "Template" ],
        "parameters" : [ {
          "$ref" : "#/components/parameters/TemplateIdPath"
        } ],
        "responses" : {
          "200" : {
            "description" : "Template removed successfully."
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials."
          },
          "403" : {
            "description" : "Forbidden — the account is not authorized to perform this operation."
          },
          "404" : {
            "description" : "Template not found.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "example" : {
                    "value" : {
                      "code" : 7,
                      "message" : "Template not found",
                      "type" : "InvalidTemplateException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          },
          "502" : {
            "description" : "Meta API error, or unreadable Meta response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "metaError" : {
                    "summary" : "Meta rejected the deletion",
                    "value" : {
                      "code" : 13,
                      "message" : "Template deletion rejected",
                      "type" : "MetaTemplateException"
                    }
                  },
                  "providerResponse" : {
                    "summary" : "Unreadable Meta response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read Meta response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/template/{templateId}/language" : {
      "post" : {
        "summary" : "Add a language to a template",
        "description" : "Adds a new language variant to an existing template.",
        "operationId" : "addTemplateLanguage",
        "tags" : [ "Template" ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/AddLanguageRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "Language added successfully."
          },
          "400" : {
            "description" : "Invalid request.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "invalidLanguage" : {
                    "summary" : "Language code not supported",
                    "value" : {
                      "code" : 3,
                      "message" : "Invalid language code",
                      "type" : "ConstraintViolationException"
                    }
                  },
                  "unknownField" : {
                    "summary" : "Unknown field in request body",
                    "value" : {
                      "code" : 3,
                      "message" : "Unknown field in request body",
                      "type" : "UnrecognizedPropertyException"
                    }
                  },
                  "invalidBody" : {
                    "summary" : "Invalid request body (e.g. wrong field type)",
                    "value" : {
                      "code" : 3,
                      "message" : "Invalid request body",
                      "type" : "InvalidFormatException"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials."
          },
          "403" : {
            "description" : "Forbidden — the account is not authorized to perform this operation."
          },
          "404" : {
            "description" : "Template not found.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                },
                "example" : {
                  "type" : "UnavailableTemplateException",
                  "code" : 7,
                  "message" : "Template not found"
                }
              }
            }
          },
          "409" : {
            "description" : "Language already present on the template.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "languageExists" : {
                    "summary" : "Language already exists",
                    "value" : {
                      "code" : 14,
                      "message" : "The language 'en' already exists for template '61'",
                      "type" : "InvalidLanguageConflictException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          },
          "502" : {
            "description" : "Meta API error, or unreadable Meta response.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "metaError" : {
                    "summary" : "Meta rejected the language addition",
                    "value" : {
                      "code" : 13,
                      "message" : "Template rejected",
                      "type" : "MetaTemplateException"
                    }
                  },
                  "providerResponse" : {
                    "summary" : "Unreadable Meta response",
                    "value" : {
                      "code" : 15,
                      "message" : "Unable to read Meta response",
                      "type" : "ProviderResponseException"
                    }
                  }
                },
                "schema" : {
                  "type" : "object",
                  "required" : [ "type", "message" ],
                  "description" : "Error response returned when a request fails.",
                  "properties" : {
                    "type" : {
                      "type" : "string",
                      "description" : "Exception type identifier."
                    },
                    "code" : {
                      "type" : "integer",
                      "format" : "int32",
                      "description" : "Numeric error code. See [Error codes](https://docs.namirial.app/products/whatsapp/) for the full list."
                    },
                    "message" : {
                      "type" : "string",
                      "description" : "Human-readable error description."
                    },
                    "errorDetails" : {
                      "type" : [ "array", "null" ],
                      "items" : {
                        "type" : "object",
                        "required" : [ "field", "message" ],
                        "properties" : {
                          "field" : {
                            "type" : "string",
                            "description" : "The field that failed validation."
                          },
                          "message" : {
                            "type" : "string",
                            "description" : "Validation error message."
                          }
                        }
                      },
                      "description" : "Additional validation error details, present on constraint violations."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "parameters" : [ {
        "$ref" : "#/components/parameters/TemplateIdPath"
      } ]
    },
    "/api/template/{templateId}/languages" : {
      "get" : {
        "summary" : "Get all template languages",
        "description" : "Returns all available language variants for a specific template.",
        "operationId" : "getTemplateLanguages",
        "tags" : [ "Template" ],
        "responses" : {
          "200" : {
            "description" : "List of template languages retrieved successfully.",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "type" : "string"
                  },
                  "example" : [ "de", "en", "fr", "it" ]
                }
              }
            }
          },
          "401" : {
            "description" : "Authentication failed — invalid or missing credentials."
          },
          "403" : {
            "description" : "Forbidden — the account does not have the required role.",
            "content" : {
              "application/json" : {
                "examples" : {
                  "forbidden" : {
                    "summary" : "Insufficient role",
                    "value" : {
                      "type" : "ForbiddenException",
                      "code" : 6,
                      "message" : "Current role [USER], missing role [ADMIN, TEMPLATE_ADMIN]"
                    }
                  }
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404" : {
            "description" : "Template not found.",
            "content" : {
              "application/json" : {
                "example" : {
                  "type" : "UnavailableTemplateException",
                  "code" : 7,
                  "message" : "Invalid template"
                },
                "schema" : {
                  "$ref" : "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "parameters" : [ {
        "$ref" : "#/components/parameters/TemplateIdPath"
      } ]
    }
  },
  "info" : {
    "title" : "Namirial WhatsApp Gateway API",
    "version" : "2.2.0.6",
    "description" : "API for sending WhatsApp messages via the Namirial WhatsApp Gateway. Supports template-based messaging, OTP delivery, and template management.\n\nAuthentication requires both Basic Auth credentials and an API key header (`X-Api-Key`). See the [Authentication](#section/Authentication) section for details."
  },
  "externalDocs" : {
    "description" : "Namirial WhatsApp Gateway documentation",
    "url" : "https://docs.namirial.app/products/whatsapp/"
  },
  "security" : [ {
    "basicAuth" : [ ],
    "ApiKeyAuth" : [ ]
  } ]
}