Quickstart

Base URL: https://api.groupapp.co.il/v1

All requests are made from your server. The API sets no CORS headers, so a browser cannot call it, and a key must never be shipped in front-end code.

1. Get a key

Keys are created today by a GroupApp admin on the dashboard, under Settings > API keys. Ask your GroupApp contact to create one for you. Customer-created keys are not available yet.

The admin sets these fields on the "New key" form:

Field Meaning
Key name A label, up to 100 characters.
System that uses the key A short name for the system that will hold the key. It is recorded next to every call.
Role viewer (default, the narrowest), manager, support_agent or admin. The role limits what the key may do on top of its permissions.
Mode Live (default) or Test. A live key (ga_live_) sends for real. A test key (ga_test_) runs every check and stops before sending. See Test mode.
Bots One bot, or all bots. A key reaches only these bots.
Permissions <family>:read and <family>:write checkboxes for each family. The default is bots:read.
Expires on (optional) A date. The key stops working at the end of that day (in the admin's time zone). Without a date it does not expire.

The secret is shown once, when the key is created. It cannot be shown again. If it is lost, create a new key. The mode is fixed when the key is created.

Start with a test key: ask for a key with Mode Test. Nothing you send with it reaches WhatsApp.

To follow this guide the key needs bots:read (read a bot), posts:write (send a post), and posts:read (read the request you get back; posts:write also allows reads). The role must be one that may send messages: manager, support_agent or admin; a viewer key is refused with forbidden.

Keep the secret in an environment variable:

export GROUPAPP_API_KEY='ga_test_XXXXXXXX...'

2. Read a bot

curl https://api.groupapp.co.il/v1/bots/my-bot \
  -H "Authorization: Bearer $GROUPAPP_API_KEY"
{
  "object": "bot",
  "id": "my-bot",
  "displayName": "My bot",
  "status": "connected",
  "lastSeenAt": "2026-01-01T09:00:00.000Z",
  "messagesToday": 12,
  "instances": [
    {
      "id": "my-bot-1",
      "label": null,
      "state": "connected",
      "liveness": "connected",
      "lastSeenAt": "2026-01-01T09:00:00.000Z"
    }
  ]
}

Every response carries a Request-Id header, except the plain 405 answer for a method a route does not support. Quote it when you contact support.

If the call fails, see Errors and Authentication.

3. Send a first post

With a test key this sends nothing: every check runs, and the send stops before it reaches a bot or WhatsApp. The target group does not have to exist.

curl -X POST https://api.groupapp.co.il/v1/posts \
  -H "Authorization: Bearer $GROUPAPP_API_KEY" \
  -H "Idempotency-Key: first-post-0001" \
  -H "Content-Type: application/json" \
  -d '{
    "botId": "my-bot",
    "targetIds": ["[email protected]"],
    "text": "Hello from the API"
  }'

Send either targetIds (1 to 100 ids) or superGroupId, never both. A post needs text, mediaUrl, or both.

An accepted target is a group id (<digits and hyphens>@g.us), a channel id (<digits>@newsletter) or status@broadcast, the bot's own WhatsApp Status. Person ids are refused. A Status post takes an image, a video or text, not audio or a document, and it is never sent a second time because of an Idempotency-Key (see Idempotency and async requests).

The body takes these fields:

