{
  "openapi": "3.1.0",
  "info": {
    "title": "WizMessage API",
    "version": "1.0.0",
    "summary": "Send and receive WhatsApp messages from your own software.",
    "description": "The WizMessage API sends and receives messages of a WhatsApp Business number that is connected to WizMessage. It needs a Wiz Bot or Wiz Pro plan and an API key from API Management. WhatsApp is a trademark of Meta. WizMessage is not made, sponsored or endorsed by Meta or WhatsApp.",
    "contact": {
      "name": "Beth Technologies",
      "url": "https://wizmessage.com/contact",
      "email": "info@bethtechnologies.com"
    },
    "termsOfService": "https://wizmessage.com/pages/terms-conditions"
  },
  "servers": [
    {
      "url": "https://wizmessage.com/api/v1/external"
    }
  ],
  "tags": [
    {
      "name": "Messages",
      "description": "Send messages and look up their status."
    },
    {
      "name": "Media",
      "description": "Upload files to send, and download files that customers sent."
    },
    {
      "name": "Templates",
      "description": "Read the approved templates of the connected account."
    }
  ],
  "security": [
    {
      "ApiKey": []
    },
    {
      "BearerKey": []
    }
  ],
  "paths": {
    "/messages/text": {
      "post": {
        "operationId": "sendText",
        "tags": ["Messages"],
        "summary": "Send a text message",
        "description": "A free-form text. WhatsApp delivers it only within 24 hours of the last message from the customer; this API does not check that for you.",
        "x-permission": "send_text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "message"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format, with the plus sign."
                  },
                  "message": {
                    "type": "string",
                    "description": "The text.",
                    "minLength": 1,
                    "maxLength": 4096
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              },
              "example": {
                "to": "+447700900123",
                "message": "Your parcel is ready to collect.",
                "reference": "order-1042"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/messages/media": {
      "post": {
        "operationId": "sendMedia",
        "tags": ["Messages"],
        "summary": "Send a document, image, video or audio file",
        "description": "Give a `media_id` from an upload or a public `link`; with both, the `media_id` is used. Free-form, so the 24-hour rule of text messages applies.",
        "x-permission": "send_media",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "type"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format, with the plus sign."
                  },
                  "type": {
                    "type": "string",
                    "enum": ["document", "image", "video", "audio"],
                    "description": "What the file is."
                  },
                  "media_id": {
                    "type": "string",
                    "description": "Media id from `POST /media/upload`.",
                    "minLength": 1
                  },
                  "link": {
                    "type": "string",
                    "description": "Public address that WhatsApp can fetch.",
                    "format": "uri"
                  },
                  "caption": {
                    "type": "string",
                    "description": "Text under the file. Not for audio.",
                    "maxLength": 1024
                  },
                  "filename": {
                    "type": "string",
                    "description": "Name shown to the customer. Documents only.",
                    "maxLength": 240
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                },
                "anyOf": [
                  {
                    "required": ["media_id"]
                  },
                  {
                    "required": ["link"]
                  }
                ]
              },
              "example": {
                "to": "+447700900123",
                "type": "document",
                "link": "https://example.com/invoice-1042.pdf",
                "filename": "Invoice 1042.pdf",
                "caption": "Your invoice",
                "reference": "invoice-1042"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/messages/template/send": {
      "post": {
        "operationId": "sendTemplate",
        "tags": ["Messages"],
        "summary": "Send an approved template",
        "description": "The recommended way to send a template: you pass your own variable names, as set up for the key in API Management. A template can start or reopen a conversation at any time.",
        "x-permission": "send_template",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "template_name", "language", "variables"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format, with the plus sign."
                  },
                  "template_name": {
                    "type": "string",
                    "description": "Name of the approved template.",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "language": {
                    "type": "string",
                    "description": "Language of the template, for example `en`.",
                    "minLength": 2,
                    "maxLength": 10
                  },
                  "variables": {
                    "type": "object",
                    "maxProperties": 50,
                    "description": "Your values by variable name. A text, a number, true or false, or a location with `latitude` and `longitude`. May be empty.",
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 4096
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "$ref": "#/components/schemas/Location"
                        }
                      ]
                    }
                  },
                  "header_filename": {
                    "type": "string",
                    "description": "File name of a document header.",
                    "maxLength": 400
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              },
              "example": {
                "to": "+447700900123",
                "template_name": "appointment_reminder",
                "language": "en",
                "variables": {
                  "customer_name": "Riya",
                  "appointment_date": "14 December, 11:30"
                },
                "reference": "booking-2026-1214"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The template is not set up for this key, or a variable is missing or wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/messages/template": {
      "post": {
        "operationId": "sendTemplateComponents",
        "tags": ["Messages"],
        "summary": "Send an approved template with raw components",
        "description": "For callers that already build template components themselves. Named variables are not supported here; use `/messages/template/send` for those.",
        "x-permission": "send_template",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "template_name", "language"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format, with the plus sign."
                  },
                  "template_name": {
                    "type": "string",
                    "description": "Name of the approved template.",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "language": {
                    "type": "string",
                    "description": "Language of the template, for example `en`.",
                    "minLength": 2,
                    "maxLength": 10
                  },
                  "header_filename": {
                    "type": "string",
                    "description": "Accepted, not used by this call.",
                    "maxLength": 400
                  },
                  "components": {
                    "type": "array",
                    "description": "Header, body and button values in the format of the WhatsApp Business Platform. See the link of this operation.",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              },
              "example": {
                "to": "+447700900123",
                "template_name": "order_update",
                "language": "en",
                "components": [
                  {
                    "type": "body",
                    "parameters": [
                      {
                        "type": "text",
                        "text": "Riya"
                      }
                    ]
                  }
                ],
                "reference": "order-1042"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The template is not set up for this key, or a variable is missing or wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        },
        "externalDocs": {
          "description": "Template components on the WhatsApp Business Platform",
          "url": "https://developers.facebook.com/docs/whatsapp"
        }
      }
    },
    "/messages/interactive/list": {
      "post": {
        "operationId": "sendList",
        "tags": ["Messages"],
        "summary": "Send a list to choose from",
        "description": "A message with a button that opens a list. The choice arrives as a message of the customer.",
        "x-permission": "send_text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "body", "button", "sections"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format, with the plus sign."
                  },
                  "header": {
                    "type": "string",
                    "description": "Short line above the text.",
                    "maxLength": 60
                  },
                  "body": {
                    "type": "string",
                    "description": "The text.",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "footer": {
                    "type": "string",
                    "description": "Small line below the text.",
                    "maxLength": 60
                  },
                  "button": {
                    "type": "string",
                    "description": "Label of the button that opens the list.",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "sections": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "$ref": "#/components/schemas/ListSection"
                    }
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              },
              "example": {
                "to": "+447700900123",
                "body": "When shall we deliver?",
                "button": "Choose a time",
                "sections": [
                  {
                    "title": "Tomorrow",
                    "rows": [
                      {
                        "id": "slot-am",
                        "title": "9:00 to 12:00"
                      },
                      {
                        "id": "slot-pm",
                        "title": "13:00 to 17:00",
                        "description": "Ring the bell"
                      }
                    ]
                  }
                ],
                "reference": "delivery-77"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/messages/interactive/button": {
      "post": {
        "operationId": "sendButtons",
        "tags": ["Messages"],
        "summary": "Send up to three reply buttons",
        "description": "A message with reply buttons. The choice arrives as a message of the customer.",
        "x-permission": "send_text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "body", "buttons"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format, with the plus sign."
                  },
                  "header": {
                    "$ref": "#/components/schemas/ButtonHeader"
                  },
                  "body": {
                    "type": "string",
                    "description": "The text.",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "footer": {
                    "type": "string",
                    "description": "Small line below the text.",
                    "maxLength": 60
                  },
                  "buttons": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 3,
                    "items": {
                      "$ref": "#/components/schemas/ReplyButton"
                    }
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              },
              "example": {
                "to": "+447700900123",
                "body": "Shall we confirm your visit?",
                "buttons": [
                  {
                    "id": "yes",
                    "title": "Yes"
                  },
                  {
                    "id": "no",
                    "title": "No"
                  }
                ],
                "reference": "visit-31"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/messages/contacts": {
      "post": {
        "operationId": "sendContacts",
        "tags": ["Messages"],
        "summary": "Send contact cards",
        "description": "One to ten cards. Free-form, so the 24-hour rule of text messages applies. Fields we do not know are dropped.",
        "x-permission": "send_text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "contacts"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+?[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format. Here the plus sign may be left out."
                  },
                  "contacts": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "$ref": "#/components/schemas/Contact"
                    }
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              },
              "example": {
                "to": "+447700900123",
                "contacts": [
                  {
                    "name": {
                      "formatted_name": "Riya Example",
                      "first_name": "Riya"
                    },
                    "phones": [
                      {
                        "phone": "+447700900456",
                        "type": "WORK",
                        "wa_id": "447700900456"
                      }
                    ],
                    "emails": [
                      {
                        "email": "riya@example.com",
                        "type": "WORK"
                      }
                    ],
                    "org": {
                      "company": "Example Shop",
                      "title": "Support"
                    }
                  }
                ],
                "reference": "ticket-88214"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/messages/reaction": {
      "post": {
        "operationId": "sendReaction",
        "tags": ["Messages"],
        "summary": "React to a message with an emoji",
        "description": "Another emoji replaces the reaction. Removing one is not possible at the moment: an empty emoji is answered with 422. WhatsApp accepts reactions to messages of the last 30 days.",
        "x-permission": "send_text",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["to", "message_id", "emoji"],
                "properties": {
                  "to": {
                    "type": "string",
                    "pattern": "^\\+[1-9]\\d{1,14}$",
                    "minLength": 10,
                    "maxLength": 20,
                    "description": "The recipient in international format, with the plus sign."
                  },
                  "message_id": {
                    "type": "string",
                    "description": "The WhatsApp id (`whatsapp_message_id`) of the message, not our uuid.",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "emoji": {
                    "type": "string",
                    "description": "One emoji.",
                    "minLength": 1,
                    "maxLength": 16
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              },
              "example": {
                "to": "+447700900123",
                "message_id": "wamid.EXAMPLE-INBOUND-1",
                "emoji": "👍",
                "reference": "order-1042"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted by WhatsApp.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "status": "sent"
                  },
                  "meta": {
                    "request_id": "b1e6a2c4-1111-4222-8333-944455566677",
                    "rate_limit": {
                      "limit": 60,
                      "remaining": 59,
                      "reset_at": "2026-11-25T10:01:00.000Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/messages/{uuid}": {
      "get": {
        "operationId": "getMessage",
        "tags": ["Messages"],
        "summary": "Look up a message",
        "description": "The state of a message that this key sent.",
        "x-permission": null,
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "The `message_id` of the send answer (our uuid).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "message_id": "0b9d7c1e-2f4a-4c55-9a5e-6a1f0c2d3e4f",
                    "status": "delivered",
                    "recipient": "+447700900123",
                    "type": "text",
                    "reference": "order-1042",
                    "template_name": null,
                    "whatsapp_message_id": "wamid.EXAMPLE-SENT-1",
                    "sent_at": "2026-11-25T10:00:01.000+00:00",
                    "delivered_at": "2026-11-25T10:00:03.000+00:00",
                    "read_at": null,
                    "error": null,
                    "created_at": "2026-11-25T10:00:00.000+00:00"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No message with this id was sent with this key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/media/upload": {
      "post": {
        "operationId": "uploadMedia",
        "tags": ["Media"],
        "summary": "Upload a file",
        "description": "Returns a media id that can be sent for 30 days. A signed request signs only the text fields here, not the file.",
        "x-permission": null,
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["file"],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file."
                  },
                  "media_type": {
                    "type": "string",
                    "enum": ["document", "image", "video", "audio"],
                    "description": "Found from the file when left out."
                  },
                  "filename": {
                    "type": "string",
                    "description": "Accepted, not used.",
                    "maxLength": 255
                  },
                  "reference": {
                    "type": "string",
                    "description": "Your own id for this send. It comes back in webhooks and in the status.",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The upload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "media_id": "100000000000003",
                    "original_filename": "invoice-1042.pdf",
                    "size": 48213,
                    "mime_type": "application/pdf",
                    "media_type": "document",
                    "expires_at": "2026-12-25T10:00:00.000+00:00",
                    "messaging_product": "whatsapp"
                  }
                }
              }
            }
          },
          "400": {
            "description": "No file, a type that is not supported, or a file that is too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/media/{media_id}": {
      "get": {
        "operationId": "downloadMedia",
        "tags": ["Media"],
        "summary": "Download a file",
        "description": "The file itself, for a media id from an inbound webhook (7 days) or from an upload (30 days). At most 32 MB. Errors are JSON.",
        "x-permission": "view_messages",
        "parameters": [
          {
            "name": "media_id",
            "in": "path",
            "required": true,
            "description": "The media id.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The bytes of the file, with its content type.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Not a media id, or the connected account is not ready.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Unknown, expired, or not of this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Larger than 32 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/templates": {
      "get": {
        "operationId": "listTemplates",
        "tags": ["Templates"],
        "summary": "List templates",
        "description": "The templates of the connected account, with their status.",
        "x-permission": "view_templates",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "How many to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The templates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateListResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    },
    "/templates/{name}": {
      "get": {
        "operationId": "getTemplate",
        "tags": ["Templates"],
        "summary": "Read one template",
        "description": "One template by name. With several languages, the first match.",
        "x-permission": "view_templates",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Template name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The template.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No template with this name.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/Refused"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "500": {
            "$ref": "#/components/responses/Unexpected"
          }
        }
      }
    }
  },
  "webhooks": {
    "message.received": {
      "post": {
        "summary": "A customer wrote to you",
        "description": "Sent only while the number forwards its messages to your webhook (Webhook forwarding as its bot). `to` is empty today. Buttons and lists arrive as text.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "version": 1,
                "event": "message.received",
                "timestamp": "2026-11-25T10:00:00.000+00:00",
                "data": {
                  "message_id": "wamid.EXAMPLE-INBOUND-1",
                  "to": "",
                  "message": {
                    "type": "text",
                    "text": {
                      "body": "Where is my order?"
                    }
                  },
                  "from": "447700900123",
                  "contact": {
                    "name": "Riya",
                    "wa_id": "447700900123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "message.sent": {
      "post": {
        "summary": "A message was sent from your number",
        "description": "From this API, the app, the inbox or an AI agent; `source` says which.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "version": 1,
                "event": "message.sent",
                "timestamp": "2026-11-25T10:00:01.000+00:00",
                "data": {
                  "message_id": "wamid.EXAMPLE-SENT-1",
                  "to": "447700900123",
                  "from": "447700900456",
                  "source": "api",
                  "reference": "order-1042",
                  "message": {
                    "type": "text",
                    "text": {
                      "body": "Your parcel is ready to collect."
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "message.delivered": {
      "post": {
        "summary": "A message was delivered",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "version": 1,
                "event": "message.delivered",
                "timestamp": "2026-11-25T10:00:03.000+00:00",
                "data": {
                  "message_id": "wamid.EXAMPLE-SENT-1",
                  "provider_message_id": "wamid.EXAMPLE-SENT-1",
                  "reference": "order-1042",
                  "status": "delivered",
                  "recipient": "447700900123",
                  "delivered_at": "2026-11-25T10:00:03.000+00:00"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "message.read": {
      "post": {
        "summary": "A message was read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "version": 1,
                "event": "message.read",
                "timestamp": "2026-11-25T10:05:00.000+00:00",
                "data": {
                  "message_id": "wamid.EXAMPLE-SENT-1",
                  "status": "read",
                  "recipient": "447700900123",
                  "reference": "order-1042",
                  "read_at": "2026-11-25T10:05:00.000+00:00"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "message.failed": {
      "post": {
        "summary": "A message could not be delivered",
        "description": "After acceptance, `message_id` is the WhatsApp id. If WhatsApp never accepted the message, it is our uuid.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "version": 1,
                "event": "message.failed",
                "timestamp": "2026-11-25T10:00:04.000+00:00",
                "data": {
                  "message_id": "wamid.EXAMPLE-SENT-1",
                  "status": "failed",
                  "recipient": "447700900123",
                  "reference": "order-1042",
                  "error": {
                    "code": "MESSAGE_SEND_FAILED",
                    "message": "The message could not be delivered."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    },
    "message.reaction": {
      "post": {
        "summary": "Somebody reacted to a message",
        "description": "`direction` says who: `inbound` is the customer. A removed reaction has an empty emoji.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEvent"
              },
              "example": {
                "version": 1,
                "event": "message.reaction",
                "timestamp": "2026-11-25T10:06:00.000+00:00",
                "data": {
                  "message_id": "wamid.EXAMPLE-REACTION-1",
                  "direction": "inbound",
                  "from": "447700900123",
                  "to": "447700900456",
                  "reaction": {
                    "message_id": "wamid.EXAMPLE-SENT-1",
                    "emoji": "👍",
                    "action": "added"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer with any 2xx within 10 seconds."
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "Unauthorized": {
        "description": "The key, the signature or the timestamp is not valid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks the permission, the plan has ended, or the address is not allowed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Refused": {
        "description": "A field is wrong, or WhatsApp refused the message. Do not send it again unchanged.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "TooMany": {
        "description": "A limit is reached, or WhatsApp slows the number down. Try again later.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unexpected": {
        "description": "Something unexpected failed.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The full key (`pk_live_…`). New keys also need `X-Timestamp` (Unix seconds, at most 5 minutes off) and `X-API-Signature`: the lowercase hex HMAC-SHA256 of `timestamp + \".\" + body`, keyed with the lowercase hex SHA-256 of the key secret. A GET signs `timestamp.`; an upload signs `timestamp.` and its text fields as JSON. The requirement can be switched off per key."
      },
      "BearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "The same key as `Authorization: Bearer`. The signature rules stay the same."
      }
    },
    "schemas": {
      "SendResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "data": {
            "type": "object",
            "properties": {
              "message_id": {
                "type": "string",
                "description": "Our uuid. Use it with `GET /messages/{uuid}`.",
                "format": "uuid"
              },
              "whatsapp_message_id": {
                "type": "string",
                "description": "WhatsApp’s id. Webhooks carry this one as `data.message_id`."
              },
              "status": {
                "type": "string",
                "enum": ["queued", "processing", "sent", "delivered", "read", "failed"]
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "data": {
            "type": "object",
            "properties": {
              "message_id": {
                "type": "string",
                "description": "Our uuid.",
                "format": "uuid"
              },
              "status": {
                "type": "string",
                "enum": ["queued", "processing", "sent", "delivered", "read", "failed"]
              },
              "recipient": {
                "type": "string",
                "description": "The number."
              },
              "type": {
                "type": "string",
                "description": "What was sent."
              },
              "reference": {
                "type": ["string", "null"],
                "description": "Your own id."
              },
              "template_name": {
                "type": ["string", "null"],
                "description": "The template, if one was sent."
              },
              "whatsapp_message_id": {
                "type": ["string", "null"],
                "description": "WhatsApp’s id."
              },
              "sent_at": {
                "type": ["string", "null"],
                "format": "date-time"
              },
              "delivered_at": {
                "type": ["string", "null"],
                "format": "date-time"
              },
              "read_at": {
                "type": ["string", "null"],
                "format": "date-time"
              },
              "error": {
                "type": ["object", "null"],
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Error code."
                  },
                  "message": {
                    "type": "string",
                    "description": "What happened."
                  }
                }
              },
              "created_at": {
                "type": "string",
                "description": "When the call arrived.",
                "format": "date-time"
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "UploadResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "data": {
            "type": "object",
            "properties": {
              "media_id": {
                "type": "string",
                "description": "Use it as `media_id`."
              },
              "original_filename": {
                "type": "string",
                "description": "Name of your file."
              },
              "size": {
                "type": "integer",
                "description": "Bytes."
              },
              "mime_type": {
                "type": "string",
                "description": "Type of the file."
              },
              "media_type": {
                "type": "string",
                "enum": ["document", "image", "video", "audio"]
              },
              "expires_at": {
                "type": "string",
                "description": "Until when the id works.",
                "format": "date-time"
              },
              "messaging_product": {
                "type": "string",
                "description": "Always `whatsapp`."
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "TemplateListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "data": {
            "type": "object",
            "properties": {
              "templates": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Template"
                }
              },
              "paging": {
                "type": "object",
                "additionalProperties": true
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "TemplateResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "data": {
            "$ref": "#/components/schemas/Template"
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Template name."
          },
          "status": {
            "type": "string",
            "description": "For example APPROVED, PENDING or REJECTED."
          },
          "category": {
            "type": "string",
            "description": "For example MARKETING or UTILITY."
          },
          "language": {
            "type": "string",
            "description": "Language of the template."
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "The parts of the template."
          }
        }
      },
      "Meta": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Quote it when you ask support."
          },
          "rate_limit": {
            "type": "object",
            "properties": {
              "limit": {
                "type": "integer",
                "description": "Requests a minute."
              },
              "remaining": {
                "type": "integer",
                "description": "Left in this minute."
              },
              "reset_at": {
                "type": "string",
                "description": "When the count starts again.",
                "format": "date-time"
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": ["string", "integer"],
                "description": "See the error codes. A failed upload can carry a number from WhatsApp."
              },
              "message": {
                "type": "string",
                "description": "What happened, for people."
              },
              "details": {
                "type": "object",
                "additionalProperties": true,
                "description": "More, for example one entry per wrong field."
              }
            }
          },
          "meta": {
            "$ref": "#/components/schemas/Meta"
          }
        },
        "example": {
          "success": false,
          "error": {
            "code": "E_VALIDATION_ERROR",
            "message": "Validation failure: to: The to field format is invalid",
            "details": {
              "to": ["The to field format is invalid"]
            }
          },
          "meta": {
            "request_id": "b1e6a2c4-1111-4222-8333-944455566677"
          }
        }
      },
      "Location": {
        "type": "object",
        "required": ["latitude", "longitude"],
        "properties": {
          "latitude": {
            "type": ["number", "string"]
          },
          "longitude": {
            "type": ["number", "string"]
          },
          "name": {
            "type": "string",
            "description": "Name of the place.",
            "maxLength": 1000
          },
          "address": {
            "type": "string",
            "description": "Address of the place.",
            "maxLength": 1000
          }
        }
      },
      "ListSection": {
        "type": "object",
        "required": ["rows"],
        "properties": {
          "title": {
            "type": "string",
            "description": "Heading of the section.",
            "maxLength": 24
          },
          "rows": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "object",
              "required": ["id", "title"],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Your own id of the row.",
                  "minLength": 1,
                  "maxLength": 200
                },
                "title": {
                  "type": "string",
                  "description": "What the customer sees.",
                  "minLength": 1,
                  "maxLength": 24
                },
                "description": {
                  "type": "string",
                  "description": "Second line.",
                  "maxLength": 72
                }
              }
            }
          }
        }
      },
      "ReplyButton": {
        "type": "object",
        "required": ["id", "title"],
        "properties": {
          "id": {
            "type": "string",
            "description": "Your own id of the button.",
            "minLength": 1,
            "maxLength": 256
          },
          "title": {
            "type": "string",
            "description": "Label.",
            "minLength": 1,
            "maxLength": 20
          }
        }
      },
      "ButtonHeader": {
        "type": "object",
        "required": ["type"],
        "properties": {
          "type": {
            "type": "string",
            "enum": ["text", "image", "video", "document"]
          },
          "text": {
            "type": "string",
            "description": "Header text, for type `text`.",
            "maxLength": 60
          },
          "image": {
            "type": "object",
            "description": "An image: either `id` from an upload or a public `link`.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Media id from `POST /media/upload`."
              },
              "link": {
                "type": "string",
                "description": "Public https address of the file.",
                "format": "uri"
              }
            }
          },
          "video": {
            "type": "object",
            "description": "A video: either `id` from an upload or a public `link`.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Media id from `POST /media/upload`."
              },
              "link": {
                "type": "string",
                "description": "Public https address of the file.",
                "format": "uri"
              }
            }
          },
          "document": {
            "type": "object",
            "description": "A document: either `id` from an upload or a public `link`.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Media id from `POST /media/upload`."
              },
              "link": {
                "type": "string",
                "description": "Public https address of the file.",
                "format": "uri"
              },
              "filename": {
                "type": "string",
                "description": "Name shown to the recipient.",
                "maxLength": 240
              }
            }
          }
        }
      },
      "Contact": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "name": {
            "type": "object",
            "required": ["formatted_name"],
            "properties": {
              "formatted_name": {
                "type": "string",
                "description": "Name on the card.",
                "minLength": 1,
                "maxLength": 255
              },
              "first_name": {
                "type": "string",
                "description": "First name.",
                "maxLength": 255
              },
              "last_name": {
                "type": "string",
                "description": "Last name.",
                "maxLength": 255
              },
              "middle_name": {
                "type": "string",
                "description": "Middle name.",
                "maxLength": 255
              },
              "prefix": {
                "type": "string",
                "description": "For example Dr.",
                "maxLength": 255
              },
              "suffix": {
                "type": "string",
                "description": "For example Jr.",
                "maxLength": 255
              }
            }
          },
          "phones": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "properties": {
                "phone": {
                  "type": "string",
                  "description": "Number on the card.",
                  "maxLength": 50
                },
                "type": {
                  "type": "string",
                  "description": "A label of your choice.",
                  "maxLength": 50
                },
                "wa_id": {
                  "type": "string",
                  "description": "The number in digits. With it, the card has a button to write to that person.",
                  "maxLength": 50
                }
              }
            }
          },
          "emails": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "description": "E-mail address.",
                  "maxLength": 255
                },
                "type": {
                  "type": "string",
                  "description": "A label of your choice.",
                  "maxLength": 50
                }
              }
            }
          },
          "addresses": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "properties": {
                "street": {
                  "type": "string",
                  "description": "Street.",
                  "maxLength": 500
                },
                "city": {
                  "type": "string",
                  "description": "Town.",
                  "maxLength": 255
                },
                "state": {
                  "type": "string",
                  "description": "State.",
                  "maxLength": 255
                },
                "zip": {
                  "type": "string",
                  "description": "Postcode.",
                  "maxLength": 50
                },
                "country": {
                  "type": "string",
                  "description": "Country.",
                  "maxLength": 255
                },
                "country_code": {
                  "type": "string",
                  "description": "Two letters.",
                  "maxLength": 10
                },
                "type": {
                  "type": "string",
                  "description": "A label of your choice.",
                  "maxLength": 50
                }
              }
            }
          },
          "urls": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "Address.",
                  "maxLength": 2048
                },
                "type": {
                  "type": "string",
                  "description": "A label of your choice.",
                  "maxLength": 50
                }
              }
            }
          },
          "org": {
            "type": "object",
            "properties": {
              "company": {
                "type": "string",
                "description": "Company.",
                "maxLength": 255
              },
              "department": {
                "type": "string",
                "description": "Department.",
                "maxLength": 255
              },
              "title": {
                "type": "string",
                "description": "Job title.",
                "maxLength": 255
              }
            }
          },
          "birthday": {
            "type": "string",
            "description": "Year, month and day, for example 1990-01-31.",
            "maxLength": 10
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "required": ["version", "event", "timestamp", "data"],
        "properties": {
          "version": {
            "type": "integer",
            "const": 1
          },
          "event": {
            "type": "string",
            "enum": [
              "message.received",
              "message.sent",
              "message.delivered",
              "message.read",
              "message.failed",
              "message.reaction",
              "webhook.test"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "When it happened.",
            "format": "date-time"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  },
  "x-limits": [
    {
      "name": "Requests a minute",
      "value": "60",
      "note": "Per key; the owner can raise it to 1,000."
    },
    {
      "name": "Requests a day",
      "value": "1,000",
      "note": "Per key, every call counts; the owner can raise it to 100,000."
    },
    {
      "name": "Messages to one number a minute",
      "value": "10",
      "note": "Per key and recipient."
    },
    {
      "name": "Speed of one WhatsApp number",
      "value": "about 15 a second",
      "note": "Shared with campaigns and the inbox. A call waits up to 30 seconds for its turn."
    },
    {
      "name": "Client timeout",
      "value": "at least 65 seconds",
      "note": "There is no idempotency key: do not send again blindly after a timeout."
    },
    {
      "name": "Document",
      "value": "100 MB",
      "note": "Image 5 MB, video 16 MB, audio 16 MB. Downloads 32 MB."
    }
  ],
  "x-webhook-signature": {
    "headers": [
      {
        "name": "X-Webhook-Signature",
        "value": "Lowercase hex HMAC-SHA256 of `timestamp + \".\" + raw body`, keyed with the webhook secret (`whsec_…`) as it is."
      },
      {
        "name": "X-Webhook-Timestamp",
        "value": "Unix seconds. Refuse deliveries that are older than a few minutes."
      },
      {
        "name": "X-Webhook-Event",
        "value": "Name of the event."
      },
      {
        "name": "X-Webhook-Id",
        "value": "Id of the event; every retry carries the same one."
      }
    ],
    "retries": "Five attempts, after about 1 second, 5 seconds, 30 seconds and 5 minutes, for network errors, 3xx, 408, 429 and 5xx. Any other 4xx is final. 410 switches the webhook off.",
    "duplicates": "The same event can arrive twice. Keep `event` together with `data.message_id` and ignore what you have already seen."
  },
  "x-errors": [
    {
      "code": "E_VALIDATION_ERROR",
      "status": 422,
      "meaning": "A field is missing or wrong. `details` names each field."
    },
    {
      "code": "VALIDATION_ERROR",
      "status": 422,
      "meaning": "The fields do not fit together, for example a caption on audio."
    },
    {
      "code": "INVALID_API_KEY",
      "status": 401,
      "meaning": "The key is missing or unknown."
    },
    {
      "code": "INVALID_SIGNATURE",
      "status": 401,
      "meaning": "The signature does not fit the body, or is missing on a key that needs it."
    },
    {
      "code": "TIMESTAMP_EXPIRED",
      "status": 401,
      "meaning": "The timestamp is more than 5 minutes off."
    },
    {
      "code": "EXPIRED_API_KEY",
      "status": 401,
      "meaning": "The key has passed its end date."
    },
    {
      "code": "REVOKED_API_KEY",
      "status": 401,
      "meaning": "The key was revoked."
    },
    {
      "code": "SUSPENDED_API_KEY",
      "status": 401,
      "meaning": "The key is switched off."
    },
    {
      "code": "IP_NOT_ALLOWED",
      "status": 403,
      "meaning": "The key has an address list and this address is not on it."
    },
    {
      "code": "PERMISSION_DENIED",
      "status": 403,
      "meaning": "The key lacks this permission. AI agent keys are always refused here."
    },
    {
      "code": "SUBSCRIPTION_REQUIRED",
      "status": 403,
      "meaning": "No active Wiz Bot or Wiz Pro plan, and the 7 days of grace are over."
    },
    {
      "code": "ACCOUNT_NOT_ACTIVE",
      "status": 403,
      "meaning": "The WhatsApp number of the key is not active."
    },
    {
      "code": "RATE_LIMIT_EXCEEDED",
      "status": 429,
      "meaning": "Too many requests this minute. `details.retry_after` says how many seconds to wait."
    },
    {
      "code": "DAILY_LIMIT_EXCEEDED",
      "status": 429,
      "meaning": "The daily limit of the key is used up."
    },
    {
      "code": "MESSAGE_SEND_FAILED",
      "status": 422,
      "meaning": "WhatsApp refused the message. With 429, WhatsApp slows the number down; with 500, something unexpected failed."
    },
    {
      "code": "MESSAGE_NOT_FOUND",
      "status": 404,
      "meaning": "No such message for this key."
    },
    {
      "code": "TEMPLATE_NOT_FOUND",
      "status": 404,
      "meaning": "No such template."
    },
    {
      "code": "TEMPLATE_NOT_CONFIGURED",
      "status": 400,
      "meaning": "The template is not set up for this key in API Management."
    },
    {
      "code": "INVALID_TEMPLATE_PARAMS",
      "status": 400,
      "meaning": "A variable of the template is missing or wrong."
    },
    {
      "code": "INVALID_DATE_FORMAT",
      "status": 400,
      "meaning": "A date variable is not a date."
    },
    {
      "code": "NO_FILE_PROVIDED",
      "status": 400,
      "meaning": "The upload has no file."
    },
    {
      "code": "INVALID_FILE",
      "status": 400,
      "meaning": "The file is too large or of a kind that is not allowed."
    },
    {
      "code": "UNSUPPORTED_FILE_TYPE",
      "status": 400,
      "meaning": "The kind of file could not be recognised."
    },
    {
      "code": "FILE_TOO_LARGE",
      "status": 400,
      "meaning": "Larger than allowed for this kind of file."
    },
    {
      "code": "INVALID_MIME_TYPE",
      "status": 400,
      "meaning": "The file does not fit the given `media_type`."
    },
    {
      "code": "UPLOAD_FAILED",
      "status": 500,
      "meaning": "The upload to WhatsApp failed."
    },
    {
      "code": "NO_MEDIA_ID",
      "status": 500,
      "meaning": "WhatsApp returned no media id."
    },
    {
      "code": "INVALID_MEDIA_ID",
      "status": 400,
      "meaning": "Not a media id."
    },
    {
      "code": "MEDIA_NOT_FOUND",
      "status": 404,
      "meaning": "Unknown, expired, or not of this account."
    },
    {
      "code": "MEDIA_TOO_LARGE",
      "status": 413,
      "meaning": "Larger than 32 MB."
    },
    {
      "code": "MEDIA_DOWNLOAD_FAILED",
      "status": 502,
      "meaning": "The file could not be fetched from WhatsApp. Worth another try."
    },
    {
      "code": "COEXT_ACCOUNT_NOT_FOUND",
      "status": 404,
      "meaning": "The WhatsApp account of the key is gone."
    },
    {
      "code": "COEXT_ACCOUNT_NOT_CONFIGURED",
      "status": 400,
      "meaning": "The WhatsApp account of the key is not ready."
    },
    {
      "code": "PHONE_NUMBER_ID_MISSING",
      "status": 400,
      "meaning": "The WhatsApp account of the key has no number."
    },
    {
      "code": "BUSINESS_TOKEN_MISSING",
      "status": 400,
      "meaning": "The WhatsApp account of the key must be connected again."
    },
    {
      "code": "INTERNAL_ERROR",
      "status": 500,
      "meaning": "Something unexpected failed."
    }
  ]
}
