From 41bcfa49c9bdbb9e223d171dd5ad0136708638ea Mon Sep 17 00:00:00 2001 From: Pranav Kamble Date: Thu, 26 Mar 2026 14:15:33 +0530 Subject: [PATCH 1/5] list new filters formating --- chat-apis.json | 1222 ++++++++++++------------------------------------ 1 file changed, 307 insertions(+), 915 deletions(-) diff --git a/chat-apis.json b/chat-apis.json index be0eb6746..1f2f4f048 100644 --- a/chat-apis.json +++ b/chat-apis.json @@ -375,7 +375,7 @@ ], "properties": { "uid": { - "description": "Unique identifier of the user. Please refer to https://www.cometchat.com/docs/rest-api/users", + "description": "Unique identifier of the user. Please refer to https://prodocs.cometchat.com/docs/concepts#uid", "type": "string" }, "name": { @@ -515,13 +515,10 @@ { "name": "status", "in": "query", - "description": "User list can be fetched depending on the user status. (available,offline).", + "description": "User list can be fetched depending on the user status. Supports multiselect with comma-separated values (e.g., available,offline).", "schema": { "type": "string", - "enum": [ - "available", - "offline" - ] + "example": "available,offline" } }, { @@ -605,6 +602,42 @@ "schema": { "type": "boolean" } + }, + { + "name": "createdAt[from]", + "in": "query", + "description": "Filter by createdAt start timestamp (Unix timestamp). Filters records created on or after this timestamp. Can be used with createdAt[to] for a date range.", + "schema": { + "type": "integer", + "example": 1738368000 + } + }, + { + "name": "createdAt[to]", + "in": "query", + "description": "Filter by createdAt end timestamp (Unix timestamp). Filters records created on or before this timestamp. Can be used with createdAt[from] for a date range.", + "schema": { + "type": "integer", + "example": 1739059200 + } + }, + { + "name": "updatedAt[from]", + "in": "query", + "description": "Filter by updatedAt start timestamp (Unix timestamp). Filters records updated on or after this timestamp. Can be used with updatedAt[to] for a date range.", + "schema": { + "type": "integer", + "example": 1738368000 + } + }, + { + "name": "updatedAt[to]", + "in": "query", + "description": "Filter by updatedAt end timestamp (Unix timestamp). Filters records updated on or before this timestamp. Can be used with updatedAt[from] for a date range.", + "schema": { + "type": "integer", + "example": 1739059200 + } } ], "responses": { @@ -1413,6 +1446,90 @@ "schema": { "type": "boolean" } + }, + { + "name": "guid", + "in": "query", + "description": "Filter groups by a specific GUID. Accepts a single GUID value.", + "schema": { + "type": "string" + } + }, + { + "name": "guids", + "in": "query", + "description": "Filter groups by multiple GUIDs. Accepts comma-separated GUID values.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "createdAt[from]", + "in": "query", + "description": "Filter by createdAt start timestamp (Unix timestamp). Filters groups created on or after this timestamp. Can be used with createdAt[to] for a date range.", + "schema": { + "type": "integer", + "example": 1738368000 + } + }, + { + "name": "createdAt[to]", + "in": "query", + "description": "Filter by createdAt end timestamp (Unix timestamp). Filters groups created on or before this timestamp. Can be used with createdAt[from] for a date range.", + "schema": { + "type": "integer", + "example": 1739059200 + } + }, + { + "name": "updatedAt[from]", + "in": "query", + "description": "Filter by updatedAt start timestamp (Unix timestamp). Filters groups updated on or after this timestamp. Only returns groups that have actually been updated (excludes groups where updatedAt equals createdAt). Can be used with updatedAt[to] for a date range.", + "schema": { + "type": "integer", + "example": 1738368000 + } + }, + { + "name": "updatedAt[to]", + "in": "query", + "description": "Filter by updatedAt end timestamp (Unix timestamp). Filters groups updated on or before this timestamp. Only returns groups that have actually been updated (excludes groups where updatedAt equals createdAt). Can be used with updatedAt[from] for a date range.", + "schema": { + "type": "integer", + "example": 1739059200 + } + }, + { + "name": "membersCount[gte]", + "in": "query", + "description": "Filter groups by members count using comparison operators. Supported operators: gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal), eq (equal). Example: membersCount[gte]=2&membersCount[lte]=10 for a range.", + "schema": { + "type": "integer", + "example": 2 + } + }, + { + "name": "membersCount[lte]", + "in": "query", + "description": "Filter groups with members count less than or equal to this value.", + "schema": { + "type": "integer", + "example": 10 + } + }, + { + "name": "membersCount[eq]", + "in": "query", + "description": "Filter groups with members count equal to this value.", + "schema": { + "type": "integer", + "example": 5 + } } ], "responses": { @@ -1991,6 +2108,19 @@ "type": "string" } }, + { + "name": "senders", + "in": "query", + "description": "Filter messages by multiple sender UIDs. Accepts comma-separated UID values.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, { "name": "mentionsWithBlockedInfo", "in": "query", @@ -2050,7 +2180,55 @@ { "name": "sentAt", "in": "query", - "description": "Fetches the messages list after a particular sentAt timestamp.", + "description": "Filter by message sent time. Value is a 10-digit unix timestamp. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: sentAt[operator]=value.\nExample: sentAt[gte]=1738368000", + "schema": { + "type": "integer" + } + }, + { + "name": "sentAt[from]", + "in": "query", + "description": "Filter by sentAt start timestamp. Value is a 10-digit unix timestamp. Filters messages sent on or after this timestamp. Can be used with sentAt[to] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: sentAt[operator]=value.\nExample: sentAt[gte]=1738368000", + "schema": { + "type": "integer" + } + }, + { + "name": "sentAt[to]", + "in": "query", + "description": "Filter by sentAt end timestamp. Value is a 10-digit unix timestamp. Filters messages sent on or before this timestamp. Can be used with sentAt[from] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: sentAt[operator]=value.\nExample: sentAt[lte]=1739059200", + "schema": { + "type": "integer" + } + }, + { + "name": "updatedAt[from]", + "in": "query", + "description": "Filter by updatedAt start timestamp. Value is a 10-digit unix timestamp. Filters messages updated on or after this timestamp. Only returns messages that have actually been updated (excludes messages where updatedAt equals createdAt). Can be used with updatedAt[to] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: updatedAt[operator]=value.\nExample: updatedAt[gte]=1738368000", + "schema": { + "type": "integer" + } + }, + { + "name": "updatedAt[to]", + "in": "query", + "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages updated on or before this timestamp. Only returns messages that have actually been updated (excludes messages where updatedAt equals createdAt). Can be used with updatedAt[from] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: updatedAt[operator]=value.\nExample: updatedAt[lte]=1739059200", + "schema": { + "type": "integer" + } + }, + { + "name": "editedAt[from]", + "in": "query", + "description": "Filter by editedAt start timestamp. Value is a 10-digit unix timestamp. Filters messages edited on or after this timestamp. Can be used with editedAt[to] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: editedAt[operator]=value.\nExample: editedAt[gte]=1738368000", + "schema": { + "type": "integer" + } + }, + { + "name": "editedAt[to]", + "in": "query", + "description": "Filter by editedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages edited on or before this timestamp. Can be used with editedAt[from] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: editedAt[operator]=value.\nExample: editedAt[lte]=1739059200", "schema": { "type": "integer" } @@ -2118,7 +2296,7 @@ { "name": "fromTimestamp", "in": "query", - "description": "Fetches the messages from this timestamp.", + "description": "Filter by message start time. Value is a 10-digit unix timestamp. Fetches messages from this timestamp onwards. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: fromTimestamp[operator]=value.\nExample: fromTimestamp[gte]=1738368000", "schema": { "type": "integer" } @@ -2126,7 +2304,7 @@ { "name": "toTimestamp", "in": "query", - "description": "Fetches the messages till this timestamp. It will be ignored if fromTimestamp is missing or empty.", + "description": "Filter by message end time. Value is a 10-digit unix timestamp. Fetches messages up to this timestamp. It will be ignored if fromTimestamp is missing or empty. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: toTimestamp[operator]=value.\nExample: toTimestamp[lte]=1739059200", "schema": { "type": "integer" } @@ -6957,595 +7135,13 @@ "featuresToRestrict" ], "properties": { - "featuresToRestrict": { - "description": "Keys of the features to be restricted.", - "type": "array", - "items": { - "type": "string" - }, - "default": "" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Restricts Features", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "u.listUsers": { - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "u.listUsers": { - "success": true, - "message": "The feature u.listUsers has been restricted successfully." - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Restrict Features" - ], - "summary": "List Restricted Features", - "description": "List all restricted features for a given role.", - "operationId": "get-restrictedfeatures", - "parameters": [ - { - "name": "role", - "in": "path", - "description": "A role for which features are restricted.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Role", - "value": "" - } - } - } - ], - "responses": { - "200": { - "description": "Lists Restricted Features", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "key": { - "type": "string" - }, - "path": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": [ - { - "title": "Delete Group", - "description": "Allows logged-in user to delete a group.", - "key": "u.deleteGroup", - "path": "/v3/groups/{{guid}}", - "createdAt": 1639448370 - }, - { - "title": "List Users", - "description": "Allows logged-in user to fetch the user list.", - "key": "u.listUsers", - "path": "/v3/users", - "createdAt": 1639448370 - } - ], - "meta": { - "pagination": { - "total": 2, - "count": 2, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Restrict Features" - ], - "summary": "Allow Features", - "description": "Allow features access for a given role.", - "operationId": "allow-features", - "parameters": [ - { - "name": "role", - "in": "path", - "description": "A role to which allow features.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Role", - "value": "" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "featuresToAllow": { - "description": "keys of the features to be allowed.", - "type": "array", - "items": { - "type": "string" - }, - "default": "" - }, - "allowAll": { - "description": "All features to be allowed.", - "type": "boolean", - "default": "" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Allows Restricted Features", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "The feature has been allowed successfully." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/roles/{role}/permissions": { - "get": { - "tags": [ - "RBAC" - ], - "summary": "List Role Permissions", - "description": "Lists role permissions", - "operationId": "list-role-permissions", - "responses": { - "200": { - "description": "Lists role permissions", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} - }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": [ - { - "id": "createGroup", - "type": "role", - "title": "Allows/Denies creating groups", - "description": "Allows/Denies creating groups", - "dataType": "string", - "availableValues": [ - "allow", - "deny" - ], - "defaultValue": "allow", - "createdAt": 1765962204, - "updatedAt": 1765962204 - }, - { - "id": "sendMessage", - "type": "role", - "title": "Allows/Denies sending messages", - "description": "Allows/Denies sending messages", - "dataType": "string", - "availableValues": [ - "allow", - "deny" - ], - "defaultValue": "allow", - "createdAt": 1765962204, - "updatedAt": 1765962204 - }, - { - "id": "sendMessage.allowedMessageTypes", - "type": "role", - "title": "Allows sending messages of the specified types", - "description": "Allows sending messages of the specified types", - "dataType": "stringArray", - "availableValues": [ - "text", - "image", - "audio", - "video", - "file" - ], - "createdAt": 1765962204, - "updatedAt": 1765962204, - "defaultValue": [] - } - ], - "meta": { - "pagination": { - "total": 28, - "count": 28, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "RBAC" - ], - "summary": "Set Role Permissions", - "description": "Sets or updates permissions for a specific role", - "operationId": "set-role-permissions", - "parameters": [ - { - "name": "role", - "in": "path", - "description": "The role identifier to update permissions for", - "required": true, - "schema": { - "type": "string", - "example": "default" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "permissions" - ], - "properties": { - "permissions": { - "description": "Permissions object containing key-value pairs for role permissions", - "type": "object", - "example": { - "createGroup": "allow", - "listUsers.mode": "friends", - "createGroup.allowedGroupTypes": [ - "public" - ] - }, - "additionalProperties": true - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Role permissions updated successfully", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "sendMessage": { - "success": true, - "message": "Permission with id sendMessage have been mapped successfully to role default." - }, - "permissions": { - "listUsers": "allow", - "listUsers.mode": "all", - "listUsers.allowedRoles": [ - "new_role" - ], - "getUserDetails.mode": "friends", - "getUserDetails.allowedRoles": [ - "default" - ], - "sendMessage": "allow", - "sendMessage.mode": "all", - "sendMessage.allowedReceiverTypes": [ - "group" - ], - "sendMessage.allowedReceiverRoles": [ - "new_role", - "default" - ], - "sendMessage.allowedMessageTypes": [ - "file", - "audio", - "video", - "image", - "text" - ], - "sendMessage.allowedMessageCategories": [ - "message", - "custom" - ], - "editMessage": "deny", - "deleteMessage": "deny", - "sendMessage.allowedMimeTypes": [ - "image/png" - ], - "initiateCall": "allow", - "initiateCall.mode": "all", - "initiateCall.allowedReceiverRoles": [ - "new_role" - ], - "createGroup": "allow", - "createGroup.allowedGroupTypes": [ - "private" - ], - "listGroups": "allow", - "listGroups.allowedGroupTypes": [ - "password" - ], - "joinGroup": "allow", - "joinGroup.allowedGroupTypes": [ - "public" - ], - "listMessages.allowedMessageCategories": [ - "message" - ], - "listMessages.allowedMessageTypes": [ - "audio" - ] - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/scopes/{scope}/permissions": { - "get": { - "tags": [ - "RBAC" - ], - "summary": "List Scope Permissions", - "description": "Lists scope permissions", - "operationId": "list-scope-permissions", - "responses": { - "200": { - "description": "Lists scope permissions", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} - }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": [ - { - "id": "addReaction", - "type": "scope", - "title": "Allows member to list the members with specified scope", - "description": "Allows member to list the members with specified scope", - "dataType": "string", - "availableValues": [ - "allow", - "deny" - ], - "defaultValue": "allow", - "createdAt": 1765962204, - "updatedAt": 1765962204 - }, - { - "id": "sendMessage", - "type": "scope", - "title": "Allows/Denies sending messages", - "description": "Allows/Denies sending messages", - "dataType": "string", - "availableValues": [ - "allow", - "deny" - ], - "defaultValue": "allow", - "createdAt": 1765962204, - "updatedAt": 1765962204 - }, - { - "id": "initiateCall.allowedType", - "type": "scope", - "title": "Allows members to initiate call with the specified types", - "description": "Allows members to initiate call with the specified types", - "dataType": "stringArray", - "availableValues": [ - "audio", - "video" - ], - "createdAt": 1765962204, - "updatedAt": 1765962204, - "defaultValue": [] - } - ], - "meta": { - "pagination": { - "total": 11, - "count": 11, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "RBAC" - ], - "summary": "Set Scope Permissions", - "description": "Sets or updates permissions for a specific group scope", - "operationId": "set-scope-permissions", - "parameters": [ - { - "name": "guid", - "in": "path", - "description": "The group GUID to update scope permissions for", - "required": true, - "schema": { - "type": "string", - "example": "supergroup" - } - }, - { - "name": "scope", - "in": "path", - "description": "The scope identifier (e.g., admin, moderator, participant)", - "required": true, - "schema": { - "type": "string", - "example": "admin" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "permissions" - ], - "properties": { - "permissions": { - "description": "Permissions object containing key-value pairs for scope permissions", - "type": "object", - "example": { - "sendMessage": "deny", - "initiateCall": "friends" + "featuresToRestrict": { + "description": "Keys of the features to be restricted.", + "type": "array", + "items": { + "type": "string" }, - "additionalProperties": true + "default": "" } }, "type": "object" @@ -7555,12 +7151,17 @@ }, "responses": { "200": { - "description": "Scope permissions updated successfully", + "description": "Restricts Features", "content": { "application/json": { "schema": { "properties": { "data": { + "properties": { + "u.listUsers": { + "type": "object" + } + }, "type": "object" } }, @@ -7568,22 +7169,9 @@ }, "example": { "data": { - "sendMessage": { + "u.listUsers": { "success": true, - "message": "Permission with id sendMessage have been mapped successfully to scope admin on group cometchat-guid-1." - }, - "permissions": { - "sendMessage": "allow", - "listMembers": "allow", - "listMembers.allowedScopes": "participant", - "addReaction": "deny", - "listReactions.allowedScopes": "moderator", - "listReactions": "deny", - "sendThreadedMessage": "allow", - "initiateCall": "deny", - "initiateCall.allowedScopes": "participant", - "initiateCall.allowedType": "audio", - "editMessage": "allow" + "message": "The feature u.listUsers has been restricted successfully." } } } @@ -7596,114 +7184,91 @@ "apiKey": [] } ] - } - }, - "/roles/{role}/permissions/{permission}": { - "delete": { + }, + "get": { "tags": [ - "RBAC" + "Restrict Features" ], - "summary": "Unset Role Permissions", - "description": "Removes a specific permission from a role", - "operationId": "unset-role-permissions", + "summary": "List Restricted Features", + "description": "List all restricted features for a given role.", + "operationId": "get-restrictedfeatures", "parameters": [ { "name": "role", "in": "path", - "description": "The role identifier to remove permission from", - "required": true, - "schema": { - "type": "string", - "example": "default" - } - }, - { - "name": "permission", - "in": "path", - "description": "The permission key to unset (e.g., listUsers.mode, createGroup, etc.)", + "description": "A role for which features are restricted.", "required": true, "schema": { - "type": "string", - "example": "listUsers.mode" + "type": "string" + }, + "examples": { + "string": { + "summary": "Role", + "value": "" + } } } ], "responses": { "200": { - "description": "Role permission unset successfully", + "description": "Lists Restricted Features", "content": { "application/json": { "schema": { "properties": { "data": { + "type": "array", + "items": { + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "key": { + "type": "string" + }, + "path": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + } + }, + "meta": { "type": "object" } }, "type": "object" }, "example": { - "data": { - "permissions": { - "listUsers": "allow", - "listUsers.mode": "all", - "listUsers.allowedRoles": [ - "new_role" - ], - "getUserDetails.mode": "friends", - "getUserDetails.allowedRoles": [ - "default" - ], - "sendMessage": "allow", - "sendMessage.mode": "all", - "sendMessage.allowedReceiverTypes": [ - "group" - ], - "sendMessage.allowedReceiverRoles": [ - "new_role", - "default" - ], - "sendMessage.allowedMessageTypes": [ - "file", - "audio", - "video", - "image", - "text" - ], - "sendMessage.allowedMessageCategories": [ - "message", - "custom" - ], - "editMessage": "deny", - "editMessage.denyForScopes": [], - "deleteMessage": "deny", - "deleteMessage.denyForScopes": [], - "sendMessage.allowedCustomTypes": [], - "sendMessage.allowedMimeTypes": [ - "image/png" - ], - "initiateCall": "allow", - "initiateCall.mode": "all", - "initiateCall.allowedReceiverRoles": [ - "new_role" - ], - "createGroup": "allow", - "createGroup.allowedGroupTypes": [ - "private" - ], - "listGroups": "allow", - "listGroups.allowedGroupTypes": [ - "password" - ], - "joinGroup": "allow", - "joinGroup.allowedGroupTypes": [ - "public" - ], - "listMessages.allowedMessageCategories": [ - "message" - ], - "listMessages.allowedMessageTypes": [ - "audio" - ] + "data": [ + { + "title": "Delete Group", + "description": "Allows logged-in user to delete a group.", + "key": "u.deleteGroup", + "path": "/v3/groups/{{guid}}", + "createdAt": 1639448370 + }, + { + "title": "List Users", + "description": "Allows logged-in user to fetch the user list.", + "key": "u.listUsers", + "path": "/v3/users", + "createdAt": 1639448370 + } + ], + "meta": { + "pagination": { + "total": 2, + "count": 2, + "per_page": 100, + "current_page": 1, + "total_pages": 1 } } } @@ -7716,51 +7281,58 @@ "apiKey": [] } ] - } - }, - "/groups/{guid}/scopes/{scope}/permissions/{permission}": { + }, "delete": { "tags": [ - "RBAC" + "Restrict Features" ], - "summary": "Unset Scope Permissions", - "description": "Removes a specific permission from a group scope", - "operationId": "unset-scope-permissions", + "summary": "Allow Features", + "description": "Allow features access for a given role.", + "operationId": "allow-features", "parameters": [ { - "name": "guid", - "in": "path", - "description": "The group GUID to remove scope permission from", - "required": true, - "schema": { - "type": "string", - "example": "supergroup" - } - }, - { - "name": "scope", - "in": "path", - "description": "The scope identifier (e.g., admin, moderator, participant)", - "required": true, - "schema": { - "type": "string", - "example": "admin" - } - }, - { - "name": "permission", + "name": "role", "in": "path", - "description": "The permission key to unset (e.g., sendMessage, initiateCall, etc.)", + "description": "A role to which allow features.", "required": true, "schema": { - "type": "string", - "example": "sendMessage" + "type": "string" + }, + "examples": { + "string": { + "summary": "Role", + "value": "" + } } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "featuresToAllow": { + "description": "keys of the features to be allowed.", + "type": "array", + "items": { + "type": "string" + }, + "default": "" + }, + "allowAll": { + "description": "All features to be allowed.", + "type": "boolean", + "default": "" + } + }, + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "Scope permission unset successfully", + "description": "Allows Restricted Features", "content": { "application/json": { "schema": { @@ -7773,19 +7345,8 @@ }, "example": { "data": { - "permissions": { - "sendMessage": "allow", - "listMembers": "allow", - "listMembers.allowedScopes": "participant", - "addReaction": "deny", - "listReactions.allowedScopes": "moderator", - "listReactions": "deny", - "sendThreadedMessage": "allow", - "initiateCall": "deny", - "initiateCall.allowedScopes": "participant", - "initiateCall.allowedType": "audio", - "editMessage": "allow" - } + "success": true, + "message": "The feature has been allowed successfully." } } } @@ -8333,7 +7894,7 @@ { "name": "fromTimestamp", "in": "query", - "description": "Fetches the messages from this timestamp.", + "description": "Filter by message start time. Value is a 10-digit unix timestamp. Fetches messages from this timestamp onwards. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: fromTimestamp[operator]=value.\nExample: fromTimestamp[gte]=1738368000", "schema": { "type": "integer" } @@ -8341,7 +7902,7 @@ { "name": "toTimestamp", "in": "query", - "description": "Fetches the messages till this timestamp.", + "description": "Filter by message end time. Value is a 10-digit unix timestamp. Fetches messages up to this timestamp. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: toTimestamp[operator]=value.\nExample: toTimestamp[lte]=1739059200", "schema": { "type": "integer" } @@ -8811,7 +8372,7 @@ { "name": "fromTimestamp", "in": "query", - "description": "Fetches the messages from this timestamp.", + "description": "Filter by message start time. Value is a 10-digit unix timestamp. Fetches messages from this timestamp onwards. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: fromTimestamp[operator]=value.\nExample: fromTimestamp[gte]=1738368000", "schema": { "type": "integer" } @@ -8819,7 +8380,7 @@ { "name": "toTimestamp", "in": "query", - "description": "Fetches the messages till this timestamp.", + "description": "Filter by message end time. Value is a 10-digit unix timestamp. Fetches messages up to this timestamp. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: toTimestamp[operator]=value.\nExample: toTimestamp[lte]=1739059200", "schema": { "type": "integer" } @@ -16495,30 +16056,6 @@ }, "type": "object" }, - "RolePermissionSchema": { - "description": "Role permission mapping", - "properties": { - "role": { - "description": "Role name", - "type": "string", - "example": "admin" - }, - "permissions": { - "description": "List of permissions mapped to the role", - "type": "object", - "example": { - "users.read": true, - "users.write": true, - "groups.read": true, - "groups.write": false - }, - "additionalProperties": { - "type": "boolean" - } - } - }, - "type": "object" - }, "Schedule": { "properties": { "monday": { @@ -16713,36 +16250,6 @@ }, "type": "object" }, - "ScopePermissionSchema": { - "description": "Scope permission details", - "properties": { - "scope": { - "description": "Scope identifier", - "type": "string", - "example": "users" - }, - "permissions": { - "description": "List of permissions available for this scope", - "type": "array", - "items": { - "properties": { - "permission": { - "description": "Permission identifier", - "type": "string", - "example": "read" - }, - "description": { - "description": "Permission description", - "type": "string", - "example": "View user information" - } - }, - "type": "object" - } - } - }, - "type": "object" - }, "SentenceSimilaritySchema": { "required": [ "category", @@ -16802,64 +16309,6 @@ }, "type": "object" }, - "SetRolePermissionSchema": { - "description": "Set role permission response", - "properties": { - "role": { - "description": "Role identifier", - "type": "string", - "example": "default" - }, - "permissions": { - "description": "Permissions configuration for the role", - "type": "object", - "example": { - "createGroup": "allow", - "listUsers.mode": "friends", - "createGroup.allowedGroupTypes": [ - "public" - ] - }, - "additionalProperties": true - }, - "updatedAt": { - "description": "Timestamp when permissions were last updated", - "type": "integer", - "example": 1640000000 - } - }, - "type": "object" - }, - "SetScopePermissionSchema": { - "description": "Set scope permission response", - "properties": { - "guid": { - "description": "Group identifier", - "type": "string", - "example": "supergroup" - }, - "scope": { - "description": "Scope identifier", - "type": "string", - "example": "admin" - }, - "permissions": { - "description": "Permissions configuration for the scope", - "type": "object", - "example": { - "sendMessage": "deny", - "initiateCall": "friends" - }, - "additionalProperties": true - }, - "updatedAt": { - "description": "Timestamp when permissions were last updated", - "type": "integer", - "example": 1640000000 - } - }, - "type": "object" - }, "SilentNotification": { "properties": { "chat": { @@ -17046,63 +16495,6 @@ }, "type": "object" }, - "UnsetRolePermissionSchema": { - "description": "Unset role permission response", - "properties": { - "role": { - "description": "Role identifier", - "type": "string", - "example": "default" - }, - "permission": { - "description": "The permission key that was removed", - "type": "string", - "example": "listUsers.mode" - }, - "status": { - "description": "Status of the operation", - "type": "string", - "example": "removed" - }, - "updatedAt": { - "description": "Timestamp when permission was removed", - "type": "integer", - "example": 1640000000 - } - }, - "type": "object" - }, - "UnsetScopePermissionSchema": { - "description": "Unset scope permission response", - "properties": { - "guid": { - "description": "Group identifier", - "type": "string", - "example": "supergroup" - }, - "scope": { - "description": "Scope identifier", - "type": "string", - "example": "admin" - }, - "permission": { - "description": "The permission key that was removed", - "type": "string", - "example": "sendMessage" - }, - "status": { - "description": "Status of the operation", - "type": "string", - "example": "removed" - }, - "updatedAt": { - "description": "Timestamp when permission was removed", - "type": "integer", - "example": 1640000000 - } - }, - "type": "object" - }, "UserFilter": { "required": [ "entity", From 8938afd390a8b6d2067d22003664aac5b9a73eb4 Mon Sep 17 00:00:00 2001 From: Pranav Kamble Date: Thu, 26 Mar 2026 16:14:52 +0530 Subject: [PATCH 2/5] Formating changes for all list filters --- chat-apis.json | 123 +++++++++++++++++++------------------------------ 1 file changed, 48 insertions(+), 75 deletions(-) diff --git a/chat-apis.json b/chat-apis.json index 1f2f4f048..eac739ae4 100644 --- a/chat-apis.json +++ b/chat-apis.json @@ -375,7 +375,7 @@ ], "properties": { "uid": { - "description": "Unique identifier of the user. Please refer to https://prodocs.cometchat.com/docs/concepts#uid", + "description": "Unique identifier of the user. Please refer to https: //www.cometchat.com/docs/rest-api/users", "type": "string" }, "name": { @@ -604,39 +604,35 @@ } }, { - "name": "createdAt[from]", + "name": "createdAt[]", "in": "query", - "description": "Filter by createdAt start timestamp (Unix timestamp). Filters records created on or after this timestamp. Can be used with createdAt[to] for a date range.", + "description": "Filter by createdAt start timestamp. Value is a 10-digit unix timestamp. Filters records created on or after this timestamp. Can be used with createdAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** createdAt[operator]=value.\n **Example:** createdAt[from]=1738368000", "schema": { - "type": "integer", - "example": 1738368000 + "type": "integer" } }, { - "name": "createdAt[to]", + "name": "createdAt[]", "in": "query", - "description": "Filter by createdAt end timestamp (Unix timestamp). Filters records created on or before this timestamp. Can be used with createdAt[from] for a date range.", + "description": "Filter by createdAt end timestamp. Value is a 10-digit unix timestamp. Filters records created on or before this timestamp. Can be used with createdAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** createdAt[operator]=value.\n **Example:** createdAt[to]=1739059200", "schema": { - "type": "integer", - "example": 1739059200 + "type": "integer" } }, { - "name": "updatedAt[from]", + "name": "updatedAt[]", "in": "query", - "description": "Filter by updatedAt start timestamp (Unix timestamp). Filters records updated on or after this timestamp. Can be used with updatedAt[to] for a date range.", + "description": "Filter by updatedAt start timestamp. Value is a 10-digit unix timestamp. Filters records updated on or after this timestamp. Can be used with updatedAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[from]=1738368000", "schema": { - "type": "integer", - "example": 1738368000 + "type": "integer" } }, { - "name": "updatedAt[to]", + "name": "updatedAt[]", "in": "query", - "description": "Filter by updatedAt end timestamp (Unix timestamp). Filters records updated on or before this timestamp. Can be used with updatedAt[from] for a date range.", + "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters records updated on or before this timestamp. Can be used with updatedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[to]=1739059200", "schema": { - "type": "integer", - "example": 1739059200 + "type": "integer" } } ], @@ -1469,66 +1465,43 @@ } }, { - "name": "createdAt[from]", - "in": "query", - "description": "Filter by createdAt start timestamp (Unix timestamp). Filters groups created on or after this timestamp. Can be used with createdAt[to] for a date range.", - "schema": { - "type": "integer", - "example": 1738368000 - } - }, - { - "name": "createdAt[to]", - "in": "query", - "description": "Filter by createdAt end timestamp (Unix timestamp). Filters groups created on or before this timestamp. Can be used with createdAt[from] for a date range.", - "schema": { - "type": "integer", - "example": 1739059200 - } - }, - { - "name": "updatedAt[from]", + "name": "createdAt[]", "in": "query", - "description": "Filter by updatedAt start timestamp (Unix timestamp). Filters groups updated on or after this timestamp. Only returns groups that have actually been updated (excludes groups where updatedAt equals createdAt). Can be used with updatedAt[to] for a date range.", + "description": "Filter by createdAt start timestamp. Value is a 10-digit unix timestamp. Filters groups created on or after this timestamp. Can be used with createdAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** createdAt[operator]=value.\n **Example:** createdAt[from]=1738368000", "schema": { - "type": "integer", - "example": 1738368000 + "type": "integer" } }, { - "name": "updatedAt[to]", + "name": "createdAt[]", "in": "query", - "description": "Filter by updatedAt end timestamp (Unix timestamp). Filters groups updated on or before this timestamp. Only returns groups that have actually been updated (excludes groups where updatedAt equals createdAt). Can be used with updatedAt[from] for a date range.", + "description": "Filter by createdAt end timestamp. Value is a 10-digit unix timestamp. Filters groups created on or before this timestamp. Can be used with createdAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** createdAt[operator]=value.\n **Example:** createdAt[to]=1739059200", "schema": { - "type": "integer", - "example": 1739059200 + "type": "integer" } }, { - "name": "membersCount[gte]", + "name": "updatedAt[]", "in": "query", - "description": "Filter groups by members count using comparison operators. Supported operators: gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal), eq (equal). Example: membersCount[gte]=2&membersCount[lte]=10 for a range.", + "description": "Filter by updatedAt start timestamp. Value is a 10-digit unix timestamp. Filters groups updated on or after this timestamp. Can be used with updatedAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[from]=1738368000", "schema": { - "type": "integer", - "example": 2 + "type": "integer" } }, { - "name": "membersCount[lte]", + "name": "updatedAt[]", "in": "query", - "description": "Filter groups with members count less than or equal to this value.", + "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters groups updated on or before this timestamp. Can be used with updatedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[to]=1739059200", "schema": { - "type": "integer", - "example": 10 + "type": "integer" } }, { - "name": "membersCount[eq]", + "name": "membersCount[]", "in": "query", - "description": "Filter groups with members count equal to this value.", + "description": "Filter groups by members count using comparison operators.\n **Supported operators:** eq, gt, gte, lt, lte.\n **Format:** membersCount[operator]=value.\n **Example:** membersCount[gte]=2", "schema": { - "type": "integer", - "example": 5 + "type": "integer" } } ], @@ -2178,57 +2151,57 @@ } }, { - "name": "sentAt", + "name": "sentAt[]", "in": "query", - "description": "Filter by message sent time. Value is a 10-digit unix timestamp. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: sentAt[operator]=value.\nExample: sentAt[gte]=1738368000", + "description": "Filter by message sent time. Value is a 10-digit unix timestamp. Fetches messages sent after the specified timestamp.\n **Supported operators:** from, to.\n **Format:** sentAt[operator]=value.\n **Example:** sentAt[from]=1738368000", "schema": { "type": "integer" } }, { - "name": "sentAt[from]", + "name": "sentAt[]", "in": "query", - "description": "Filter by sentAt start timestamp. Value is a 10-digit unix timestamp. Filters messages sent on or after this timestamp. Can be used with sentAt[to] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: sentAt[operator]=value.\nExample: sentAt[gte]=1738368000", + "description": "Filter by sentAt start timestamp. Value is a 10-digit unix timestamp. Filters messages sent on or after this timestamp. Can be used with sentAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** sentAt[operator]=value.\n **Example:** sentAt[from]=1738368000", "schema": { "type": "integer" } }, { - "name": "sentAt[to]", + "name": "sentAt[]", "in": "query", - "description": "Filter by sentAt end timestamp. Value is a 10-digit unix timestamp. Filters messages sent on or before this timestamp. Can be used with sentAt[from] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: sentAt[operator]=value.\nExample: sentAt[lte]=1739059200", + "description": "Filter by sentAt end timestamp. Value is a 10-digit unix timestamp. Filters\nmessages sent on or before this timestamp. Can be used with sentAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** sentAt[operator]=value.\n **Example:** sentAt[to]=1739059200", "schema": { "type": "integer" } }, { - "name": "updatedAt[from]", + "name": "updatedAt[]", "in": "query", - "description": "Filter by updatedAt start timestamp. Value is a 10-digit unix timestamp. Filters messages updated on or after this timestamp. Only returns messages that have actually been updated (excludes messages where updatedAt equals createdAt). Can be used with updatedAt[to] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: updatedAt[operator]=value.\nExample: updatedAt[gte]=1738368000", + "description": "Filter by updatedAt start timestamp. Value is a 10-digit unix timestamp. Filters messages updated on or after this timestamp. Can be used with updatedAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[from]=1738368000", "schema": { "type": "integer" } }, { - "name": "updatedAt[to]", + "name": "updatedAt[]", "in": "query", - "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages updated on or before this timestamp. Only returns messages that have actually been updated (excludes messages where updatedAt equals createdAt). Can be used with updatedAt[from] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: updatedAt[operator]=value.\nExample: updatedAt[lte]=1739059200", + "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages updated on or before this timestamp. Can be used with updatedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[to]=1739059200", "schema": { "type": "integer" } }, { - "name": "editedAt[from]", + "name": "editedAt[]", "in": "query", - "description": "Filter by editedAt start timestamp. Value is a 10-digit unix timestamp. Filters messages edited on or after this timestamp. Can be used with editedAt[to] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: editedAt[operator]=value.\nExample: editedAt[gte]=1738368000", + "description": "Filter by editedAt start timestamp. Value is a 10-digit unix timestamp. Filters messages edited on or after this timestamp. Can be used with editedAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** editedAt[operator]=value.\n **Example:** editedAt[from]=1738368000", "schema": { "type": "integer" } }, { - "name": "editedAt[to]", + "name": "editedAt[]", "in": "query", - "description": "Filter by editedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages edited on or before this timestamp. Can be used with editedAt[from] for a date range. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: editedAt[operator]=value.\nExample: editedAt[lte]=1739059200", + "description": "Filter by editedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages edited on or before this timestamp. Can be used with editedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** editedAt[operator]=value.\n **Example:** editedAt[to]=1739059200", "schema": { "type": "integer" } @@ -2296,7 +2269,7 @@ { "name": "fromTimestamp", "in": "query", - "description": "Filter by message start time. Value is a 10-digit unix timestamp. Fetches messages from this timestamp onwards. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: fromTimestamp[operator]=value.\nExample: fromTimestamp[gte]=1738368000", + "description": "Fetches the messages from this timestamp.", "schema": { "type": "integer" } @@ -2304,7 +2277,7 @@ { "name": "toTimestamp", "in": "query", - "description": "Filter by message end time. Value is a 10-digit unix timestamp. Fetches messages up to this timestamp. It will be ignored if fromTimestamp is missing or empty. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: toTimestamp[operator]=value.\nExample: toTimestamp[lte]=1739059200", + "description": "Fetches the messages till this timestamp. It will be ignored if fromTimestamp is missing or empty.", "schema": { "type": "integer" } @@ -7894,7 +7867,7 @@ { "name": "fromTimestamp", "in": "query", - "description": "Filter by message start time. Value is a 10-digit unix timestamp. Fetches messages from this timestamp onwards. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: fromTimestamp[operator]=value.\nExample: fromTimestamp[gte]=1738368000", + "description": "Fetches the messages from this timestamp.", "schema": { "type": "integer" } @@ -7902,7 +7875,7 @@ { "name": "toTimestamp", "in": "query", - "description": "Filter by message end time. Value is a 10-digit unix timestamp. Fetches messages up to this timestamp. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: toTimestamp[operator]=value.\nExample: toTimestamp[lte]=1739059200", + "description": "Fetches the messages till this timestamp.", "schema": { "type": "integer" } @@ -8372,7 +8345,7 @@ { "name": "fromTimestamp", "in": "query", - "description": "Filter by message start time. Value is a 10-digit unix timestamp. Fetches messages from this timestamp onwards. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: fromTimestamp[operator]=value.\nExample: fromTimestamp[gte]=1738368000", + "description": "Fetches the messages from this timestamp.", "schema": { "type": "integer" } @@ -8380,7 +8353,7 @@ { "name": "toTimestamp", "in": "query", - "description": "Filter by message end time. Value is a 10-digit unix timestamp. Fetches messages up to this timestamp. Supports bracket notation operators: eq, gt, gte, lt, lte.\nFormat: toTimestamp[operator]=value.\nExample: toTimestamp[lte]=1739059200", + "description": "Fetches the messages till this timestamp.", "schema": { "type": "integer" } From ff387ebd56610cabc59d542c207c75bfd6933242 Mon Sep 17 00:00:00 2001 From: Pranav Kamble Date: Thu, 26 Mar 2026 16:17:22 +0530 Subject: [PATCH 3/5] Formating changes for all list filters --- chat-apis.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chat-apis.json b/chat-apis.json index eac739ae4..8ec92967b 100644 --- a/chat-apis.json +++ b/chat-apis.json @@ -375,7 +375,7 @@ ], "properties": { "uid": { - "description": "Unique identifier of the user. Please refer to https: //www.cometchat.com/docs/rest-api/users", + "description": "Unique identifier of the user. Please refer to https://www.cometchat.com/docs/rest-api/users", "type": "string" }, "name": { From e029f91ee7cef627625c068e029c34c6ba77e8b6 Mon Sep 17 00:00:00 2001 From: Pranav Kamble Date: Thu, 26 Mar 2026 16:58:53 +0530 Subject: [PATCH 4/5] duplicate code removed --- chat-apis.json | 64 -------------------------------------------------- 1 file changed, 64 deletions(-) diff --git a/chat-apis.json b/chat-apis.json index 8ec92967b..47b2e7ab2 100644 --- a/chat-apis.json +++ b/chat-apis.json @@ -611,14 +611,6 @@ "type": "integer" } }, - { - "name": "createdAt[]", - "in": "query", - "description": "Filter by createdAt end timestamp. Value is a 10-digit unix timestamp. Filters records created on or before this timestamp. Can be used with createdAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** createdAt[operator]=value.\n **Example:** createdAt[to]=1739059200", - "schema": { - "type": "integer" - } - }, { "name": "updatedAt[]", "in": "query", @@ -626,14 +618,6 @@ "schema": { "type": "integer" } - }, - { - "name": "updatedAt[]", - "in": "query", - "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters records updated on or before this timestamp. Can be used with updatedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[to]=1739059200", - "schema": { - "type": "integer" - } } ], "responses": { @@ -1472,14 +1456,6 @@ "type": "integer" } }, - { - "name": "createdAt[]", - "in": "query", - "description": "Filter by createdAt end timestamp. Value is a 10-digit unix timestamp. Filters groups created on or before this timestamp. Can be used with createdAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** createdAt[operator]=value.\n **Example:** createdAt[to]=1739059200", - "schema": { - "type": "integer" - } - }, { "name": "updatedAt[]", "in": "query", @@ -1488,14 +1464,6 @@ "type": "integer" } }, - { - "name": "updatedAt[]", - "in": "query", - "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters groups updated on or before this timestamp. Can be used with updatedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[to]=1739059200", - "schema": { - "type": "integer" - } - }, { "name": "membersCount[]", "in": "query", @@ -2158,22 +2126,6 @@ "type": "integer" } }, - { - "name": "sentAt[]", - "in": "query", - "description": "Filter by sentAt start timestamp. Value is a 10-digit unix timestamp. Filters messages sent on or after this timestamp. Can be used with sentAt[to] for a date range.\n **Supported operators:** from, to.\n **Format:** sentAt[operator]=value.\n **Example:** sentAt[from]=1738368000", - "schema": { - "type": "integer" - } - }, - { - "name": "sentAt[]", - "in": "query", - "description": "Filter by sentAt end timestamp. Value is a 10-digit unix timestamp. Filters\nmessages sent on or before this timestamp. Can be used with sentAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** sentAt[operator]=value.\n **Example:** sentAt[to]=1739059200", - "schema": { - "type": "integer" - } - }, { "name": "updatedAt[]", "in": "query", @@ -2182,14 +2134,6 @@ "type": "integer" } }, - { - "name": "updatedAt[]", - "in": "query", - "description": "Filter by updatedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages updated on or before this timestamp. Can be used with updatedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** updatedAt[operator]=value.\n **Example:** updatedAt[to]=1739059200", - "schema": { - "type": "integer" - } - }, { "name": "editedAt[]", "in": "query", @@ -2198,14 +2142,6 @@ "type": "integer" } }, - { - "name": "editedAt[]", - "in": "query", - "description": "Filter by editedAt end timestamp. Value is a 10-digit unix timestamp. Filters messages edited on or before this timestamp. Can be used with editedAt[from] for a date range.\n **Supported operators:** from, to.\n **Format:** editedAt[operator]=value.\n **Example:** editedAt[to]=1739059200", - "schema": { - "type": "integer" - } - }, { "name": "limit", "in": "query", From b9f8b21694f1e13345a93caec7479b3d5a80d3e3 Mon Sep 17 00:00:00 2001 From: Pranav Kamble Date: Thu, 26 Mar 2026 18:59:17 +0530 Subject: [PATCH 5/5] RBAC branch merged and description updated for users status --- chat-apis.json | 794 +++++++++++++++++++++++++++++++++++++++++- data-import-apis.json | 169 +++++++++ 2 files changed, 961 insertions(+), 2 deletions(-) diff --git a/chat-apis.json b/chat-apis.json index 47b2e7ab2..4efd1042a 100644 --- a/chat-apis.json +++ b/chat-apis.json @@ -515,10 +515,14 @@ { "name": "status", "in": "query", - "description": "User list can be fetched depending on the user status. Supports multiselect with comma-separated values (e.g., available,offline).", + "description": "User list can be fetched depending on the user status. (available,offline).", "schema": { "type": "string", - "example": "available,offline" + "enum": [ + "available", + "offline" + ], + "example": "available" } }, { @@ -7269,6 +7273,623 @@ ] } }, + "/roles/{role}/permissions": { + "get": { + "tags": [ + "RBAC" + ], + "summary": "List Role Permissions", + "description": "Lists role permissions", + "operationId": "list-role-permissions", + "responses": { + "200": { + "description": "Lists role permissions", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "createGroup", + "type": "role", + "title": "Allows/Denies creating groups", + "description": "Allows/Denies creating groups", + "dataType": "string", + "availableValues": [ + "allow", + "deny" + ], + "defaultValue": "allow", + "createdAt": 1765962204, + "updatedAt": 1765962204 + }, + { + "id": "sendMessage", + "type": "role", + "title": "Allows/Denies sending messages", + "description": "Allows/Denies sending messages", + "dataType": "string", + "availableValues": [ + "allow", + "deny" + ], + "defaultValue": "allow", + "createdAt": 1765962204, + "updatedAt": 1765962204 + }, + { + "id": "sendMessage.allowedMessageTypes", + "type": "role", + "title": "Allows sending messages of the specified types", + "description": "Allows sending messages of the specified types", + "dataType": "stringArray", + "availableValues": [ + "text", + "image", + "audio", + "video", + "file" + ], + "createdAt": 1765962204, + "updatedAt": 1765962204, + "defaultValue": [] + } + ], + "meta": { + "pagination": { + "total": 28, + "count": 28, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "RBAC" + ], + "summary": "Set Role Permissions", + "description": "Sets or updates permissions for a specific role", + "operationId": "set-role-permissions", + "parameters": [ + { + "name": "role", + "in": "path", + "description": "The role identifier to update permissions for", + "required": true, + "schema": { + "type": "string", + "example": "default" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "description": "Permissions object containing key-value pairs for role permissions", + "type": "object", + "example": { + "createGroup": "allow", + "listUsers.mode": "friends", + "createGroup.allowedGroupTypes": [ + "public" + ] + }, + "additionalProperties": true + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Role permissions updated successfully", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "sendMessage": { + "success": true, + "message": "Permission with id sendMessage have been mapped successfully to role default." + }, + "permissions": { + "listUsers": "allow", + "listUsers.mode": "all", + "listUsers.allowedRoles": [ + "new_role" + ], + "getUserDetails.mode": "friends", + "getUserDetails.allowedRoles": [ + "default" + ], + "sendMessage": "allow", + "sendMessage.mode": "all", + "sendMessage.allowedReceiverTypes": [ + "group" + ], + "sendMessage.allowedReceiverRoles": [ + "new_role", + "default" + ], + "sendMessage.allowedMessageTypes": [ + "file", + "audio", + "video", + "image", + "text" + ], + "sendMessage.allowedMessageCategories": [ + "message", + "custom" + ], + "editMessage": "deny", + "deleteMessage": "deny", + "sendMessage.allowedMimeTypes": [ + "image/png" + ], + "initiateCall": "allow", + "initiateCall.mode": "all", + "initiateCall.allowedReceiverRoles": [ + "new_role" + ], + "createGroup": "allow", + "createGroup.allowedGroupTypes": [ + "private" + ], + "listGroups": "allow", + "listGroups.allowedGroupTypes": [ + "password" + ], + "joinGroup": "allow", + "joinGroup.allowedGroupTypes": [ + "public" + ], + "listMessages.allowedMessageCategories": [ + "message" + ], + "listMessages.allowedMessageTypes": [ + "audio" + ] + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/scopes/{scope}/permissions": { + "get": { + "tags": [ + "RBAC" + ], + "summary": "List Scope Permissions", + "description": "Lists scope permissions", + "operationId": "list-scope-permissions", + "responses": { + "200": { + "description": "Lists scope permissions", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "addReaction", + "type": "scope", + "title": "Allows member to list the members with specified scope", + "description": "Allows member to list the members with specified scope", + "dataType": "string", + "availableValues": [ + "allow", + "deny" + ], + "defaultValue": "allow", + "createdAt": 1765962204, + "updatedAt": 1765962204 + }, + { + "id": "sendMessage", + "type": "scope", + "title": "Allows/Denies sending messages", + "description": "Allows/Denies sending messages", + "dataType": "string", + "availableValues": [ + "allow", + "deny" + ], + "defaultValue": "allow", + "createdAt": 1765962204, + "updatedAt": 1765962204 + }, + { + "id": "initiateCall.allowedType", + "type": "scope", + "title": "Allows members to initiate call with the specified types", + "description": "Allows members to initiate call with the specified types", + "dataType": "stringArray", + "availableValues": [ + "audio", + "video" + ], + "createdAt": 1765962204, + "updatedAt": 1765962204, + "defaultValue": [] + } + ], + "meta": { + "pagination": { + "total": 11, + "count": 11, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "RBAC" + ], + "summary": "Set Scope Permissions", + "description": "Sets or updates permissions for a specific group scope", + "operationId": "set-scope-permissions", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "The group GUID to update scope permissions for", + "required": true, + "schema": { + "type": "string", + "example": "supergroup" + } + }, + { + "name": "scope", + "in": "path", + "description": "The scope identifier (e.g., admin, moderator, participant)", + "required": true, + "schema": { + "type": "string", + "example": "admin" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "permissions" + ], + "properties": { + "permissions": { + "description": "Permissions object containing key-value pairs for scope permissions", + "type": "object", + "example": { + "sendMessage": "deny", + "initiateCall": "friends" + }, + "additionalProperties": true + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Scope permissions updated successfully", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "sendMessage": { + "success": true, + "message": "Permission with id sendMessage have been mapped successfully to scope admin on group cometchat-guid-1." + }, + "permissions": { + "sendMessage": "allow", + "listMembers": "allow", + "listMembers.allowedScopes": "participant", + "addReaction": "deny", + "listReactions.allowedScopes": "moderator", + "listReactions": "deny", + "sendThreadedMessage": "allow", + "initiateCall": "deny", + "initiateCall.allowedScopes": "participant", + "initiateCall.allowedType": "audio", + "editMessage": "allow" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/roles/{role}/permissions/{permission}": { + "delete": { + "tags": [ + "RBAC" + ], + "summary": "Unset Role Permissions", + "description": "Removes a specific permission from a role", + "operationId": "unset-role-permissions", + "parameters": [ + { + "name": "role", + "in": "path", + "description": "The role identifier to remove permission from", + "required": true, + "schema": { + "type": "string", + "example": "default" + } + }, + { + "name": "permission", + "in": "path", + "description": "The permission key to unset (e.g., listUsers.mode, createGroup, etc.)", + "required": true, + "schema": { + "type": "string", + "example": "listUsers.mode" + } + } + ], + "responses": { + "200": { + "description": "Role permission unset successfully", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "permissions": { + "listUsers": "allow", + "listUsers.mode": "all", + "listUsers.allowedRoles": [ + "new_role" + ], + "getUserDetails.mode": "friends", + "getUserDetails.allowedRoles": [ + "default" + ], + "sendMessage": "allow", + "sendMessage.mode": "all", + "sendMessage.allowedReceiverTypes": [ + "group" + ], + "sendMessage.allowedReceiverRoles": [ + "new_role", + "default" + ], + "sendMessage.allowedMessageTypes": [ + "file", + "audio", + "video", + "image", + "text" + ], + "sendMessage.allowedMessageCategories": [ + "message", + "custom" + ], + "editMessage": "deny", + "editMessage.denyForScopes": [], + "deleteMessage": "deny", + "deleteMessage.denyForScopes": [], + "sendMessage.allowedCustomTypes": [], + "sendMessage.allowedMimeTypes": [ + "image/png" + ], + "initiateCall": "allow", + "initiateCall.mode": "all", + "initiateCall.allowedReceiverRoles": [ + "new_role" + ], + "createGroup": "allow", + "createGroup.allowedGroupTypes": [ + "private" + ], + "listGroups": "allow", + "listGroups.allowedGroupTypes": [ + "password" + ], + "joinGroup": "allow", + "joinGroup.allowedGroupTypes": [ + "public" + ], + "listMessages.allowedMessageCategories": [ + "message" + ], + "listMessages.allowedMessageTypes": [ + "audio" + ] + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/scopes/{scope}/permissions/{permission}": { + "delete": { + "tags": [ + "RBAC" + ], + "summary": "Unset Scope Permissions", + "description": "Removes a specific permission from a group scope", + "operationId": "unset-scope-permissions", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "The group GUID to remove scope permission from", + "required": true, + "schema": { + "type": "string", + "example": "supergroup" + } + }, + { + "name": "scope", + "in": "path", + "description": "The scope identifier (e.g., admin, moderator, participant)", + "required": true, + "schema": { + "type": "string", + "example": "admin" + } + }, + { + "name": "permission", + "in": "path", + "description": "The permission key to unset (e.g., sendMessage, initiateCall, etc.)", + "required": true, + "schema": { + "type": "string", + "example": "sendMessage" + } + } + ], + "responses": { + "200": { + "description": "Scope permission unset successfully", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "permissions": { + "sendMessage": "allow", + "listMembers": "allow", + "listMembers.allowedScopes": "participant", + "addReaction": "deny", + "listReactions.allowedScopes": "moderator", + "listReactions": "deny", + "sendThreadedMessage": "allow", + "initiateCall": "deny", + "initiateCall.allowedScopes": "participant", + "initiateCall.allowedType": "audio", + "editMessage": "allow" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, "/messages/{id}/thread": { "post": { "tags": [ @@ -15965,6 +16586,30 @@ }, "type": "object" }, + "RolePermissionSchema": { + "description": "Role permission mapping", + "properties": { + "role": { + "description": "Role name", + "type": "string", + "example": "admin" + }, + "permissions": { + "description": "List of permissions mapped to the role", + "type": "object", + "example": { + "users.read": true, + "users.write": true, + "groups.read": true, + "groups.write": false + }, + "additionalProperties": { + "type": "boolean" + } + } + }, + "type": "object" + }, "Schedule": { "properties": { "monday": { @@ -16159,6 +16804,36 @@ }, "type": "object" }, + "ScopePermissionSchema": { + "description": "Scope permission details", + "properties": { + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "users" + }, + "permissions": { + "description": "List of permissions available for this scope", + "type": "array", + "items": { + "properties": { + "permission": { + "description": "Permission identifier", + "type": "string", + "example": "read" + }, + "description": { + "description": "Permission description", + "type": "string", + "example": "View user information" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, "SentenceSimilaritySchema": { "required": [ "category", @@ -16218,6 +16893,64 @@ }, "type": "object" }, + "SetRolePermissionSchema": { + "description": "Set role permission response", + "properties": { + "role": { + "description": "Role identifier", + "type": "string", + "example": "default" + }, + "permissions": { + "description": "Permissions configuration for the role", + "type": "object", + "example": { + "createGroup": "allow", + "listUsers.mode": "friends", + "createGroup.allowedGroupTypes": [ + "public" + ] + }, + "additionalProperties": true + }, + "updatedAt": { + "description": "Timestamp when permissions were last updated", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, + "SetScopePermissionSchema": { + "description": "Set scope permission response", + "properties": { + "guid": { + "description": "Group identifier", + "type": "string", + "example": "supergroup" + }, + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "admin" + }, + "permissions": { + "description": "Permissions configuration for the scope", + "type": "object", + "example": { + "sendMessage": "deny", + "initiateCall": "friends" + }, + "additionalProperties": true + }, + "updatedAt": { + "description": "Timestamp when permissions were last updated", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, "SilentNotification": { "properties": { "chat": { @@ -16404,6 +17137,63 @@ }, "type": "object" }, + "UnsetRolePermissionSchema": { + "description": "Unset role permission response", + "properties": { + "role": { + "description": "Role identifier", + "type": "string", + "example": "default" + }, + "permission": { + "description": "The permission key that was removed", + "type": "string", + "example": "listUsers.mode" + }, + "status": { + "description": "Status of the operation", + "type": "string", + "example": "removed" + }, + "updatedAt": { + "description": "Timestamp when permission was removed", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, + "UnsetScopePermissionSchema": { + "description": "Unset scope permission response", + "properties": { + "guid": { + "description": "Group identifier", + "type": "string", + "example": "supergroup" + }, + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "admin" + }, + "permission": { + "description": "The permission key that was removed", + "type": "string", + "example": "sendMessage" + }, + "status": { + "description": "Status of the operation", + "type": "string", + "example": "removed" + }, + "updatedAt": { + "description": "Timestamp when permission was removed", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, "UserFilter": { "required": [ "entity", diff --git a/data-import-apis.json b/data-import-apis.json index 98f9ea677..b96dcabbb 100644 --- a/data-import-apis.json +++ b/data-import-apis.json @@ -2081,6 +2081,30 @@ }, "type": "object" }, + "RolePermissionSchema": { + "description": "Role permission mapping", + "properties": { + "role": { + "description": "Role name", + "type": "string", + "example": "admin" + }, + "permissions": { + "description": "List of permissions mapped to the role", + "type": "object", + "example": { + "users.read": true, + "users.write": true, + "groups.read": true, + "groups.write": false + }, + "additionalProperties": { + "type": "boolean" + } + } + }, + "type": "object" + }, "Schedule": { "properties": { "monday": { @@ -2275,6 +2299,36 @@ }, "type": "object" }, + "ScopePermissionSchema": { + "description": "Scope permission details", + "properties": { + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "users" + }, + "permissions": { + "description": "List of permissions available for this scope", + "type": "array", + "items": { + "properties": { + "permission": { + "description": "Permission identifier", + "type": "string", + "example": "read" + }, + "description": { + "description": "Permission description", + "type": "string", + "example": "View user information" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, "SentenceSimilaritySchema": { "required": [ "category", @@ -2334,6 +2388,64 @@ }, "type": "object" }, + "SetRolePermissionSchema": { + "description": "Set role permission response", + "properties": { + "role": { + "description": "Role identifier", + "type": "string", + "example": "default" + }, + "permissions": { + "description": "Permissions configuration for the role", + "type": "object", + "example": { + "createGroup": "allow", + "listUsers.mode": "friends", + "createGroup.allowedGroupTypes": [ + "public" + ] + }, + "additionalProperties": true + }, + "updatedAt": { + "description": "Timestamp when permissions were last updated", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, + "SetScopePermissionSchema": { + "description": "Set scope permission response", + "properties": { + "guid": { + "description": "Group identifier", + "type": "string", + "example": "supergroup" + }, + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "admin" + }, + "permissions": { + "description": "Permissions configuration for the scope", + "type": "object", + "example": { + "sendMessage": "deny", + "initiateCall": "friends" + }, + "additionalProperties": true + }, + "updatedAt": { + "description": "Timestamp when permissions were last updated", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, "SilentNotification": { "properties": { "chat": { @@ -2520,6 +2632,63 @@ }, "type": "object" }, + "UnsetRolePermissionSchema": { + "description": "Unset role permission response", + "properties": { + "role": { + "description": "Role identifier", + "type": "string", + "example": "default" + }, + "permission": { + "description": "The permission key that was removed", + "type": "string", + "example": "listUsers.mode" + }, + "status": { + "description": "Status of the operation", + "type": "string", + "example": "removed" + }, + "updatedAt": { + "description": "Timestamp when permission was removed", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, + "UnsetScopePermissionSchema": { + "description": "Unset scope permission response", + "properties": { + "guid": { + "description": "Group identifier", + "type": "string", + "example": "supergroup" + }, + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "admin" + }, + "permission": { + "description": "The permission key that was removed", + "type": "string", + "example": "sendMessage" + }, + "status": { + "description": "Status of the operation", + "type": "string", + "example": "removed" + }, + "updatedAt": { + "description": "Timestamp when permission was removed", + "type": "integer", + "example": 1640000000 + } + }, + "type": "object" + }, "UserFilter": { "required": [ "entity",