Skip to content

Commit 89eaa77

Browse files
author
Nicolás Gudiño
committed
Update api spec file to include new group endpoints
1 parent 4eef375 commit 89eaa77

1 file changed

Lines changed: 239 additions & 21 deletions

File tree

static/api/spec.yml

Lines changed: 239 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -922,52 +922,182 @@ paths:
922922
schema:
923923
example: { "code": 200, "data": { "AnnounceVersionID": "1650572126123738", "DisappearingTimer": 0, "GroupCreated": "2022-04-21T17:15:26-03:00", "IsAnnounce": false, "IsEphemeral": false, "IsLocked": false, "JID": "120362023605733675@g.us", "Name": "Super Group", "NameSetAt": "2022-04-21T17:15:26-03:00", "NameSetBy": "5491155554444@s.whatsapp.net", "OwnerJID": "5491155554444@s.whatsapp.net", "ParticipantVersionID": "1650234126145738", "Participants": [ { "IsAdmin": true, "IsSuperAdmin": true, "JID": "5491155554444@s.whatsapp.net" }, { "IsAdmin": false, "IsSuperAdmin": false, "JID": "5491155553333@s.whatsapp.net" }, { "IsAdmin": false, "IsSuperAdmin": false, "JID": "5491155552222@s.whatsapp.net" } ], "Topic": "", "TopicID": "", "TopicSetAt": "0001-01-01T00:00:00Z", "TopicSetBy": "" }, "success": true }
924924

925-
/group/name:
925+
/group/photo:
926926
post:
927927
tags:
928928
- Group
929-
summary: Changes group name
930-
description: Allows you to change a group name
929+
summary: Changes group photo
930+
description: Allows you to change a group photo/image. Returns the Picture ID number
931931
security:
932932
- ApiKeyAuth: []
933933
requestBody:
934934
required: true
935935
content:
936936
application/json:
937937
schema:
938-
$ref: '#definitions/GroupName'
938+
$ref: '#definitions/GroupPhoto'
939939

940940
responses:
941941
200:
942942
description: Response
943+
content:
944+
application/json:
945+
schema:
946+
example: { "code": 200, "data": { "Details": "Group Photo set successfully", "PictureID": "1222332123" }, "success": true }
947+
948+
/group/leave:
949+
post:
950+
tags:
951+
- Group
952+
summary: Leave a WhatsApp group
953+
description: Removes the authenticated user from the specified group.
954+
security:
955+
- ApiKeyAuth: []
956+
requestBody:
957+
required: true
958+
content:
959+
application/json:
960+
schema:
961+
$ref: '#/definitions/GroupLeave'
962+
responses:
963+
200:
964+
description: Success
965+
content:
966+
application/json:
967+
schema:
968+
example: { "code": 200, "data": { "Details": "Left group successfully" }, "success": true }
969+
970+
/group/name:
971+
post:
972+
tags:
973+
- Group
974+
summary: Change group name
975+
description: Updates the name of the specified WhatsApp group.
976+
security:
977+
- ApiKeyAuth: []
978+
requestBody:
979+
required: true
980+
content:
981+
application/json:
982+
schema:
983+
$ref: '#/definitions/GroupName'
984+
responses:
985+
200:
986+
description: Success
943987
content:
944988
application/json:
945989
schema:
946990
example: { "code": 200, "data": { "Details": "Group Name set successfully" }, "success": true }
947-
/group/photo:
991+
992+
/group/topic:
948993
post:
949994
tags:
950-
- Group
951-
summary: Changes group photo
952-
description: Allows you to change a group photo/image. Returns the Picture ID number
995+
- Group
996+
summary: Set group topic/description
997+
description: Updates the topic or description of the specified WhatsApp group.
953998
security:
954999
- ApiKeyAuth: []
9551000
requestBody:
9561001
required: true
9571002
content:
9581003
application/json:
9591004
schema:
960-
$ref: '#definitions/GroupPhoto'
961-
1005+
$ref: '#/definitions/GroupTopic'
9621006
responses:
9631007
200:
964-
description: Response
1008+
description: Success
9651009
content:
9661010
application/json:
9671011
schema:
968-
example: { "code": 200, "data": { "Details": "Group Photo set successfully", "PictureID": "1222332123" }, "success": true }
1012+
example: { "code": 200, "data": { "Details": "Group Topic set successfully" }, "success": true }
9691013

1014+
/group/announce:
1015+
post:
1016+
tags:
1017+
- Group
1018+
summary: Set group announce mode
1019+
description: Enables or disables "announce" mode (admin-only messages) for the specified group.
1020+
security:
1021+
- ApiKeyAuth: []
1022+
requestBody:
1023+
required: true
1024+
content:
1025+
application/json:
1026+
schema:
1027+
$ref: '#/definitions/GroupAnnounce'
1028+
responses:
1029+
200:
1030+
description: Success
1031+
content:
1032+
application/json:
1033+
schema:
1034+
example: { "code": 200, "data": { "Details": "Group Announce mode set successfully" }, "success": true }
9701035

