Skip to content
WhatSync/DocsAPI v1

Check a WhatsApp campaign recipient CSV

Analyze up to 3,000 CSV rows for international phone format, duplicates, declared opt-in, and candidate countries.

POST/api/v1/tools/analyze_campaign_csvRead
Key permissions
Read chats and messages
Authentication
Authorization: Bearer $WHATSYNC_API_KEY
How keys work

How it works

Requires phone and opt_in columns.

This cannot prove WhatsApp registration or provide a live Meta price; it sends nothing.

Body parameters

csvstringrequired

CSV content with phone and opt_in columns; paste or supply file contents from your agent

requiredTemplateVariablesintegeroptional

Number of body variables in the selected approved template; validates param_1, param_2, and so on

Response

HTTP 200 returns this tool's JSON directly, without an MCP content wrapper. Optional provider fields may be absent or null; check pagination and coverage before treating a page as complete.

Every response includes X-Request-Id. Errors use the shared error format and retry rules.

Schemas

Input JSON Schema
Input JSON Schema
{
  "type": "object",
  "properties": {
    "csv": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500000,
      "description": "CSV content with phone and opt_in columns; paste or supply file contents from your agent"
    },
    "requiredTemplateVariables": {
      "type": "integer",
      "minimum": 0,
      "maximum": 20,
      "description": "Number of body variables in the selected approved template; validates param_1, param_2, and so on"
    }
  },
  "required": [
    "csv"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Response JSON Schema
Response JSON Schema
{
  "type": "object",
  "properties": {
    "total_rows": {
      "type": "number"
    },
    "candidates": {
      "type": "number"
    },
    "invalid_format": {
      "type": "number"
    },
    "duplicates": {
      "type": "number"
    },
    "opt_in_not_confirmed": {
      "type": "number"
    },
    "missing_template_parameters": {
      "type": "number"
    },
    "candidate_countries": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      }
    },
    "first_issues": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "row": {
            "type": "number"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [],
        "additionalProperties": true
      }
    },
    "note": {
      "type": "string"
    }
  },
  "required": [],
  "additionalProperties": true
}