Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

Merge remote-tracking branch 'origin/main' into docs/groups-response-schemas

Yudhi Armyndharisfb5bb7968e7a
diff --cc CHANGELOG.md
index 926e1bd3c,2643b6a72..de923a642
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -21,7 -21,7 +21,8 @@@ and this project adheres to [Semantic V
### Changed
+ - **The ten contacts endpoints now publish the shape of what they return** — they documented a status and a sentence but no schema, so the committed OpenAPI snapshot had nothing to diff for any of them and a change to a response body could reach clients without the contract gate noticing; `GET /contacts/{contactId}/phone` returning `null` for an unresolvable id, and the batch picture lookup answering `null` per id rather than failing, are now stated rather than discovered by calling.
+- **The eighteen group endpoints now publish the shape of what they return** — the whole module documented statuses and prose but not one response schema, so the committed OpenAPI snapshot had nothing to diff for any of it; the per-participant `results` array that an add/remove/promote/demote returns, and the fact that a partial refusal is reported inside a `200` rather than as an error, are now in the contract instead of only in a sentence.
- **Fourteen more boolean environment variables are now validated at boot** — they are read with a bare `=== 'true'` / `!== 'false'` comparison, so a spelling like `DATABASE_SSL=require` silently configured the opposite of what was asked for; `DATABASE_SSL` in particular read as OFF and sent credentials in plaintext to a server the operator believed was TLS-protected. Only `true`/`false` (or blank) are accepted now, so a deployment using another spelling will fail startup until it is corrected. `MCP_READONLY` and `PUPPETEER_HEADLESS` stay tolerant deliberately — both fail toward the safe state.
- **The API description now documents the two statuses middleware returns before routing** — `415` for a compressed request body and `503` with `Retry-After` when too much body data is already in flight, neither of which appeared anywhere in the OpenAPI document despite applying to every operation.
- **The Helm chart now states the reason `replicaCount` must stay 1 that actually applies today** — the warning described two pods corrupting shared session auth, which a session lease and per-pod volumes already prevent, so an operator acting on it would mitigate the wrong thing.
diff --cc openapi.json
index f1f34cdc8,9c23b7e3f..358b12c40
--- a/openapi.json
+++ b/openapi.json
@@@ -9405,173 -9477,25 +9603,192 @@@
"firstName"
]
},
+ "ContactAckResponseDto": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean",
+ "description": "Always true — a failure is reported as a non-2xx status, not as false.",
+ "example": true
+ },
+ "message": {
+ "type": "string",
+ "description": "Human-readable confirmation of what was done.",
+ "example": "Contact saved"
+ }
+ },
+ "required": [
+ "success",
+ "message"
+ ]
+ },
+ "GroupJoinInfoDto": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Group id.",
+ "example": "[email protected]"
+ },
+ "name": {
+ "type": "string",
+ "description": "Group subject.",
+ "example": "Engineering"
+ },
+ "description": {
+ "type": "string",
+ "description": "Group description.",
+ "example": "Release coordination"
+ },
+ "owner": {
+ "type": "string",
+ "description": "Owner id in the engine's native format.",
+ "example": "[email protected]"
+ },
+ "createdAt": {
+ "type": "number",
+ "description": "Unix SECONDS the group was created.",
+ "example": 1786000000
+ },
+ "participantCount": {
+ "type": "number",
+ "description": "Member count, when disclosed.",
+ "example": 42
+ }
+ },
+ "required": [
+ "id",
+ "name"
+ ]
+ },
+ "GroupParticipantDto": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Participant id in the engine's native format.",
+ "example": "[email protected]"
+ },
+ "number": {
+ "type": "string",
+ "description": "MSISDN digits, without a leading + or separators.",
+ "example": "628123456789"
+ },
+ "name": {
+ "type": "string",
+ "description": "Display name, when the engine reports one.",
+ "example": "Ada Lovelace"
+ },
+ "isAdmin": {
+ "type": "boolean",
+ "description": "Whether the participant is a group admin.",
+ "example": false
+ },
+ "isSuperAdmin": {
+ "type": "boolean",
+ "description": "Whether the participant created the group.",
+ "example": false
+ }
+ },
+ "required": [
+ "id",
+ "number",
+ "isAdmin",
+ "isSuperAdmin"
+ ]
+ },
+ "GroupInfoDto": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Group id.",
+ "example": "[email protected]"
+ },
+ "name": {
+ "type": "string",
+ "description": "Group subject.",
+ "example": "Engineering"
+ },
+ "participantsCount": {
+ "type": "number",
+ "description": "Member count, when the engine reports it.",
+ "example": 42
+ },
+ "isAdmin": {
+ "type": "boolean",
+ "description": "Whether this account is an admin of the group.",
+ "example": true
+ },
+ "linkedParentJID": {
+ "type": "string",
+ "nullable": true,
+ "description": "JID of the parent community, or null when the group is standalone.",
+ "example": null
+ },
+ "description": {
+ "type": "string",
+ "description": "Group description.",
+ "example": "Release coordination"
+ },
+ "owner": {
+ "type": "string",
+ "description": "Owner id in the engine's native format.",
+ "example": "[email protected]"
+ },
+ "createdAt": {
+ "type": "number",
+ "description": "Unix SECONDS the group was created.",
+ "example": 1786000000
+ },
+ "participants": {
+ "description": "Members of the group.",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/GroupParticipantDto"
+ }
+ },
+ "isReadOnly": {
+ "type": "boolean",
+ "description": "Whether this account can no longer post (left or removed).",
+ "example": false
+ },
+ "isAnnounce": {
+ "type": "boolean",
+ "description": "Engine-reported announce flag.",
+ "example": false
+ },
+ "announce": {
+ "type": "boolean",
+ "description": "Only admins may send messages.",
+ "example": false
+ },
+ "locked": {
+ "type": "boolean",
+ "description": "Only admins may edit subject, description and picture.",
+ "example": false
+ },
+ "ephemeralSeconds": {
+ "type": "number",
+ "description": "Disappearing-messages timer in seconds; 0 or absent means off.",
+ "example": 0
+ },
+ "memberAddMode": {
+ "type": "string",
+ "enum": [
+ "all",
+ "admins"
+ ],
+ "description": "Who may add participants. Absent when the engine did not report it.",
+ "example": "admins"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "participants"
+ ]
+ },
"JoinGroupDto": {
"type": "object",
"properties": {