# Save group AI summary settings

Switch AI summaries on or off for a group and choose when and where they are sent.
**How it works.** When nobody has written in the group for `quietMinutes`, eCommunicate's AI summarises
the messages since the last summary (issues raised, how they were resolved, action items) and `POST`s the
summary to `webhookUrl`. See the **Callbacks** section below for the request your API receives.
- Summaries start from the moment you switch them on; messages from before that are never summarised.
- A conversation with fewer than
`minMessages`
 messages waits for more; its messages are included in the

group's next summary. Set
`sendShortAfterHours`
 to summarise it anyway once its first message is that

many hours old, so a lone announcement isn't held back.
`null`
 waits for more messages indefinitely.
- For groups that are rarely quiet,
`longMode`
 also ends a conversation after
`longLimit`
 hours since

its first unsummarised message (
`MAX_HOURS`
) or after
`longLimit`
 messages (
`MAX_MESSAGES`
).
- Only WhatsApp Lite groups can be summarised. Messages are only stored for groups eCommunicate knows

about, so import groups your number was already in before setting this up.

**Saving replaces every setting**, so send all fields. The one exception is `webhookApiKey`: leave it
out, or send it blank, to keep the saved key. Send `removeWebhookApiKey: true` to delete the saved key.
`webhookUrl` must be `https://` and reachable on the internet. `localhost` and private, loopback and
link-local addresses are refused. Switching summaries on requires `webhookUrl`. The `webhookApiKey` is
optional; without one, summaries are sent with no `Authorization` header.

Endpoint: PUT /payless4messaging-service/WhatsApp/api/v1/groups/{id}/summary-settings
Version: 3.0.0
Security: apikeyAuth

## Security:

  - `apikeyAuth` (unknown)
    apiKey in header Authorization

  - `groupSummaryWebhookKey` (unknown)
    apiKey in header Authorization

## Path parameters:

  - `id` (string, required)
    The group's `id` (UUID) from the group list, not its WhatsApp JID.

## Request fields (application/json):

  - `enabled` (boolean, required)
    Example: true

  - `quietMinutes` (integer, required)
    Summarise once nobody has written for this many minutes.
    Example: 30

  - `format` (string, required)
    `TEXT` sends a plain-text summary; `JSON` sends an object (see `GroupSummaryJson`).
    Enum: "TEXT", "JSON"

  - `longMode` (string, required)
    What else ends a conversation that never goes quiet.
    Enum: "NONE", "MAX_HOURS", "MAX_MESSAGES"

  - `longLimit` (integer | null)
    Hours (1–48) for `MAX_HOURS`, messages (10–1000) for `MAX_MESSAGES`. Ignored for `NONE`.
    Example: null

  - `minMessages` (integer, required)
    Conversations shorter than this wait for the next one.
    Example: 3

  - `sendShortAfterHours` (integer | null)
    Summarise a conversation shorter than `minMessages` anyway once its first message is this many hours old. Null waits for more messages. Defaults to 24 for a group never set up.
    Example: 24

  - `webhookUrl` (string | null)
    Your API. Public `https://` only. Null clears it, which is only allowed while summaries are off.
    Example: https://api.example.com/group-summaries

  - `webhookApiKey` (string | null)
    Optional. Sent in the `Authorization` header with every summary. Omit or leave blank to keep the saved key.
    Example: sk_live_4f9a2c7e1b

  - `removeWebhookApiKey` (boolean)
    `true` deletes the saved key, so summaries are sent without an `Authorization` header. Wins over `webhookApiKey`.
    Example: false

## Request examples:

  - `Switch on, plain text` (unknown)

  - `JSON, capped at 4 hours, keep the saved key` (unknown)

## Response 200:

  - `200` (unknown)
    The saved settings

## Response 200 fields (application/json):

  - `groupId` (string)
    Example: c0d1e2f3-a4b5-6789-c0d1-e2f3a4b56789

  - `available` (boolean)
    Whether AI summaries are switched on for your account.
    Example: true

  - `enabled` (boolean)
    Example: true

  - `quietMinutes` (integer)
    Example: 30

  - `format` (string)
    Enum: "TEXT", "JSON"

  - `longMode` (string)
    Enum: "NONE", "MAX_HOURS", "MAX_MESSAGES"

  - `longLimit` (integer | null)
    Example: null

  - `minMessages` (integer)
    Example: 3

  - `sendShortAfterHours` (integer | null)
    Example: 24

  - `webhookUrl` (string | null)
    Example: https://api.example.com/group-summaries

  - `hasApiKey` (boolean)
    Whether an API key is saved. The key itself is never returned.
    Example: true

## Response 400:

  - `400` (unknown)
    A value is out of range, `webhookUrl` isn't a public `https://` address, or summaries were switched on
without both an address and a key. The message says which.

## Response 400 fields (application/json):

  - `title` (string)
    Example: Bad Request

  - `status` (integer)
    Example: 400

  - `detail` (string)
    Example: Your API's address must start with https://