Field Type Meaning
botId string, required The bot to send through, 1 to 200 characters.
targetIds array of strings 1 to 100 targets. Repeated ids count once.
superGroupId string 1 to 200 characters. Give exactly one of targetIds and superGroupId.
text string 1 to 65,536 characters. With mediaUrl it is the caption. A post to a super group cannot be a timing command (a message that starts with one of the bot's scheduling commands).
mediaUrl string The link of the file to send.
quotedMessageId string 1 to 300 characters. The message to reply to. Needs targetIds with exactly one target.
asVoice boolean Send an audio file as a voice note. Needs targetIds and mediaUrl.
linkPreview boolean Ask for a link preview.
sendMediaAsDocument boolean Send the file as a document.
metadata object Up to 20 pairs, echoed back on the request. A key is 1 to 40 characters of A-Z, a-z, 0-9, _ or -; a value is a string of at most 500 characters.

Any other field is refused as unknown field.

A test key accepts a group id of the usual shape (digits and hyphens followed by @g.us) without checking that the group exists or that the bot is in it.

Always send an Idempotency-Key. If the request times out or the connection drops, repeat it with the same key and body: you get the original answer and no second message. See Idempotency and async requests.

The post is accepted, not yet sent. The answer is 202 Accepted:

HTTP/1.1 202 Accepted
Location: /v1/requests/req_00000000-0000-0000-0000-000000000000
Request-Id: ...
{
  "object": "request",
  "id": "req_00000000-0000-0000-0000-000000000000",
  "status": "accepted",
  "botId": "my-bot"
}

4. Check the result

Poll the request until status is no longer accepted or in_progress:

curl https://api.groupapp.co.il/v1/requests/req_00000000-0000-0000-0000-000000000000 \
  -H "Authorization: Bearer $GROUPAPP_API_KEY"
{
  "object": "request",
  "id": "req_00000000-0000-0000-0000-000000000000",
  "status": "succeeded",
  "botId": "my-bot",
  "createdAt": "2026-01-01T09:00:00.000Z",
  "completedAt": "2026-01-01T09:00:02.000Z",
  "result": {
    "targets": [
      { "targetId": "[email protected]", "status": "sent", "messageId": "test_00000000-0000-0000-0000-000000000000_0" }
    ]
  }
}

A test send ends succeeded and its messageId starts with test_. A live send carries the id of the real message. If you sent to a super group (superGroupId) with a test key, result is {}: no post is created, so there is no postId.

While the request is open the response carries Retry-After: 2. Wait that many seconds between polls.

To avoid polling, add ?wait=<seconds> (0 to 10) to the POST. The call then holds until the send finishes or the time runs out, and answers 200 with the finished request, or the same 202 if it is still open:

curl -X POST "https://api.groupapp.co.il/v1/posts?wait=10" ...

5. Try the failure cases

A test key gives three reserved target ids that always fail in the same way. Use them to test how your code handles a failed target:

Target id Target status error refused
[email protected] failed not-admin true
[email protected] failed not-member true
[email protected] failed send-failed not present
curl -X POST https://api.groupapp.co.il/v1/posts \
  -H "Authorization: Bearer $GROUPAPP_API_KEY" \
  -H "Idempotency-Key: first-post-0002" \
  -H "Content-Type: application/json" \
  -d '{
    "botId": "my-bot",
    "targetIds": ["[email protected]", "[email protected]"],
    "text": "Hello from the API"
  }'

The request still ends succeeded. The failure is in result.targets:

{
  "targets": [
    { "targetId": "[email protected]", "status": "sent", "messageId": "test_00000000-0000-0000-0000-000000000000_0" },
    { "targetId": "[email protected]", "status": "failed", "error": "not-admin", "refused": true }
  ]
}

A live key refuses these ids: the post is not accepted, and the answer is 400 invalid-request with the detail person-target-refused.

Test mode

A test key does what a live key with the same bots, scopes and role does, with one difference: a send stops before it is sent.

  • Same checks. The key, its scopes and role, the bot, the body, the Idempotency-Key and the rate limits work as for a live key, and the same problems are returned.
  • Nothing is sent. No message reaches a bot or WhatsApp.
  • Canned result. A POST /v1/posts is accepted with 202 and the request ends succeeded. For targetIds, result.targets has one entry per target: sent with a messageId starting with test_, or failed for a reserved id. For superGroupId, result is {}.
  • Webhooks. A test send never reaches a bot, so it produces no post.* event. A test send to targetIds does queue a send.completed event, with the sample result. A request.completed event for a test key does not reach subscriptions that receive live events. See Webhooks.
  • Reads are real. GET /v1/bots/{botId} with a test key returns the same data as with a live key.
  • Kept apart from live. A test key and a live key of the same system have separate idempotency keys, separate rate-limit counts and separate requests. A request made with a test key answers 404 not-found to a live key, and the other way round.

6. Going live

Warning: a live key sends real WhatsApp messages. Use a group you own for the first live post.

  1. Ask for a key with Mode Live (the default), with the same bots, scopes and role as the test key.
  2. Replace GROUPAPP_API_KEY with the live secret (ga_live_XXXXXXXX...). The URLs and requests do not change.
  3. Remove the reserved [email protected] ids from your requests: a live key refuses them.
  4. Idempotency keys are separate between modes, so a key you used in testing is new to the live key.
  5. Keep reading the request with GET /v1/requests/{id} to see the real result, and subscribe to webhooks to be told when a post finishes.

Next steps

  • Authentication: key format, test and live keys, scopes, what to do if a key leaks.
  • Errors: every problem code.
  • Rate limits: how many calls and sends a key may make.
  • The OpenAPI document is served at https://api.groupapp.co.il/v1/openapi.json.