1036+
/group/join:
1037+
post:
1038+
tags:
1039+
- Group
1040+
summary: Join a WhatsApp group via invite code
1041+
description: Joins the WhatsApp group using the given invite code.
1042+
security:
1043+
- ApiKeyAuth: []
1044+
requestBody:
1045+
required: true
1046+
content:
1047+
application/json:
1048+
schema:
1049+
$ref: '#/definitions/GroupJoin'
1050+
responses:
1051+
200:
1052+
description: Success
1053+
content:
1054+
application/json:
1055+
schema:
1056+
example: { "code": 200, "data": { "Details": "Joined group successfully" }, "success": true }
1057+
1058+
/group/inviteinfo:
1059+
post:
1060+
tags:
1061+
- Group
1062+
summary: Get information about a group invite code
1063+
description: Returns details about a WhatsApp group given an invite code.
1064+
security:
1065+
- ApiKeyAuth: []
1066+
requestBody:
1067+
required: true
1068+
content:
1069+
application/json:
1070+
schema:
1071+
$ref: '#/definitions/GroupInviteInfo'
1072+
responses:
1073+
200:
1074+
description: Success
1075+
content:
1076+
application/json:
1077+
schema:
1078+
example: { "code": 200, "data": { "InviteInfo": { "GroupName": "Test Group", "GroupJID": "120363312246943103@g.us" } }, "success": true }
1079+
1080+
/group/updateparticipants:
1081+
post:
1082+
tags:
1083+
- Group
1084+
summary: Add or remove participants from a group
1085+
description: Adds or removes participants from the specified WhatsApp group.
1086+
security:
1087+
- ApiKeyAuth: []
1088+
requestBody:
1089+
required: true
1090+
content:
1091+
application/json:
1092+
schema:
1093+
$ref: '#/definitions/UpdateGroupParticipants'
1094+
responses:
1095+
200:
1096+
description: Success
1097+
content:
1098+
application/json:
1099+
schema:
1100+
example: { "code": 200, "data": { "Details": "Participants updated successfully" }, "success": true }
9711101
definitions:
9721102
User:
9731103
type: object
@@ -1007,15 +1137,6 @@ definitions:
10071137
Image:
10081138
type: string
10091139
example: "data:image/jpeg;base64,Akd9300..."
1010-
GroupName:
1011-
type: object
1012-
properties:
1013-
GroupJID:
1014-
type: string
1015-
example: "120362023605733675@g.us"
1016-
Name:
1017-
type: string
1018-
example: "My group name"
10191140
GroupInfo:
10201141
type: object
10211142
properties:
@@ -1506,6 +1627,103 @@ definitions:
15061627
description: Whether the webhook should be active or not
15071628
example: true
15081629

1630+
GroupLeave:
1631+
type: object
1632+
required:
1633+
- groupJID
1634+
properties:
1635+
groupJID:
1636+
type: string
1637+
description: The JID of the group to leave (e.g., 120363312246943103@g.us)
1638+
example: 120363312246943103@g.us
1639+
1640+
GroupName:
1641+
type: object
1642+
required:
1643+
- groupJID
1644+
- name
1645+
properties:
1646+
groupJID:
1647+
type: string
1648+
description: The JID of the group to rename
1649+
example: 120363312246943103@g.us
1650+
name:
1651+
type: string
1652+
description: The new name for the group
1653+
example: My New Group Name
1654+
1655+
GroupTopic:
1656+
type: object
1657+
required:
1658+
- groupJID
1659+
- topic
1660+
properties:
1661+
groupJID:
1662+
type: string
1663+
description: The JID of the group to set the topic for
1664+
example: 120363312246943103@g.us
1665+
topic:
1666+
type: string
1667+
description: The new topic/description for the group
1668+
example: Welcome to our project group!
1669+
1670+
GroupAnnounce:
1671+
type: object
1672+
required:
1673+
- groupJID
1674+
- announce
1675+
properties:
1676+
groupJID:
1677+
type: string
1678+
description: The JID of the group to set announce mode
1679+
example: 120363312246943103@g.us
1680+
announce:
1681+
type: boolean
1682+
description: Whether to enable (true) or disable (false) announce mode
1683+
example: true
1684+
1685+
GroupJoin:
1686+
type: object
1687+
required:
1688+
- inviteCode
1689+
properties:
1690+
inviteCode:
1691+
type: string
1692+
description: The invite code or link to join the group
1693+
example: HffXhYmzzyJGec61oqMXiz
1694+
1695+
GroupInviteInfo:
1696+
type: object
1697+
required:
1698+
- inviteCode
1699+
properties:
1700+
inviteCode:
1701+
type: string
1702+
description: The group invite code to get information for
1703+
example: HffXhYmzzyJGec61oqMXiz
1704+
1705+
UpdateGroupParticipants:
1706+
type: object
1707+
required:
1708+
- groupJID
1709+
- action
1710+
- participants
1711+
properties:
1712+
groupJID:
1713+
type: string
1714+
description: The JID of the group
1715+
example: 120363312246943103@g.us
1716+
action:
1717+
type: string
1718+
description: Action to perform ("add" to add participants, "remove" to remove participants)
1719+
enum: [add, remove]
1720+
example: add
1721+
participants:
1722+
type: array
1723+
items:
1724+
type: string
1725+
description: List of participant JIDs (e.g., 5491112345678@s.whatsapp.net)
1726+
example: [ "5491112345678@s.whatsapp.net", "5491123456789@s.whatsapp.net" ]
15091727
components:
15101728
securitySchemes:
15111729
ApiKeyAuth:

0 commit comments

Comments
 (0)