WhatsMCP Chats API

The Chats API from WhatsMCP — 6 operation(s) for chats.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 6

GET /v1/accounts/{account_id}/chats List an account's chats #
GET /v1/accounts/{account_id}/chats/{chat} Read one chat #
PUT /v1/accounts/{account_id}/chats/{chat}/archive Archive or unarchive a chat #
POST /v1/accounts/{account_id}/chats/{chat}/history Load older messages #
PUT /v1/accounts/{account_id}/chats/{chat}/presence Set presence in a chat #
PUT /v1/accounts/{account_id}/presence Set an account online or offline #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/whatsmcp-com:whatsmcp-com-chats-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

whatsmcp-com-chats-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: Send and read WhatsApp messages from your own accounts. The same capabilities as the WhatsMCP MCP server, over plain HTTP.
  title: WhatsMCP Chats API
  version: 0.1.195
servers:
- url: https://api.whatsmcp.com
security:
- bearerAuth: []
- apiKey: []
tags:
- name: Chats
paths:
  /v1/accounts/{account_id}/chats:
    get:
      description: Lists one account's conversations — direct chats, groups and channels — most recently active first, each with its JID, type and archive status (is_archived). Pass exclude_archived to leave archived chats out. Mirrors the wa_list_chats MCP tool.
      operationId: list-chats
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          type: string
      - description: how many conversations, 1-200; omit or 0 for 50
        explode: false
        in: query
        name: limit
        schema:
          description: how many conversations, 1-200; omit or 0 for 50
          format: int64
          maximum: 200
          minimum: 0
          type: integer
      - description: omit chats you have archived on WhatsApp; default false
        explode: false
        in: query
        name: exclude_archived
        schema:
          description: omit chats you have archived on WhatsApp; default false
          type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListChatsOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Forbidden
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: List an account's chats
      tags:
      - Chats
  /v1/accounts/{account_id}/chats/{chat}:
    get:
      operationId: get-chat
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          type: string
      - description: a phone number (digits) or a full JID (…@g.us)
        in: path
        name: chat
        required: true
        schema:
          description: a phone number (digits) or a full JID (…@g.us)
          type: string
      - explode: false
        in: query
        name: limit
        schema:
          format: int64
          maximum: 200
          minimum: 0
          type: integer
      - explode: false
        in: query
        name: since
        schema:
          type: string
      - explode: false
        in: query
        name: until
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetChatOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Forbidden
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: Read one chat
      tags:
      - Chats
  /v1/accounts/{account_id}/chats/{chat}/archive:
    put:
      operationId: archive-chat
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          type: string
      - in: path
        name: chat
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArchiveChatInBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArchiveChatOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Forbidden
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: Archive or unarchive a chat
      tags:
      - Chats
  /v1/accounts/{account_id}/chats/{chat}/history:
    post:
      operationId: load-history
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          type: string
      - in: path
        name: chat
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoadHistoryInBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoadHistoryOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Forbidden
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: Load older messages
      tags:
      - Chats
  /v1/accounts/{account_id}/chats/{chat}/presence:
    put:
      operationId: set-presence
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          type: string
      - in: path
        name: chat
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetPresenceInBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetPresenceOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Forbidden
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: Set presence in a chat
      tags:
      - Chats
  /v1/accounts/{account_id}/presence:
    put:
      operationId: set-account-presence
      parameters:
      - in: path
        name: account_id
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetAccountPresenceInBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetPresenceOutput'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Forbidden
        '409':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Conflict
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Internal Server Error
      summary: Set an account online or offline
      tags:
      - Chats
