{
  "openapi": "3.1.0",
  "info": {
    "title": "Fortwave API",
    "version": "1.0.0",
    "summary": "Send SMS to every network in Burundi and WhatsApp Business messages to any country.",
    "description": "REST API for bulk SMS and OTP to Lumitel, Econet Leo and Onatel in Burundi, and the official WhatsApp Business API. Human-readable reference: https://fortwave.io/docs. Guides: https://fortwave.io/help/developers.",
    "contact": {
      "name": "Fortwave support",
      "email": "support@fortwave.io",
      "url": "https://fortwave.io/contact"
    },
    "termsOfService": "https://fortwave.io/terms-conditions"
  },
  "externalDocs": {
    "description": "API reference",
    "url": "https://fortwave.io/docs"
  },
  "servers": [
    {
      "url": "https://rest.api.fortwave.io/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "SMS",
      "description": "SMS to Burundian numbers.",
      "externalDocs": {
        "url": "https://fortwave.io/docs/sms"
      }
    },
    {
      "name": "WhatsApp",
      "description": "WhatsApp Business messages to any country.",
      "externalDocs": {
        "url": "https://fortwave.io/docs/whatsapp"
      }
    }
  ],
  "paths": {
    "/sms": {
      "post": {
        "operationId": "smsSendSms",
        "tags": [
          "SMS"
        ],
        "summary": "Send SMS",
        "description": "Send one SMS to one recipient. Use it for transactional messages such as OTPs and alerts, and for test traffic with the MiraiTest sender.\n\nPhone numbers are accepted in local or international format (61000000 or +25761000000) and normalized to E.164. The to field in the response shows the normalized number.\n\nCredits are deducted when the message is queued. One credit covers 160 standard (GSM-7) characters, or 153 per part for longer messages. With emoji or other Unicode characters, it covers 70 characters, or 67 per part. item_count tells you how many were used.\n\nTo try the API without spending credits, send with the MiraiTest sender to your verified test number. See Test environment below.\n\nReference: https://fortwave.io/docs/sms#send-sms",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "phone_number": {
                    "type": "string",
                    "description": "Recipient number in local or international format. Must be a valid number for your company's country. With MiraiTest, it must be your verified test number. Rules: Required; Valid number for your company's country."
                  },
                  "sender": {
                    "type": "string",
                    "description": "Name of an approved sender ID on your company, 1–11 letters or digits. Use MiraiTest for test sends. Rules: Required; 1–11 letters or digits."
                  },
                  "message": {
                    "type": "string",
                    "description": "Message text, up to 600 characters. Rules: Required; At most 600 characters."
                  }
                },
                "required": [
                  "phone_number",
                  "sender",
                  "message"
                ]
              },
              "example": {
                "phone_number": "+25761000000",
                "sender": "MyApp",
                "message": "Your verification code is 123456."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The message was accepted and queued for delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Message ID (ULID)."
                    },
                    "item_count": {
                      "type": "integer",
                      "description": "Credits (SMS parts) charged for this message."
                    },
                    "remaining_items": {
                      "type": "integer",
                      "description": "Your company's credit balance after this message. With MiraiTest, your remaining test credits instead."
                    },
                    "status": {
                      "type": "string",
                      "description": "Always queued."
                    },
                    "to": {
                      "type": "string",
                      "description": "Recipient number in E.164 format."
                    },
                    "sender": {
                      "type": "string",
                      "description": "The sender from your request."
                    },
                    "message": {
                      "type": "string",
                      "description": "Human-readable confirmation, localized."
                    }
                  }
                },
                "example": {
                  "id": "01JQ8Z5N2W4K7V3T9R6B1M0XHC",
                  "item_count": 1,
                  "remaining_items": 9999,
                  "status": "queued",
                  "to": "+25761000000",
                  "sender": "MyApp",
                  "message": "Message queued for sending"
                }
              }
            }
          },
          "400": {
            "description": "The body is valid, but a business rule blocked the send. Nothing was queued and no credits were used. The body contains a single message field.\n- Your account has not created a company.: \"You must create a company before sending messages.\"\n- Your company has not been approved yet.: \"Your company must be approved before sending messages.\"\n- Your company has not been verified yet.: \"Your company must be verified before sending messages.\"\n- Your balance is lower than the credits this message needs.: \"Insufficient SMS credits. This message requires 2 credits.\"\n- No sender ID with this name exists on your company.: \"Sender not found.\"\n- The sender ID exists but is not approved yet.: \"The sender must be approved before sending messages.\"\n\nOnly when sender is MiraiTest:\n- Test messaging is temporarily unavailable on the platform.: \"Test messaging is not configured. Please contact support.\"\n- You have not saved a test phone number.: \"Save and verify a test phone number before sending test messages.\"\n- Your test phone number is saved but not verified.: \"Your test phone number is not verified.\"\n- phone_number is not your verified test number.: \"The phone number must be your verified test phone number.\"\n- Your remaining test credits are lower than this message needs.: \"Insufficient test SMS credits. This message requires 1 credit.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The sender must be approved before sending messages."
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "The body failed validation. Nothing was queued and no credits were used. errors maps each failing field to its messages, and message repeats the first one.\n\nValidation messages:\n- phone_number: \"The phone number is required.\"\n- phone_number: \"The phone number must be a valid number for Burundi.\"\n- sender: \"The sender is required.\"\n- sender: \"The sender must be 1–11 alphanumeric characters.\"\n- message: \"The message content is required.\"\n- message: \"The message must not exceed 600 characters.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The phone number must be a valid number for Burundi. (and 1 more error)",
                  "errors": {
                    "phone_number": [
                      "The phone number must be a valid number for Burundi."
                    ],
                    "sender": [
                      "The sender must be 1–11 alphanumeric characters."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You sent more than 500 requests in one minute. The limit is per user and shared by /sms, /sms/bulk, and /sms/template. Wait the number of seconds given in the Retry-After header, then retry. Every response carries X-RateLimit-Limit and X-RateLimit-Remaining so you can slow down before hitting it.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The body never contains internal details. The request may still have been partly processed, and the API has no idempotency keys: before retrying, check your message history in the dashboard so you don't send duplicates (this matters most for bulk and template batches). If no messages were created, retry with exponential backoff. If the error persists, contact support with the time of the request.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/sms/bulk": {
      "post": {
        "operationId": "smsSendBulkSms",
        "tags": [
          "SMS"
        ],
        "summary": "Send bulk SMS",
        "description": "Send different messages to up to 500 recipients in one request, all from the same sender. Use it when every recipient gets their own text.\n\nAll or nothing: if any item fails validation or a business rule, nothing is queued and no credits are used. Fix the request and send the whole batch again.\n\nEvery recipient must be in the same country as the carrier of your sender ID.\n\nEach message is charged by its own length. item_count is the total for the batch.\n\nThe MiraiTest sender is not accepted here. Use Send SMS for test traffic.\n\nReference: https://fortwave.io/docs/sms#send-bulk-sms",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sender": {
                    "type": "string",
                    "description": "Name of an approved sender ID on your company, 1–11 letters or digits. Rules: Required; 1–11 letters or digits."
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "phone_number": {
                          "type": "string",
                          "description": "Recipient number in local or international format. Must be a valid number for your company's country. Rules: Required; Valid number for your company's country."
                        },
                        "message": {
                          "type": "string",
                          "description": "Text for this recipient, up to 600 characters. Rules: Required; At most 600 characters."
                        }
                      },
                      "required": [
                        "phone_number",
                        "message"
                      ]
                    },
                    "description": "List of 1 to 500 messages. Rules: Required; At least 1 item; At most 500 items."
                  }
                },
                "required": [
                  "sender",
                  "messages"
                ]
              },
              "example": {
                "sender": "MyApp",
                "messages": [
                  {
                    "phone_number": "+25761000000",
                    "message": "Hi Alice, your order has shipped."
                  },
                  {
                    "phone_number": "+25762000000",
                    "message": "Hi Bob, your order is ready for pickup."
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every message was accepted and queued as one batch.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch_id": {
                      "type": "string",
                      "description": "Batch ID (ULID)."
                    },
                    "status": {
                      "type": "string",
                      "description": "Always queued."
                    },
                    "sender": {
                      "type": "string",
                      "description": "Sender used for every message in the batch."
                    },
                    "recipients_count": {
                      "type": "integer",
                      "description": "Number of messages queued."
                    },
                    "item_count": {
                      "type": "integer",
                      "description": "Total credits charged for the batch."
                    },
                    "remaining_items": {
                      "type": "integer",
                      "description": "Your company's credit balance after the batch."
                    }
                  }
                },
                "example": {
                  "batch_id": "01JV5P0Y7B0V3P8NQ2TV6QG5V4",
                  "status": "queued",
                  "sender": "MyApp",
                  "recipients_count": 2,
                  "item_count": 2,
                  "remaining_items": 9997
                }
              }
            }
          },
          "400": {
            "description": "The body is valid, but a business rule blocked the send. Nothing was queued and no credits were used. The body contains a single message field.\n- Your account has not created a company.: \"You must create a company before sending messages.\"\n- sender is MiraiTest.: \"Bulk send does not support the MiraiTest sender; use the single-message endpoint for test traffic.\"\n- Your company has not been approved yet.: \"Your company must be approved before sending messages.\"\n- Your company has not been verified yet.: \"Your company must be verified before sending messages.\"\n- No sender ID with this name exists on your company.: \"Sender not found.\"\n- The sender ID exists but is not approved yet.: \"The sender must be approved before sending messages.\"\n- A recipient's number is in a different country from your sender ID's carrier.: \"The phone number country (KE) does not match the sender ID's telco country (BI).\"\n- Your balance is lower than the total credits the batch needs.: \"Insufficient SMS credits. This batch requires 12 credits.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The phone number country (KE) does not match the sender ID's telco country (BI)."
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "The body failed validation. Nothing was queued and no credits were used. errors maps each failing field to its messages, and message repeats the first one.\n\nValidation messages:\n- sender: \"The sender is required.\"\n- sender: \"The sender must be 1–11 alphanumeric characters.\"\n- messages: \"At least one message is required.\"\n- messages: \"At least one message is required.\"\n- messages: \"A maximum of 500 messages may be sent per request.\"\n- messages.N.phone_number: \"The phone number is required.\"\n- messages.N.phone_number: \"The phone number must be a valid number for Burundi.\"\n- messages.N.message: \"The message content is required.\"\n- messages.N.message: \"The message must not exceed 600 characters.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The phone number must be a valid number for Burundi. (and 1 more error)",
                  "errors": {
                    "messages.0.phone_number": [
                      "The phone number must be a valid number for Burundi."
                    ],
                    "messages.1.message": [
                      "The message must not exceed 600 characters."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You sent more than 500 requests in one minute. The limit is per user and shared by /sms, /sms/bulk, and /sms/template. Wait the number of seconds given in the Retry-After header, then retry. Every response carries X-RateLimit-Limit and X-RateLimit-Remaining so you can slow down before hitting it.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The body never contains internal details. The request may still have been partly processed, and the API has no idempotency keys: before retrying, check your message history in the dashboard so you don't send duplicates (this matters most for bulk and template batches). If no messages were created, retry with exponential backoff. If the error persists, contact support with the time of the request.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/sms/template": {
      "post": {
        "operationId": "smsSendTemplateSms",
        "tags": [
          "SMS"
        ],
        "summary": "Send template SMS",
        "description": "Send one template to up to 500 recipients and fill in each recipient's own values, such as their name or a code.\n\nAll or nothing: if any item fails validation or a business rule, nothing is queued and no credits are used. Fix the request and send the whole batch again.\n\nEach recipient's variables must include every placeholder used in the template, or the whole request fails with 400. Extra keys are ignored.\n\nVariable values must be strings of up to 255 characters, so send numbers as text (\"1234\"). null renders as empty text.\n\nCredits are calculated on each recipient's rendered message, so longer values can cost more parts.\n\nEvery recipient must be in the same country as the carrier of your sender ID.\n\nThe MiraiTest sender is not accepted here. Use Send SMS for test traffic.\n\nReference: https://fortwave.io/docs/sms#send-template-sms",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sender": {
                    "type": "string",
                    "description": "Name of an approved sender ID on your company, 1–11 letters or digits. Rules: Required; 1–11 letters or digits."
                  },
                  "template": {
                    "type": "string",
                    "description": "Message text with placeholders, up to 600 characters. Rules: Required; At most 600 characters."
                  },
                  "recipients": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "phone_number": {
                          "type": "string",
                          "description": "Recipient number in local or international format. Must be a valid number for your company's country. Rules: Required; Valid number for your company's country."
                        },
                        "variables": {
                          "type": "object",
                          "description": "Placeholder values for this recipient, keyed by placeholder name. Rules: Required; Key/value object.",
                          "additionalProperties": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Value for one placeholder, up to 255 characters."
                          }
                        }
                      },
                      "required": [
                        "phone_number",
                        "variables"
                      ]
                    },
                    "description": "List of 1 to 500 recipients. Rules: Required; At least 1 item; At most 500 items."
                  }
                },
                "required": [
                  "sender",
                  "template",
                  "recipients"
                ]
              },
              "example": {
                "sender": "MyApp",
                "template": "Hello {{name}}, your code is {{code}}.",
                "recipients": [
                  {
                    "phone_number": "+25761000000",
                    "variables": {
                      "name": "Alice",
                      "code": "1234"
                    }
                  },
                  {
                    "phone_number": "+25762000000",
                    "variables": {
                      "name": "Bob",
                      "code": "5678"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every rendered message was accepted and queued as one batch.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch_id": {
                      "type": "string",
                      "description": "Batch ID (ULID)."
                    },
                    "status": {
                      "type": "string",
                      "description": "Always queued."
                    },
                    "sender": {
                      "type": "string",
                      "description": "Sender used for every message in the batch."
                    },
                    "recipients_count": {
                      "type": "integer",
                      "description": "Number of messages queued."
                    },
                    "item_count": {
                      "type": "integer",
                      "description": "Total credits charged for the batch."
                    },
                    "remaining_items": {
                      "type": "integer",
                      "description": "Your company's credit balance after the batch."
                    }
                  }
                },
                "example": {
                  "batch_id": "01JS9M8AN9T25FE0J8QWWHE6BV",
                  "status": "queued",
                  "sender": "MyApp",
                  "recipients_count": 2,
                  "item_count": 2,
                  "remaining_items": 9997
                }
              }
            }
          },
          "400": {
            "description": "The body is valid, but a business rule blocked the send. Nothing was queued and no credits were used. The body contains a single message field.\n- Your account has not created a company.: \"You must create a company before sending messages.\"\n- sender is MiraiTest.: \"Bulk send does not support the MiraiTest sender; use the single-message endpoint for test traffic.\"\n- Your company has not been approved yet.: \"Your company must be approved before sending messages.\"\n- Your company has not been verified yet.: \"Your company must be verified before sending messages.\"\n- No sender ID with this name exists on your company.: \"Sender not found.\"\n- The sender ID exists but is not approved yet.: \"The sender must be approved before sending messages.\"\n- A recipient's number is in a different country from your sender ID's carrier.: \"The phone number country (KE) does not match the sender ID's telco country (BI).\"\n- A recipient's variables is missing a placeholder used in the template. The message gives the recipient's position (starting at 1) and the missing names.: \"Recipient #2 is missing required template variables: code.\"\n- Your balance is lower than the total credits the batch needs.: \"Insufficient SMS credits. This batch requires 12 credits.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "Recipient #2 is missing required template variables: code."
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "The body failed validation. Nothing was queued and no credits were used. errors maps each failing field to its messages, and message repeats the first one.\n\nValidation messages:\n- sender: \"The sender is required.\"\n- sender: \"The sender must be 1–11 alphanumeric characters.\"\n- template: \"The template is required.\"\n- template: \"The template must not exceed 600 characters.\"\n- recipients: \"At least one recipient is required.\"\n- recipients: \"At least one recipient is required.\"\n- recipients: \"A maximum of 500 recipients may be sent per request.\"\n- recipients.N.phone_number: \"The phone number is required.\"\n- recipients.N.phone_number: \"The phone number must be a valid number for Burundi.\"\n- recipients.N.variables: \"Template variables are required for each recipient.\"\n- recipients.N.variables: \"Template variables must be a key/value object.\"\n- recipients.N.variables.<name>: \"Each template variable value must be a string.\"\n- recipients.N.variables.<name>: \"Each template variable value must not exceed 255 characters.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The template is required. (and 1 more error)",
                  "errors": {
                    "template": [
                      "The template is required."
                    ],
                    "recipients.0.variables.code": [
                      "Each template variable value must be a string."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You sent more than 500 requests in one minute. The limit is per user and shared by /sms, /sms/bulk, and /sms/template. Wait the number of seconds given in the Retry-After header, then retry. Every response carries X-RateLimit-Limit and X-RateLimit-Remaining so you can slow down before hitting it.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The body never contains internal details. The request may still have been partly processed, and the API has no idempotency keys: before retrying, check your message history in the dashboard so you don't send duplicates (this matters most for bulk and template batches). If no messages were created, retry with exponential backoff. If the error persists, contact support with the time of the request.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp/media": {
      "post": {
        "operationId": "whatsappUploadMedia",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Upload media",
        "description": "Upload an image, video, audio file or document to use as a template's media header or as a free-form attachment. Upload a file once and reuse its id in as many messages as you like until it expires.\n\nNeeded for templates with an image, video or document header, and for files sent with Send a free-form message. Text-only messages never need it.\n\nUpload a shared file (for example a promotion banner) once and reuse its id, rather than uploading it for every message.\n\nUploaded media expires 30 days after upload. After that it can no longer be sent; upload it again.\n\nTemplate headers are stricter than free-form attachments: an image header takes PNG or JPEG up to 5 MB, a video header MP4 up to 16 MB, a document header a PDF up to 50 MB. Any accepted file uploads successfully; the header rules are checked when you send.\n\n120 req/min\n\nReference: https://fortwave.io/docs/whatsapp#upload-media",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file: a PNG or JPEG image (up to 5 MB), an MP4 video (up to 16 MB), an MP3 audio file (up to 16 MB) or a PDF, Word or Excel document (up to 100 MB). Rules: Required; PNG, JPG, MP3, MP4, PDF, Word or Excel; Images: at most 5 MB; Videos: at most 16 MB; Audio: at most 16 MB; Any file: at most 100 MB."
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The file was stored. Send its id as header_media_id, or in media_ids of a free-form message.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Media ID. Send it as header_media_id or in media_ids."
                    },
                    "name": {
                      "type": "string",
                      "description": "Original file name."
                    },
                    "mime_type": {
                      "type": "string",
                      "description": "Detected file type."
                    },
                    "size": {
                      "type": "integer",
                      "description": "File size in bytes."
                    },
                    "expires_at": {
                      "type": "string",
                      "description": "When the media expires (ISO 8601). It cannot be sent after this date."
                    }
                  }
                },
                "example": {
                  "id": "01K6TR0B9C8D7E6F5G4H3J2K1M",
                  "name": "banner.png",
                  "mime_type": "image/png",
                  "size": 48213,
                  "expires_at": "2026-11-04T10:15:30+00:00"
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "The file is missing, of an unsupported type or too large. errors.file holds the reason.\n\nValidation messages:\n- file: \"A file is required.\"\n- file: \"The file must be a PNG, JPG, MP3, MP4, PDF, Word or Excel file.\"\n- file: \"Each image must not be larger than 5MB.\"\n- file: \"Each video must not be larger than 16MB.\"\n- file: \"Each audio file must not be larger than 16MB.\"\n- file: \"The file must not be larger than 100MB.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "Each image must not be larger than 5MB.",
                  "errors": {
                    "file": [
                      "Each image must not be larger than 5MB."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You went over the rate limit for this endpoint (120 uploads or 500 send requests per minute, per user). Wait the number of seconds given in the Retry-After header, then retry.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The request may still have been processed: before retrying, check your WhatsApp message history in the dashboard so you don't send or pay for duplicates. If nothing was created, retry with exponential backoff.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp/messages": {
      "post": {
        "operationId": "whatsappSendMessage",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Send a message",
        "description": "Send one template message to one phone number. Use it for messages triggered by events in your app, such as order updates, reminders or verification codes.\n\nThe template must belong to the same WhatsApp business account as the sender. A template from another account is reported as not found.\n\nvariables must contain exactly the template's variables, each with a non-empty string value of up to 255 characters.\n\nTemplates with an image, video or document header need header_media_id. Upload the file first with Upload media.\n\nThe message is paid from your WhatsApp wallet when it is accepted. The response gives the cost and your new balance.\n\n500 req/min\n\nReference: https://fortwave.io/docs/whatsapp#send-message",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sender_id": {
                    "type": "string",
                    "description": "API sender ID of a connected sender. Rules: Exists on your account and is connected."
                  },
                  "template_id": {
                    "type": "string",
                    "description": "API template ID of an approved template on the same WhatsApp business account as the sender. Rules: Approved, on the sender's business account."
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "Recipient, in international format with the country code. Rules: Valid number in international format; Destination country supported (XX lists the country codes)."
                  },
                  "variables": {
                    "type": "object",
                    "description": "Template variable values, keyed by variable name. Required when the template has variables; omit it otherwise. Rules: Only the template's variables.",
                    "additionalProperties": {
                      "type": "string",
                      "description": "Value for one variable: a non-empty string of at most 255 characters."
                    }
                  },
                  "header_media_id": {
                    "type": "string",
                    "description": "id returned by Upload media. Required when the template has an image, video or document header; not allowed otherwise. Its type must match the header. Rules: Required when the template has a media header; Not allowed when the template has no media header; An id from one of your own uploads; Uploaded less than 30 days ago; Image header: PNG or JPEG media, up to 5 MB; Video header: MP4 media, up to 16 MB; Document header: PDF media only, up to 50 MB."
                  }
                },
                "required": [
                  "sender_id",
                  "template_id",
                  "phone_number"
                ]
              },
              "example": {
                "sender_id": "01K6TQ2X8Y3M4N5P6Q7R8S9T0V",
                "template_id": "01K6TQ5A1B2C3D4E5F6G7H8J9K",
                "phone_number": "+25779123456",
                "variables": {
                  "customer_name": "Pablo",
                  "order_number": "860198"
                },
                "header_media_id": "01K6TR0B9C8D7E6F5G4H3J2K1M"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The message was accepted, paid for and queued for delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Message ID."
                    },
                    "status": {
                      "type": "string",
                      "description": "Always queued."
                    },
                    "cost": {
                      "type": "string",
                      "description": "Price of the message, in your wallet currency."
                    },
                    "balance": {
                      "type": "string",
                      "description": "Your WhatsApp wallet balance after this request was paid."
                    },
                    "currency": {
                      "type": "string",
                      "description": "Wallet currency: USD, BIF or RWF."
                    }
                  }
                },
                "example": {
                  "id": "01K6TR3N4P5Q6R7S8T9V0W1X2Y",
                  "status": "queued",
                  "cost": "0.002000",
                  "balance": "9.998000",
                  "currency": "USD"
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "Validation or business error: the body is invalid, or a sender, template, media or wallet check failed. Nothing was sent and nothing was charged. errors maps each failing field to its messages, and message repeats the first one.\n\nValidation messages:\n- sender_id: \"The WhatsApp sender was not found or is not connected.\"\n- template_id: \"The WhatsApp template was not found for this sender or is not approved.\"\n- phone_number: \"The phone number is invalid.\"\n- phone_number: \"WhatsApp messages cannot be sent to these countries yet: XX.\"\n- variables: \"The template variables must only contain the template's variables.\"\n- variables.<name>: \"A value is required for each template variable.\"\n- header_media_id: \"The template has a media header: a header media id is required.\"\n- header_media_id: \"The template has no media header: a header media id cannot be sent.\"\n- header_media_id: \"The header media was not found.\"\n- header_media_id: \"The header media has expired: upload it again.\"\n- header_media_id: \"The header image must be a JPEG or PNG file no larger than 5MB.\"\n- header_media_id: \"The header video must be an MP4 file no larger than 16MB.\"\n- header_media_id: \"The header document must be a PDF file no larger than 50MB.\"\n- wallet: \"Insufficient WhatsApp balance: this costs … but your balance is ….\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The WhatsApp sender was not found or is not connected. (and 1 more error)",
                  "errors": {
                    "sender_id": [
                      "The WhatsApp sender was not found or is not connected."
                    ],
                    "variables.order_number": [
                      "A value is required for each template variable."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You went over the rate limit for this endpoint (120 uploads or 500 send requests per minute, per user). Wait the number of seconds given in the Retry-After header, then retry.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The request may still have been processed: before retrying, check your WhatsApp message history in the dashboard so you don't send or pay for duplicates. If nothing was created, retry with exponential backoff.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp/messages/bulk": {
      "post": {
        "operationId": "whatsappSendBulk",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Send in bulk",
        "description": "Send the same template to up to 500 recipients in one request, each with their own variables. All messages share the same header media, if the template has one.\n\nAll or nothing: if any item fails validation or a business rule, nothing is queued and no credits are used. Fix the request and send the whole batch again.\n\nheader_media_id is set once, at the top level, and used as the header of every message. To send a different file to each recipient, use Send a batch.\n\nvariables must contain exactly the template's variables, each with a non-empty string value of up to 255 characters.\n\nThe whole request is paid from your wallet at once. cost is the total for every message.\n\n500 req/min\n\nReference: https://fortwave.io/docs/whatsapp#send-bulk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sender_id": {
                    "type": "string",
                    "description": "API sender ID of a connected sender. Rules: Exists on your account and is connected."
                  },
                  "template_id": {
                    "type": "string",
                    "description": "API template ID of an approved template on the same WhatsApp business account as the sender. Rules: Approved, on the sender's business account."
                  },
                  "recipients": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "phone_number": {
                          "type": "string",
                          "description": "Recipient, in international format with the country code. Rules: Valid number in international format."
                        },
                        "variables": {
                          "type": "object",
                          "description": "This recipient's variable values. Required when the template has variables. Rules: Only the template's variables."
                        }
                      },
                      "required": [
                        "phone_number"
                      ]
                    },
                    "description": "1 to 500 recipients. Rules: At most 500 items; Destination country supported (XX lists the country codes)."
                  },
                  "header_media_id": {
                    "type": "string",
                    "description": "One uploaded media, sent as the header of every message. Required when the template has a media header. Rules: Required when the template has a media header; Not allowed when the template has no media header; An id from one of your own uploads; Uploaded less than 30 days ago; Image header: PNG or JPEG media, up to 5 MB; Video header: MP4 media, up to 16 MB; Document header: PDF media only, up to 50 MB."
                  }
                },
                "required": [
                  "sender_id",
                  "template_id",
                  "recipients"
                ]
              },
              "example": {
                "sender_id": "01K6TQ2X8Y3M4N5P6Q7R8S9T0V",
                "template_id": "01K6TQ5A1B2C3D4E5F6G7H8J9K",
                "header_media_id": "01K6TR0B9C8D7E6F5G4H3J2K1M",
                "recipients": [
                  {
                    "phone_number": "+25779123456",
                    "variables": {
                      "customer_name": "Pablo",
                      "order_number": "1001"
                    }
                  },
                  {
                    "phone_number": "+25779654321",
                    "variables": {
                      "customer_name": "Ana",
                      "order_number": "1002"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every message was accepted, paid for and queued as one batch.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch_id": {
                      "type": "string",
                      "description": "Batch ID. The batch appears in your message history with the source API."
                    },
                    "messages_count": {
                      "type": "integer",
                      "description": "Number of messages queued."
                    },
                    "status": {
                      "type": "string",
                      "description": "Always queued."
                    },
                    "cost": {
                      "type": "string",
                      "description": "Total price of every message in the batch, in your wallet currency."
                    },
                    "balance": {
                      "type": "string",
                      "description": "Your WhatsApp wallet balance after this request was paid."
                    },
                    "currency": {
                      "type": "string",
                      "description": "Wallet currency: USD, BIF or RWF."
                    }
                  }
                },
                "example": {
                  "batch_id": "01K6TR6Z7A8B9C0D1E2F3G4H5J",
                  "status": "queued",
                  "messages_count": 2,
                  "cost": "0.004000",
                  "balance": "9.994000",
                  "currency": "USD"
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "Validation or business error: the body is invalid, or a sender, template, media or wallet check failed. Nothing was sent and nothing was charged. errors maps each failing field to its messages, and message repeats the first one.\n\nValidation messages:\n- sender_id: \"The WhatsApp sender was not found or is not connected.\"\n- template_id: \"The WhatsApp template was not found for this sender or is not approved.\"\n- recipients: \"A maximum of 500 recipients may be sent per request.\"\n- recipients.N.phone_number: \"The phone number is invalid.\"\n- recipients: \"WhatsApp messages cannot be sent to these countries yet: XX.\"\n- recipients.N.variables: \"The template variables must only contain the template's variables.\"\n- recipients.N.variables.<name>: \"A value is required for each template variable.\"\n- header_media_id: \"The template has a media header: a header media id is required.\"\n- header_media_id: \"The template has no media header: a header media id cannot be sent.\"\n- header_media_id: \"The header media was not found.\"\n- header_media_id: \"The header media has expired: upload it again.\"\n- header_media_id: \"The header image must be a JPEG or PNG file no larger than 5MB.\"\n- header_media_id: \"The header video must be an MP4 file no larger than 16MB.\"\n- header_media_id: \"The header document must be a PDF file no larger than 50MB.\"\n- wallet: \"Insufficient WhatsApp balance: this costs … but your balance is ….\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The phone number is invalid. (and 1 more error)",
                  "errors": {
                    "recipients.1.phone_number": [
                      "The phone number is invalid."
                    ],
                    "recipients.1.variables.order_number": [
                      "A value is required for each template variable."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You went over the rate limit for this endpoint (120 uploads or 500 send requests per minute, per user). Wait the number of seconds given in the Retry-After header, then retry.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The request may still have been processed: before retrying, check your WhatsApp message history in the dashboard so you don't send or pay for duplicates. If nothing was created, retry with exponential backoff.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp/messages/batch": {
      "post": {
        "operationId": "whatsappSendBatch",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Send a batch",
        "description": "Send the same template in up to 500 messages, each with its own variables and its own header media. For example, send each customer their own invoice PDF.\n\nAll or nothing: if any item fails validation or a business rule, nothing is queued and no credits are used. Fix the request and send the whole batch again.\n\nEach message carries its own header_media_id. Several messages may use the same media.\n\nvariables must contain exactly the template's variables, each with a non-empty string value of up to 255 characters.\n\nThe whole request is paid from your wallet at once. cost is the total for every message.\n\n500 req/min\n\nReference: https://fortwave.io/docs/whatsapp#send-batch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sender_id": {
                    "type": "string",
                    "description": "API sender ID of a connected sender. Rules: Exists on your account and is connected."
                  },
                  "template_id": {
                    "type": "string",
                    "description": "API template ID of an approved template on the same WhatsApp business account as the sender. Rules: Approved, on the sender's business account."
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "phone_number": {
                          "type": "string",
                          "description": "Recipient, in international format with the country code. Rules: Valid number in international format."
                        },
                        "variables": {
                          "type": "object",
                          "description": "This message's variable values. Required when the template has variables. Rules: Only the template's variables."
                        },
                        "header_media_id": {
                          "type": "string",
                          "description": "This message's uploaded header media. Required when the template has a media header. Rules: Required when the template has a media header; Not allowed when the template has no media header; An id from one of your own uploads; Uploaded less than 30 days ago; Image header: PNG or JPEG media, up to 5 MB; Video header: MP4 media, up to 16 MB; Document header: PDF media only, up to 50 MB."
                        }
                      },
                      "required": [
                        "phone_number"
                      ]
                    },
                    "description": "1 to 500 messages. Rules: At most 500 items; Destination country supported (XX lists the country codes)."
                  }
                },
                "required": [
                  "sender_id",
                  "template_id",
                  "messages"
                ]
              },
              "example": {
                "sender_id": "01K6TQ2X8Y3M4N5P6Q7R8S9T0V",
                "template_id": "01K6TQ9M8N7P6Q5R4S3T2V1W0X",
                "messages": [
                  {
                    "phone_number": "+25779123456",
                    "variables": {
                      "customer_name": "Pablo",
                      "order_number": "1001"
                    },
                    "header_media_id": "01K6TRA1B2C3D4E5F6G7H8J9K0"
                  },
                  {
                    "phone_number": "+25779654321",
                    "variables": {
                      "customer_name": "Ana",
                      "order_number": "1002"
                    },
                    "header_media_id": "01K6TRB2C3D4E5F6G7H8J9K0M1"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every message was accepted, paid for and queued as one batch. Same shape as Send in bulk.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "batch_id": {
                      "type": "string",
                      "description": "Batch ID. The batch appears in your message history with the source API."
                    },
                    "messages_count": {
                      "type": "integer",
                      "description": "Number of messages queued."
                    },
                    "status": {
                      "type": "string",
                      "description": "Always queued."
                    },
                    "cost": {
                      "type": "string",
                      "description": "Total price of every message in the batch, in your wallet currency."
                    },
                    "balance": {
                      "type": "string",
                      "description": "Your WhatsApp wallet balance after this request was paid."
                    },
                    "currency": {
                      "type": "string",
                      "description": "Wallet currency: USD, BIF or RWF."
                    }
                  }
                },
                "example": {
                  "batch_id": "01K6TRC3D4E5F6G7H8J9K0M1N2",
                  "status": "queued",
                  "messages_count": 2,
                  "cost": "0.004000",
                  "balance": "9.990000",
                  "currency": "USD"
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "Validation or business error: the body is invalid, or a sender, template, media or wallet check failed. Nothing was sent and nothing was charged. errors maps each failing field to its messages, and message repeats the first one.\n\nValidation messages:\n- sender_id: \"The WhatsApp sender was not found or is not connected.\"\n- template_id: \"The WhatsApp template was not found for this sender or is not approved.\"\n- messages: \"A maximum of 500 recipients may be sent per request.\"\n- messages.N.phone_number: \"The phone number is invalid.\"\n- messages: \"WhatsApp messages cannot be sent to these countries yet: XX.\"\n- messages.N.variables: \"The template variables must only contain the template's variables.\"\n- messages.N.variables.<name>: \"A value is required for each template variable.\"\n- messages.N.header_media_id: \"The template has a media header: a header media id is required.\"\n- messages.N.header_media_id: \"The template has no media header: a header media id cannot be sent.\"\n- messages.N.header_media_id: \"The header media was not found.\"\n- messages.N.header_media_id: \"The header media has expired: upload it again.\"\n- messages.N.header_media_id: \"The header image must be a JPEG or PNG file no larger than 5MB.\"\n- messages.N.header_media_id: \"The header video must be an MP4 file no larger than 16MB.\"\n- messages.N.header_media_id: \"The header document must be a PDF file no larger than 50MB.\"\n- wallet: \"Insufficient WhatsApp balance: this costs … but your balance is ….\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The header media has expired: upload it again.",
                  "errors": {
                    "messages.0.header_media_id": [
                      "The header media has expired: upload it again."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You went over the rate limit for this endpoint (120 uploads or 500 send requests per minute, per user). Wait the number of seconds given in the Retry-After header, then retry.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The request may still have been processed: before retrying, check your WhatsApp message history in the dashboard so you don't send or pay for duplicates. If nothing was created, retry with exponential backoff.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp/messages/free-form": {
      "post": {
        "operationId": "whatsappSendFreeForm",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Send a free-form message",
        "description": "Reply to a customer with plain text, files, or both, without a template. Only possible within 24 hours of the customer's last message to this sender.\n\nWhatsApp only allows free-form messages for 24 hours after the customer last wrote to this sender. Outside the window the request returns 400: send a template with Send a message instead.\n\nFiles are not sent in this request. Upload each one with Upload media first, then list their ids in media_ids. The request itself is plain JSON.\n\nWhatsApp delivers each file as its own message. One request creates the text message (when there is a body), then one message per file, in the order of media_ids.\n\nEach message is billed at the free-form price for the destination country. cost is the total for every message. If your wallet can't pay for all of them, nothing is sent.\n\nA message can still fail after it is queued, for example when Meta refuses a file. Its status then becomes failed and it is refunded automatically.\n\n500 req/min\n\nReference: https://fortwave.io/docs/whatsapp#send-free-form",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sender_id": {
                    "type": "string",
                    "description": "API sender ID of a connected sender. Rules: Exists on your account and is connected."
                  },
                  "phone_number": {
                    "type": "string",
                    "description": "Recipient, in international format with the country code. Rules: Valid number in international format; Destination country supported (XX lists the country codes)."
                  },
                  "body": {
                    "type": "string",
                    "description": "Message text, up to 4096 characters. Required when there are no media_ids. Rules: A body, media_ids, or both; At most 4096 characters."
                  },
                  "media_ids": {
                    "type": "array",
                    "items": {},
                    "description": "Up to 5 ids returned by Upload media, each used once, 100 MB in total. Sent in the given order. Required when there is no body. Rules: A list of media ids; At most 5 files; At most 100 MB in total."
                  }
                },
                "required": [
                  "sender_id",
                  "phone_number"
                ]
              },
              "example": {
                "sender_id": "01K6TQ2X8Y3M4N5P6Q7R8S9T0V",
                "phone_number": "+25779123456",
                "body": "Here are your documents.",
                "media_ids": [
                  "01K6TR0B9C8D7E6F5G4H3J2K1M",
                  "01K6TRD4E5F6G7H8J9K0M1N2P3"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Every message was accepted, paid for and queued for delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "messages": {
                      "type": "array",
                      "items": {},
                      "description": "The messages created: the text first (when there is a body), then one per file."
                    },
                    "messages[].id": {
                      "type": "string",
                      "description": "Message ID."
                    },
                    "messages[].type": {
                      "type": "string",
                      "description": "text, image, video, audio or document."
                    },
                    "messages[].status": {
                      "type": "string",
                      "description": "Always queued."
                    },
                    "messages_count": {
                      "type": "integer",
                      "description": "Number of messages queued."
                    },
                    "cost": {
                      "type": "string",
                      "description": "Total price of every message, in your wallet currency."
                    },
                    "balance": {
                      "type": "string",
                      "description": "Your WhatsApp wallet balance after this request was paid."
                    },
                    "currency": {
                      "type": "string",
                      "description": "Wallet currency: USD, BIF or RWF."
                    }
                  }
                },
                "example": {
                  "messages": [
                    {
                      "id": "01K6TRE5F6G7H8J9K0M1N2P3Q4",
                      "type": "text",
                      "status": "queued"
                    },
                    {
                      "id": "01K6TRE5F6G7H8J9K0M1N2P3Q5",
                      "type": "document",
                      "status": "queued"
                    },
                    {
                      "id": "01K6TRE5F6G7H8J9K0M1N2P3Q6",
                      "type": "image",
                      "status": "queued"
                    }
                  ],
                  "messages_count": 3,
                  "cost": "0.006000",
                  "balance": "9.994000",
                  "currency": "USD"
                }
              }
            }
          },
          "400": {
            "description": "The customer's 24-hour window is closed. Nothing was sent or charged. The body only has a message: send a template instead.\n- The customer hasn't written to this sender in the last 24 hours.: \"The 24-hour conversation window is closed. Send a template instead.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The 24-hour conversation window is closed. Send a template instead."
                }
              }
            }
          },
          "401": {
            "description": "The Authorization header is missing or malformed, or the token was revoked.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unauthenticated."
                }
              }
            }
          },
          "422": {
            "description": "Validation or business error: the body is invalid, or a sender, template, media or wallet check failed. Nothing was sent and nothing was charged. errors maps each failing field to its messages, and message repeats the first one.\n\nValidation messages:\n- sender_id: \"The WhatsApp sender was not found or is not connected.\"\n- phone_number: \"The phone number is invalid.\"\n- phone_number: \"WhatsApp messages cannot be sent to these countries yet: XX.\"\n- body: \"A message or at least one media id is required.\"\n- body: \"The message must not be longer than 4096 characters.\"\n- media_ids: \"The media ids must be a list of ids returned when uploading media.\"\n- media_ids: \"You can attach at most 5 files.\"\n- media_ids: \"The attachments must not be larger than 100MB in total.\"\n- media_ids.N: \"Each media id must be the id returned when uploading the media.\"\n- media_ids.N: \"The media was not found.\"\n- media_ids.N: \"The media has expired: upload it again.\"\n- media_ids.N: \"The same media cannot be attached twice.\"\n- wallet: \"Insufficient WhatsApp balance: this costs … but your balance is ….\"\n- wallet: \"Create a WhatsApp wallet first.\"",
            "content": {
              "application/json": {
                "example": {
                  "message": "The media has expired: upload it again.",
                  "errors": {
                    "media_ids.1": [
                      "The media has expired: upload it again."
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "You went over the rate limit for this endpoint (120 uploads or 500 send requests per minute, per user). Wait the number of seconds given in the Retry-After header, then retry.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Too Many Attempts."
                }
              }
            }
          },
          "500": {
            "description": "Something unexpected went wrong on our side, and the error was reported to our team automatically. The request may still have been processed: before retrying, check your WhatsApp message history in the dashboard so you don't send or pay for duplicates. If nothing was created, retry with exponential backoff.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Server Error"
                }
              }
            }
          }
        }
      }
    },
    "/whatsapp/messages/{message_id}/attachments/{attachment_id}": {
      "get": {
        "operationId": "whatsappDownloadAttachment",
        "tags": [
          "WhatsApp"
        ],
        "summary": "Downloading a file",
        "description": "Request its download_url with your API token. It shares the 120 requests per minute limit of Upload media.\n\nReference: https://fortwave.io/docs/whatsapp",
        "parameters": [
          {
            "name": "message_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Message ID (ULID)."
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Attachment ID."
          },
          {
            "name": "inline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file, with its Content-Type and its name in Content-Disposition. Add ?inline=1 to have it shown in the browser instead of downloaded.",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "The API key is missing, invalid or revoked."
          },
          "404": {
            "description": "The file doesn't belong to you, or it could not be fetched from Meta."
          },
          "409": {
            "description": "The file is still downloading. Try again in a few seconds."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key created under Settings → API keys. See https://fortwave.io/help/developers/api-keys."
      }
    }
  }
}