## Response 401:

  - `401` (unknown)
    Authentication failed — the API key sent in the `Authorization` header is missing,
invalid, or has been revoked.
**Verify your API key before changing anything else.** Check the key currently active
on your account either in the eCommunicate web UI (API key settings), or by calling
`POST /payless4messaging-service/WhatsApp/authenticate/retrieveApiKey` with your
account credentials — that endpoint needs no existing key, so it works while every
other call is returning `401`. Compare the result with the value your integration is
sending: pass the key on its own (no `Bearer` prefix), trimmed of whitespace, as a
36-character UUID.
Do not retry a `401` — it will fail identically until the key is corrected. See the
[Authentication guide](/guides/authentication#troubleshooting-a-401).

## Response 401 fields (application/json):

  - `status` (string)
    Example: ERROR

  - `message` (string)
    Example: Unauthorized user

  - `requestId` (string)
    Example: c3a1f8e2-4b6d-11ee-be56-0242ac120002

  - `timestamp` (string)
    Example: 2026-01-15T10:30:00Z

## Response 403:

  - `403` (unknown)
    AI summaries aren't switched on for your account. Contact eCommunicate support.

## Response 403 fields (application/json):

  - `title` (string)
    Example: Forbidden

  - `status` (integer)
    Example: 403

  - `detail` (string)
    Example: Group chat summaries aren't switched on for your account. Contact support to turn them on.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `status` (string)
    Example: ERROR

  - `message` (string)
    Example: Resource not found

  - `requestId` (string)
    Example: c3a1f8e2-4b6d-11ee-be56-0242ac120002

  - `timestamp` (string)
    Example: 2026-01-15T10:30:00Z

## Callback:

  - `groupSummary` (unknown)
    Group summary sent to your API Sent to your `webhookUrl` each time a group conversation ends and has been summarised.
**Authentication.** If you saved a `webhookApiKey`, the `Authorization` header carries it exactly
as you typed it (no `Bearer` prefix is added); reject requests that don't carry it. With no key
saved, the header is left out.
**Answer with any `2xx`** once you have stored the summary. Anything else, a timeout (10 seconds)
or a connection failure is retried after 1, 5 and 30 minutes; after 4 attempts the summary is not
sent again. Redirects are not followed, so a `3xx` counts as a failure.
**Duplicates.** A retry after a timeout you did process sends the same summary again. Use
`X-Idempotency-Key` (equal to `summaryId`) to ignore it.
Summaries of one group arrive in order, but don't rely on it: sort by `windowEnd`.

## Callback header parameters:

  - `X-Idempotency-Key` (string, required)
    The summary's id. The same value on every retry of one summary.

## Callback request fields (application/json):

  - `summaryId` (string, required)
    Unique per summary; also sent as `X-Idempotency-Key`.
    Example: 6f1c2a9e-3b7d-4e8a-9c2f-1d5e7a3b9c04

  - `clientRef` (string, required)
    Example: Growthpoint

  - `groupJid` (string, required)
    Example: 120363045678901234@g.us

  - `groupName` (string | null)
    The group's name when the summary was sent.
    Example: Printer support

  - `windowStart` (string, required)
    UTC. Exclusive: the last message of the previous summary, or when summaries were switched on.
    Example: 2026-11-19T07:00:00Z

  - `windowEnd` (string, required)
    UTC. The newest message included.
    Example: 2026-11-19T07:42:13.518Z

  - `messageCount` (integer, required)
    Messages in the window, attachments included.
    Example: 14

  - `format` (string, required)
    Enum: "TEXT", "JSON"

  - `summary` (any, required)
    A plain-text summary when `format` is `TEXT`; a `GroupSummaryJson` object when it is `JSON`.

  - `summary.summary` (string, required)
    Two or three sentences on what the conversation was about and where it stands.
    Example: The floor 3 printer jammed and was fixed; toner is still low.

  - `summary.issues` (array, required)
    Each distinct issue raised, oldest first.

  - `summary.issues.title` (string, required)
    Example: Toner low

  - `summary.issues.raisedBy` (string, required)
    Name as shown in the group; never a phone number.
    Example: Carol

  - `summary.issues.resolution` (string | null, required)
    How it was resolved and by whom; null while open.
    Example: null

  - `summary.issues.status` (string, required)
    Enum: "RESOLVED", "OPEN"

  - `summary.actionItems` (array, required)

  - `summary.actionItems.description` (string, required)
    Example: Order toner

  - `summary.actionItems.owner` (string | null, required)
    Null when the chat names nobody.
    Example: Facilities

  - `summary.participants` (array, required)
    Names of everyone who wrote in the conversation.

## Callback request examples:

  - `Plain text` (unknown)

  - `JSON` (unknown)

## Callback response 2XX:

  - `2XX` (unknown)
    Stored. The summary is not sent again.

## Callback response 4XX:

  - `4XX` (unknown)
    Not accepted. Retried, up to 4 attempts in all.

## Callback response 5XX:

  - `5XX` (unknown)
    Not accepted. Retried, up to 4 attempts in all.