components:
  schemas:
    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
    GetChatOutput:
      additionalProperties: false
      properties:
        account:
          $ref: '#/components/schemas/AccountRef'
          description: the account this conversation was read from
        account_notices:
          description: 'present when a number this read covers is not working: new messages are not arriving on it; says why and what to do'
          items:
            $ref: '#/components/schemas/AccountNotice'
          type:
          - array
          - 'null'
        has_more:
          description: true when older messages match than were returned; page them with wa_list_messages(account_id, chat, since, until, include_history=true)
          type: boolean
        messages:
          description: recent messages for this account, oldest first
          items:
            $ref: '#/components/schemas/MessageView'
          type:
          - array
          - 'null'
        refusal:
          $ref: '#/components/schemas/Refusal'
          description: present only when the request was declined
      required:
      - messages
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    LoadHistoryOutput:
      additionalProperties: false
      properties:
        answered:
          description: the phone answered in time; false means it may still answer later (it must be online) — read the chat again in a minute
          type: boolean
        imported:
          description: of those, how many were new here; 0 with answered=true usually means you reached the start of what the phone holds
          format: int64
          type: integer
        received:
          description: messages the phone sent back
          format: int64
          type: integer
        refusal:
          $ref: '#/components/schemas/Refusal'
          description: present only when status is refused
        status:
          description: ok (the request reached the phone) or refused (nothing was asked)
          type: string
      required:
      - status
      - answered
      - received
      - imported
      type: object
    LoadHistoryInBody:
      additionalProperties: false
      properties:
        count:
          description: how many older messages to ask the phone for, 1-500; defaults to 50
          format: int64
          type: integer
      type: object
    AttachmentView:
      additionalProperties: false
      properties:
        available:
          description: true when the file should be fetchable with wa_get_media(account_id, message_id) — a live received or sent attachment; false for imported history, which is not kept
          type: boolean
        file_name:
          description: 'documents only: the file name the sender gave it'
          type: string
        media_url:
          description: a time-limited (1h) signed URL to GET the attachment's bytes, present only when the read passed include_media_urls and the attachment is available; an expired link is refused — read again for a fresh one
          type: string
        mime:
          description: the attachment's mime type as the sender declared it, e.g. image/jpeg or application/pdf; empty for a message stored before this was recorded
          type: string
        size:
          description: the attachment's size in bytes as the sender declared it; 0 when unknown
          format: int64
          type: integer
      required:
      - available
      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: '#/components/schemas/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
    SetPresenceInBody:
      additionalProperties: false
      properties:
        state:
          description: composing, paused, available, or unavailable
          type: string
      required:
      - state
      type: object
    AccountRef:
      additionalProperties: false
      properties:
        account_id:
          description: the id to pass to other wa_ tools
          type: string
        name:
          description: the account's WhatsApp display name
          type: string
        phone:
          description: the account's phone number, E.164
          type: string
      required:
      - account_id
      type: object
    ListChatsOutput:
      additionalProperties: false
      properties:
        account:
          $ref: '#/components/schemas/AccountRef'
        account_notices:
          items:
            $ref: '#/components/schemas/AccountNotice'
          type:
          - array
          - 'null'
        chats:
          items:
            $ref: '#/components/schemas/ChatView'
          type:
          - array
          - 'null'
        refusal:
          $ref: '#/components/schemas/Refusal'
      required:
      - chats
      type: object
    ArchiveChatOutput:
      additionalProperties: false
      properties:
        refusal:
          $ref: '#/components/schemas/Refusal'
          description: present only when status is refused
        status:
          description: ok (queued to the bridge) or refused (nothing was done)
          type: string
      required:
      - status
      type: object
    SentByView:
      additionalProperties: false
      properties:
        id:
          description: the agent's, the API key's or the OAuth app's id
          type: string
        kind:
          description: agent (a hosted AI agent), api_key (an app on one of your API keys) or oauth_app (an app you connected over OAuth, such as Claude)
          type: string
        name:
          description: its name as it was when the message was sent
          type: string
        version:
          description: 'an agent only: the number of the agent''s version that wrote it'
          format: int64
          type: integer
        via:
          description: 'an app only: mcp or rest, the API it sent through'
          type: string
      required:
      - kind
      - id
      type: object
    MessageView:
      additionalProperties: false
      properties:
        account_id:
          description: which of your accounts this message belongs to
          type: string
        account_name:
          description: the WhatsApp display name of that account
          type: string
        account_phone:
          description: the phone number of your account this message was sent from or received on, E.164
          type: string
        at:
          description: when the message was sent, RFC3339
          type: string
        attachment:
          $ref: '#/components/schemas/AttachmentView'
          description: 'present on an image, video, audio, document or sticker message: the file''s mime type, size and name; fetch the bytes with wa_get_media, or pass include_media_urls on the read to get a direct media_url'
        chat:
          description: 'the conversation JID; pass it to wa_send_message''s ''to'' to reply here — a group is …@g.us, a channel …@newsletter; on a Telegram account a Telegram id: <id>@telegram for a user, -<id>@telegram for a basic group, -100<id>@telegram for a channel or supergroup'
          type: string
        chat_kind:
          description: dm, group, channel or broadcast; a Telegram supergroup reads as channel
          type: string
        cursor:
          description: pass the highest cursor you have seen back as after_cursor to continue
          format: int64
          type: integer
        direction:
          description: inbound (received) or outbound (sent by you)
          type: string
        imported:
          description: true for a message loaded as history (pairing sync or wa_load_history) rather than received live
          type: boolean
        kind:
          description: 'what the message is: text, image, video, audio, document, sticker, reaction, location, live_location, contact, poll, poll_vote, video_note, album, event, comment, pin, group_invite, template or call_permission; other is a type this server does not classify. text carries a body, and so do image/video/document captions, template text and a call_permission request or answer; an image, video, audio, document or sticker attachment can be fetched with wa_get_media; a reaction carries its emoji as text and names its target message in reacted_to_message_id, while a reply carries quoted_message_id for the message it quotes'
          type: string
        message_id:
          description: WhatsApp's id for this message
          type: string
        peer:
          description: the other party's phone number (for a group/channel this is the individual SENDER; use chat to reply); on a Telegram account the other party's Telegram id, <id>@telegram
          type: string
        quoted_message_id:
          description: 'present on a reply: the message_id of the message this one quotes; pass it to wa_get_message to read what was quoted'
          type: string
        quoted_sender:
          description: 'who wrote the quoted message: a phone number when known, otherwise a JID'
          type: string
        reacted_to_message_id:
          description: 'present on a kind=reaction message: the message_id this reaction is about; the emoji itself is in text'
          type: string
        received_at:
          description: when this server received and stored the message, RFC3339; later than at for a message delivered late or loaded as history
          type: string
        send_error:
          description: set on an outbound message that failed to send
          type: string
        sender_name:
          description: 'who wrote the message, by name: for inbound the sender''s name as saved in this account''s contacts, or else the name they chose for themselves; for outbound this account''s own WhatsApp name. Empty when no name is known'
          type: string
        sent_by:
          $ref: '#/components/schemas/SentByView'
          description: 'present on an outbound message an AI agent or an app sent through WhatsMCP: who asked for the send'
        status:
          description: 'delivery status of an outbound message from the provider''s receipts: sent, delivered, read or failed; empty when no receipt has arrived (or for inbound). Only Business (Cloud API) numbers report this today'
          type: string
        text:
          description: the message body; for a kind=reaction message this is the emoji
          type: string
        undecryptable:
          description: 'true for an inbound message this account could not decrypt: its text is unavailable. The sender''s app may resend it, after which a later read returns the decrypted message'
          type: boolean
      required:
      - cursor
      - account_id
      - direction
      - peer
      - text
      - kind
      - at
      - message_id
      type: object
    AccountNotice:
      additionalProperties: false
      properties:
        account_id:
          description: the account this notice is about
          type: string
        message:
          description: what is wrong and what to do; tell the user
          type: string
        since:
          description: when it stopped working, RFC3339, when known
          type: string
        status:
          description: 'why it is not live: starting, not_running, whatsapp_down (telegram_down for a Telegram account), suspended, pairing, unlinked or locked'
          type: string
        status_reason:
          description: the detail, e.g. no_egress, no_plan, stopped
          type: string
      required:
      - account_id
      - status
      - message
      type: object
    SetAccountPresenceInBody:
      additionalProperties: false
      properties:
        state:
          description: available or unavailable (sets the account online/offline); composing/paused are per-chat — use …/chats/{chat}/presence
          type: string
      required:
      - state
      type: object
    SetPresenceOutput:
      additionalProperties: false
      properties:
        refusal:
          $ref: '#/components/schemas/Refusal'
          description: present only when status is refused
        status:
          description: ok (queued to the bridge) or refused (nothing was sent)
          type: string
      required:
      - status
      type: object
    ArchiveChatInBody:
      additionalProperties: false
      properties:
        archive:
          description: true to archive (the default when omitted), false to unarchive
          type: boolean
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: A human-readable explanation specific to this occurrence of the problem.
          examples:
          - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
          - array
          - 'null'
        instance:
          description: A URI reference that identifies the specific occurrence of the problem.
          examples:
          - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
          - 400
          format: int64
          type: integer
        title:
          description: A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
          examples:
          - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
          - https://example.com/errors/example
          format: uri
          type: string
      type: object
    ChatView:
      additionalProperties: false
      properties:
        archived_at:
          type: string
        chat:
          type: string
        chat_kind:
          type: string
        is_archived:
          type: boolean
        last_message_at:
          type: string
        message_count:
          format: int64
          type: integer
        name:
          type: string
      required:
      - chat
      - chat_kind
      - is_archived
      type: object
  securitySchemes:
    apiKey:
      description: An API key from the console.
      in: header
      name: X-API-Key
      type: apiKey
    bearerAuth:
      description: 'An API key from the console (API keys page), as Authorization: Bearer wamcp_live_…. OAuth access tokens are not accepted here; they are for /mcp.'
      scheme: bearer
      type: http