{
  "openapi": "3.1.0",
  "info": {
    "title": "IDBURO Services — WhatsApp API",
    "version": "1.0.0",
    "description": "Nederlandstalige referentie op basis van de geïnstalleerde v1-updatepakketten. Alleen HTTPS. Template-aflevering nog niet in productie bewezen."
  },
  "servers": [
    {
      "url": "https://api.idburo.nl"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Start"
    },
    {
      "name": "Lezen"
    },
    {
      "name": "Schrijven"
    },
    {
      "name": "Media"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "get_root",
        "tags": [
          "Start"
        ],
        "summary": "Platformstatus",
        "description": "Publieke status van IDBURO Services. Geen API-key nodig.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "platform": {
                          "type": "string"
                        },
                        "api_version": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": null,
        "security": []
      }
    },
    "/v1/auth/check": {
      "get": {
        "operationId": "get_v1_auth_check",
        "tags": [
          "Start"
        ],
        "summary": "API-key controleren",
        "description": "Controleer de identiteit van de gekoppelde API-key en het project. Geen aparte resourcepermissie.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "authenticated": {
                          "type": "boolean"
                        },
                        "project_id": {
                          "type": [
                            "integer",
                            "string"
                          ]
                        },
                        "project_key": {
                          "type": "string"
                        },
                        "project_name": {
                          "type": "string"
                        },
                        "api_key_id": {
                          "type": [
                            "integer",
                            "string"
                          ]
                        },
                        "api_key_name": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": null
      }
    },
    "/v1/whatsapp/accounts": {
      "get": {
        "operationId": "get_v1_whatsapp_accounts",
        "tags": [
          "Lezen"
        ],
        "summary": "Accounts ophalen",
        "description": "Geeft uitsluitend actieve, aan de API-key toegewezen WhatsApp-accounts terug. Geen account_id vereist.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "accounts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_account_id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "phone_number": {
                                "type": "string"
                              },
                              "active": {
                                "type": "integer"
                              },
                              "send_enabled": {
                                "type": "integer"
                              },
                              "receive_enabled": {
                                "type": "integer"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.accounts.read"
      }
    },
    "/v1/whatsapp/contacts": {
      "get": {
        "operationId": "get_v1_whatsapp_contacts",
        "tags": [
          "Lezen"
        ],
        "summary": "Contactpersonen ophalen",
        "description": "Records oplopend op whatsapp_contact_id. Datumfilters from en to zijn inclusief op created_at. Alle filters worden gecombineerd (AND). Onbekende parameters worden geweigerd. count is de grootte van de pagina, niet het totaal.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_contact_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_account_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "wa_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "phone_number": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "profile_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "first_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "last_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "emailaddress": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "blocked": {
                                "type": "integer"
                              },
                              "active": {
                                "type": "integer"
                              },
                              "first_message_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "last_message_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "last_inbound_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "last_outbound_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "created_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "updated_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            },
                            "offset": {
                              "type": "integer"
                            },
                            "has_more": {
                              "type": "boolean"
                            },
                            "next_offset": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "next_after_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.contacts.read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "blocked",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "0",
                "1"
              ]
            }
          }
        ]
      }
    },
    "/v1/whatsapp/conversations": {
      "get": {
        "operationId": "get_v1_whatsapp_conversations",
        "tags": [
          "Lezen"
        ],
        "summary": "Conversaties ophalen",
        "description": "Records oplopend op whatsapp_conversation_id. Datumfilters from en to zijn inclusief op created_at. Alle filters worden gecombineerd (AND). Onbekende parameters worden geweigerd. count is de grootte van de pagina, niet het totaal.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_conversation_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_account_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_contact_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "open",
                                  "pending",
                                  "closed",
                                  "archived"
                                ]
                              },
                              "priority": {
                                "type": "string",
                                "enum": [
                                  "low",
                                  "normal",
                                  "high",
                                  "urgent"
                                ]
                              },
                              "subject": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "last_message_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "last_message_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "last_inbound_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "last_outbound_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "service_window_until": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "created_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "updated_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "closed_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            },
                            "offset": {
                              "type": "integer"
                            },
                            "has_more": {
                              "type": "boolean"
                            },
                            "next_offset": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "next_after_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.conversations.read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "pending",
                "closed",
                "archived"
              ]
            }
          },
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "normal",
                "high",
                "urgent"
              ]
            }
          }
        ]
      }
    },
    "/v1/whatsapp/messages": {
      "get": {
        "operationId": "get_v1_whatsapp_messages",
        "tags": [
          "Lezen"
        ],
        "summary": "Berichten ophalen",
        "description": "Records oplopend op whatsapp_message_id. Datumfilters from en to zijn inclusief op message_at. Alle filters worden gecombineerd (AND). Onbekende parameters worden geweigerd. count is de grootte van de pagina, niet het totaal.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_message_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_account_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_contact_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_conversation_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "wamid": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "direction": {
                                "type": "string",
                                "enum": [
                                  "inbound",
                                  "outbound"
                                ]
                              },
                              "message_type": {
                                "type": "string"
                              },
                              "body": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "template_name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "template_language": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "reply_to_wamid": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "received",
                                  "queued",
                                  "sending",
                                  "accepted",
                                  "sent",
                                  "delivered",
                                  "read",
                                  "failed",
                                  "unknown"
                                ]
                              },
                              "error_code": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "message_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "sent_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "delivered_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "read_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "failed_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "created_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "updated_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            },
                            "offset": {
                              "type": "integer"
                            },
                            "has_more": {
                              "type": "boolean"
                            },
                            "next_offset": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "next_after_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.messages.read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "conversation_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "received",
                "queued",
                "sending",
                "accepted",
                "sent",
                "delivered",
                "read",
                "failed",
                "unknown"
              ]
            }
          },
          {
            "name": "message_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ]
      }
    },
    "/v1/whatsapp/statuses": {
      "get": {
        "operationId": "get_v1_whatsapp_statuses",
        "tags": [
          "Lezen"
        ],
        "summary": "Statusgeschiedenis ophalen",
        "description": "Records oplopend op whatsapp_message_status_id. Datumfilters from en to zijn inclusief op status_at. Alle filters worden gecombineerd (AND). Onbekende parameters worden geweigerd. count is de grootte van de pagina, niet het totaal.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_message_status_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_account_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_message_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "wamid": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "error_code": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "created_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            },
                            "offset": {
                              "type": "integer"
                            },
                            "has_more": {
                              "type": "boolean"
                            },
                            "next_offset": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "next_after_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.status.read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "message_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ]
      }
    },
    "/v1/whatsapp/attachments": {
      "get": {
        "operationId": "get_v1_whatsapp_attachments",
        "tags": [
          "Lezen"
        ],
        "summary": "Bijlagen ophalen",
        "description": "Records oplopend op whatsapp_attachment_id. Datumfilters from en to zijn inclusief op created_at. Alle filters worden gecombineerd (AND). Onbekende parameters worden geweigerd. count is de grootte van de pagina, niet het totaal.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_attachment_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_account_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_message_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "media_type": {
                                "type": "string"
                              },
                              "mime_type": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "filename": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "filesize": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "caption": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "download_status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "downloading",
                                  "downloaded",
                                  "failed"
                                ]
                              },
                              "scan_status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "scanning",
                                  "clean",
                                  "infected",
                                  "error"
                                ]
                              },
                              "scanned_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "created_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            },
                            "offset": {
                              "type": "integer"
                            },
                            "has_more": {
                              "type": "boolean"
                            },
                            "next_offset": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "next_after_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.attachments.read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "message_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "download_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "downloading",
                "downloaded",
                "failed"
              ]
            }
          },
          {
            "name": "scan_status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "scanning",
                "clean",
                "infected",
                "error"
              ]
            }
          },
          {
            "name": "media_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ]
      }
    },
    "/v1/whatsapp/queue": {
      "get": {
        "operationId": "get_v1_whatsapp_queue",
        "tags": [
          "Lezen"
        ],
        "summary": "Verzendwachtrij ophalen",
        "description": "Records oplopend op whatsapp_queue_id. Datumfilters from en to zijn inclusief op created_at. Alle filters worden gecombineerd (AND). Onbekende parameters worden geweigerd. count is de grootte van de pagina, niet het totaal.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_queue_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_account_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_message_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "recipient": {
                                "type": "string"
                              },
                              "message_type": {
                                "type": "string"
                              },
                              "body": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "processing",
                                  "processed",
                                  "retry",
                                  "failed",
                                  "unknown",
                                  "expired",
                                  "cancelled"
                                ]
                              },
                              "attempts": {
                                "type": "integer"
                              },
                              "max_attempts": {
                                "type": "integer"
                              },
                              "scheduled_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "expires_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "next_attempt_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "processed_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "http_code": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "error_code": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "created_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              },
                              "updated_at": {
                                "type": "string",
                                "description": "UTC, YYYY-MM-DD HH:mm:ss"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        },
                        "pagination": {
                          "type": "object",
                          "properties": {
                            "limit": {
                              "type": "integer"
                            },
                            "offset": {
                              "type": "integer"
                            },
                            "has_more": {
                              "type": "boolean"
                            },
                            "next_offset": {
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "next_after_id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.queue.read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000,
              "default": 0
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
              "examples": [
                "2026-12-01T10:00:00Z"
              ]
            }
          },
          {
            "name": "message_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "processing",
                "processed",
                "retry",
                "failed",
                "unknown",
                "expired",
                "cancelled"
              ]
            }
          },
          {
            "name": "message_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 50,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          }
        ]
      }
    },
    "/v1/whatsapp/messages/text": {
      "post": {
        "operationId": "post_v1_whatsapp_messages_text",
        "tags": [
          "Schrijven"
        ],
        "summary": "Tekstbericht inplannen",
        "description": "Plant een tekstbericht in. scheduled_at en expires_at zijn optioneel; gebruik bij voorkeur een korte vervaltijd. Het geplande moment moet binnen het open service window liggen; de worker controleert opnieuw vóór verzending.",
        "responses": {
          "202": {
            "description": "Nieuwe opdracht geaccepteerd (niet hetzelfde als aflevering)",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_queue_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "status": {
                          "type": "string"
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "200": {
            "description": "Identieke bestaande opdracht",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_queue_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "status": {
                          "type": "string"
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED, SEND_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_CONFLICT, RECIPIENT_UNAVAILABLE, SERVICE_WINDOW_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.messages.send",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,19}$",
                        "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                      },
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    ],
                    "description": "Gebruik bij voorkeur een decimale string; numerieke JSON-ID’s worden ook geaccepteerd."
                  },
                  "recipient": {
                    "type": "string",
                    "maxLength": 15,
                    "description": "Internationaal telefoonnummer zonder +, spaties of voorloopnul; 7–15 cijfers.",
                    "pattern": "^[1-9][0-9]{6,14}$",
                    "minLength": 7
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 191,
                    "description": "Verplicht: 1–191 afdrukbare ASCII-tekens zonder spaties. Bewaar dezelfde sleutel en dezelfde payload bij retries.",
                    "minLength": 1,
                    "pattern": "^[!-~]+$"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "default": 5,
                    "description": "1 is hoogste prioriteit."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
                    "examples": [
                      "2026-12-01T10:00:00Z"
                    ]
                  },
                  "expires_at": {
                    "type": "string",
                    "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
                    "examples": [
                      "2026-12-01T10:00:00Z"
                    ]
                  },
                  "body": {
                    "type": "string",
                    "maxLength": 4096,
                    "description": "Niet-lege UTF-8-tekst.",
                    "minLength": 1
                  }
                },
                "required": [
                  "account_id",
                  "recipient",
                  "idempotency_key",
                  "body"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "1",
                "recipient": "31612345678",
                "idempotency_key": "example-order-001",
                "body": "Hallo, dit is een voorbeeldbericht."
              }
            }
          }
        }
      }
    },
    "/v1/whatsapp/messages/template": {
      "post": {
        "operationId": "post_v1_whatsapp_messages_template",
        "tags": [
          "Schrijven"
        ],
        "summary": "Templatebericht inplannen",
        "description": "Alleen door Meta goedgekeurde en door IDBURO geconfigureerde naam/taalcombinaties, met het exacte aantal positionele tekstparameters in de body. Statische header/footer zijn mogelijk; dynamische header, buttons en named parameters worden niet ondersteund. Ook templates zijn gebonden aan de 24-uursregel. Voorbeeld is illustratief en vereist activatie; succesvolle productieaflevering is nog niet gevalideerd.",
        "responses": {
          "202": {
            "description": "Nieuwe opdracht geaccepteerd (niet hetzelfde als aflevering)",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_queue_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "status": {
                          "type": "string"
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "200": {
            "description": "Identieke bestaande opdracht",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_queue_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "status": {
                          "type": "string"
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED, SEND_DISABLED, TEMPLATE_DENIED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_CONFLICT, RECIPIENT_UNAVAILABLE, SERVICE_WINDOW_CLOSED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.templates.send",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,19}$",
                        "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                      },
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    ],
                    "description": "Gebruik bij voorkeur een decimale string; numerieke JSON-ID’s worden ook geaccepteerd."
                  },
                  "recipient": {
                    "type": "string",
                    "maxLength": 15,
                    "description": "Internationaal telefoonnummer zonder +, spaties of voorloopnul; 7–15 cijfers.",
                    "pattern": "^[1-9][0-9]{6,14}$",
                    "minLength": 7
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 191,
                    "description": "Verplicht: 1–191 afdrukbare ASCII-tekens zonder spaties. Bewaar dezelfde sleutel en dezelfde payload bij retries.",
                    "minLength": 1,
                    "pattern": "^[!-~]+$"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "default": 5,
                    "description": "1 is hoogste prioriteit."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
                    "examples": [
                      "2026-12-01T10:00:00Z"
                    ]
                  },
                  "expires_at": {
                    "type": "string",
                    "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
                    "examples": [
                      "2026-12-01T10:00:00Z"
                    ]
                  },
                  "template_name": {
                    "type": "string",
                    "maxLength": 255,
                    "pattern": "^[a-z0-9_]+$"
                  },
                  "template_language": {
                    "type": "string",
                    "pattern": "^[a-z]{2,3}(_[A-Z]{2})?$"
                  },
                  "template_parameters": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 4096,
                      "description": "Maximaal 4096 UTF-8-bytes; geen ASCII-controltekens.",
                      "minLength": 1
                    },
                    "maxItems": 20,
                    "default": []
                  }
                },
                "required": [
                  "account_id",
                  "recipient",
                  "idempotency_key",
                  "template_name",
                  "template_language"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "1",
                "recipient": "31612345678",
                "idempotency_key": "example-template-001",
                "template_name": "aanvraag_bevestiging",
                "template_language": "nl",
                "template_parameters": [
                  "REF-001"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/whatsapp/queue/{id}/cancel": {
      "post": {
        "operationId": "post_v1_whatsapp_queue_id_cancel",
        "tags": [
          "Schrijven"
        ],
        "summary": "Verzendopdracht annuleren",
        "description": "Alleen pending of retry kan worden geannuleerd. Herhaald annuleren retourneert opnieuw 200. Processing of definitieve statussen geven 409. Een geannuleerd bericht wordt niet verzonden.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_queue_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "cancelled"
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "QUEUE_NOT_CANCELLABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.queue.cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,19}$",
                        "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                      },
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    ],
                    "description": "Gebruik bij voorkeur een decimale string; numerieke JSON-ID’s worden ook geaccepteerd."
                  }
                },
                "required": [
                  "account_id"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "1"
              }
            }
          }
        }
      }
    },
    "/v1/whatsapp/contacts/{id}": {
      "patch": {
        "operationId": "patch_v1_whatsapp_contacts_id",
        "tags": [
          "Schrijven"
        ],
        "summary": "Contactpersonen wijzigen",
        "description": "Minimaal één wijzigbaar veld naast account_id. Ongewijzigde waarden leveren een lege changed_fields-lijst op. Andere velden zijn niet wijzigbaar. blocked accepteert boolean of integer 0/1.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_contact_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "changed_fields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.contacts.write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,19}$",
                        "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                      },
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    ],
                    "description": "Gebruik bij voorkeur een decimale string; numerieke JSON-ID’s worden ook geaccepteerd."
                  },
                  "first_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 100,
                    "description": "Niet-lege tekst of null om te wissen."
                  },
                  "last_name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 150,
                    "description": "Niet-lege tekst of null om te wissen."
                  },
                  "emailaddress": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email",
                    "maxLength": 255
                  },
                  "blocked": {
                    "oneOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "account_id"
                ],
                "additionalProperties": false,
                "minProperties": 2
              },
              "example": {
                "account_id": "1",
                "first_name": "Jan",
                "last_name": "Voorbeeld"
              }
            }
          }
        }
      }
    },
    "/v1/whatsapp/conversations/{id}": {
      "patch": {
        "operationId": "patch_v1_whatsapp_conversations_id",
        "tags": [
          "Schrijven"
        ],
        "summary": "Conversaties wijzigen",
        "description": "Minimaal één wijzigbaar veld naast account_id. Ongewijzigde waarden leveren een lege changed_fields-lijst op. Andere velden zijn niet wijzigbaar. closed_at wordt automatisch bijgewerkt; service_window_until is niet wijzigbaar.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_conversation_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "changed_fields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.conversations.write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,19}$",
                        "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                      },
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    ],
                    "description": "Gebruik bij voorkeur een decimale string; numerieke JSON-ID’s worden ook geaccepteerd."
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "pending",
                      "closed",
                      "archived"
                    ]
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "normal",
                      "high",
                      "urgent"
                    ]
                  },
                  "subject": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 255,
                    "description": "Niet-lege tekst of null om te wissen."
                  }
                },
                "required": [
                  "account_id"
                ],
                "additionalProperties": false,
                "minProperties": 2
              },
              "example": {
                "account_id": "1",
                "status": "closed",
                "subject": "Afgehandeld"
              }
            }
          }
        }
      }
    },
    "/v1/whatsapp/attachments/{id}/download": {
      "get": {
        "operationId": "get_v1_whatsapp_attachments_id_download",
        "tags": [
          "Media"
        ],
        "summary": "Inkomende bijlage downloaden",
        "description": "Retourneert binaire bytes (geen JSON bij succes), maximaal 100 MiB. Alleen downloaded + clean met overeenkomende SHA-256-scans; integriteit opnieuw gecontroleerd. Content-Type application/octet-stream, Content-Disposition attachment, Content-Length, Cache-Control no-store en Accept-Ranges none. Downloadrechten staan los van metadata-leesrechten.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "const": "none"
                }
              }
            },
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "ATTACHMENT_NOT_AVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY, ATTACHMENT_UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.attachments.download",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          }
        ]
      }
    },
    "/v1/whatsapp/media/upload": {
      "post": {
        "operationId": "post_v1_whatsapp_media_upload",
        "tags": [
          "Media"
        ],
        "summary": "Mediabestand uploaden",
        "description": "Exact één bestand in multipart/form-data met Content-Length. Geen queryparameters. Nieuwe uploads worden synchroon op MIME-type, SHA-256 en antivirus gecontroleerd. Identieke replay vereist dezelfde bestandsnaam, mediatype en bytes; ook verwijderde of verlopen uploads kunnen als bestaande metadata terugkomen, dus controleer de status. Gebruik bij een nieuwe upload een nieuwe sleutel.",
        "responses": {
          "201": {
            "description": "Nieuwe schone upload",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_media_upload_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "whatsapp_account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "media_type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "document",
                            "audio",
                            "video"
                          ]
                        },
                        "filename": {
                          "type": "string"
                        },
                        "mime_type": {
                          "type": "string"
                        },
                        "filesize": {
                          "type": "integer"
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "scan_status": {
                          "type": "string"
                        },
                        "scanned_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "created_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "deleted_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "purged_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "200": {
            "description": "Identieke bestaande upload",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_media_upload_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "whatsapp_account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "media_type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "document",
                            "audio",
                            "video"
                          ]
                        },
                        "filename": {
                          "type": "string"
                        },
                        "mime_type": {
                          "type": "string"
                        },
                        "filesize": {
                          "type": "integer"
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "scan_status": {
                          "type": "string"
                        },
                        "scanned_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "created_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "deleted_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "purged_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON, INVALID_UPLOAD",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_CONFLICT, QUOTA_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "411": {
            "description": "LENGTH_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "MEDIA_SCAN_REJECTED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY, MEDIA_SCAN_UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.media.upload",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,19}$",
                    "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                  },
                  "media_type": {
                    "type": "string",
                    "enum": [
                      "image",
                      "document",
                      "audio",
                      "video"
                    ]
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 191,
                    "description": "Verplicht: 1–191 afdrukbare ASCII-tekens zonder spaties. Bewaar dezelfde sleutel en dezelfde payload bij retries.",
                    "minLength": 1,
                    "pattern": "^[!-~]+$"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Bestand met veilige UTF-8-naam (1–255 bytes)."
                  }
                },
                "required": [
                  "account_id",
                  "media_type",
                  "idempotency_key",
                  "file"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/whatsapp/media": {
      "get": {
        "operationId": "get_v1_whatsapp_media",
        "tags": [
          "Media"
        ],
        "summary": "Uploads ophalen",
        "description": "Uploads van het eigen project en account, inclusief logisch verwijderde of opgeschoonde records. Cursorpaginering: limit 1–250, standaard 100; after_id optioneel. Geen offset of datumfilters. has_more en next_after_id staan direct in data.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "whatsapp_media_upload_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "whatsapp_account_id": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]{0,19}$",
                                "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                              },
                              "media_type": {
                                "type": "string",
                                "enum": [
                                  "image",
                                  "document",
                                  "audio",
                                  "video"
                                ]
                              },
                              "filename": {
                                "type": "string"
                              },
                              "mime_type": {
                                "type": "string"
                              },
                              "filesize": {
                                "type": "integer"
                              },
                              "sha256": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "scan_status": {
                                "type": "string"
                              },
                              "scanned_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                              },
                              "created_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                              },
                              "expires_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                              },
                              "deleted_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                              },
                              "purged_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "count": {
                          "type": "integer"
                        },
                        "has_more": {
                          "type": "boolean"
                        },
                        "next_after_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.media.read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            }
          },
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          }
        ]
      }
    },
    "/v1/whatsapp/media/{id}": {
      "get": {
        "operationId": "get_v1_whatsapp_media_id",
        "tags": [
          "Media"
        ],
        "summary": "Uploadinformatie ophalen",
        "description": "Retourneert metadata van een eigen upload, inclusief verwijder-/opruimstatus. Geen download van uitgaande uploads via dit endpoint.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_media_upload_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "whatsapp_account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "media_type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "document",
                            "audio",
                            "video"
                          ]
                        },
                        "filename": {
                          "type": "string"
                        },
                        "mime_type": {
                          "type": "string"
                        },
                        "filesize": {
                          "type": "integer"
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "scan_status": {
                          "type": "string"
                        },
                        "scanned_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "created_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "deleted_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "purged_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.media.read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          }
        ]
      },
      "delete": {
        "operationId": "delete_v1_whatsapp_media_id",
        "tags": [
          "Media"
        ],
        "summary": "Upload verwijderen",
        "description": "Logische verwijdering; fysieke verwijdering volgt via cleanup. Geen request body. Upload met queue-status pending, retry of processing kan niet worden verwijderd. Herhaling is toegestaan.",
        "responses": {
          "200": {
            "description": "Succes",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_media_upload_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "whatsapp_account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "media_type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "document",
                            "audio",
                            "video"
                          ]
                        },
                        "filename": {
                          "type": "string"
                        },
                        "mime_type": {
                          "type": "string"
                        },
                        "filesize": {
                          "type": "integer"
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "scan_status": {
                          "type": "string"
                        },
                        "scanned_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "created_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "expires_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "deleted_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        },
                        "purged_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "UTC-datum/tijd als YYYY-MM-DD HH:mm:ss of null."
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "MEDIA_IN_USE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.media.delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]{0,19}$",
              "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
            }
          }
        ]
      }
    },
    "/v1/whatsapp/messages/media": {
      "post": {
        "operationId": "post_v1_whatsapp_messages_media",
        "tags": [
          "Media"
        ],
        "summary": "Mediabericht inplannen",
        "description": "Gebruik een schoon, niet-verwijderd intern upload-ID van het eigen project/account. expires_at is verplicht en mag niet na het service window liggen. Caption maximaal 1024 tekens; audio accepteert geen caption. Geen externe URL of Meta-media-ID als input. De worker scant het bestand opnieuw vóór verzending.",
        "responses": {
          "202": {
            "description": "Nieuwe opdracht geaccepteerd (niet hetzelfde als aflevering)",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_queue_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "status": {
                          "type": "string"
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "200": {
            "description": "Identieke bestaande opdracht",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "whatsapp_queue_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "account_id": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]{0,19}$",
                          "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                        },
                        "status": {
                          "type": "string"
                        },
                        "replayed": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "request_id",
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PARAMETER, INVALID_JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "INVALID_API_KEY, AUTHENTICATION_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "PERMISSION_DENIED, ACCOUNT_DENIED, IP_NOT_ALLOWED, SEND_DISABLED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ENDPOINT_NOT_FOUND, RECORD_NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "IDEMPOTENCY_CONFLICT, RECIPIENT_UNAVAILABLE, SERVICE_WINDOW_CLOSED, MEDIA_NOT_AVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "UNSUPPORTED_MEDIA_TYPE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "RATE_LIMIT_EXCEEDED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Aantal seconden tot een nieuwe poging."
              }
            }
          },
          "500": {
            "description": "INTERNAL_ERROR",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "SERVICE_UNAVAILABLE, SERVICE_BUSY",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-permission": "whatsapp.messages.media.send",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,19}$",
                        "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                      },
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    ],
                    "description": "Gebruik bij voorkeur een decimale string; numerieke JSON-ID’s worden ook geaccepteerd."
                  },
                  "recipient": {
                    "type": "string",
                    "maxLength": 15,
                    "description": "Internationaal telefoonnummer zonder +, spaties of voorloopnul; 7–15 cijfers.",
                    "pattern": "^[1-9][0-9]{6,14}$",
                    "minLength": 7
                  },
                  "idempotency_key": {
                    "type": "string",
                    "maxLength": 191,
                    "description": "Verplicht: 1–191 afdrukbare ASCII-tekens zonder spaties. Bewaar dezelfde sleutel en dezelfde payload bij retries.",
                    "minLength": 1,
                    "pattern": "^[!-~]+$"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10,
                    "default": 5,
                    "description": "1 is hoogste prioriteit."
                  },
                  "scheduled_at": {
                    "type": "string",
                    "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
                    "examples": [
                      "2026-12-01T10:00:00Z"
                    ]
                  },
                  "expires_at": {
                    "type": "string",
                    "description": "UTC: YYYY-MM-DD, YYYY-MM-DD HH:mm:ss, ISO 8601 met Z of numerieke offset; zonder fracties.",
                    "examples": [
                      "2026-12-01T10:00:00Z"
                    ]
                  },
                  "media_upload_id": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,19}$",
                        "description": "Positieve decimale ID, maximaal 18446744073709551615. Gebruik strings voor BIGINT."
                      },
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 9007199254740991
                      }
                    ],
                    "description": "Gebruik bij voorkeur een decimale string; numerieke JSON-ID’s worden ook geaccepteerd."
                  },
                  "caption": {
                    "type": "string",
                    "maxLength": 1024,
                    "minLength": 1
                  }
                },
                "required": [
                  "account_id",
                  "recipient",
                  "idempotency_key",
                  "media_upload_id",
                  "expires_at"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Persoonlijke API-key; geen Meta-token."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "const": false
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "success",
          "request_id",
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}
