Skip to main content

Overview

This section documents the 19 Z-API group routes that Omni Z-API serves in Z-API Compatibility. The path (/instances/ or /channels/, followed by /{id}/token/{token}/ and the route), the body fields and the response format are the Z-API ones. To query, create and manage groups, the only change in your application is still the base URL and the authentication header. What each route does depends on the channel type. The group routes work on WhatsApp Web channels and, with limitations, on WhatsApp Official channels (Meta’s official API).

Availability by channel

  • WhatsApp Web: the 19 routes are available.
  • WhatsApp Official: 12 routes work, through Meta’s Groups API. The other 7 answer 422 with <route> is not available for META_WHATSAPP channels, where <route> is the route name without the slash, such as add-participant.
  • Other channels (Telegram, Instagram, Messenger and others): every route answers 422.
<TYPE> is the channel type. A channel without a type gets group route is not available for this channel type; available only on Z-API (WhatsApp Web) instances.

Group ID

The group ID is the value the routes receive in phone or groupId.
  • Get the ID from Get groups or from the Create group response. Use the value as you received it, without building or changing it.
  • On WhatsApp Official, the ID has 1 to 128 characters of [A-Za-z0-9._=-]. An ID with @, such as 120363019502650977@g.us, answers 400 with invalid path parameter.
  • An integration that recognizes a group by the -group suffix does not recognize the WhatsApp Official ID.
  • The ID of one channel does not work on another: the formats are different.

What changes on WhatsApp Official

The group routes on WhatsApp Official require an Official Business Account (OBA) and do not work on a number in coexistence, according to Meta. The errors for these two situations are in Common errors.
Meta’s Groups API has limits that WhatsApp Web does not have. An integration coming from Z-API needs to know:
  • Get groups lists the active groups of the number in Meta’s Groups API.
  • Nobody is added at creation. The numbers in phones come back in phonesNotAdded, and entry is only through the invitation link, because Meta does not allow adding participants manually.
  • The group has at most 8 participants, a Meta limit.
  • The business is the creator and administrator of the group. owner is null, participants come back as regular members, and the promote and remove admin routes do not exist on WhatsApp Official.
  • {"value": true} is Meta’s acceptance, not confirmation that the change already showed up in the group.
  • phone can be null at creation, when Meta has not listed the group yet.
  • Check Get groups before repeating a creation that answered 502: the group may have been created.
  • Approving and rejecting participants only work for a group with join approval, created with requireAdminApproval true.

Common errors

Every error has the format {"error": "<message>"}. The ones that apply to the group routes: