{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whatsmcp-com/json-schema/whatsmcp-com-list-contacts-output-schema.json",
  "title": "ListContactsOutput",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whatsmcp-com-openapi.json#/components/schemas/ListContactsOutput",
  "additionalProperties": false,
  "properties": {
    "contacts": {
      "items": {
        "$ref": "#/$defs/ContactView"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "has_more": {
      "description": "true when more contacts remain after this page",
      "type": "boolean"
    },
    "next_cursor": {
      "description": "pass this as after_cursor to continue; page until has_more is false to read the whole address book",
      "type": "string"
    },
    "note": {
      "type": "string"
    },
    "refusal": {
      "$ref": "#/$defs/Refusal",
      "description": "present only when the request was declined"
    },
    "total": {
      "description": "how many contacts matched in total, before the limit was applied",
      "format": "int64",
      "type": "integer"
    },
    "truncated": {
      "description": "true when more contacts exist than were returned",
      "type": "boolean"
    }
  },
  "required": [
    "contacts",
    "total"
  ],
  "type": "object",
  "$defs": {
    "AccountCandidate": {
      "additionalProperties": false,
      "properties": {
        "account_id": {
          "description": "the id to retry with as account_id",
          "type": "string"
        },
        "name": {
          "description": "the account's WhatsApp display name",
          "type": "string"
        },
        "phone": {
          "description": "the account's phone number, E.164",
          "type": "string"
        },
        "status": {
          "description": "whether the number works right now — live, connecting, or why not, as wa_list_accounts reports it",
          "type": "string"
        }
      },
      "required": [
        "account_id"
      ],
      "type": "object"
    },
    "ContactView": {
      "additionalProperties": false,
      "properties": {
        "jid": {
          "description": "the network's own identifier for this contact; on a Telegram account pass this as to or chat to every other tool",
          "type": "string"
        },
        "name": {
          "description": "the best available display name",
          "type": "string"
        },
        "name_source": {
          "description": "saved, business, or push — push names are chosen by the contact themselves",
          "type": "string"
        },
        "phone": {
          "description": "the contact's number in international form — on WhatsApp pass this to wa_send_message; on Telegram use jid instead",
          "type": "string"
        },
        "picture_url": {
          "description": "only with include_pictures: a WhatsApp-hosted URL that expires, so fetch it promptly. Empty means not visible to this account or not retrieved this time — see note. A contact without a phone number never has one",
          "type": "string"
        },
        "username": {
          "description": "Telegram only: the contact's public username, without the @",
          "type": "string"
        }
      },
      "type": "object"
    },
    "Refusal": {
      "additionalProperties": false,
      "properties": {
        "account_status": {
          "description": "when the number is not working: its status — starting, not_running, whatsapp_down (telegram_down for a Telegram account), suspended, pairing, unlinked or locked",
          "type": "string"
        },
        "account_status_reason": {
          "description": "the detail of account_status, e.g. no_egress, stopped, no_plan",
          "type": "string"
        },
        "candidates": {
          "description": "on an account_ambiguous refusal: the accounts to choose from — retry with one of these as account_id",
          "items": {
            "$ref": "#/$defs/AccountCandidate"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "message": {
          "description": "a human-readable explanation",
          "type": "string"
        },
        "reason": {
          "description": "why the call was declined",
          "type": "string"
        },
        "refused": {
          "description": "true when the call was declined rather than performed",
          "type": "boolean"
        },
        "retry_after_seconds": {
          "description": "seconds to wait before retrying; absent or 0 means retrying will not help",
          "format": "int64",
          "type": "integer"
        },
        "since": {
          "description": "when the number stopped working, RFC3339, when known",
          "type": "string"
        }
      },
      "required": [
        "refused",
        "reason",
        "message"
      ],
      "type": "object"
    }
  }
}