diff --git a/calls.json b/calls.json index f5b5050e4..856a66959 100644 --- a/calls.json +++ b/calls.json @@ -1,588 +1,605 @@ { - "openapi": "3.1.0", - "info": { - "title": "calls-api", - "version": "3" - }, - "servers": [ - { - "url": "https://{appId}.call-{region}.cometchat.io/v3", - "variables": { - "appId": { - "default": "appId" - }, - "region": { - "default": "region" - } - } - } - ], - "components": { - "securitySchemes": { - "sec0": { - "type": "apiKey", - "in": "header", - "name": "apikey" - } - } - }, - "security": [ - { - "sec0": [] - } - ], - "paths": { - "/calls": { - "get": { - "summary": "List Calls", - "description": "lists all the calls that are available in the app. It can include participants, and recordings property in the response (if present).", - "operationId": "list-calls", - "parameters": [ - { - "name": "type", - "in": "query", - "description": "It includes the type of the call, possible values: audio & video", - "schema": { - "type": "string", - "enum": [ - "audio", - "video" - ], - "description": "Allowed values: audio, video" - } - }, - { - "name": "mode", - "in": "query", - "description": "It represents the mode of call, possible values: call, meet & presenter.", - "schema": { - "type": "string", - "enum": [ - "call", - "meet", - "presenter" - ], - "description": "Allowed values: call, meet, presenter" - } - }, - { - "name": "participantsCount", - "in": "query", - "description": "This query parameter allows you to filter the list of calls based on the number of participants involved in each call. For example, participantsCount=5 will return calls that had exactly 5 participants.", - "schema": { - "type": "string" - } - }, - { - "name": "startedAt", - "in": "query", - "description": "It represents when the call was started. It's 10 digit unix timestamp.", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "status", - "in": "query", - "description": "It indicates the status of the call. Possible values are initiated, ongoing, ended, unanswered, rejected, canceled.", - "schema": { - "type": "string", - "enum": [ - "initiated", - "ongoing", - "ended", - "unanswered", - "rejected", - "canceled" - ], - "description": "Allowed values: initiated, ongoing, ended, unanswered, rejected, canceled" - } - }, - { - "name": "receiverType", - "in": "query", - "description": "It indicates if it was 1-1 call of group call. Possible values: user & group.", - "schema": { - "type": "string", - "enum": [ - "user", - "group" - ], - "description": "Allowed values: user, group" - } - }, - { - "name": "endedAt", - "in": "query", - "description": "It represents when the call was ended.", - "schema": { - "type": "integer", - "format": "int32" - } - }, - { - "name": "hasRecording", - "in": "query", - "description": "It's a boolean field indicating if the call has recording present or not.", - "schema": { - "type": "boolean" - } - }, - { - "name": "uid", - "in": "query", - "description": "It fetches only those calls in which the passed uid is a part of.", - "schema": { - "type": "string" - } - }, - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "200", - "content": { - "application/json": { - "examples": { - "Result": { - "value": "{\n \"data\": [\n {\n \"sessionId\": \"v1.us.31780434a95d45.1692368168aefba73a1e5938ad7a02f8e61ea1c9a287a08aeb\",\n \"totalAudioMinutes\": 0.31666666666666665,\n \"totalVideoMinutes\": 0,\n \"totalDuration\": \"00:00:19\",\n \"hasRecording\": false,\n \"initiatedAt\": 1692368168,\n \"initiator\": \"cometchat-uid-8\",\n \"mode\": \"call\",\n \"receiver\": \"sivamathewstestgroup\",\n \"receiverType\": \"group\",\n \"status\": \"ended\",\n \"totalDurationInMinutes\": 0.31666666666666665,\n \"totalParticipants\": 2,\n \"type\": \"audio\",\n \"mid\": \"3f7596ac-854b-484d-b36c-d623e193bd81\",\n \"startedAt\": 1692368180,\n \"endedAt\": 1692368199,\n \"participants\": [\n {\n \"uid\": \"cometchat-uid-2\",\n \"totalAudioMinutes\": 0.31666666666666665,\n \"totalVideoMinutes\": 0,\n \"isJoined\": true,\n \"state\": \"ended\",\n \"totalDuration\": 0.31666666666666665,\n \"deviceId\": \"b7683aaf-090a-4204-8f84-7ddd652923aa@rtc.cometchat.com/ucTKf4eq\",\n \"joinedAt\": 1692368180,\n \"mid\": \"3f7596ac-854b-484d-b36c-d623e193bd81\",\n \"leftAt\": 1692368199\n },\n {\n \"uid\": \"cometchat-uid-8\",\n \"totalAudioMinutes\": 0.2833333333333333,\n \"totalVideoMinutes\": 0,\n \"isJoined\": true,\n \"state\": \"ended\",\n \"totalDuration\": 0.2833333333333333,\n \"deviceId\": \"f55d46e5-2b1c-4b02-9072-382209a8753f@rtc.cometchat.com/K-s6dB3N\",\n \"joinedAt\": 1692368180,\n \"mid\": \"3f7596ac-854b-484d-b36c-d623e193bd81\",\n \"leftAt\": 1692368197\n },\n {\n \"uid\": \"cometchat-uid-4\",\n \"totalAudioMinutes\": 0,\n \"totalVideoMinutes\": 0,\n \"isJoined\": false,\n \"state\": \"unanswered\",\n \"totalDuration\": 0\n },\n {\n \"uid\": \"cometchat-uid-7\",\n \"totalAudioMinutes\": 0,\n \"totalVideoMinutes\": 0,\n \"isJoined\": false,\n \"state\": \"unanswered\",\n \"totalDuration\": 0\n },\n {\n \"uid\": \"cometchat-uid-6\",\n \"totalAudioMinutes\": 0,\n \"totalVideoMinutes\": 0,\n \"isJoined\": false,\n \"state\": \"unanswered\",\n \"totalDuration\": 0\n }\n ]\n },\n {\n \"sessionId\": \"v1.us.31780434a95d45.16923681138d75114d60d1345a22e4cc612263fb26c0b5cf92\",\n \"totalAudioMinutes\": 0.31666666666666665,\n \"totalVideoMinutes\": 0,\n \"totalDuration\": \"00:00:19\",\n \"hasRecording\": false,\n \"initiatedAt\": 1692368113,\n \"initiator\": \"cometchat-uid-8\",\n \"mode\": \"call\",\n \"receiver\": \"cometchat-uid-2\",\n \"receiverType\": \"user\",\n \"status\": \"ended\",\n \"totalDurationInMinutes\": 0.31666666666666665,\n \"totalParticipants\": 2,\n \"type\": \"audio\",\n \"mid\": \"855e1519-1244-4213-8e40-53044c1e9e43\",\n \"startedAt\": 1692368127,\n \"endedAt\": 1692368146,\n \"participants\": [\n {\n \"uid\": \"cometchat-uid-8\",\n \"totalAudioMinutes\": 0.26666666666666666,\n \"totalVideoMinutes\": 0,\n \"totalDuration\": 0.26666666666666666,\n \"deviceId\": \"70ecae89-b71c-4bb3-8220-b7c99ec1658f@rtc.cometchat.com/hsYWb5ul\",\n \"isJoined\": true,\n \"joinedAt\": 1692368128,\n \"mid\": \"855e1519-1244-4213-8e40-53044c1e9e43\",\n \"state\": \"ended\",\n \"leftAt\": 1692368144\n },\n {\n \"uid\": \"cometchat-uid-2\",\n \"totalAudioMinutes\": 0.23333333333333334,\n \"totalVideoMinutes\": 0,\n \"totalDuration\": 0.23333333333333334,\n \"deviceId\": \"c9ed493e-8495-428d-b6ee-b32019cc57ce@rtc.cometchat.com/CKT3xgR4\",\n \"isJoined\": true,\n \"joinedAt\": 1692368132,\n \"mid\": \"855e1519-1244-4213-8e40-53044c1e9e43\",\n \"state\": \"ended\",\n \"leftAt\": 1692368146\n }\n ]\n }\n ],\n \"meta\": {\n \"pagination\": {\n \"total\": 2,\n \"count\": 2,\n \"total_pages\": 1,\n \"current_page\": 1\n }\n }\n}" - } + "openapi": "3.0.0", + "info": { + "title": "Calls APIs", + "description": "Manage calls using our API.", + "version": "3.0" + }, + "servers": [ + { + "url": "https://{appId}.call-{region}.cometchat.io/v3", + "variables": { + "appId": { + "default": "appId", + "description": "(Required) App ID" }, - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sessionId": { - "type": "string", - "example": "v1.us.31780434a95d45.1692368168aefba73a1e5938ad7a02f8e61ea1c9a287a08aeb" - }, - "totalAudioMinutes": { - "type": "number", - "example": 0.31666666666666665, - "default": 0 - }, - "totalVideoMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "totalDuration": { - "type": "string", - "example": "00:00:19" - }, - "hasRecording": { - "type": "boolean", - "example": false, - "default": true - }, - "initiatedAt": { - "type": "integer", - "example": 1692368168, - "default": 0 - }, - "initiator": { - "type": "string", - "example": "cometchat-uid-8" - }, - "mode": { - "type": "string", - "example": "call" - }, - "receiver": { - "type": "string", - "example": "sivamathewstestgroup" - }, - "receiverType": { + "region": { + "enum": [ + "us", + "eu", + "in" + ], + "default": "us", + "description": "Select Region" + } + } + } + ], + "paths": { + "/calls": { + "get": { + "tags": [ + "Calls" + ], + "summary": "List Calls", + "description": "lists all the calls that are available in the app. It can include participants, and recordings property in the response (if present).", + "operationId": "list-calls", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "type", + "in": "query", + "description": "It includes the type of the call, possible values: audio & video", + "schema": { "type": "string", - "example": "group" - }, - "status": { + "enum": [ + "audio", + "video" + ] + } + }, + { + "name": "mode", + "in": "query", + "description": "It represents the mode of call, possible values: call, meet & presenter.", + "schema": { "type": "string", - "example": "ended" - }, - "totalDurationInMinutes": { - "type": "number", - "example": 0.31666666666666665, - "default": 0 - }, - "totalParticipants": { - "type": "integer", - "example": 2, - "default": 0 - }, - "type": { + "enum": [ + "call", + "meet", + "presenter" + ] + } + }, + { + "name": "participantsCount", + "in": "query", + "description": "This query parameter allows you to filter the list of calls based on the number of participants involved in each call. For example, participantsCount=5 will return calls that had exactly 5 participants.", + "schema": { + "type": "integer" + } + }, + { + "name": "startedAt", + "in": "query", + "description": "It represents when the call was started. It's 10 digit unix timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "status", + "in": "query", + "description": "It indicates the status of the call. Possible values are unanswered, rejected, ongoing, ended.", + "schema": { "type": "string", - "example": "audio" - }, - "mid": { + "enum": [ + "rejected", + "ongoing", + "ended" + ] + } + }, + { + "name": "receiverType", + "in": "query", + "description": "It indicates if it was 1-1 call of group call. Possible values: user & group.", + "schema": { "type": "string", - "example": "3f7596ac-854b-484d-b36c-d623e193bd81" - }, - "startedAt": { - "type": "integer", - "example": 1692368180, - "default": 0 - }, - "endedAt": { - "type": "integer", - "example": 1692368199, - "default": 0 - }, - "participants": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "string", - "example": "cometchat-uid-2" - }, - "totalAudioMinutes": { - "type": "number", - "example": 0.31666666666666665, - "default": 0 - }, - "totalVideoMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "isJoined": { - "type": "boolean", - "example": true, - "default": true - }, - "state": { - "type": "string", - "example": "ended" - }, - "totalDuration": { - "type": "number", - "example": 0.31666666666666665, - "default": 0 - }, - "deviceId": { - "type": "string", - "example": "b7683aaf-090a-4204-8f84-7ddd652923aa@rtc.cometchat.com/ucTKf4eq" - }, - "joinedAt": { - "type": "integer", - "example": 1692368180, - "default": 0 + "enum": [ + "user", + "group" + ] + } + }, + { + "name": "endedAt", + "in": "query", + "description": "It represents when the call was ended.", + "schema": { + "type": "integer" + } + }, + { + "name": "hasRecording", + "in": "query", + "description": "It's a boolean field indicating if the call has recording present or not.", + "schema": { + "type": "boolean" + } + }, + { + "name": "uid", + "in": "query", + "description": "It fetches only those calls in which the passed uid is a part of.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Lists Calls", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "": { + "$ref": "#/components/schemas/callSchema" + } + }, + "type": "object" + } + }, + "meta": { + "properties": { + "": { + "$ref": "#/components/schemas/metaSchema" + } + }, + "type": "object" + } + }, + "type": "object" }, - "mid": { - "type": "string", - "example": "3f7596ac-854b-484d-b36c-d623e193bd81" + "example": { + "data": [ + { + "sessionId": "v1.us.31780434a95d45.1692368168aefba73a1e5938ad7a02f8e61ea1c9a287a08aeb", + "totalAudioMinutes": 0.31666666666666665, + "totalVideoMinutes": 0, + "totalDuration": "00:00:19", + "hasRecording": false, + "initiatedAt": 1692368168, + "initiator": "superhero8", + "mode": "call", + "receiver": "sivamathewstestgroup", + "receiverType": "group", + "status": "ended", + "totalDurationInMinutes": 0.31666666666666665, + "totalParticipants": 2, + "type": "audio", + "mid": "3f7596ac-854b-484d-b36c-d623e193bd81", + "startedAt": 1692368180, + "endedAt": 1692368199, + "participants": [ + { + "uid": "superhero2", + "totalAudioMinutes": 0.31666666666666665, + "totalVideoMinutes": 0, + "isJoined": true, + "state": "ended", + "totalDuration": 0.31666666666666665, + "deviceId": "b7683aaf-090a-4204-8f84-7ddd652923aa@rtc.cometchat-staging.com/ucTKf4eq", + "joinedAt": 1692368180, + "mid": "3f7596ac-854b-484d-b36c-d623e193bd81", + "leftAt": 1692368199 + }, + { + "uid": "superhero8", + "totalAudioMinutes": 0.2833333333333333, + "totalVideoMinutes": 0, + "isJoined": true, + "state": "ended", + "totalDuration": 0.2833333333333333, + "deviceId": "f55d46e5-2b1c-4b02-9072-382209a8753f@rtc.cometchat-staging.com/K-s6dB3N", + "joinedAt": 1692368180, + "mid": "3f7596ac-854b-484d-b36c-d623e193bd81", + "leftAt": 1692368197 + }, + { + "uid": "superhero4", + "totalAudioMinutes": 0, + "totalVideoMinutes": 0, + "isJoined": false, + "state": "unanswered", + "totalDuration": 0 + }, + { + "uid": "superhero7", + "totalAudioMinutes": 0, + "totalVideoMinutes": 0, + "isJoined": false, + "state": "unanswered", + "totalDuration": 0 + }, + { + "uid": "superhero6", + "totalAudioMinutes": 0, + "totalVideoMinutes": 0, + "isJoined": false, + "state": "unanswered", + "totalDuration": 0 + } + ] + }, + { + "sessionId": "v1.us.31780434a95d45.16923681138d75114d60d1345a22e4cc612263fb26c0b5cf92", + "totalAudioMinutes": 0.31666666666666665, + "totalVideoMinutes": 0, + "totalDuration": "00:00:19", + "hasRecording": false, + "initiatedAt": 1692368113, + "initiator": "superhero8", + "mode": "call", + "receiver": "superhero2", + "receiverType": "user", + "status": "ended", + "totalDurationInMinutes": 0.31666666666666665, + "totalParticipants": 2, + "type": "audio", + "mid": "855e1519-1244-4213-8e40-53044c1e9e43", + "startedAt": 1692368127, + "endedAt": 1692368146, + "participants": [ + { + "uid": "superhero8", + "totalAudioMinutes": 0.26666666666666666, + "totalVideoMinutes": 0, + "totalDuration": 0.26666666666666666, + "deviceId": "70ecae89-b71c-4bb3-8220-b7c99ec1658f@rtc.cometchat-staging.com/hsYWb5ul", + "isJoined": true, + "joinedAt": 1692368128, + "mid": "855e1519-1244-4213-8e40-53044c1e9e43", + "state": "ended", + "leftAt": 1692368144 + }, + { + "uid": "superhero2", + "totalAudioMinutes": 0.23333333333333334, + "totalVideoMinutes": 0, + "totalDuration": 0.23333333333333334, + "deviceId": "c9ed493e-8495-428d-b6ee-b32019cc57ce@rtc.cometchat-staging.com/CKT3xgR4", + "isJoined": true, + "joinedAt": 1692368132, + "mid": "855e1519-1244-4213-8e40-53044c1e9e43", + "state": "ended", + "leftAt": 1692368146 + } + ] + } + ], + "meta": { + "pagination": { + "total": 2, + "count": 2, + "total_pages": 1, + "current_page": 1 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/calls/{sessionId}": { + "get": { + "tags": [ + "Calls" + ], + "summary": "Get Call", + "description": "Fetches all the details of the call whose sessionId is passed in the URL.", + "operationId": "retrieve-call-details", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "sessionId", + "in": "path", + "description": "Call to Retreive", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Rereives Call Details", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/callSchema" + } + }, + "type": "object" + } + }, + "type": "object" }, - "leftAt": { - "type": "integer", - "example": 1692368199, - "default": 0 + "example": { + "data": { + "sessionId": "v1.us.31780434a95d45.16923681138d75114d60d1345a22e4cc612263fb26c0b5cf92", + "totalAudioMinutes": 0.31666666666666665, + "totalVideoMinutes": 0, + "totalDuration": "00:00:19", + "metaData": [], + "hasRecording": false, + "initiatedAt": 1692368113, + "initiator": "superhero8", + "mode": "call", + "receiver": "superhero2", + "receiverType": "user", + "status": "ended", + "tags": [], + "totalDurationInMinutes": 0.31666666666666665, + "totalParticipants": 2, + "type": "audio", + "mid": "855e1519-1244-4213-8e40-53044c1e9e43", + "startedAt": 1692368127, + "endedAt": 1692368146, + "participants": [ + { + "uid": "superhero2", + "totalAudioMinutes": 0.23333333333333334, + "totalVideoMinutes": 0, + "totalDuration": 0.23333333333333334, + "deviceId": "c9ed493e-8495-428d-b6ee-b32019cc57ce@rtc.cometchat-staging.com/CKT3xgR4", + "isJoined": true, + "joinedAt": 1692368132, + "mid": "855e1519-1244-4213-8e40-53044c1e9e43", + "state": "ended", + "leftAt": 1692368146 + }, + { + "uid": "superhero8", + "totalAudioMinutes": 0.26666666666666666, + "totalVideoMinutes": 0, + "totalDuration": 0.26666666666666666, + "deviceId": "70ecae89-b71c-4bb3-8220-b7c99ec1658f@rtc.cometchat-staging.com/hsYWb5ul", + "isJoined": true, + "joinedAt": 1692368128, + "mid": "855e1519-1244-4213-8e40-53044c1e9e43", + "state": "ended", + "leftAt": 1692368144 + } + ] + } } - } } - } } - } - }, - "meta": { - "type": "object", - "properties": { - "pagination": { - "type": "object", - "properties": { + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + } + }, + "components": { + "schemas": { + "callSchema": { + "description": "Response data", + "properties": { + "sessionId": { + "type": "string" + }, + "totalAudioMinutes": { + "type": "integer" + }, + "totalVideoMinutes": { + "type": "integer" + }, + "totalDuration": { + "type": "integer" + }, + "hasRecording": { + "type": "boolean" + }, + "initiatedAt": { + "type": "integer" + }, + "initiator": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "status": { + "type": "string" + }, + "totalDurationInMinutes": { + "type": "integer" + }, + "totalParticipants": { + "type": "integer" + }, + "type": { + "type": "string" + }, + "mid": { + "type": "string" + }, + "startedAt": { + "type": "integer" + }, + "endedAt": { + "type": "integer" + }, + "participants": { + "type": "array", + "items": { + "properties": { + "": { + "$ref": "#/components/schemas/participantSchema" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "deleteSchema": { + "properties": { + "success": { + "type": "boolean" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "metaSchema": { + "properties": { + "pagination": { + "properties": { "total": { - "type": "integer", - "example": 2, - "default": 0 + "type": "integer" }, "count": { - "type": "integer", - "example": 2, - "default": 0 + "type": "integer" }, - "total_pages": { - "type": "integer", - "example": 1, - "default": 0 + "per_page": { + "type": "integer" }, "current_page": { - "type": "integer", - "example": 1, - "default": 0 + "type": "integer" + }, + "total_pages": { + "type": "integer" } - } - } - } + }, + "type": "object" } - } - } - } - } - }, - "400": { - "description": "400", - "content": { - "application/json": { - "examples": { - "Result": { - "value": "{}" - } }, - "schema": { - "type": "object", - "properties": {} - } - } - } - } - }, - "deprecated": false - } - }, - "/calls/{sessionId}": { - "get": { - "summary": "Get Call", - "description": "Fetches all the details of the call whose sessionId is passed in the URL.", - "operationId": "get-call", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "schema": { - "type": "string" - } - }, - { - "name": "sessionId", - "in": "path", - "description": "Call to Retrieve", - "schema": { - "type": "string" + "type": "object" }, - "required": true - } - ], - "responses": { - "200": { - "description": "200", - "content": { - "application/json": { - "examples": { - "Get Call": { - "value": "{\n \"data\": [\n {\n \"sessionId\": \"v1.eu.2574867aa2e6e417.17158459999d7fa95b1b4faea599f11eb5ecf07611b0b335c3\",\n \"totalAudioMinutes\": 0,\n \"totalVideoMinutes\": 0,\n \"totalDuration\": \"00:00:00\",\n \"hasRecording\": false,\n \"initiatedAt\": 1715845999,\n \"initiator\": \"cometchat-uid-1\",\n \"mode\": \"call\",\n \"receiver\": \"cometchat-uid-2\",\n \"receiverType\": \"user\",\n \"status\": \"initiated\",\n \"totalDurationInMinutes\": 0,\n \"totalParticipants\": 0,\n \"type\": \"audio\",\n \"participants\": [\n {\n \"uid\": \"cometchat-uid-1\",\n \"totalAudioMinutes\": 0,\n \"totalVideoMinutes\": 0,\n \"isJoined\": false,\n \"totalDurationInMinutes\": 0,\n \"name\": \"Andrew Joseph\",\n \"avatar\": \"https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp\"\n },\n {\n \"uid\": \"cometchat-uid-2\",\n \"totalAudioMinutes\": 0,\n \"totalVideoMinutes\": 0,\n \"isJoined\": false,\n \"state\": \"unanswered\",\n \"totalDurationInMinutes\": 0,\n \"name\": \"George Alan\",\n \"avatar\": \"https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp\"\n }\n ],\n \"data\": {\n \"entities\": {\n \"initiator\": {\n \"entity\": {\n \"uid\": \"cometchat-uid-1\",\n \"name\": \"Andrew Joseph\",\n \"avatar\": \"https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp\"\n }\n },\n \"receiver\": {\n \"entity\": {\n \"uid\": \"cometchat-uid-2\",\n \"name\": \"George Alan\",\n \"avatar\": \"https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp\"\n }\n }\n }\n }\n }\n ]\n}" - } + "participantSchema": { + "properties": { + "uid": { + "type": "string" + }, + "totalAudioMinutes": { + "type": "integer" + }, + "totalVideoMinutes": { + "type": "integer" + }, + "isJoined": { + "type": "boolean" + }, + "state": { + "type": "string" + }, + "totalDuration": { + "type": "integer" + }, + "deviceId": { + "type": "integer" + }, + "joinedAt": { + "type": "integer" + }, + "mid": { + "type": "string" + }, + "leftAt": { + "type": "integer" + } }, + "type": "object" + } + }, + "parameters": { + "uid": { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "sessionId": { - "type": "string", - "example": "v1.eu.2574867aa2e6e417.17158459999d7fa95b1b4faea599f11eb5ecf07611b0b335c3" - }, - "totalAudioMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "totalVideoMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "totalDuration": { - "type": "string", - "example": "00:00:00" - }, - "hasRecording": { - "type": "boolean", - "example": false, - "default": true - }, - "initiatedAt": { - "type": "integer", - "example": 1715845999, - "default": 0 - }, - "initiator": { - "type": "string", - "example": "cometchat-uid-1" - }, - "mode": { - "type": "string", - "example": "call" - }, - "receiver": { - "type": "string", - "example": "cometchat-uid-2" - }, - "receiverType": { - "type": "string", - "example": "user" - }, - "status": { - "type": "string", - "example": "initiated" - }, - "totalDurationInMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "totalParticipants": { - "type": "integer", - "example": 0, - "default": 0 - }, - "type": { - "type": "string", - "example": "audio" - }, - "participants": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "string", - "example": "cometchat-uid-1" - }, - "totalAudioMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "totalVideoMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "isJoined": { - "type": "boolean", - "example": false, - "default": true - }, - "totalDurationInMinutes": { - "type": "integer", - "example": 0, - "default": 0 - }, - "name": { - "type": "string", - "example": "Andrew Joseph" - }, - "avatar": { - "type": "string", - "example": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp" - } - } - } - }, - "data": { - "type": "object", - "properties": { - "entities": { - "type": "object", - "properties": { - "initiator": { - "type": "object", - "properties": { - "entity": { - "type": "object", - "properties": { - "uid": { - "type": "string", - "example": "cometchat-uid-1" - }, - "name": { - "type": "string", - "example": "Andrew Joseph" - }, - "avatar": { - "type": "string", - "example": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp" - } - } - } - } - }, - "receiver": { - "type": "object", - "properties": { - "entity": { - "type": "object", - "properties": { - "uid": { - "type": "string", - "example": "cometchat-uid-2" - }, - "name": { - "type": "string", - "example": "George Alan" - }, - "avatar": { - "type": "string", - "example": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp" - } - } - } - } - } - } - } - } - } - } - } + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" } - } } - } - } - }, - "400": { - "description": "400", - "content": { - "application/json": { - "examples": { - "Result": { - "value": "{}" - } + }, + "guid": { + "name": "guid", + "in": "path", + "description": "A GUID of a group.", + "required": true, + "schema": { + "type": "string" }, + "examples": { + "string": { + "summary": "GUID", + "value": "" + } + } + }, + "requiredonBehalfOf": { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + "onBehalfOf": { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", "schema": { - "type": "object", - "properties": {} + "type": "string" } - } } - } }, - "deprecated": false - } - } - }, - "x-readme": { - "headers": [], - "explorer-enabled": true, - "proxy-enabled": true - }, - "x-readme-fauxas": true + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "description": "API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).", + "name": "apikey", + "in": "header" + } + } + }, + "tags": [ + { + "name": "Calls", + "description": "The Calls tag" + } + ] } \ No newline at end of file diff --git a/chat-apis.json b/chat-apis.json index 4b53bf26b..595147810 100644 --- a/chat-apis.json +++ b/chat-apis.json @@ -1,18198 +1,20256 @@ { - "openapi": "3.0.0", - "info": { - "title": "Chat APIs", - "description": "Manage messages, users, groups for a particular app using our Chat API.", - "version": "3.0" - }, - "servers": [ - { - "url": "https://{appId}.api-{region}.cometchat.io/v3", - "variables": { - "appId": { - "default": "appId", - "description": "(Required) App ID" - }, - "region": { - "enum": [ - "us", - "eu", - "in" - ], - "default": "us", - "description": "Select Region" - } - } - } - ], - "paths": { - "/apikeys": { - "post": { - "tags": [ - "API Keys" - ], - "summary": "Create", - "description": "Creates a new API key", - "operationId": "create-apikey", - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "name", - "scope" - ], - "properties": { - "name": { - "description": "Friendly name for the API key.", - "type": "string" - }, - "scope": { - "description": "Scope for the API key.", - "type": "string", - "default": "authOnly", - "enum": [ - "authOnly", - "fullAccess" - ] - } + "openapi": "3.0.0", + "info": { + "title": "Chat APIs", + "description": "Manage messages, users, groups for a particular app using our Chat API.", + "version": "3.0" + }, + "servers": [ + { + "url": "https://{appId}.api-{region}.cometchat.io/v3", + "variables": { + "appId": { + "default": "appId", + "description": "(Required) App ID" }, - "type": "object" - } + "region": { + "enum": [ + "us", + "eu", + "in" + ], + "default": "us", + "description": "Select Region" + } } - } - }, - "responses": { - "200": { - "description": "Created API key", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + } + ], + "paths": { + "/apikeys": { + "post": { + "tags": [ + "API Keys" + ], + "summary": "Create", + "description": "Creates a new API key", + "operationId": "create-apikey", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "name", + "scope" + ], + "properties": { + "name": { + "description": "Friendly name for the API key.", + "type": "string" + }, + "scope": { + "description": "Scope for the API key. Possible values: fullAccess, authOnly.", + "type": "string", + "default": "authOnly", + "enum": [ + "authOnly", + "fullAccess" + ] + } + }, + "type": "object" + } + } } - }, - "type": "object" }, - "example": { - "data": { - "apiKey": "f1915e328e249ffaaafd97fb46a57ba55d233fbf", - "name": "John's apiKey", - "scope": "authOnly", - "createdAt": 1625206799 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "API Keys" - ], - "summary": "List", - "description": "Lists API keys", - "operationId": "list-apikeys", - "parameters": [ - { - "name": "scope", - "in": "query", - "description": "Scope of the apikey. Available values: fullAccess, authOnly", - "schema": { - "type": "string", - "enum": [ - "fullAccess", - "authOnly" - ], - "description": "API key scope. fullAccess: all operations. authOnly: user auth only." - } - }, - { - "name": "searchKey", - "in": "query", - "description": "Searches for specified keyword in name", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Lists API keys", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "apiKey": { - "type": "string" - }, - "name": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } + "responses": { + "200": { + "description": "Created API key", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "apiKey": "f1915e328e249ffaaafd97fb46a57ba55d233fbf", + "name": "John's apiKey", + "scope": "authOnly", + "createdAt": 1625206799 + } + } + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ + "security": [ { - "apiKey": "fcf32d085482db7ef10e971967d70a91cdb6677a", - "name": "John's apiKey", - "scope": "authOnly", - "createdAt": 1631095584 - }, + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "API Keys" + ], + "summary": "List", + "description": "Lists API keys", + "operationId": "list-apikeys", + "parameters": [ { - "apiKey": "0f40b2c254f33d429b1fca5e0eb1cef72c594ddc", - "name": "Auth Key", - "scope": "authOnly", - "createdAt": 1629869272 + "name": "scope", + "in": "query", + "description": "Scope of the apikey. Available values: fullAccess, authOnly", + "schema": { + "type": "string", + "enum": [ + "fullAccess", + "authOnly" + ] + } }, { - "apiKey": "495318bc2e137fb2decf17078abd169a7bd50c8b", - "name": "Rest API Key", - "scope": "fullAccess", - "createdAt": 1629869272 - } - ], - "meta": { - "pagination": { - "total": 3, - "count": 3, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/apikeys/{apiKey}": { - "get": { - "tags": [ - "API Keys" - ], - "summary": "Get", - "description": "Retrieves API key", - "operationId": "get-apikey", - "parameters": [ - { - "name": "apiKey", - "in": "path", - "description": "An apikey to retrieve.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Retrieves API key", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "name": "searchKey", + "in": "query", + "description": "Searches for specified keyword in name", + "schema": { + "type": "string" + } } - }, - "type": "object" - }, - "example": { - "data": { - "apiKey": "f1915e328e249ffaaafd97fb46a57ba55d233fbf", - "name": "John's apiKey", - "scope": "authOnly", - "createdAt": 1625206799 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "API Keys" - ], - "summary": "Update", - "description": "Updates an API key", - "operationId": "update-apikey", - "parameters": [ - { - "name": "apiKey", - "in": "path", - "description": "An apikey to update.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "description": "Friendly name for the API key.", - "type": "string" - }, - "scope": { - "description": "Scope for the API key.", - "type": "string", - "enum": [ - "authOnly", - "fullAccess" - ] - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Updated API Key", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + ], + "responses": { + "200": { + "description": "Lists API keys", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "apiKey": "fcf32d085482db7ef10e971967d70a91cdb6677a", + "name": "John's apiKey", + "scope": "authOnly", + "createdAt": 1631095584 + }, + { + "apiKey": "0f40b2c254f33d429b1fca5e0eb1cef72c594ddc", + "name": "Auth Key", + "scope": "authOnly", + "createdAt": 1629869272 + }, + { + "apiKey": "495318bc2e137fb2decf17078abd169a7bd50c8b", + "name": "Rest API Key", + "scope": "fullAccess", + "createdAt": 1629869272 + } + ], + "meta": { + "pagination": { + "total": 3, + "count": 3, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "apiKey": "f1915e328e249ffaaafd97fb46a57ba55d233fbf", - "name": "John's apiKey", - "scope": "authOnly", - "createdAt": 1625206799 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "API Keys" - ], - "summary": "Delete", - "description": "Deletes an API key", - "operationId": "delete-apikey", - "parameters": [ - { - "name": "apiKey", - "in": "path", - "description": "An apikey to delete.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "API Key.", - "value": "f1915e328e249ffaaafd97fb46a57ba55d233fbf" - } - } - } - ], - "responses": { - "200": { - "description": "A list of api keys", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "The Api Key fcf32d085482db7ef10e971967d70a91cdb6677a has been deleted successfully." - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users": { - "post": { - "tags": [ - "Users" - ], - "summary": "Create", - "description": "Creates a new user", - "operationId": "create-user", - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "uid", - "name" + "/apikeys/{apiKey}": { + "get": { + "tags": [ + "API Keys" ], - "properties": { - "uid": { - "description": "Unique identifier of the user. Please refer to https://prodocs.cometchat.com/docs/concepts#uid", - "type": "string" - }, - "name": { - "description": "Display name of the user.", - "type": "string" - }, - "avatar": { - "description": "URL to profile picture of the user.", - "type": "string" - }, - "link": { - "description": "URL to profile page.", - "type": "string" - }, - "role": { - "description": "User role of the user for role based access control.", - "type": "string" - }, - "statusMessage": { - "description": "A message providing context related to the user's current status or mood.", - "type": "string" - }, - "metadata": { - "description": "Additional information about the user as JSON. If you plan to use [Email Notification](doc:android-extensions-email-notification#section-configure-your-backend-to-store-emails) or [SMS Notification](doc:android-extensions-sms-notification#section-configure-your-backend-to-store-phone-number) extensions, Please add the private metadata here.", - "properties": { - "@private": { - "properties": { - "email": { - "type": "string" - }, - "contactNumber": { + "summary": "Get", + "description": "Retrieves API key", + "operationId": "get-apikey", + "parameters": [ + { + "name": "apiKey", + "in": "path", + "description": "An apikey to retrieve.", + "required": true, + "schema": { "type": "string" - } - }, - "type": "object" - } - }, - "type": "object", - "default": { - "@private": { - "email": "user@email.com", - "contactNumber": "0123456789" - } - } - }, - "tags": { - "description": "A list of tags to identify specific users.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "withAuthToken": { - "description": "Includes authToken of created user in response.", - "type": "boolean" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Create User", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + } } - }, - "type": "object" - }, - "example": { - "data": { - "uid": "cometchat-uid-6", - "name": "Barry Allen", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "metadata": { - "rawMetadata": "{'gender':'Male'}" - }, - "status": "offline", - "role": "manager", - "createdAt": 1638354015, - "tags": [ - "Engineer", - "manager" - ], - "authToken": "cometchat-uid-6_16383540156641d37a023c75d26f4c22a21ff126" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Users" - ], - "summary": "List", - "description": "Lists all the users of an app", - "operationId": "list-users", - "parameters": [ - { - "name": "searchKey", - "in": "query", - "description": "The searchKey query parameter work for both name and uid:\nIt performs a LIKE% query, searching for uid/name values starting with the specified characters.", - "schema": { - "type": "string" - } - }, - { - "name": "searchIn", - "in": "query", - "description": "Searches for specified keyword in name,UID or both.", - "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "name", - "uid" ], - "description": "Search field." - } - } - }, - { - "name": "status", - "in": "query", - "description": "User list can be fetched depending on the user status. (available,offline).", - "schema": { - "type": "string", - "enum": [ - "available", - "offline" - ], - "description": "User status filter." - } - }, - { - "name": "count", - "in": "query", - "description": "Fetches users count.", - "schema": { - "type": "boolean" - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of users to be fetched in a request. The default value is 100 and the maximum value is 1000.", - "schema": { - "type": "integer", - "default": "100" - } - }, - { - "name": "page", - "in": "query", - "description": "Page Number.", - "schema": { - "type": "integer", - "default": "1" - } - }, - { - "name": "role", - "in": "query", - "description": "Retrieves user list based on role.", - "schema": { - "type": "string" - } - }, - { - "name": "withTags", - "in": "query", - "description": "Includes tags in the response.", - "schema": { - "type": "boolean" - } - }, - { - "name": "tags", - "in": "query", - "description": "Fetches only those users that have these tags.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "roles", - "in": "query", - "description": "Fetches users based on multiple roles.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "onlyDeactivated", - "in": "query", - "description": "Fetches all the deactivated users of an app.", - "schema": { - "type": "boolean" - } - }, - { - "name": "withDeactivated", - "in": "query", - "description": "Fetches all the users including deactivated users.", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "A list of users", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "link": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } + "responses": { + "200": { + "description": "Retrieves API key", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "apiKey": "f1915e328e249ffaaafd97fb46a57ba55d233fbf", + "name": "John's apiKey", + "scope": "authOnly", + "createdAt": 1625206799 + } + } + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" - }, - "example": { - "data": [ - { - "uid": "cometchat-uid-6", - "name": "Barry Allen", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "metadata": { - "email": "user@email.com", - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "manager", - "createdAt": 1638354015, - "updatedAt": 1638354799, - "conversationId": "cometchat-uid-4_user_cometchat-uid-6" - }, - { - "uid": "cometchat-uid-2", - "name": "George Alan", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "role": "default", - "createdAt": 1629869270, - "updatedAt": 1630308676, - "conversationId": "cometchat-uid-2_user_cometchat-uid-4" - }, - { - "uid": "cometchat-uid-3", - "name": "George Alan", - "link": "https://data-us.cometchat.io/assets", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "metadata": { - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "default", - "blockedByMe": true, - "blockedByMeAt": 1638346853, - "blockedAt": 1638346853, - "createdAt": 1629869270, - "updatedAt": 1638351060, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - } - ], - "meta": { - "pagination": { - "total": 0, - "count": 5, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - } - }, - "cursor": { - "updatedAt": 1638354799, - "affix": "prepend" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Users" - ], - "summary": "Reactivate", - "description": "Reactivates users for the specified UIDs", - "operationId": "reactivate-users", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "uidsToActivate": { - "description": "UIDs that needs to reactivated.", - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "tag1" - ] - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "re-activated users", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "nonDeactivatedUids": { - "type": "array", - "items": {} + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "API Keys" + ], + "summary": "Update", + "description": "Updates an API key", + "operationId": "update-apikey", + "parameters": [ + { + "name": "apiKey", + "in": "path", + "description": "An apikey to update.", + "required": true, + "schema": { + "type": "string" } - }, - "type": "object" } - }, - "type": "object" - }, - "example": { - "data": { - "nonDeactivatedUids": [ - "cometchat-uid-2", - "cometchat-uid-3" - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Users" - ], - "summary": "Deactivate", - "description": "Deactivates users for the specified UIDs", - "operationId": "deactivate-users", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "uidsToDeactivate": { - "description": "UIDs that needs to deactivated.", - "type": "array", - "items": { - "type": "string" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "Friendly name for the API key.", + "type": "string" + }, + "scope": { + "description": "Scope for the API key. Possible values: fullAccess, authOnly.", + "type": "string", + "enum": [ + "fullAccess", + "authOnly" + ] + } + }, + "type": "object" + } + } } - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Deactivated Users", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "deactivatedUids": { - "type": "array", - "items": {} + "responses": { + "200": { + "description": "Updated API Key", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "apiKey": "f1915e328e249ffaaafd97fb46a57ba55d233fbf", + "name": "John's apiKey", + "scope": "authOnly", + "createdAt": 1625206799 + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "deactivatedUids": [ - "cometchat-uid-2", - "cometchat-uid-3" - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get", - "description": "Retrieves user details for a specified UID.", - "operationId": "get-user", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - { - "$ref": "#/components/parameters/onBehalfOf" - } - ], - "responses": { - "200": { - "description": "Fetched User", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "delete": { + "tags": [ + "API Keys" + ], + "summary": "Delete", + "description": "Deletes an API key", + "operationId": "delete-apikey", + "parameters": [ + { + "name": "apiKey", + "in": "path", + "description": "An apikey to delete.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "API Key.", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "A list of api keys", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The Api Key fcf32d085482db7ef10e971967d70a91cdb6677a has been deleted successfully." + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "uid": "cometchat-uid-6", - "name": "Barry Allen", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "status": "offline", - "role": "manager", - "createdAt": 1638354015 - } - } - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Users" - ], - "summary": "Update", - "description": "Updates a user with the provided UID", - "operationId": "update-user", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "description": "Display name of the user.", - "type": "string" - }, - "avatar": { - "description": "URL to profile picture of the user.", - "type": "string" - }, - "link": { - "description": "URL to profile page.", - "type": "string" - }, - "role": { - "description": "User role of the user for role based access control.", - "type": "string" - }, - "statusMessage": { - "description": "A message providing context related to the user's current status or mood.", - "type": "string" - }, - "metadata": { - "description": "Additional information about the user as JSON. If you plan to use [Email Notification](doc:android-extensions-email-notification#section-configure-your-backend-to-store-emails) or [SMS Notification](doc:android-extensions-sms-notification#section-configure-your-backend-to-store-phone-number) extensions, Please add the private metadata here.", - "properties": { - "@private": { - "properties": { - "email": { + "/users": { + "post": { + "tags": [ + "Users" + ], + "summary": "Create", + "description": "Creates a new user", + "operationId": "creates-user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "Unique identifier of the user. Please refer to https://prodocs.cometchat.com/docs/concepts#uid", + "type": "string" + }, + "name": { + "description": "Display name of the user.", + "type": "string" + }, + "avatar": { + "description": "URL to profile picture of the user.", + "type": "string" + }, + "link": { + "description": "URL to profile page.", + "type": "string" + }, + "role": { + "description": "User role of the user for role based access control.", + "type": "string" + }, + "statusMessage": { + "description": "A message providing context related to the user's current status or mood.", + "type": "string" + }, + "metadata": { + "description": "Additional information about the user as JSON. If you plan to use [Email Notification](doc:android-extensions-email-notification#section-configure-your-backend-to-store-emails) or [SMS Notification](doc:android-extensions-sms-notification#section-configure-your-backend-to-store-phone-number) extensions, Please add the private metadata here.", + "properties": { + "@private": { + "properties": { + "email": { + "type": "string" + }, + "contactNumber": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object", + "default": { + "@private": { + "email": "user@email.com", + "contactNumber": "0123456789" + } + } + }, + "tags": { + "description": "A list of tags to identify specific users.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "withAuthToken": { + "description": "Includes authToken of created user in response.", + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Create User", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "uid": "superhero6", + "name": "Barry Allen", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "metadata": { + "rawMetadata": "{'gender':'Male'}" + }, + "status": "offline", + "role": "manager", + "createdAt": 1638354015, + "tags": [ + "Engineer", + "manager" + ], + "authToken": "superhero6_16383540156641d37a023c75d26f4c22a21ff126" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Users" + ], + "summary": "List", + "description": "Lists all the users of an app", + "operationId": "list-users", + "parameters": [ + { + "name": "searchKey", + "in": "query", + "description": "The searchKey query parameter work for both name and uid:\nIt performs a LIKE% query, searching for uid/name values starting with the specified characters.", + "schema": { + "type": "string" + } + }, + { + "name": "searchIn", + "in": "query", + "description": "Searches for specified keyword in name,UID or both.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "name", + "uid" + ] + } + } + }, + { + "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).", + "schema": { + "type": "string", + "example": "available,offline" + } + }, + { + "name": "count", + "in": "query", + "description": "Fetches users count.", + "schema": { + "type": "boolean" + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of users to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "page", + "in": "query", + "description": "Page Number.", + "schema": { + "type": "integer", + "default": "1" + } + }, + { + "name": "role", + "in": "query", + "description": "Retrieves user list based on role.", + "schema": { + "type": "string" + } + }, + { + "name": "withTags", + "in": "query", + "description": "Includes tags in the response.", + "schema": { + "type": "boolean" + } + }, + { + "name": "tags", + "in": "query", + "description": "Fetches only those users that have these tags.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "roles", + "in": "query", + "description": "Fetches users based on multiple roles.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "onlyDeactivated", + "in": "query", + "description": "Fetches all the deactivated users of an app.", + "schema": { + "type": "boolean" + } + }, + { + "name": "withDeactivated", + "in": "query", + "description": "Fetches all the users including deactivated users.", + "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": { + "200": { + "description": "A list of users", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "uid": "superhero6", + "name": "Barry Allen", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "metadata": { + "email": "user@email.com", + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "manager", + "createdAt": 1638354015, + "updatedAt": 1638354799, + "conversationId": "superhero4_user_superhero6" + }, + { + "uid": "superhero2", + "name": "Captain America", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "role": "default", + "createdAt": 1629869270, + "updatedAt": 1630308676, + "conversationId": "superhero2_user_superhero4" + }, + { + "uid": "superhero3", + "name": "Captain America", + "link": "https://data-us.cometchat.io/assets", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "metadata": { + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "default", + "blockedByMe": true, + "blockedByMeAt": 1638346853, + "blockedAt": 1638346853, + "createdAt": 1629869270, + "updatedAt": 1638351060, + "conversationId": "superhero3_user_superhero4" + } + ], + "meta": { + "pagination": { + "total": 0, + "count": 5, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + }, + "cursor": { + "updatedAt": 1638354799, + "affix": "prepend" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Users" + ], + "summary": "Reactivate", + "description": "Reactivates users for the specified UIDs", + "operationId": "reactivate-users", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "uidsToActivate": { + "description": "UIDs that needs to reactivated.", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "tag1" + ] + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "re-activated users", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "nonDeactivatedUids": { + "type": "array", + "items": {} + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "nonDeactivatedUids": [ + "superhero2", + "superhero3" + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Users" + ], + "summary": "Deactivate", + "description": "Deactivates users for the specified UIDs", + "operationId": "deactivate-users", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "uidsToDeactivate": { + "description": "UIDs that needs to deactivated.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Deactivated Users", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "deactivatedUids": { + "type": "array", + "items": {} + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "deactivatedUids": [ + "superhero2", + "superhero3" + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get", + "description": "Retrieves user details for a specified UID.", + "operationId": "get-user", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + { + "$ref": "#/components/parameters/onBehalfOf" + } + ], + "responses": { + "200": { + "description": "Fetched User", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "uid": "superhero6", + "name": "Barry Allen", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "status": "offline", + "role": "manager", + "createdAt": 1638354015 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Users" + ], + "summary": "Update", + "description": "Updates a user with the provided UID", + "operationId": "update-user", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "Display name of the user.", + "type": "string" + }, + "avatar": { + "description": "URL to profile picture of the user.", + "type": "string" + }, + "link": { + "description": "URL to profile page.", + "type": "string" + }, + "role": { + "description": "User role of the user for role based access control.", + "type": "string" + }, + "statusMessage": { + "description": "A message providing context related to the user's current status or mood.", + "type": "string" + }, + "metadata": { + "description": "Additional information about the user as JSON. If you plan to use [Email Notification](doc:android-extensions-email-notification#section-configure-your-backend-to-store-emails) or [SMS Notification](doc:android-extensions-sms-notification#section-configure-your-backend-to-store-phone-number) extensions, Please add the private metadata here.", + "properties": { + "@private": { + "properties": { + "email": { + "type": "string" + }, + "contactNumber": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object", + "default": { + "@private": { + "email": "user@email.com", + "contactNumber": "0123456789" + } + } + }, + "tags": { + "description": "A list of tags to identify specific users.", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "tag1" + ] + }, + "unset": { + "description": "The unsettable user attributes are avatar, link and metadata.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "avatar", + "link", + "metadata" + ] + }, + "default": [ + "avatar" + ] + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Updated user", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "uid": "superhero6", + "name": "Barry Allen", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "metadata": { + "email": "user@email.com", + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "manager", + "createdAt": 1638354015, + "updatedAt": 1638354799, + "tags": [ + "supergroup" + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Users" + ], + "summary": "Delete", + "description": "Deletes a user for the specified UID", + "operationId": "delete-user", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "permanent": { + "description": "Permanently deletes the user along with all the messages, conversations, etc.", + "type": "boolean", + "default": "false" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Deleted User", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "User with superhero6 has been deleted successfully." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Create", + "description": "Creates a group.", + "operationId": "create-group", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "guid", + "name", + "type" + ], + "properties": { + "guid": { + "description": "A unique identifier for a group.", + "type": "string" + }, + "name": { + "description": "Name of the group.", + "type": "string" + }, + "type": { + "description": "Type of the group. Can be public, password or private.", + "type": "string", + "enum": [ + "public", + "password", + "private" + ] + }, + "password": { + "description": "A password required to join the the group with type password", + "type": "string" + }, + "icon": { + "description": "An URL for a group icon.", + "type": "string" + }, + "description": { + "description": "Description about the group", + "type": "string" + }, + "metadata": { + "description": "Additional data for the group.", + "type": "object" + }, + "owner": { + "description": "The UID that you wish to make owner of the group", + "type": "string" + }, + "tags": { + "description": "List of tags to identify specific groups.", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "tag1" + ] + }, + "members": { + "description": "Add members to a group with scope admins,moderators and participants.", + "properties": { + "admins": { + "description": "UIDs of users to be made admins.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "moderators": { + "description": "UIDs of users to be made moderators.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "usersToBan": { + "description": "UIDs of the users to be banned from the group.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "participants": { + "description": "UIDs of users to be made participants.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "type": "object", + "additionalProperties": false, + "x-omitempty": true + } + }, + "type": "object" + }, + "examples": { + "Send Moderation Message": { + "summary": "Send Moderation Message", + "value": { + "guid": "testgroup", + "name": "Test Group", + "type": "public" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Create Group", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "guid": "project-group", + "name": "Project Group", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "public", + "scope": "admin", + "membersCount": 1, + "joinedAt": 1638440784, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1638440784, + "owner": "superhero4", + "tags": [ + "friends", + "project" + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Groups" + ], + "summary": "List", + "description": "Lists the groups.", + "operationId": "list-groups", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "searchKey", + "in": "query", + "description": "Searches for given keyword in group's list (either GUID, name or email).", + "schema": { + "type": "string" + } + }, + { + "name": "searchIn", + "in": "query", + "description": "Searches for specified keyword in name,GUID or both.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "sortBy", + "in": "query", + "description": "Sorts the group list by either Name,Guid or Created at . Available values: name, guid, createdAt", + "schema": { + "type": "string", + "enum": [ + "name", + "guid", + "createdAt" + ] + } + }, + { + "name": "sortOrder", + "in": "query", + "description": "Sorts the group list in ascending or descending order. Available values: asc, desc", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of groups to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "affix", + "in": "query", + "description": "Determines whether to fetch the groups either before or after createdAt/updatedAt timestamp. Possible values are append(after) and prepend(before).", + "schema": { + "type": "string", + "enum": [ + "append", + "prepend" + ] + } + }, + { + "name": "updatedAt", + "in": "query", + "description": "Fetches the groups list after a particular updatedAt timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "withTags", + "in": "query", + "description": "Includes those groups that have tags.", + "schema": { + "type": "boolean" + } + }, + { + "name": "tags", + "in": "query", + "description": "Fetches only those groups that have these tags.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "type", + "in": "query", + "description": "Fetches groups based on group type(public, protected, password).", + "schema": { + "type": "string", + "enum": [ + "public", + "private", + "protected" + ] + } + }, + { + "name": "types", + "in": "query", + "description": "Fetches groups based on multiple types.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "page", + "in": "query", + "description": "Page number.", + "schema": { + "type": "integer" + } + }, + { + "name": "hasJoined", + "in": "query", + "description": "Fetches all the joined groups of a user. This will work only with onBehalfOf parameter in header. It accepts only true as a value, setting it as false simply removes this filter.", + "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": { + "200": { + "description": "A list of groups", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + }, + "cursor": { + "properties": { + "updatedAt": { + "type": "integer" + }, + "affix": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "guid": "project-group", + "name": "Project Group", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "public", + "scope": "admin", + "membersCount": 1, + "joinedAt": 1638440784, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1638440784, + "owner": "superhero4", + "tags": [ + "friends", + "project" + ] + }, + { + "guid": "project-group-2", + "name": "Project Group 2", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "public", + "scope": "admin", + "membersCount": 1, + "joinedAt": 1638440784, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1638440784, + "owner": "superhero4", + "tags": [ + "friends", + "project" + ] + } + ], + "meta": { + "pagination": { + "total": 0, + "count": 5, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + }, + "cursor": { + "updatedAt": 1638354799, + "affix": "prepend" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}": { + "get": { + "tags": [ + "Groups" + ], + "summary": "Get", + "description": "Retrieves details of a group for a given GUID.", + "operationId": "get-group", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + } + ], + "responses": { + "200": { + "description": "Get group", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "guid": "project-group", + "name": "Project Group", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "public", + "scope": "admin", + "membersCount": 1, + "joinedAt": 1638440784, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1638440784, + "owner": "superhero4", + "tags": [ + "friends", + "project" + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Groups" + ], + "summary": "Update", + "description": "Updates the group details for a given GUID.", + "operationId": "update-group", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "Name of the group.", + "type": "string" + }, + "type": { + "description": "The type of the group. The available values are: public, password and private.", + "type": "string", + "enum": [ + "public", + "password", + "private" + ] + }, + "password": { + "description": "A password required to join the the group with type password", + "type": "string" + }, + "icon": { + "description": "An URL for a group icon.", + "type": "string" + }, + "description": { + "description": "Description about the group", + "type": "string" + }, + "metadata": { + "description": "Additional group data.", + "type": "object" + }, + "owner": { + "description": "The UID that you wish to make the owner of the group.This field will be ignored if onBehalfOf parameter in the header is present in the request.", + "type": "string" + }, + "tags": { + "description": "Updates tags of a group.", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "tag1" + ] + }, + "unset": { + "description": "The unsettable user attributes are icon, description and metadata.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "icon", + "description", + "metadata" + ] + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Get group", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "guid": "project-group", + "name": "Project Group", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "public", + "scope": "admin", + "membersCount": 1, + "joinedAt": 1638440784, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1638440784, + "owner": "superhero4", + "tags": [ + "friends", + "project" + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Groups" + ], + "summary": "Delete", + "description": "Deletes a group with a given GUID.", + "operationId": "delete-group", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + } + ], + "responses": { + "200": { + "description": "Deleted Group", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Group with guid project-group has been deleted successfully." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/messages": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Send Message", + "description": "Sends Message on behalf of a user.", + "operationId": "send-message", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "discriminator": { + "propertyName": "category", + "mapping": { + "message": "#/components/schemas/messageCategorySchema", + "interactive": "#/components/schemas/interactiveCategorySchema", + "custom": "#/components/schemas/customCategorySchema" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/messageCategorySchema" + }, + { + "$ref": "#/components/schemas/customCategorySchema" + }, + { + "$ref": "#/components/schemas/interactiveCategorySchema" + } + ] + }, + "examples": { + "Text Message": { + "$ref": "#/components/examples/text-message" + }, + "Media Message": { + "$ref": "#/components/examples/media-message" + }, + "Custom Message": { + "$ref": "#/components/examples/custom-message" + } + } + } + } + }, + "responses": { + "200": { + "description": "Create Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "1", + "conversationId": "superhero3_user_superhero5", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero5", + "category": "message", + "type": "text", + "data": { + "text": "test hello", + "metadata": { + "key1": "val1" + }, + "entities": { + "sender": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550, + "conversationId": "superhero3_user_superhero5" + }, + "entityType": "user" + } + } + }, + "sentAt": 1638423490, + "updatedAt": 1638423490 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Messages" + ], + "summary": "List Messages", + "description": "Fetches the messages list.", + "operationId": "list-all-messages", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "searchKey", + "in": "query", + "description": "Fetches messages that include the searchKey.", + "schema": { + "type": "string" + } + }, + { + "name": "hideMessagesFromBlockedUsers", + "in": "query", + "description": "Fetches messages sent by users who are blocked by the requesting user.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasAttachments", + "in": "query", + "description": "Fetches messages that include attachments.", + "schema": { + "type": "boolean" + } + }, + { + "name": "attachmentTypes", + "in": "query", + "description": "Displays messages according to the type of attachment. Supported types include: image, video, audio, and file.", + "schema": { + "type": "string", + "enum": [ + "image", + "video", + "audio", + "file" + ] + } + }, + { + "name": "hasMentions", + "in": "query", + "description": "Fetches messages that include mentions.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasLinks", + "in": "query", + "description": "Fetches messages that include links.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mentionedUids", + "in": "query", + "description": "Fetches messages that include the mentioned comma-separated UIDs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasReactions", + "in": "query", + "description": "Fetches messages that include reactions.", + "schema": { + "type": "boolean" + } + }, + { + "name": "receiverType", + "in": "query", + "description": "Displays messages based on receiverType (user/group)", + "schema": { + "type": "string", + "enum": [ + "user", + "group" + ] + } + }, + { + "name": "affix", + "in": "query", + "description": "Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).", + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "query", + "description": "Retrieves all those messages after the passed id.", + "schema": { + "type": "string" + } + }, + { + "name": "category", + "in": "query", + "description": "Filters messages by category. Possible values: message, action and custom.", + "schema": { + "type": "string", + "enum": [ + "message", + "action", + "custom" + ] + } + }, + { + "name": "type", + "in": "query", + "description": "Filters messages by type.", + "schema": { + "type": "string" + } + }, + { + "name": "sender", + "in": "query", + "description": "Filters messages with sender. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", + "schema": { + "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", + "description": "For the mentioned users, provides blocked information with respect to the UID in onBehalfOf header.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mentionsWithTagInfo", + "in": "query", + "description": "Provides user tags for the mentioned users.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hideDeleted", + "in": "query", + "description": "Hides deleted messages from List.", + "schema": { + "type": "boolean" + } + }, + { + "name": "onlyDeleted", + "in": "query", + "description": "Includes only deleted messages in List.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hideReplies", + "in": "query", + "description": "Shows only messages skipping the replies in the message thread.", + "schema": { + "type": "boolean" + } + }, + { + "name": "count", + "in": "query", + "description": "Includes unread message count in List.", + "schema": { + "type": "boolean" + } + }, + { + "name": "unread", + "in": "query", + "description": "Retrieves all the unread messages in a conversation. It must be used alongside count query parameter.", + "schema": { + "type": "boolean" + } + }, + { + "name": "sentAt", + "in": "query", + "description": "Fetches the messages list after a particular sentAt timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "sentAt[from]", + "in": "query", + "description": "Filter by sentAt start timestamp (Unix timestamp). Filters messages sent on or after this timestamp. Can be used with sentAt[to] for a date range.", + "schema": { + "type": "integer", + "example": 1738368000 + } + }, + { + "name": "sentAt[to]", + "in": "query", + "description": "Filter by sentAt end timestamp (Unix timestamp). Filters messages sent on or before this timestamp. Can be used with sentAt[from] for a date range.", + "schema": { + "type": "integer", + "example": 1739059200 + } + }, + { + "name": "updatedAt[from]", + "in": "query", + "description": "Filter by updatedAt start timestamp (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.", + "schema": { + "type": "integer", + "example": 1738368000 + } + }, + { + "name": "updatedAt[to]", + "in": "query", + "description": "Filter by updatedAt end timestamp (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.", + "schema": { + "type": "integer", + "example": 1739059200 + } + }, + { + "name": "editedAt[from]", + "in": "query", + "description": "Filter by editedAt start timestamp (Unix timestamp). Filters messages edited on or after this timestamp. Can be used with editedAt[to] for a date range.", + "schema": { + "type": "integer", + "example": 1738368000 + } + }, + { + "name": "editedAt[to]", + "in": "query", + "description": "Filter by editedAt end timestamp (Unix timestamp). Filters messages edited on or before this timestamp. Can be used with editedAt[from] for a date range.", + "schema": { + "type": "integer", + "example": 1739059200 + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000", + "schema": { + "type": "integer", + "default": "10" + } + }, + { + "name": "conversationId", + "in": "query", + "description": "Fetches all the messages belong to a particular conversation.", + "schema": { + "type": "string" + } + }, + { + "name": "withTags", + "in": "query", + "description": "This will fetch messages along with the tags.", + "schema": { + "type": "boolean" + } + }, + { + "name": "tags", + "in": "query", + "description": "This will fetch only those messages belonging to the mentioned tags.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "categories", + "in": "query", + "description": "Fetches messages based on multiple categories.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "types", + "in": "query", + "description": "Fetches messages based on multiple types.", + "schema": { + "type": "array", + "items": {} + } + }, + { + "name": "fromTimestamp", + "in": "query", + "description": "Fetches the messages from this timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "toTimestamp", + "in": "query", + "description": "Fetches the messages till this timestamp. It will be ignored if fromTimestamp is missing or empty.", + "schema": { + "type": "integer" + } + }, + { + "name": "hideQuotedMessages", + "in": "query", + "description": "If set to true, the API response will exclude all quotedMessage nodes from the returned messages. This allows clients to fetch only the messages without any quoted messages.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "List Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "1", + "conversationId": "superhero3_user_superhero5", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero5", + "category": "message", + "type": "text", + "data": { + "text": "test hello", + "entities": { + "sender": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "createdAt": 1638361550 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "createdAt": 1638361550, + "conversationId": "superhero3_user_superhero5" + }, + "entityType": "user" + } + }, + "metadata": { + "key1": "val1" + } + }, + "sentAt": 1638423490, + "updatedAt": 1638423490 + } + ], + "meta": { + "current": { + "limit": 100, + "count": 1 + }, + "next": { + "affix": "append", + "sentAt": 1638423490, + "id": "1" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/messages/{id}": { + "get": { + "tags": [ + "Messages" + ], + "summary": "Get Message", + "description": "Fetches the details of a message.", + "operationId": "get-message-details", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose details are to be fetched.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Retreived Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "1", + "conversationId": "superhero3_user_superhero5", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero5", + "category": "message", + "type": "text", + "data": { + "text": "test hello", + "metadata": { + "key1": "val1" + }, + "entities": { + "sender": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550, + "conversationId": "superhero3_user_superhero5" + }, + "entityType": "user" + } + } + }, + "sentAt": 1638423490, + "updatedAt": 1638423490 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Messages" + ], + "summary": "Update Message", + "description": "Edits the message on behalf of a user.", + "operationId": "update-message", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose details are to be fetched.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "description": "The data that needs to be modified.", + "properties": { + "text": { + "type": "string" + }, + "metadata": { + "type": "object" + } + }, + "type": "object" + }, + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "tag1" + ] + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Updated Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "402", + "conversationId": "superhero1_user_superhero2", + "sender": "superhero1", + "receiverType": "user", + "receiver": "superhero2", + "category": "action", + "type": "message", + "data": { + "action": "edited", + "entities": { + "by": { + "entity": { + "uid": "superhero1", + "name": "Updated Name", + "status": "offline", + "role": "default", + "createdAt": 1639448370, + "updatedAt": 1640599553 + }, + "entityType": "user" + }, + "for": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "role": "default", + "createdAt": 1639448370 + }, + "entityType": "user" + }, + "on": { + "entity": { + "id": "69", + "conversationId": "superhero1_user_superhero2", + "sender": "superhero1", + "receiverType": "user", + "receiver": "superhero2", + "category": "message", + "type": "text", + "data": { + "text": "hello spider", + "entities": { + "sender": { + "entity": { + "uid": "superhero1", + "name": "Iron Man", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "status": "offline", + "createdAt": 1639448370 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1639448370, + "conversationId": "superhero1_user_superhero2" + }, + "entityType": "user" + } + } + }, + "sentAt": 1640171302, + "editedAt": 1641477338, + "editedBy": "app_system", + "updatedAt": 1641477338, + "tags": [ + "t6" + ] + }, + "entityType": "message" + } + } + }, + "sentAt": 1641477338, + "updatedAt": 1641477338 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Messages" + ], + "summary": "Delete Message", + "description": "Deletes the message.", + "operationId": "deletes-message", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose details are to be deleted.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "permanent": { + "description": "Deletes the message permanently.", + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Deleted Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "402", + "conversationId": "superhero1_user_superhero2", + "sender": "superhero1", + "receiverType": "user", + "receiver": "superhero2", + "category": "action", + "type": "message", + "data": { + "action": "edited", + "entities": { + "by": { + "entity": { + "uid": "superhero1", + "name": "Updated Name", + "status": "offline", + "role": "default", + "createdAt": 1639448370 + }, + "entityType": "user" + }, + "for": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "role": "default", + "createdAt": 1639448370 + }, + "entityType": "user" + }, + "on": { + "entity": { + "id": "69", + "conversationId": "superhero1_user_superhero2", + "sender": "superhero1", + "receiverType": "user", + "receiver": "superhero2", + "category": "message", + "type": "text", + "data": { + "text": "hello spider", + "entities": { + "sender": { + "entity": { + "uid": "superhero1", + "name": "Iron Man", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "status": "offline", + "createdAt": 1639448370 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1639448370, + "conversationId": "superhero1_user_superhero2" + }, + "entityType": "user" + } + } + }, + "sentAt": 1640171302, + "editedAt": 1641477338, + "editedBy": "app_system", + "updatedAt": 1641477338, + "tags": [ + "t6" + ] + }, + "entityType": "message" + } + } + }, + "sentAt": 1641477338, + "updatedAt": 1641477338 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/messages/{id}/reactions": { + "get": { + "tags": [ + "Messages" + ], + "summary": "List all reactions", + "description": "Lists all the reactions for a message", + "operationId": "list-all-reactions", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose reactions are to be fetched.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "List Reactions", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "": { + "$ref": "#/components/schemas/reactionSchema" + } + }, + "type": "object" + } + }, + "meta": { + "properties": { + "": { + "$ref": "#/components/schemas/messageMetaSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "1", + "messageId": "2", + "reaction": ":reaction", + "uid": "superhero1", + "reactedAt": 1700210335, + "reactedBy": { + "uid": "superhero1", + "name": "Iron Man", + "status": "offline", + "role": "default", + "createdAt": 1698934972 + } + }, + { + "id": "2", + "messageId": "2", + "reaction": "😅", + "uid": "superhero1", + "reactedAt": 1700210456, + "reactedBy": { + "uid": "superhero1", + "name": "Iron Man", + "status": "offline", + "role": "default", + "createdAt": 1698934972 + } + }, + { + "id": "5", + "messageId": "2", + "reaction": "😒", + "uid": "superhero2", + "reactedAt": 1700230866, + "reactedBy": { + "uid": "superhero2", + "name": "Captain America", + "status": "offline", + "role": "default", + "createdAt": 1698934987, + "conversationId": "superhero1_user_superhero2" + } + } + ], + "meta": { + "current": { + "limit": 100, + "count": 3 + }, + "next": { + "affix": "append", + "id": "5" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/messages/{id}/reactions/{reaction}": { + "get": { + "tags": [ + "Messages" + ], + "summary": "List reactions with a specific emoji/unicodes", + "description": "List reactions with a specific emoji/unicodes for a message", + "operationId": "get-message-reactions", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose reactions are to be fetched.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + }, + { + "name": "reaction", + "in": "path", + "description": "reaction whose details are to be fetched.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Reaction", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Get Reactions", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "properties": { + "": { + "$ref": "#/components/schemas/reactionSchema" + } + }, + "type": "object" + } + }, + "meta": { + "properties": { + "": { + "$ref": "#/components/schemas/messageMetaSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "1", + "messageId": "1", + "reaction": "😅", + "uid": "superhero1", + "reactedAt": 1702638595, + "reactedBy": { + "uid": "superhero1", + "name": "Iron Man", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/ironman.png", + "status": "available", + "role": "default", + "lastActiveAt": 1689082633, + "createdAt": 1684751861 + } + } + ], + "meta": { + "current": { + "limit": 100, + "count": 1 + }, + "next": { + "affix": "append", + "id": "1" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "post": { + "tags": [ + "Messages" + ], + "summary": "Add reaction", + "description": "Adds a reaction to a message.", + "operationId": "add-message-reactions", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message to react.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + }, + { + "name": "reaction", + "in": "path", + "description": "reaction to react.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Reaction", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Adding reaction", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/messageReactionSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "2", + "conversationId": "superhero1_user_superhero2", + "sender": "superhero1", + "receiverType": "user", + "receiver": "superhero2", + "category": "message", + "type": "text", + "data": { + "text": "Hi,", + "entities": { + "sender": { + "entity": { + "uid": "superhero1", + "name": "Iron Man", + "role": "default", + "status": "offline" + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "status": "offline", + "conversationId": "superhero1_user_superhero2" + }, + "entityType": "user" + } + }, + "reactions": [ + { + "reaction": ":reaction", + "count": 1 + }, + { + "reaction": "😅", + "count": 1 + }, + { + "reaction": "😒", + "count": 1, + "reactedByMe": true + }, + { + "reaction": "🤨", + "count": 1, + "reactedByMe": true + } + ] + }, + "sentAt": 1700210266, + "updatedAt": 1700210266 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Messages" + ], + "summary": "Remove reaction", + "description": "Removes a reaction from a message", + "operationId": "remove-message-reactions", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose reaction is to be removed.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + }, + { + "name": "reaction", + "in": "path", + "description": "reaction to be removed.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Reaction", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Remove Reactions", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/messageReactionSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "2", + "conversationId": "superhero1_user_superhero2", + "sender": "superhero1", + "receiverType": "user", + "receiver": "superhero2", + "category": "message", + "type": "text", + "data": { + "text": "Hi,", + "entities": { + "sender": { + "entity": { + "uid": "superhero1", + "name": "Iron Man", + "role": "default", + "status": "offline" + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "status": "offline", + "conversationId": "superhero1_user_superhero2" + }, + "entityType": "user" + } + }, + "reactions": [ + { + "reaction": ":reaction", + "count": 1 + }, + { + "reaction": "😅", + "count": 1 + }, + { + "reaction": "😒", + "count": 1, + "reactedByMe": true + } + ] + }, + "sentAt": 1700210266, + "updatedAt": 1700210266 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/conversations": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "List conversations", + "description": "Fetching all the conversations", + "operationId": "list-all-conversations", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.\n\n\nIf onBehalfOf header is not passed,then list Conversations API will be ordered based on `uid`, `updatedAt` and then `conversationWith`\n\nIf onBehalfOf header is passed, then list Conversations API will be ordered based on `updatedAt` and then `conversationWith`.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "searchKey", + "in": "query", + "description": "Fetches conversations that include the specified searchKey, allowing you to search for conversations based on the name of a User or Group.", + "schema": { + "type": "string" + } + }, + { + "name": "conversationType", + "in": "query", + "description": "Retrieves only the specified conversation type (user and group) while fetching conversations list.", + "schema": { + "type": "string" + } + }, + { + "name": "withTags", + "in": "query", + "description": "Includes those groups that have tags.", + "schema": { + "type": "boolean" + } + }, + { + "name": "tags", + "in": "query", + "description": "Fetches only those groups that have these tags.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "withUserAndGroupTags", + "in": "query", + "description": "Retrieves conversations with tags", + "schema": { + "type": "boolean" + } + }, + { + "name": "includeBlockedUsers", + "in": "query", + "description": "Set to true to include conversations with blocked users in the response.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "withBlockedInfo", + "in": "query", + "description": "Set to true to include block status details of users in each conversation.", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "name": "userTags", + "in": "query", + "description": "Filters conversations by tags associated with the user entity in the conversationWith property.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "groupTags", + "in": "query", + "description": "Filters conversations by tags associated with the group entity in the conversationWith property.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "unread", + "in": "query", + "description": "Lists only unread conversations by excluding the conversations with conversation.unreadMessageCount=0", + "schema": { + "type": "boolean" + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of conversations to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number.", + "schema": { + "type": "integer", + "default": "1" + } + }, + { + "name": "hideAgentic", + "in": "query", + "description": "Hides agentic conversations from the list.", + "schema": { + "type": "boolean" + } + }, + { + "name": "onlyAgentic", + "in": "query", + "description": "Shows only agentic conversations in the list.", + "schema": { + "type": "boolean" + } + }, + { + "name": "useCursoredIndex", + "in": "query", + "description": "Enables cursor-based pagination for more efficient conversations listing.", + "schema": { + "type": "integer", + "default": 1, + "enum": [ + 0, + 1 + ] + } + }, + { + "name": "unique", + "in": "query", + "description": "Enables unique conversation mode, returning only unique conversations in the response (super-admin only). Cannot be used together with the onBehalfOf header.", + "schema": { + "type": "integer", + "enum": [ + 0, + 1 + ] + } + } + ], + "responses": { + "200": { + "description": "Get Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "conversationId": "group_project-group", + "conversationType": "group", + "unreadMessageCount": "0", + "createdAt": 1630071782, + "updatedAt": 1630481413, + "lastMessage": { + "id": "50", + "conversationId": "group_project-group", + "sender": "superhero4", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "unbanned", + "entities": { + "by": { + "entity": { + "uid": "superhero4", + "name": "Wolverine", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "createdAt": 1629869270 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero3", + "link": "https://data-us.cometchat.io/assets", + "name": "Captain America", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1629869270, + "updatedAt": 1629964825, + "conversationId": "superhero3_user_superhero4" + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group1", + "type": "private", + "owner": "superhero4", + "createdAt": 1630071341, + "updatedAt": 1630305525, + "updatedBy": "superhero4", + "description": "project related discussions between members", + "membersCount": 4, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1630305562, + "updatedAt": 1630305562, + "receipts": { + "data": [ + [] + ] + } + }, + "conversationWith": { + "guid": "project-group", + "name": "Project Group1", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "private", + "scope": "participant", + "membersCount": 4, + "joinedAt": 1630071782, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1630071341, + "owner": "superhero4", + "updatedAt": 1630308875, + "updatedBy": "superhero4" + } + } + ], + "meta": { + "pagination": { + "total": 1, + "count": 1, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/conversations/{conversationId}": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "Get conversation", + "description": "This API is deprecated please use Get User/Group ConversationAPI", + "operationId": "get-conversation", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/conversationId" + } + ], + "responses": { + "200": { + "description": "Get Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "conversationId": "group_project-group", + "conversationType": "group", + "unreadMessageCount": "0", + "createdAt": 1630071782, + "updatedAt": 1630481413, + "lastMessage": { + "id": "50", + "conversationId": "group_project-group", + "sender": "superhero4", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "unbanned", + "entities": { + "by": { + "entity": { + "uid": "superhero4", + "name": "Wolverine", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "createdAt": 1629869270 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero3", + "link": "https://data-us.cometchat.io/assets", + "name": "Captain America", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1629869270, + "updatedAt": 1629964825, + "conversationId": "superhero3_user_superhero4" + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group1", + "type": "private", + "owner": "superhero4", + "createdAt": 1630071341, + "updatedAt": 1630305525, + "updatedBy": "superhero4", + "description": "project related discussions between members", + "membersCount": 4, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1630305562, + "updatedAt": 1630305562, + "receipts": { + "data": [ + [] + ] + } + }, + "conversationWith": { + "guid": "project-group", + "name": "Project Group1", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "private", + "scope": "participant", + "membersCount": 4, + "joinedAt": 1630071782, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1630071341, + "owner": "superhero4", + "updatedAt": 1630308875, + "updatedBy": "superhero4" + } + } + ] + } + } + } + } + }, + "deprecated": true, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Conversations" + ], + "summary": "Delete Conversation", + "description": "This API is deprecated please use Reset User/GroupConversation API", + "operationId": "deletes-conversation", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/conversationId" + } + ], + "responses": { + "200": { + "description": "Deleted Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The conversation group_project-group has been deleted successfully for all the users." + } + } + } + } + } + }, + "deprecated": true, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/conversation": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "Get User Conversation", + "description": "Getting user conversation", + "operationId": "get-user-conversations", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/uid--conversation" + } + ], + "responses": { + "200": { + "description": "Get user Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "conversationId": "group_project-group", + "conversationType": "group", + "unreadMessageCount": "0", + "createdAt": 1630071782, + "updatedAt": 1630481413, + "lastMessage": { + "id": "50", + "conversationId": "group_project-group", + "sender": "superhero4", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "unbanned", + "entities": { + "by": { + "entity": { + "uid": "superhero4", + "name": "Wolverine", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "createdAt": 1629869270 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero3", + "link": "https://data-us.cometchat.io/assets", + "name": "Captain America", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1629869270, + "updatedAt": 1629964825, + "conversationId": "superhero3_user_superhero4" + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group1", + "type": "private", + "owner": "superhero4", + "createdAt": 1630071341, + "updatedAt": 1630305525, + "updatedBy": "superhero4", + "description": "project related discussions between members", + "membersCount": 4, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1630305562, + "updatedAt": 1630305562 + }, + "conversationWith": { + "guid": "project-group", + "name": "Project Group1", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "private", + "scope": "participant", + "membersCount": 4, + "joinedAt": 1630071782, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1630071341, + "owner": "superhero4", + "updatedAt": 1630308875, + "updatedBy": "superhero4" + } + } + ] + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Conversations" + ], + "summary": "Update User Conversation", + "description": "Updating User Conversation", + "operationId": "updates-user-conversation", + "parameters": [ + { + "$ref": "#/components/parameters/uid--conversation" + }, + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "tags": { + "description": "List of tags to identify specific conversation.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Updated user Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "conversationId": "group_project-group", + "conversationType": "group", + "unreadMessageCount": "0", + "createdAt": 1630071782, + "updatedAt": 1630481413, + "lastMessage": { + "id": "50", + "conversationId": "group_project-group", + "sender": "superhero4", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "unbanned", + "entities": { + "by": { + "entity": { + "uid": "superhero4", + "name": "Wolverine", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "createdAt": 1629869270 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero3", + "link": "https://data-us.cometchat.io/assets", + "name": "Captain America", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1629869270, + "updatedAt": 1629964825, + "conversationId": "superhero3_user_superhero4" + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group1", + "type": "private", + "owner": "superhero4", + "createdAt": 1630071341, + "updatedAt": 1630305525, + "updatedBy": "superhero4", + "description": "project related discussions between members", + "membersCount": 4, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1630305562, + "updatedAt": 1630305562, + "receipts": { + "data": [ + [] + ] + } + }, + "conversationWith": { + "guid": "project-group", + "name": "Project Group1", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "private", + "scope": "participant", + "membersCount": 4, + "joinedAt": 1630071782, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1630071341, + "owner": "superhero4", + "updatedAt": 1630308875, + "updatedBy": "superhero4" + } + } + ] + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Conversations" + ], + "summary": "Reset User Conversation", + "description": "Resetting User Conversation", + "operationId": "resets-user-conversation", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/uid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "conversationWith": { + "description": "UID of a user", + "type": "string" + }, + "deleteMessagesPermanently": { + "description": "Permanently deletes messages in that particular conversation", + "type": "boolean" + }, + "preserveOrder": { + "description": "When set to true, maintains the conversation's position in the user's conversation list after reset.", + "type": "boolean", + "default": false + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Resetted user Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The conversation superhero1_user_superhero2 has been deleted successfully for UID superhero1." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/conversation/delivered": { + "post": { + "tags": [ + "Conversations" + ], + "summary": "Mark User Conversation As Delivered", + "description": "This API will mark the user conversation as delivered.", + "operationId": "mark-conversation-as-delivered", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the receiver of the message", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/uid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "messageId": { + "description": "The id of the message upto which the conversation needs to be marked as delivered.", + "type": "integer" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Marking Conversation as delivered", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "Message": "All the messages from the user {{UID}} are marked as delivered for the user {{onBehalfOf}}." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/conversation/read": { + "post": { + "tags": [ + "Conversations" + ], + "summary": "Mark User Conversation As Read", + "description": "This API will mark the user conversation as read.", + "operationId": "mark-conversation-as-read", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the receiver of the message", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/uid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "messageId": { + "description": "The id of the message upto which the conversation needs to be marked as read.", + "type": "integer" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Marking Conversation as read", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "Message": "All the messages from the user {{UID}} are marked as read for the user {{onBehalfOf}}." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Conversations" + ], + "summary": "Mark Conversation Messages As Unread", + "description": "Allows you to mark messages within a conversation as unread", + "operationId": "mark-conversation-as-unread", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the receiver of the message", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/uid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "messageId": { + "description": "The id of the message upto which the conversation needs to be marked as unread.", + "type": "integer" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Marking Conversation as unread", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The messages after the message id 340 from the user demo1 are marked as unread for the user demo3." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/conversation": { + "get": { + "tags": [ + "Conversations" + ], + "summary": "Get Group Conversation", + "description": "Getting group conversation", + "operationId": "get-group-conversations", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/guid--conversation" + } + ], + "responses": { + "200": { + "description": "Get user Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "conversationId": "group_project-group", + "conversationType": "group", + "unreadMessageCount": "0", + "createdAt": 1630071782, + "updatedAt": 1630481413, + "lastMessage": { + "id": "50", + "conversationId": "group_project-group", + "sender": "superhero4", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "unbanned", + "entities": { + "by": { + "entity": { + "uid": "superhero4", + "name": "Wolverine", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "createdAt": 1629869270 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero3", + "link": "https://data-us.cometchat.io/assets", + "name": "Captain America", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1629869270, + "updatedAt": 1629964825, + "conversationId": "superhero3_user_superhero4" + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group1", + "type": "private", + "owner": "superhero4", + "createdAt": 1630071341, + "updatedAt": 1630305525, + "updatedBy": "superhero4", + "description": "project related discussions between members", + "membersCount": 4, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1630305562, + "updatedAt": 1630305562 + }, + "conversationWith": { + "guid": "project-group", + "name": "Project Group1", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "private", + "scope": "participant", + "membersCount": 4, + "joinedAt": 1630071782, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1630071341, + "owner": "superhero4", + "updatedAt": 1630308875, + "updatedBy": "superhero4" + } + } + ] + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Conversations" + ], + "summary": "Update Group Conversation", + "description": "Updating Group Conversation", + "operationId": "updates-group-conversation", + "parameters": [ + { + "$ref": "#/components/parameters/guid--conversation" + }, + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "tags": { + "description": "List of tags to identify specific conversation.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Updated user Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "conversationId": "group_project-group", + "conversationType": "group", + "unreadMessageCount": "0", + "createdAt": 1630071782, + "updatedAt": 1630481413, + "lastMessage": { + "id": "50", + "conversationId": "group_project-group", + "sender": "superhero4", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "unbanned", + "entities": { + "by": { + "entity": { + "uid": "superhero4", + "name": "Wolverine", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "createdAt": 1629869270 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero3", + "link": "https://data-us.cometchat.io/assets", + "name": "Captain America", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "createdAt": 1629869270, + "updatedAt": 1629964825, + "conversationId": "superhero3_user_superhero4" + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group1", + "type": "private", + "owner": "superhero4", + "createdAt": 1630071341, + "updatedAt": 1630305525, + "updatedBy": "superhero4", + "description": "project related discussions between members", + "membersCount": 4, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1630305562, + "updatedAt": 1630305562, + "receipts": { + "data": [ + [] + ] + } + }, + "conversationWith": { + "guid": "project-group", + "name": "Project Group1", + "description": "project related discussions between members", + "icon": "http://placehold.it/120x120&text=image1", + "type": "private", + "scope": "participant", + "membersCount": 4, + "joinedAt": 1630071782, + "conversationId": "group_project-group", + "hasJoined": true, + "createdAt": 1630071341, + "owner": "superhero4", + "updatedAt": 1630308875, + "updatedBy": "superhero4" + } + } + ] + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Conversations" + ], + "summary": "Reset Group Conversation", + "description": "Resetting Group Conversation", + "operationId": "resets-group-conversation", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/guid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "preserveOrder": { + "description": "When set to true, maintains the conversation's position in the user's conversation list after reset.", + "type": "boolean", + "default": false + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Resetted user Conversations", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The conversation superhero1_user_superhero2 has been deleted successfully for UID superhero1." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/conversation/delivered": { + "post": { + "tags": [ + "Conversations" + ], + "summary": "Mark Group Conversation As Delivered", + "description": "This API will mark the group conversation as delivered.", + "operationId": "mark-group-conversation-as-delivered", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the receiver of the message", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/guid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "messageId": { + "description": "The id of the message upto which the conversation needs to be marked as delivered.", + "type": "integer" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Marking Conversation as delivered", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "All the messages in group {{GUID}} are marked as delivered for the user {{onBehalfOf}}." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/conversation/read": { + "post": { + "tags": [ + "Conversations" + ], + "summary": "Mark Group Conversation As Read", + "description": "This API will mark the group conversation as read.", + "operationId": "mark-group-conversation-as-read", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the receiver of the message", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/guid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "messageId": { + "description": "The id of the message upto which the conversation needs to be marked as read.", + "type": "integer" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Marking Conversation as read", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "All the messages in group {{GUID}} are marked as read for the user {{onBehalfOf}}." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Conversations" + ], + "summary": "Mark Group Conversation As Unread", + "description": "This API will mark the group conversation as unread.", + "operationId": "mark-group-conversation-as-unread", + "parameters": [ + { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the group member marking the messages as unread.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/guid--conversation" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "messageId": { + "description": "The id of the message upto which the conversation needs to be marked as unread.", + "type": "integer" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Marking Conversation as unread", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The messages after the message id 340 from the user demo1 are marked as unread for the user demo3." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/auth_tokens": { + "post": { + "tags": [ + "Auth Tokens" + ], + "summary": "Create", + "description": "Creates auth token for a user with the specified UID.", + "operationId": "create-authtoken", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "force": { + "description": "Generates new auth token forcefully.", + "type": "boolean" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Created auth token", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "uid": "superhero1", + "authToken": "superhero1_1630306819c3027ce530b2367f3c97b4106f0cb8", + "createdAt": 1630306819 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Auth Tokens" + ], + "summary": "List", + "description": "Lists auth tokens for a user with the specified UID.", + "operationId": "list-authtokens", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of auth tokens to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number.", + "schema": { + "type": "integer", + "default": "1" + } + } + ], + "responses": { + "200": { + "description": "A list of auth tokens", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "uid": "superhero1", + "authToken": "superhero1_1630306819c3027ce530b2367f3c97b4106f0cb8", + "createdAt": 1630306819 + } + ], + "meta": { + "pagination": { + "total": 1, + "count": 1, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Auth Tokens" + ], + "summary": "Flush", + "description": "Deletes all the auth tokens for the specified UID.", + "operationId": "flush-authtokens", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "A list of api keys", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Cleared Auth Tokens successfully for uid superhero1." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/auth_tokens/{authToken}": { + "get": { + "tags": [ + "Auth Tokens" + ], + "summary": "Get", + "description": "Retrieves details of an auth token for the specified UID andauth token.", + "operationId": "get-authtoken", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + { + "$ref": "#/components/parameters/authToken" + } + ], + "responses": { + "200": { + "description": "Retrieve Auth Token", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "uid": "superhero1", + "authToken": "superhero1_1630306819c3027ce530b2367f3c97b4106f0cb8", + "createdAt": 1630306819 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Auth Tokens" + ], + "summary": "Update", + "description": "Updates the details of an auth token for the specified UID andauth token.", + "operationId": "update-authtoken", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + { + "name": "authToken", + "in": "path", + "description": "An auth token of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Auth Token", + "value": "" + } + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "platform": { + "description": "The platform on which the auth token is being used.", + "type": "string" + }, + "userAgent": { + "description": "userAgent from which the auth token is used.", + "type": "string" + }, + "appInfo": { + "description": "JSON data containing app information.", + "type": "object" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Updated Auth Token", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "uid": "superhero1", + "authToken": "superhero1_1630306819c3027ce530b2367f3c97b4106f0cb8", + "createdAt": 1630306819 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Auth Tokens" + ], + "summary": "Delete", + "description": "Deletes an auth token for the specified UID.", + "operationId": "delete-authtoken", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + { + "name": "authToken", + "in": "path", + "description": "An auth token of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Auth Token", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Deleted Auth token", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "User with superhero6 has been deleted successfully." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/members": { + "post": { + "tags": [ + "Group Members" + ], + "summary": "Add members", + "description": "Adds multiple users as per the scope.", + "operationId": "add-group-members", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "admins": { + "description": "UIDs of users to be made admins.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "moderators": { + "description": "UIDs of users to be made moderators.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "participants": { + "description": "UIDs of users to be made participants.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + }, + "usersToBan": { + "description": "UIDs of the users to be banned from the group.", + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1 + } + }, + "type": "object" + }, + "examples": { + "Add Members": { + "summary": "Add Members", + "value": { + "participants": [ + "cometchat-uid-1" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Create Group Members", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "usersToBan": { + "superhero6": { + "success": true + } + }, + "admins": { + "superhero1": { + "success": true, + "data": { + "id": "32", + "conversationId": "group_project-group", + "sender": "app_system", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "added", + "entities": { + "by": { + "entity": { + "uid": "app_system", + "name": "System", + "role": "default", + "status": "offline", + "createdAt": 1596537299 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero1", + "name": "Iron Man", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/ironman.png", + "status": "offline", + "createdAt": 1596537299 + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group", + "tags": [ + "friends", + "project" + ], + "type": "public", + "owner": "superhero2", + "createdAt": 1625460947, + "description": "project related discussions between members", + "membersCount": 2, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1625460972, + "updatedAt": 1625460972 + } + } + }, + "moderators": { + "superhero3": { + "success": true, + "data": { + "id": "33", + "conversationId": "group_project-group", + "sender": "app_system", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "added", + "entities": { + "by": { + "entity": { + "uid": "app_system", + "name": "System", + "role": "default", + "status": "offline", + "createdAt": 1596537299 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "createdAt": 1596537299, + "updatedAt": 1625234590 + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group", + "tags": [ + "friends", + "project" + ], + "type": "public", + "owner": "superhero2", + "createdAt": 1625460947, + "updatedAt": 1625460972, + "description": "project related discussions between members", + "membersCount": 3, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1625460973, + "updatedAt": 1625460973 + } + } + }, + "participants": { + "superhero4": { + "success": true, + "data": { + "id": "34", + "conversationId": "group_project-group", + "sender": "app_system", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "added", + "entities": { + "by": { + "entity": { + "uid": "app_system", + "name": "System", + "role": "default", + "status": "offline", + "createdAt": 1596537299 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero4", + "name": "Wolverine", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "createdAt": 1596537299 + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group", + "tags": [ + "friends", + "project" + ], + "type": "public", + "owner": "superhero2", + "createdAt": 1625460947, + "updatedAt": 1625460973, + "description": "project related discussions between members", + "membersCount": 4, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1625460973, + "updatedAt": 1625460973 + } + }, + "superhero5": { + "success": true, + "data": { + "id": "35", + "conversationId": "group_project-group", + "sender": "app_system", + "receiverType": "group", + "receiver": "project-group", + "category": "action", + "type": "groupMember", + "data": { + "action": "added", + "entities": { + "by": { + "entity": { + "uid": "app_system", + "name": "System", + "role": "default", + "status": "offline", + "createdAt": 1596537299 + }, + "entityType": "user" + }, + "on": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "createdAt": 1596537299 + }, + "entityType": "user" + }, + "for": { + "entity": { + "guid": "project-group", + "icon": "http://placehold.it/120x120&text=image1", + "name": "Project Group", + "tags": [ + "friends", + "project" + ], + "type": "public", + "owner": "superhero2", + "createdAt": 1625460947, + "updatedAt": 1625460973, + "description": "project related discussions between members", + "membersCount": 5, + "conversationId": "group_project-group" + }, + "entityType": "group" + } + } + }, + "sentAt": 1625460973, + "updatedAt": 1625460973 + } + } + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Group Members" + ], + "summary": "List", + "description": "List the members of a group for a given GUID", + "operationId": "list-group-members", + "parameters": [ + { + "$ref": "#/components/parameters/guid" + }, + { + "name": "perPage", + "in": "query", + "description": "Number of users to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "status", + "in": "query", + "description": "Group members list can be fetched depending on the user status. (available,offline).", + "schema": { + "type": "string", + "enum": [ + "available", + "offline" + ] + } + }, + { + "name": "page", + "in": "query", + "description": "Page Number.", + "schema": { + "type": "integer", + "default": "1" + } + }, + { + "name": "scopes", + "in": "query", + "description": "Fetches group members based on multiple scope.", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": {} + } + } + ], + "responses": { + "200": { + "description": "Create Group Members", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "uid": "superhero2", + "name": "Captain America", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "role": "default", + "scope": "participant", + "joinedAt": 1638360106, + "createdAt": 1629869270, + "updatedAt": 1630308676, + "conversationId": "superhero2_user_superhero4" + }, + { + "uid": "superhero3", + "name": "Captain America", + "link": "https://data-us.cometchat.io/assets", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "metadata": { + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "default", + "scope": "participant", + "joinedAt": 1638360106, + "createdAt": 1629869270, + "updatedAt": 1638351060, + "conversationId": "superhero3_user_superhero4" + }, + { + "uid": "superhero5", + "name": "Cyclops", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "role": "default", + "scope": "moderator", + "joinedAt": 1638360106, + "createdAt": 1629869270, + "conversationId": "superhero4_user_superhero5" + }, + { + "uid": "superhero4", + "name": "Wolverine", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png", + "status": "offline", + "role": "default", + "scope": "admin", + "joinedAt": 1638359534, + "createdAt": 1629869270 + } + ], + "meta": { + "pagination": { + "total": 0, + "count": 5, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + }, + "cursor": { + "updatedAt": 1638354799, + "affix": "prepend" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/members/{uid}": { + "put": { + "tags": [ + "Group Members" + ], + "summary": "Change Scope", + "description": "Change scope of a member to the group for a given GUID and UID", + "operationId": "change-group-member-scope", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + }, + { + "$ref": "#/components/parameters/uid" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "scope": { + "description": "A scope for the user.", + "type": "string", + "default": "participant" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Changed Scope of Group Members", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "guid": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "joinedAt": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "guid": "supergroup", + "uid": "superhero2", + "scope": "participant", + "joinedAt": 1631690303 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Group Members" + ], + "summary": "Kick", + "description": "Removes a member with given UID from a group for a given GUID.", + "operationId": "kick-group-member", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + }, + { + "$ref": "#/components/parameters/uid" + } + ], + "responses": { + "200": { + "description": "Kicked Group Members", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The member with superhero3 has been kicked from the Group with supergroup." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/bannedusers/{uid}": { + "post": { + "tags": [ + "Banned Users" + ], + "summary": "Ban", + "description": "Bans a member from a group for a given GUID and UID.", + "operationId": "ban-group-user", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + }, + { + "$ref": "#/components/parameters/uid" + } + ], + "responses": { + "200": { + "description": "Create Group", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The user with uid superhero3 has been banned from the Group with supergroup." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Banned Users" + ], + "summary": "Unban", + "description": "Unban a member with given UID from a group for a given GUID.", + "operationId": "unban-group-user", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + }, + { + "$ref": "#/components/parameters/uid" + } + ], + "responses": { + "200": { + "description": "Create Group", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "The user with uid superhero3 has been banned from the Group with supergroup." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/bannedusers": { + "get": { + "tags": [ + "Banned Users" + ], + "summary": "List", + "description": "Lists banned users from a group for a given GUID.", + "operationId": "list-banned-group-users", + "parameters": [ + { + "$ref": "#/components/parameters/guid" + }, + { + "name": "perPage", + "in": "query", + "description": "Number of banned users to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number.", + "schema": { + "type": "integer", + "default": "1" + } + } + ], + "responses": { + "200": { + "description": "get Banned User", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + }, + "meta": { + "type": "object" + }, + "cursor": { + "properties": { + "updatedAt": { + "type": "integer" + }, + "affix": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "uid": "superhero6", + "name": "Barry Allen", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "metadata": { + "email": "user@email.com", + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "manager", + "createdAt": 1638354015, + "updatedAt": 1638354799, + "conversationId": "superhero4_user_superhero6" + }, + { + "uid": "superhero2", + "name": "Captain America", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "role": "default", + "createdAt": 1629869270, + "updatedAt": 1630308676, + "conversationId": "superhero2_user_superhero4" + }, + { + "uid": "superhero3", + "name": "Captain America", + "link": "https://data-us.cometchat.io/assets", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "metadata": { + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "default", + "blockedByMe": true, + "blockedByMeAt": 1638346853, + "blockedAt": 1638346853, + "createdAt": 1629869270, + "updatedAt": 1638351060, + "conversationId": "superhero3_user_superhero4" + } + ], + "meta": { + "pagination": { + "total": 0, + "count": 5, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/friends": { + "post": { + "tags": [ + "Friends" + ], + "summary": "Add Friends", + "description": "The API allows to add multiple friends for a given UID.", + "operationId": "add-friend", + "parameters": [ + { + "$ref": "#/components/parameters/uid" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "accepted": { + "description": "The array of UIDs of the friends.", + "type": "array", + "items": { + "type": "string" + } + }, + "addToConversations": { + "description": "When enabled, automatically creates chat conversations between users when they become friends.", + "type": "boolean", + "default": false + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Added Friend", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "type": "object" + }, + "": { + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "accepted": { + "superhero2": { + "success": true, + "message": "Created relationship with status accepted." + }, + "superhero3": { + "success": true, + "message": "Created relationship with status accepted." + } + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Friends" + ], + "summary": "List Friends", + "description": "The API allows to fetch friends for a given UID.", + "operationId": "list-all-friends", + "parameters": [ + { + "$ref": "#/components/parameters/uid" + }, + { + "name": "searchKey", + "in": "query", + "description": "Searches for given keyword in friends list (either UID or name).", + "schema": { + "type": "string" + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of friends to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "page", + "in": "query", + "description": "Page Number.", + "schema": { + "type": "integer", + "default": "1" + } + } + ], + "responses": { + "200": { + "description": "A list of friends.", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "uid": "superhero6", + "name": "Barry Allen", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "metadata": { + "email": "user@email.com", + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "manager", + "createdAt": 1638354015, + "updatedAt": 1638354799, + "conversationId": "superhero4_user_superhero6" + }, + { + "uid": "superhero2", + "name": "Captain America", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "role": "default", + "createdAt": 1629869270, + "updatedAt": 1630308676, + "conversationId": "superhero2_user_superhero4" + }, + { + "uid": "superhero3", + "name": "Captain America", + "link": "https://data-us.cometchat.io/assets", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png", + "metadata": { + "contactNumber": "0123456789" + }, + "status": "offline", + "role": "default", + "blockedByMe": true, + "blockedByMeAt": 1638346853, + "blockedAt": 1638346853, + "createdAt": 1629869270, + "updatedAt": 1638351060, + "conversationId": "superhero3_user_superhero4" + } + ], + "meta": { + "pagination": { + "total": 0, + "count": 5, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + }, + "cursor": { + "updatedAt": 1638354799, + "affix": "prepend" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Friends" + ], + "summary": "Remove Friends", + "description": "The API removes friends for a given UID.", + "operationId": "remove-friend", + "parameters": [ + { + "$ref": "#/components/parameters/uid" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "friends": { + "description": "The array of friends to remove.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "A list of api keys", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Deleted the friend relations succussfully" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/blockedusers": { + "post": { + "tags": [ + "Blocked Users" + ], + "summary": "Block User", + "description": "Blocks the specified user", + "operationId": "block-users", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "blockedUids" + ], + "properties": { + "blockedUids": { + "description": "UIDs of the users to be blocked", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Blocked user", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "superhero4": { + "success": true, + "message": "The user with UID superhero1 has blocked user with UID superhero3 successfully." + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Blocked Users" + ], + "summary": "Unblock User", + "description": "Unblocks the specified user", + "operationId": "unblock-users", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "blockedUids" + ], + "properties": { + "blockedUids": { + "description": "UIDs of the users to be unblock", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Blocked user", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "superhero4": { + "success": true, + "message": "The user with UID superhero1 has blocked user with UID superhero3 successfully." + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Blocked Users" + ], + "summary": "List Blocked Users", + "description": "Retrieves the blocked users", + "operationId": "list-all-blocked-users", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + { + "name": "perPage", + "in": "query", + "description": "Number of blocked users to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number.", + "schema": { + "type": "integer", + "default": "1" + } + } + ], + "responses": { + "200": { + "description": "Blocked user", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/userSchema" + }, + { + "$ref": "#/components/schemas/blockedUserSchema" + } + ] + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "uid": "superhero6", + "name": "Barry Allen", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "metadata": { + "rawMetadata": "{'gender':'Male'}" + }, + "status": "offline", + "role": "manager", + "blockedByMe": true, + "blockedByMeAt": 1638346853, + "blockedAt": 1638346853, + "createdAt": 1629869270, + "updatedAt": 1638351060, + "conversationId": "superhero3_user_superhero4" + }, + { + "uid": "superhero2", + "name": "Captain America", + "link": "http://placehold.it", + "avatar": "http://placehold.it/120x120&text=image1", + "metadata": { + "rawMetadata": "{'gender':'Male'}" + }, + "status": "offline", + "role": "manager", + "blockedByMe": true, + "blockedByMeAt": 1638346853, + "blockedAt": 1638346853, + "createdAt": 1629869270, + "updatedAt": 1638351060, + "conversationId": "superhero1_user_superhero2" + } + ], + "meta": { + "pagination": { + "total": 0, + "count": 5, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + }, + "cursor": { + "updatedAt": 1638354799, + "affix": "prepend" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/roles": { + "post": { + "tags": [ + "Roles" + ], + "summary": "Create", + "description": "Creates a new user role", + "operationId": "create-role", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "role", + "name" + ], + "properties": { + "role": { + "description": "A unique identifier for the role.", + "type": "string", + "default": "" + }, + "name": { + "description": "Friendly name of the role.", + "type": "string", + "default": "" + }, + "description": { + "description": "Description of the role.", + "type": "string", + "default": "" + }, + "metadata": { + "description": "Addition information about the role as JSON.", + "type": "object" + }, + "settings": { + "description": "Role settings that is used for restricting list users/send message. Possible values for listUsers & sendMessagesTo are all and friendsOnly", + "type": "object" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Created a new Role", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "role": "manager", + "name": "manager", + "description": "This role gives an update access", + "metadata": { + "email": "managers@gmail.com" + }, + "settings": { + "listUsers": "all", + "sendMessagesTo": "friendsOnly" + }, + "createdAt": 1638343994 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Roles" + ], + "summary": "List", + "description": "Lists the user roles", + "operationId": "list-roles", + "parameters": [ + { + "name": "perPage", + "in": "query", + "description": "Number of roles to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number.", + "schema": { + "type": "integer", + "default": "1" + } + } + ], + "responses": { + "200": { + "description": "Lists the user roles", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "role": "manager", + "name": "manager", + "description": "This role gives an update access", + "metadata": { + "email": "managers@gmail.com" + }, + "settings": { + "listUsers": "all", + "sendMessagesTo": "friendsOnly" + }, + "createdAt": 1638343994 + }, + { + "role": "default", + "name": "Default Role", + "description": "This role gives full access ", + "createdAt": 1629869270, + "updatedAt": 1630306291 + } + ], + "meta": { + "pagination": { + "total": 2, + "count": 2, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/roles/{role}": { + "get": { + "tags": [ + "Roles" + ], + "summary": "Get", + "description": "Retrieves role details for a given role.", + "operationId": "get-role", + "parameters": [ + { + "name": "role", + "in": "path", + "description": "A role to get.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Role", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Fetched the role", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "role": "manager", + "name": "manager", + "description": "This role gives an update access", + "metadata": { + "email": "managers@gmail.com" + }, + "settings": { + "listUsers": "all", + "sendMessagesTo": "friendsOnly" + }, + "createdAt": 1638343994 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Roles" + ], + "summary": "Update", + "description": "Updates a given role.", + "operationId": "update-role", + "parameters": [ + { + "name": "role", + "in": "path", + "description": "A role to update.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Role", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "Friendly name of the role.", + "type": "string", + "default": "" + }, + "description": { + "description": "Description of the role.", + "type": "string", + "default": "" + }, + "metadata": { + "description": "Additional information about the role.", + "type": "object", + "default": { + "email": "dummy@example.com" + } + }, + "unset": { + "description": "The unsettable role attributes are settings, description and metadata.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "settings", + "description", + "metadata" + ] + }, + "default": [] + }, + "settings": { + "description": "Role settings that is used for restricting list users/send message. Possible values for listUsers & sendMessagesTo are all and friendsOnly", + "type": "object", + "default": [] + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Updated Role", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "role": "manager", + "name": "manager", + "description": "This role gives an update access", + "metadata": { + "email": "managers@gmail.com" + }, + "settings": { + "listUsers": "all", + "sendMessagesTo": "friendsOnly" + }, + "createdAt": 1638343994 + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Roles" + ], + "summary": "Delete", + "description": "Deletes a role.", + "operationId": "delete-role", + "parameters": [ + { + "name": "role", + "in": "path", + "description": "A role to delete.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Role", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Deleted Role", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Role manager has been deleted successfully." + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/roles/{role}/restrictedfeatures": { + "post": { + "tags": [ + "Restrict Features" + ], + "summary": "Restrict Features", + "description": "Restrict Features for a given role.", + "operationId": "restrict-features", + "parameters": [ + { + "name": "role", + "in": "path", + "description": "A role to which features to be restricted.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Role", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "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", + "parameters": [ + { + "name": "role", + "in": "path", + "description": "The role identifier to list permissions for", + "required": true, + "schema": { + "type": "string", + "example": "default" + } + } + ], + "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", + "parameters": [ + { + "name": "guid", + "in": "path", + "description": "The group GUID to list 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" + } + } + ], + "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": [ + "Messages" + ], + "summary": "Send Threaded Message", + "description": "Sends Threaded Message on behalf of a user.", + "operationId": "send-thread-message", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message for which thread message to be sent", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "receiver": { + "description": "The receiver of the message.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" + ] + }, + "category": { + "description": "Category of the message. The available categories are message and custom.", + "type": "string", + "default": "message", + "enum": [ + "message", + "custom" + ] + }, + "type": { + "description": "Type of the message. The available values are text, image, file, audio, video.", + "type": "string", + "default": "text", + "enum": [ + "text", + "image", + "file", + "audio", + "video" + ] + }, + "data": { + "description": "JSON containing message attributes.", + "type": "object", + "default": { + "text": "Hi Tom!", + "metadata": { + "key1": "value1", + "key2": "value2" + } + } + }, + "multipleReceivers": { + "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", + "type": "object", + "default": { + "uids": [ + "uid1", + "uid2" + ], + "guids": [ + "guid1" + ] + } + }, + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "tag1" + ] + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Create Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object", + "allOf": [ + { + "properties": { + "parentId": { + "readOnly": false + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/messageSchema" + } + ] + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "2", + "conversationId": "superhero3_user_superhero5", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero5", + "category": "message", + "type": "text", + "data": { + "text": "test hello", + "metadata": { + "key1": "val1" + }, + "entities": { + "sender": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550, + "conversationId": "superhero3_user_superhero5" + }, + "entityType": "user" + } + } + }, + "sentAt": 1638423490, + "updatedAt": 1638423490, + "parentId": "1" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Messages" + ], + "summary": "List Threaded Messages", + "description": "Fetches the messages list of a thread.", + "operationId": "list-all-thread-messages", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose thread messages are to be fetched.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + }, + { + "name": "affix", + "in": "query", + "description": "Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).", + "schema": { + "type": "string" + } + }, + { + "name": "id", + "in": "query", + "description": "Retrieves all those messages after the passed id.", + "schema": { + "type": "string" + } + }, + { + "name": "sentAt", + "in": "query", + "description": "Fetches the messages list after a particular sentAt timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000", + "schema": { + "type": "integer", + "default": "10" + } + } + ], + "responses": { + "200": { + "description": "Create Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "allOf": [ + { + "properties": { + "parentId": { + "readOnly": false + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/messageSchema" + } + ] + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "2", + "conversationId": "superhero3_user_superhero5", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero5", + "category": "message", + "type": "text", + "data": { + "text": "test hello", + "entities": { + "sender": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "createdAt": 1638361550 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "createdAt": 1638361550, + "conversationId": "superhero3_user_superhero5" + }, + "entityType": "user" + } + }, + "metadata": { + "key1": "val1" + } + }, + "sentAt": 1638423490, + "updatedAt": 1638423490, + "parentId": "1" + } + ], + "meta": { + "current": { + "limit": 10, + "count": 1 + }, + "next": { + "affix": "append", + "sentAt": 1638423490, + "id": "3" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/threads": { + "get": { + "tags": [ + "Messages" + ], + "summary": "List Threads", + "description": "Fetches the list of threads.", + "operationId": "list-all-threads", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "name": "limit", + "in": "query", + "description": "Number of threads to be fetched in a request. The default value is 100 and the maximum value is 1000.", + "schema": { + "type": "integer", + "default": 100 + } + }, + { + "name": "affix", + "in": "query", + "description": "Cursor direction used for pagination.", + "schema": { + "type": "string", + "enum": [ + "append", + "prepend" + ] + } + }, + { + "name": "updatedAt", + "in": "query", + "description": "Cursor value (updatedAt) used for pagination.", + "schema": { + "type": "integer" + } + }, + { + "name": "participatedByMe", + "in": "query", + "description": "Lists only the threads the user has participated in.", + "schema": { + "type": "boolean" + } + }, + { + "name": "withUnreadReplyCount", + "in": "query", + "description": "Enriches each thread with the per-user unread reply count.", + "schema": { + "type": "boolean" + } + }, + { + "name": "withMentionCount", + "in": "query", + "description": "Enriches each thread with the per-user unread mention count.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "List Threads", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "4002", + "conversationId": "cometchat-uid-1_user_cometchat-uid-2", + "sender": "cometchat-uid-1", + "receiverType": "user", + "receiver": "cometchat-uid-2", + "category": "message", + "type": "text", + "data": { + "entities": { + "receiver": { + "entity": { + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", + "conversationId": "cometchat-uid-1_user_cometchat-uid-2", + "createdAt": 1783932561, + "lastActiveAt": 1783932561, + "name": "George Alan", + "role": "default", + "status": "offline", + "uid": "cometchat-uid-2" + }, + "entityType": "user" + }, + "sender": { + "entity": { + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", + "createdAt": 1783932561, + "lastActiveAt": 1783932561, + "name": "Andrew Joseph", + "role": "default", + "status": "offline", + "tags": [ + "abc" + ], + "uid": "cometchat-uid-1", + "updatedAt": 1783944695 + }, + "entityType": "user" + } + }, + "moderation": { + "rule": { + "id": "customrule", + "name": "custom-rule" + }, + "status": "disapproved" + }, + "text": "123" + }, + "sentAt": 1784014343, + "updatedAt": 1784014370, + "replyCount": 1, + "lastReply": { + "id": "4003", + "muid": "", + "conversationId": "cometchat-uid-1_user_cometchat-uid-2", + "sender": "cometchat-uid-1", + "receiverType": "user", + "receiver": "cometchat-uid-2", + "category": "message", + "type": "text", + "data": { + "entities": { + "receiver": { + "entity": { + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", + "conversationId": "cometchat-uid-1_user_cometchat-uid-2", + "createdAt": 1783932561, + "lastActiveAt": 1783932561, + "name": "George Alan", + "role": "default", + "status": "offline", + "uid": "cometchat-uid-2" + }, + "entityType": "user" + }, + "sender": { + "entity": { + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", + "createdAt": 1783932561, + "lastActiveAt": 1783932561, + "name": "Andrew Joseph", + "role": "default", + "status": "offline", + "tags": [ + "abc" + ], + "uid": "cometchat-uid-1", + "updatedAt": 1783944695 + }, + "entityType": "user" + } + }, + "moderation": { + "status": "approved" + }, + "text": "Hello in thread" + }, + "sentAt": 1784014370, + "editedAt": null, + "editedBy": "", + "deliveredAt": null, + "readAt": null, + "deletedAt": null, + "updatedAt": 1784014370 + } + } + ], + "meta": { + "current": { + "limit": 100, + "count": 1 + }, + "next": { + "affix": "append", + "updatedAt": 1784014370 + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/messages/{id}/thread/subscription": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Subscribe Thread", + "description": "Subscribes the user to a message thread.", + "operationId": "subscribe-thread", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose thread is to be subscribed to.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Subscribe Thread", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Messages" + ], + "summary": "Unsubscribe Thread", + "description": "Unsubscribes the user from a message thread.", + "operationId": "unsubscribe-thread", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message whose thread is to be unsubscribed from.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "Unsubscribe Thread", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/users/{uid}/messages": { + "get": { + "tags": [ + "Messages" + ], + "summary": "List User Messages", + "description": "Fetches messages between onBehalfOfuid and an uid from path param.", + "operationId": "user-list-user-messages", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/uid" + }, + { + "name": "searchKey", + "in": "query", + "description": "searches for occurence of message.", + "schema": { + "type": "string" + } + }, + { + "name": "hasAttachments", + "in": "query", + "description": "Fetches messages that include attachments.", + "schema": { + "type": "boolean" + } + }, + { + "name": "attachmentTypes", + "in": "query", + "description": "Displays messages according to the type of attachment. Supported types include: image, video, audio, and file.", + "schema": { + "type": "string", + "enum": [ + "image", + "video", + "audio", + "file" + ] + } + }, + { + "name": "hasMentions", + "in": "query", + "description": "Fetches messages that include mentions.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasLinks", + "in": "query", + "description": "Fetches messages that include links.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mentionedUids", + "in": "query", + "description": "Fetches messages that include the mentioned comma-separated UIDs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "unread", + "in": "query", + "description": "displays all the unread messages of the user.", + "schema": { + "type": "boolean" + } + }, + { + "name": "undelivered", + "in": "query", + "description": "displays all the messages those are undelivered.", + "schema": { + "type": "boolean" + } + }, + { + "name": "count", + "in": "query", + "description": "displays the count of messages as per group/user", + "schema": { + "type": "boolean" + } + }, + { + "name": "hideReplies", + "in": "query", + "description": "Shows only messages skipping the replies in the message thread.", + "schema": { + "type": "boolean" + } + }, + { + "name": "affix", + "in": "query", + "description": "Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).", + "schema": { + "type": "string", + "enum": [ + "append", + "prepend" + ] + } + }, + { + "name": "id", + "in": "query", + "description": "Retrieves all those messages after the passed id.", + "schema": { + "type": "string" + } + }, + { + "name": "category", + "in": "query", + "description": "Fetches messages that belongs to specific category.", + "schema": { + "type": "string" + } + }, + { + "name": "categories", + "in": "query", + "description": "Fetches messages that contains multiple categories.", + "schema": { + "type": "array", + "items": {} + } + }, + { + "name": "type", + "in": "query", + "description": "Fetches messages that belongs to a specific type.", + "schema": { + "type": "string" + } + }, + { + "name": "types", + "in": "query", + "description": "Fetches messages with multiple types.", + "schema": { + "type": "array", + "items": {} + } + }, + { + "name": "myMentionsOnly", + "in": "query", + "description": "Filters messages with mentions for the UID in onBehalfOf header.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "hasReactions", + "in": "query", + "description": "Filters messages sent by a the uid given in sender query param and has reactions. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "sender", + "in": "query", + "description": "Filters messages with sender. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", + "schema": { + "type": "string" + } + }, + { + "name": "mentionsWithBlockedInfo", + "in": "query", + "description": "For the mentioned users, provides blocked information with respect to the UID in onBehalfOf header.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "mentionsWithTagInfo", + "in": "query", + "description": "Provides user tags for the mentioned users.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "perPage", + "in": "query", + "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000", + "schema": { + "type": "integer", + "default": "100" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000 (works alongside onBehalfOf header)", + "schema": { + "type": "integer", + "default": "10" + } + }, + { + "name": "fromTimestamp", + "in": "query", + "description": "Fetches the messages from this timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "toTimestamp", + "in": "query", + "description": "Fetches the messages till this timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "withTags", + "in": "query", + "description": "This will fetch messages along with the tags.", + "schema": { + "type": "boolean" + } + }, + { + "name": "tags", + "in": "query", + "description": "This will fetch only those messages belonging to the mentioned tags.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "hideQuotedMessages", + "in": "query", + "description": "If set to true, the API response will exclude all quotedMessage nodes from the returned messages. This allows clients to fetch only the messages without any quoted messages.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Get User Messages", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "1776", + "conversationId": "superhero2_user_superhero3", + "sender": "superhero2", + "receiverType": "user", + "receiver": "superhero3", + "category": "call", + "type": "audio", + "data": { + "action": "initiated", + "entities": { + "by": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline" + }, + "entityType": "user" + }, + "on": { + "entity": { + "data": { + "entities": { + "sender": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline" + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "conversationId": "superhero2_user_superhero3" + }, + "entityType": "user" + } + }, + "metadata": { + "key": { + "one": "two" + } + } + }, + "type": "audio", + "sender": "superhero2", + "status": "initiated", + "joinedAt": 1646995097, + "receiver": "superhero3", + "sessionid": "16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba", + "wsChannel": { + "secret": "083c2a7f660150e42c2bf07a17231e90980b290d", + "service": "19757e59e8b9669.call", + "identity": "[19757e59e8b9669]16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba" + }, + "initiatedAt": 1646995097, + "receiverType": "user", + "conversationId": "superhero2_user_superhero3" + }, + "entityType": "call" + }, + "for": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "conversationId": "superhero2_user_superhero3" + }, + "entityType": "user" + } + } + }, + "sentAt": 1646995097, + "updatedAt": 1646995097 + }, + { + "id": "1777", + "conversationId": "superhero2_user_superhero3", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero2", + "category": "call", + "type": "video", + "data": { + "action": "ongoing", + "entities": { + "by": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline" + }, + "entityType": "user" + }, + "on": { + "entity": { + "data": { + "entities": { + "sender": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline" + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "conversationId": "superhero2_user_superhero3" + }, + "entityType": "user" + } + }, + "metadata": { + "key": { + "one": "two" + } + } + }, + "type": "video", + "sender": "superhero2", + "status": "ongoing", + "joinedAt": 1646995512, + "receiver": "superhero3", + "sessionid": "16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba", + "startedAt": 1646995512, + "wsChannel": { + "secret": "083c2a7f660150e42c2bf07a17231e90980b290d", + "service": "19757e59e8b9669.call", + "identity": "[19757e59e8b9669]16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba" + }, + "initiatedAt": 1646995097, + "receiverType": "user", + "conversationId": "superhero2_user_superhero3" + }, + "entityType": "call" + }, + "for": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "role": "default", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "conversationId": "superhero2_user_superhero3" + }, + "entityType": "user" + } + } + }, + "sentAt": 1646995512, + "updatedAt": 1646995512 + } + ], + "meta": { + "pagination": { + "total": 0, + "count": 2, + "per_page": 100, + "current_page": 1, + "total_pages": 1 + }, + "cursor": { + "id": 1786, + "affix": "prepend" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/groups/{guid}/messages": { + "get": { + "tags": [ + "Messages" + ], + "summary": "List Group Messages", + "description": "Fetches the group message list for a user.", + "operationId": "user-list-group-messages", + "parameters": [ + { + "$ref": "#/components/parameters/onBehalfOf" + }, + { + "$ref": "#/components/parameters/guid" + }, + { + "name": "searchKey", + "in": "query", + "description": "searches for occurence of message.", + "schema": { + "type": "string" + } + }, + { + "name": "hasAttachments", + "in": "query", + "description": "Fetches messages that include attachments.", + "schema": { + "type": "boolean" + } + }, + { + "name": "attachmentTypes", + "in": "query", + "description": "Displays messages according to the type of attachment. Supported types include: image, video, audio, and file.", + "schema": { + "type": "string", + "enum": [ + "image", + "video", + "audio", + "file" + ] + } + }, + { + "name": "hasMentions", + "in": "query", + "description": "Fetches messages that include mentions.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hasLinks", + "in": "query", + "description": "Fetches messages that include links.", + "schema": { + "type": "boolean" + } + }, + { + "name": "mentionedUids", + "in": "query", + "description": "Fetches messages that include the mentioned comma-separated UIDs.", + "schema": { + "type": "boolean" + } + }, + { + "name": "unread", + "in": "query", + "description": "displays all the unread messages of the user.", + "schema": { + "type": "boolean" + } + }, + { + "name": "undelivered", + "in": "query", + "description": "displays all the messages those are undelivered.", + "schema": { + "type": "boolean" + } + }, + { + "name": "count", + "in": "query", + "description": "displays the count of messages as per group/user", + "schema": { + "type": "boolean" + } + }, + { + "name": "hideMessagesFromBlockedUsers", + "in": "query", + "description": "Hides the messages from blocked users in group.", + "schema": { + "type": "boolean" + } + }, + { + "name": "hideReplies", + "in": "query", + "description": "Shows only messages skipping the replies in the message thread.", + "schema": { + "type": "boolean" + } + }, + { + "name": "affix", + "in": "query", + "description": "Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).", + "schema": { + "type": "string", + "enum": [ + "append", + "prepend" + ] + } + }, + { + "name": "id", + "in": "query", + "description": "Retrieves all those messages after the passed id.", + "schema": { + "type": "string" + } + }, + { + "name": "category", + "in": "query", + "description": "Fetches messages that belongs to specific category.", + "schema": { + "type": "string" + } + }, + { + "name": "categories", + "in": "query", + "description": "Fetches messages that contains multiple categories.", + "schema": { + "type": "array", + "items": {} + } + }, + { + "name": "type", + "in": "query", + "description": "Fetches messages that belongs to a specific type.", + "schema": { "type": "string" - }, - "contactNumber": { + } + }, + { + "name": "types", + "in": "query", + "description": "Fetches messages with multiple types.", + "schema": { + "type": "array", + "items": {} + } + }, + { + "name": "myMentionsOnly", + "in": "query", + "description": "Filters messages with mentions for the UID in onBehalfOf header.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "hasReactions", + "in": "query", + "description": "Filters messages sent by a the uid given in sender query param and has reactions. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "sender", + "in": "query", + "description": "Filters messages with sender. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", + "schema": { + "type": "string" + } + }, + { + "name": "mentionsWithBlockedInfo", + "in": "query", + "description": "For the mentioned users, provides blocked information with respect to the UID in onBehalfOf header.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "mentionsWithTagInfo", + "in": "query", + "description": "Provides user tags for the mentioned users.", + "schema": { + "type": "boolean", + "default": "false" + } + }, + { + "name": "limit", + "in": "query", + "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000", + "schema": { + "type": "integer", + "default": "10" + } + }, + { + "name": "fromTimestamp", + "in": "query", + "description": "Fetches the messages from this timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "toTimestamp", + "in": "query", + "description": "Fetches the messages till this timestamp.", + "schema": { + "type": "integer" + } + }, + { + "name": "withTags", + "in": "query", + "description": "This will fetch messages along with the tags.", + "schema": { + "type": "boolean" + } + }, + { + "name": "tags", + "in": "query", + "description": "This will fetch only those messages belonging to the mentioned tags.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "name": "hideQuotedMessages", + "in": "query", + "description": "If set to true, the API response will exclude all quotedMessage nodes from the returned messages. This allows clients to fetch only the referenced messages without any quoted messages.", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "Retreived Group Messages", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "1", + "conversationId": "superhero3_user_superhero5", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero5", + "category": "message", + "type": "text", + "data": { + "text": "test hello", + "entities": { + "sender": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "createdAt": 1638361550 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "role": "default", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "createdAt": 1638361550, + "conversationId": "superhero3_user_superhero5" + }, + "entityType": "user" + } + }, + "metadata": { + "key1": "val1" + } + }, + "sentAt": 1638423490, + "updatedAt": 1638423490 + } + ], + "meta": { + "current": { + "limit": 100, + "count": 1 + }, + "next": { + "affix": "append", + "sentAt": 1638423490, + "id": "1" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/bots/{uid}/messages": { + "post": { + "tags": [ + "Messages" + ], + "summary": "Send Bot Message", + "description": "Sends Message from a Bot.", + "operationId": "sends-bot-message", + "parameters": [ + { + "name": "uid", + "in": "path", + "description": "An UID of the Bot.", + "required": true, + "schema": { "type": "string" - } }, - "type": "object" - } - }, - "type": "object", - "default": { - "@private": { - "email": "user@email.com", - "contactNumber": "0123456789" - } - } - }, - "tags": { - "description": "A list of tags to identify specific users.", - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "tag1" - ] - }, - "unset": { - "description": "The unsettable user attributes are avatar, link and metadata.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "avatar", - "link", - "metadata" - ], - "description": "User attributes that can be unset." - }, - "default": [ - "avatar" - ] - } + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "discriminator": { + "propertyName": "category", + "mapping": { + "message": "#/components/schemas/messageCategorySchema", + "interactive": "#/components/schemas/interactiveCategorySchema", + "custom": "#/components/schemas/customCategorySchema" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/messageCategorySchema" + }, + { + "$ref": "#/components/schemas/customCategorySchema" + }, + { + "$ref": "#/components/schemas/interactiveCategorySchema" + } + ] + }, + "examples": { + "form-interactive": { + "summary": "Interactive form example", + "value": { + "receiverType": "user", + "data": { + "interactionGoal": { + "type": "allOf", + "elementIds": [ + "element8" + ] + }, + "allowSenderInteraction": true, + "interactiveData": { + "title": "Form Title", + "formFields": [ + { + "elementType": "textInput", + "elementId": "element1", + "defaultValue": "vivek", + "label": "Name", + "optional": false, + "maxLines": 1, + "placeholder": { + "text": "write your name here" + } + }, + { + "elementType": "textInput", + "elementId": "element2", + "label": "Last Name", + "optional": false, + "maxLines": 1 + }, + { + "elementType": "textInput", + "elementId": "element3", + "label": "Address", + "optional": false, + "maxLines": 5 + }, + { + "elementType": "dropdown", + "elementId": "element4", + "label": "Country", + "optional": false, + "defaultValue": "option1", + "options": [ + { + "value": "option1", + "label": "INDIA" + }, + { + "value": "option2", + "label": "AUSTRALIA" + } + ] + }, + { + "elementType": "checkbox", + "elementId": "element5", + "optional": true, + "label": "Services", + "options": [ + { + "value": "option1", + "label": "Garbage" + }, + { + "value": "option2", + "label": "Electricity Bill" + }, + { + "value": "option3", + "label": "Lift" + } + ], + "defaultValue": [ + "option1", + "option2" + ] + }, + { + "elementType": "singleSelect", + "elementId": "element6", + "optional": false, + "label": "Wing", + "defaultValue": "option1", + "options": [ + { + "value": "option1", + "label": "A Wing" + }, + { + "value": "option2", + "label": "B Wing" + } + ] + }, + { + "elementType": "button", + "elementId": "element9", + "buttonText": "About us", + "disableAfterInteracted": true, + "action": { + "actionType": "urlNavigation", + "url": "https://www.cometchat.com" + } + } + ], + "submitElement": { + "elementType": "button", + "elementId": "element8", + "buttonText": "Submit", + "disableAfterInteracted": true, + "action": { + "actionType": "apiAction", + "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", + "method": "POST", + "payload": { + "category": "message", + "type": "text", + "data": { + "text": "Thanks For filling the Form!" + }, + "receiver": "superhero2", + "receiverType": "user" + }, + "headers": { + "appId": "10893f2ae68f59", + "Content-Type": "application/json", + "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", + "onBehalfOf": "superhero1" + }, + "dataKey": "CometChatData" + } + } + } + }, + "category": "interactive", + "type": "form", + "receiver": "superhero1", + "tags": [ + "tag1" + ] + } + }, + "card-interactive": { + "summary": "Interactive card example", + "value": { + "receiverType": "user", + "data": { + "interactionGoal": { + "type": "none" + }, + "allowSenderInteraction": true, + "interactiveData": { + "imageUrl": "https://upload.wikimedia.org/wikipedia/en/e/e1/Thomas_D._Baird_%28low-resolution%29.jpg", + "text": "Thanks For filling the Form!.\n\nWant to make your gifts more special? Now its easy with our personalized card messages!\n\nOur new feature lets you add a custom message on a beautifully designed card, making your gift-giving extra personal and memorable.\nWhether its for a birthday , anniversary , or just because , our card messages will express your feelings perfectly.\n\nTo start creating your own card message:\nChoose the gift\nWrite your heartfelt message\nWell print it on a high-quality card and include it with your gift\nAdd a touch of your own sentiments with our personalized card messages. Make every gift unforgettable. Start creating your card message today!\nVisit our website Website Link or download our app App Link.\n\nExpress more than just words with our Personalized Card Messages.Because its not just a gift, its your feelings.\n", + "cardActions": [ + { + "elementType": "button", + "elementId": "element8", + "buttonText": "Buy now", + "disableAfterInteracted": true, + "action": { + "actionType": "apiAction", + "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", + "method": "POST", + "payload": { + "category": "message", + "type": "text", + "data": { + "text": "Thanks For filling the Form!" + }, + "receiver": "group_1695921003310", + "receiverType": "group" + }, + "headers": { + "appId": "10893f2ae68f59", + "Content-Type": "application\\/json", + "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", + "onBehalfOf": "superhero1" + }, + "dataKey": "CometChatData" + } + }, + { + "elementType": "button", + "elementId": "element9", + "buttonText": "Navigate", + "disableAfterInteracted": true, + "action": { + "actionType": "urlNavigation", + "url": "https://www.cometchat.com" + } + }, + { + "elementType": "button", + "elementId": "element10", + "buttonText": "Submit", + "disableAfterInteracted": true, + "action": { + "actionType": "apiAction", + "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", + "method": "POST", + "payload": { + "category": "message", + "type": "text", + "data": { + "text": "Thanks For filling the Form!" + }, + "receiver": "group_1695921003310", + "receiverType": "group" + }, + "headers": { + "appId": "10893f2ae68f59", + "Content-Type": "application/json", + "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", + "onBehalfOf": "superhero1" + }, + "dataKey": "CometChatData" + } + } + ] + } + }, + "category": "interactive", + "type": "card", + "receiver": "superhero1", + "tags": [ + "tag1" + ] + } + }, + "scheduler-interactive": { + "summary": "Interactive scheduler example", + "value": { + "receiverType": "user", + "receiver": "superhero2", + "category": "interactive", + "type": "scheduler", + "data": { + "receiverType": "user", + "receiver": "superhero2", + "muid": "16Jan3:41423PM", + "interactionGoal": { + "type": "anyAction", + "elementIds": [] + }, + "allowSenderInteraction": false, + "interactiveData": { + "title": "Meet with Dr. Jacob", + "avatarUrl": "https: //data-us.cometchat.io/assets/images/avatars/ironman.png", + "bufferTime": 15, + "icsFileUrl": "https://data-us.cometchat.io/23965108c9b89ad2/media/1704380186_864562419_ab59586ed5ab5f89d2c960457ceee249.ics", + "availability": { + "friday": [ + { + "to": "2359", + "from": "0000" + } + ], + "monday": [ + { + "to": "1700", + "from": "0600" + } + ], + "tuesday": [ + { + "to": "1400", + "from": "1000" + }, + { + "to": "2000", + "from": "1700" + } + ], + "thursday": [ + { + "to": "2359", + "from": "0000" + } + ], + "wednesday": [ + { + "to": "0800", + "from": "0600" + }, + { + "to": "1700", + "from": "1200" + } + ] + }, + "timezoneCode": "Asia/Kolkata", + "duration": 60, + "scheduleElement": { + "action": { + "url": "https://802bba5ae13a7.api-us.cometchat-staging.com/v3.0/messages", + "actionType": "apiAction", + "method": "post", + "dataKey": "", + "headers": { + "accept": "application/json", + "apiKey": "62a32b5140e6b630dab38e2e690d88de9c69d416", + "onBehalfOf": "suryansh1", + "content-type": "application/json" + }, + "payload": { + "data": { + "text": "Meeting Scheduled Successfully!" + }, + "type": "text", + "category": "message", + "receiver": "demo1", + "receiverType": "group" + } + }, + "elementId": "1", + "buttonText": "Schedule", + "elementType": "button", + "disableAfterInteracted": true + }, + "goalCompletionText": "Your meeting has been Scheduled", + "dateRangeStart": "2024-06-09", + "dateRangeEnd": "2024-06-09" + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Send Bot Message", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "1", + "conversationId": "superhero3_user_superhero5", + "sender": "superhero3", + "receiverType": "user", + "receiver": "superhero5", + "category": "message", + "type": "text", + "data": { + "text": "test hello", + "metadata": { + "key1": "val1" + }, + "entities": { + "sender": { + "entity": { + "uid": "superhero3", + "name": "Spiderman", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/spiderman.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero5", + "name": "Cyclops", + "avatar": "https://data-us.cometchat.io/assets/images/avatars/cyclops.png", + "status": "offline", + "role": "default", + "createdAt": 1638361550, + "conversationId": "superhero3_user_superhero5" + }, + "entityType": "user" + } + } + }, + "sentAt": 1638423490, + "updatedAt": 1638423490 + } + } + } + } + } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Updated user", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/v1/settings": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "List Settings", + "description": "List preferences, templates and sounds for the given app.", + "operationId": "notifications-push-list-settings", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "preferences": { + "group": { + "messagesSetting": 2, + "messageEditedSetting": 2, + "messagesOverride": true, + "repliesSetting": 2, + "repliesOverride": true, + "messageDeletedSetting": 2, + "reactionsSetting": 2, + "reactionsOverride": true, + "memberLeftSetting": 1, + "memberLeftOverride": true, + "memberAddedSetting": 1, + "memberAddedOverride": true, + "memberJoinedSetting": 1, + "memberJoinedOverride": true, + "memberKickedSetting": 1, + "memberKickedOverride": true, + "memberBannedSetting": 1, + "memberBannedOverride": true, + "memberUnbannedSetting": 1, + "memberUnbannedOverride": true, + "memberScopeChangedSetting": 1, + "memberScopeChangedOverride": true + }, + "bypassPreferencesForMentions": false, + "bypassPreferencesForGroupMentions": false, + "call": { + "busySetting": 1, + "cancelledSetting": 1, + "endedSetting": 1, + "initiatedSetting": 1, + "ongoingSetting": 1, + "rejectedSetting": 1, + "unansweredSetting": 1, + "initiatedOverride": false, + "ongoingOverride": false, + "cancelledOverride": false, + "rejectedOverride": false, + "unansweredOverride": false, + "busyOverride": false, + "endedOverride": false + }, + "oneOnOne": { + "messagesSetting": 2, + "messagesOverride": true, + "repliesSetting": 2, + "repliesOverride": true, + "messageEditedSetting": 2, + "messageDeletedSetting": 2, + "reactionsSetting": 2, + "reactionsOverride": true + }, + "mute": { + "dndPreferenceSetting": 1, + "dndPreferenceOverride": true, + "schedulePreferenceSetting": { + "monday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "tuesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "wednesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "thursday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "friday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "saturday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "sunday": { + "from": 0, + "to": 2359, + "dnd": false + } + }, + "schedulePreferenceOverride": true, + "mutedGroupsOverride": true, + "mutedOneOnOnesOverride": true + }, + "email": { + "notifyForUnreadOnly": true, + "intervalInSeconds": 7200, + "maxPerDay": 20, + "maxPerDayPerConversation": 2, + "includeMessageObjectSetting": false, + "includeSenderMetadataSetting": true, + "includeReceiverMetadataSetting": true, + "includeMessageMetadataSetting": true + }, + "sms": { + "notifyForUnreadOnly": true, + "intervalInSeconds": 7200, + "maxPerDay": 20, + "maxPerDayPerConversation": 2, + "includeMessageObjectSetting": false, + "includeSenderMetadataSetting": true, + "includeReceiverMetadataSetting": true, + "includeMessageMetadataSetting": true + }, + "push": { + "includeMessageObjectSetting": false, + "includeSenderMetadataSetting": true, + "includeReceiverMetadataSetting": true, + "trimTextFieldSetting": false, + "includeMessageMetadataSetting": true, + "customJson": { + "hello": "world" + } + } + }, + "sound": { + "chat": "default", + "call": "default" + }, + "templates": { + "usePrivacyTemplate": 3, + "textMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}" + }, + "textMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "mediaMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body_audio": "🔈 Has sent an audio", + "body_file": "📄 Has sent a file", + "body_image": "📷 Has sent an image", + "body_video": "🎥 Has sent a video" + }, + "mediaMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body_audio": "New audio message", + "body_file": "New file message", + "body_image": "New image message", + "body_video": "New video message" + }, + "customMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}", + "body_fallback": "New message" + }, + "customMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message", + "body_fallback": "New message" + }, + "interactiveFormTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.interactiveData.title}}" + }, + "interactiveFormTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "interactiveCardTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.interactiveData.text}}" + }, + "interactiveCardTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}}", + "body": "New message" + }, + "interactiveSchedulerTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New invite" + }, + "interactiveSchedulerTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New invite" + }, + "interactiveCustomTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "interactiveCustomTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "emailSubjectTemplateDefault": { + "subjectGroup": "New messages in {{groupDetails.name}}", + "subjectOneOnOne": "New messages from {{senderDetails.name}}" + }, + "emailSubjectTemplatePrivacy": { + "subjectGroup": "New messages in {{groupDetails.name}}", + "subjectOneOnOne": "New messages from {{senderDetails.name}}" + }, + "smsContentTemplateDefault": { + "bodyGroup": "You've received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.", + "bodyOneOnOne": "You've received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com." + }, + "smsContentTemplatePrivacy": { + "bodyGroup": "You've received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.", + "bodyOneOnOne": "You've received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com." + } + } + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "uid": "cometchat-uid-6", - "name": "Barry Allen", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "metadata": { - "email": "user@email.com", - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "manager", - "createdAt": 1638354015, - "updatedAt": 1638354799, - "tags": [ - "cometchat-guid-1" - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Users" - ], - "summary": "Delete", - "description": "Deletes a user for the specified UID", - "operationId": "delete-user", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "permanent": { - "description": "Permanently deletes the user along with all the messages, conversations, etc.", - "type": "boolean", - "default": "false" - } + "patch": { + "tags": [ + "Notifications" + ], + "summary": "Update Settings", + "description": "Update preferences, templates and sounds for the given app.", + "operationId": "notifications-push-update-settings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pnSettingSchema" + } + } + } }, - "type": "object" - } + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Reset Settings", + "description": "Reset preferences, templates and sounds to default values for the given app.", + "operationId": "notifications-push-reset-settings", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Deleted User", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/push/v1/providers/fcm": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "List FCM Providers", + "description": "List the configured FCM providers for the given app.", + "operationId": "notifications-push-list-fcm-providers", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "pushProviders": [] + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "User with cometchat-uid-6 has been deleted successfully." - } - } - } + "security": [ + { + "apiKey": [] + } + ] + }, + "post": { + "tags": [ + "Notifications" + ], + "summary": "Add FCM Provider", + "description": "Add new FCM provider for the given app.", + "operationId": "notifications-push-add-fcm-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/fcmCreateProviderSchema" + } + } + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Notifications" + ], + "summary": "Update FCM Provider", + "description": "Update existing FCM provider for the given app.", + "operationId": "notifications-push-update-fcm-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "properties": { + "providerId": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/fcmCreateProviderSchema" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups": { - "post": { - "tags": [ - "Groups" - ], - "summary": "Create", - "description": "Creates a group.", - "operationId": "create-group", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "guid", - "name", - "type" + "/notifications/push/v1/providers/fcm/{providerId}": { + "delete": { + "tags": [ + "Notifications" ], - "properties": { - "guid": { - "description": "A unique identifier for a group.", - "type": "string" - }, - "name": { - "description": "Name of the group.", - "type": "string" - }, - "type": { - "description": "Type of the group. Can be public, password or private.", - "type": "string", - "enum": [ - "public", - "password", - "private" - ] - }, - "password": { - "description": "A password required to join the the group with type password", - "type": "string" - }, - "icon": { - "description": "An URL for a group icon.", - "type": "string" - }, - "description": { - "description": "Description about the group", - "type": "string" - }, - "metadata": { - "description": "Additional data for the group.", - "type": "object" - }, - "owner": { - "description": "The UID that you wish to make owner of the group", - "type": "string" - }, - "tags": { - "description": "List of tags to identify specific groups.", - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "tag1" - ] - }, - "members": { - "description": "Add members to a group with scope admins,moderators and participants.", - "properties": { - "admins": { - "description": "UIDs of users to be made admins.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "moderators": { - "description": "UIDs of users to be made moderators.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "participants": { - "description": "UIDs of users to be made participants.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "usersToBan": { - "description": "UIDs of the users to be banned from the group.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - } - }, - "type": "object" - } + "summary": "Delete FCM Provider", + "description": "Delete an FCM provider for the given app.", + "operationId": "notifications-push-delete-fcm-provider", + "parameters": [ + { + "$ref": "#/components/parameters/providerId" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Create Group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/push/v1/providers/fcm/default/{providerId}": { + "put": { + "tags": [ + "Notifications" + ], + "summary": "Change default FCM Provider", + "description": "Change the default FCM provider for the given app.", + "operationId": "notifications-push-default-fcm-provider", + "parameters": [ + { + "$ref": "#/components/parameters/providerId" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "guid": "project-group", - "name": "Project Group", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "public", - "scope": "admin", - "membersCount": 1, - "joinedAt": 1638440784, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1638440784, - "owner": "cometchat-uid-4", - "tags": [ - "friends", - "project" - ] - } - } - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Groups" - ], - "summary": "List", - "description": "Lists the groups.", - "operationId": "list-groups", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "searchKey", - "in": "query", - "description": "Searches for given keyword in group's list (either GUID, name or email).", - "schema": { - "type": "string" - } - }, - { - "name": "searchIn", - "in": "query", - "description": "Searches for specified keyword in name,GUID or both.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "sortBy", - "in": "query", - "description": "Sorts the group list by either Name,Guid or Created at . Available values: name, guid, createdAt", - "schema": { - "type": "string", - "enum": [ - "name", - "guid", - "createdAt" - ], - "description": "Sort field for listing groups." - } - }, - { - "name": "sortOrder", - "in": "query", - "description": "Sorts the group list in ascending or descending order. Available values: asc, desc", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "description": "Sort order." - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of groups to be fetched in a request. The default value is 100 and the maximum value is 1000.", - "schema": { - "type": "integer", - "default": "100" - } - }, - { - "name": "affix", - "in": "query", - "description": "Determines whether to fetch the groups either before or after createdAt/updatedAt timestamp. Possible values are append(after) and prepend(before).", - "schema": { - "type": "string", - "enum": [ - "append", - "prepend" - ], - "description": "Cursor pagination direction." - } - }, - { - "name": "updatedAt", - "in": "query", - "description": "Fetches the groups list after a particular updatedAt timestamp.", - "schema": { - "type": "integer" - } - }, - { - "name": "withTags", - "in": "query", - "description": "Includes those groups that have tags.", - "schema": { - "type": "boolean" - } - }, - { - "name": "tags", - "in": "query", - "description": "Fetches only those groups that have these tags.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "type", - "in": "query", - "description": "Fetches groups based on group type(public, protected, password).", - "schema": { - "type": "string", - "enum": [ - "public", - "private", - "password" - ], - "description": "Group type. public: anyone can join. password: requires password. private: invitation only." - } - }, - { - "name": "types", - "in": "query", - "description": "Fetches groups based on multiple types.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "page", - "in": "query", - "description": "Page number.", - "schema": { - "type": "integer" - } - }, - { - "name": "hasJoined", - "in": "query", - "description": "Fetches all the joined groups of a user. This will work only with onBehalfOf parameter in header. It accepts only true as a value, setting it as false simply removes this filter.", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "A list of groups", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "0": { - "type": "object" - }, - "guid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "type": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "membersCount": { - "type": "integer" - }, - "joinedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - }, - "hasJoined": { - "type": "boolean" - }, - "createdAt": { - "type": "integer" - }, - "owner": { - "type": "string" - }, - "tags": { - "type": "array", - "items": {} - } + "/notifications/push/v1/providers/apns": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "List APNS Providers", + "description": "List the configured APNS providers for the given app.", + "operationId": "notifications-push-list-apns-providers", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": {} + }, + "type": "object" + }, + "example": { + "data": { + "pushProviders": [] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Notifications" + ], + "summary": "Update APNS Providers", + "description": "Update existing APNS provider for the given app.", + "operationId": "notifications-push-update-apns-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "properties": { + "providerId": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/createApnsProvider" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": {} + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "post": { + "tags": [ + "Notifications" + ], + "summary": "Add APNS Provider", + "description": "Add new APNS provider for the given app.", + "operationId": "notifications-push-add-apns-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/createApnsProvider" + } } - } - }, - "meta": { - "type": "object" - }, - "cursor": { - "properties": { - "updatedAt": { - "type": "integer" - }, - "affix": { - "type": "string" + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": {} + }, + "type": "object" + }, + "example": { + "data": { + "pushProviders": [] + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "0": { - "0": { - "guid": "project-group-2", - "name": "Project Group 2", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "public", - "scope": "admin", - "membersCount": 1, - "joinedAt": 1638440784, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1638440784, - "owner": "cometchat-uid-4", - "tags": [ - "friends", - "project" - ] - }, - "guid": "project-group", - "name": "Project Group", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "public", - "scope": "admin", - "membersCount": 1, - "joinedAt": 1638440784, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1638440784, - "owner": "cometchat-uid-4", - "tags": [ - "friends", - "project" - ] - }, - "meta": { - "pagination": { - "total": 0, - "count": 5, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - }, - "cursor": { - "updatedAt": 1638354799, - "affix": "prepend" - } - } - } - } - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Get", - "description": "Retrieves details of a group for a given GUID.", - "operationId": "get-group", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - } - ], - "responses": { - "200": { - "description": "Get group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/push/v1/providers/apns/{providerId}": { + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete APNS Providers", + "description": "Delete an APNS provider for the given app.", + "operationId": "notifications-push-delete-apns-provider", + "parameters": [ + { + "$ref": "#/components/parameters/providerId" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": {} + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "guid": "project-group", - "name": "Project Group", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "public", - "scope": "admin", - "membersCount": 1, - "joinedAt": 1638440784, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1638440784, - "owner": "cometchat-uid-4", - "tags": [ - "friends", - "project" - ] - } - } - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Groups" - ], - "summary": "Update", - "description": "Updates the group details for a given GUID.", - "operationId": "update-group", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "description": "Name of the group.", - "type": "string" - }, - "type": { - "description": "The type of the group. The available values are: public, password and private.", - "type": "string", - "enum": [ - "public", - "password", - "private" - ] - }, - "password": { - "description": "A password required to join the the group with type password", - "type": "string" - }, - "icon": { - "description": "An URL for a group icon.", - "type": "string" - }, - "description": { - "description": "Description about the group", - "type": "string" - }, - "metadata": { - "description": "Additional group data.", - "type": "object" - }, - "owner": { - "description": "The UID that you wish to make the owner of the group.This field will be ignored if onBehalfOf parameter in the header is present in the request.", - "type": "string" - }, - "tags": { - "description": "Updates tags of a group.", - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "tag1" - ] - }, - "unset": { - "description": "The unsettable user attributes are icon, description and metadata.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "icon", - "description", - "metadata" - ], - "description": "Group attributes that can be unset." - } - } + "/notifications/push/v1/providers/apns/default/{providerId}": { + "put": { + "tags": [ + "Notifications" + ], + "summary": "Change default APNS Provider", + "description": "Change the default APNS provider for the given app.", + "operationId": "notifications-push-default-apns-provider", + "parameters": [ + { + "$ref": "#/components/parameters/providerId" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": {} + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Get group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/v1/preferences": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "List Preferences", + "description": "List the configured preferences for the given user.", + "operationId": "notifications-push-list-preferences", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "preferences": { + "group": { + "messagesSetting": 2, + "messagesOverride": true, + "repliesSetting": 2, + "repliesOverride": true, + "reactionsSetting": 2, + "reactionsOverride": true, + "memberLeftSetting": 1, + "memberLeftOverride": true, + "memberAddedSetting": 1, + "memberAddedOverride": true, + "memberJoinedSetting": 1, + "memberJoinedOverride": true, + "memberKickedSetting": 1, + "memberKickedOverride": true, + "memberBannedSetting": 1, + "memberBannedOverride": true, + "memberUnbannedSetting": 1, + "memberUnbannedOverride": true, + "memberScopeChangedSetting": 1, + "memberScopeChangedOverride": true + }, + "oneOnOne": { + "messagesSetting": 2, + "messagesOverride": true, + "repliesSetting": 2, + "repliesOverride": true, + "reactionsSetting": 2, + "reactionsOverride": true + }, + "mute": { + "dndPreferenceSetting": 1, + "dndPreferenceOverride": true, + "schedulePreferenceSetting": { + "monday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "tuesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "wednesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "thursday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "friday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "saturday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "sunday": { + "from": 0, + "to": 2359, + "dnd": false + } + }, + "schedulePreferenceOverride": true, + "mutedGroupsOverride": true, + "mutedOneOnOnesOverride": true + } + }, + "sound": { + "chat": "default", + "call": "default" + }, + "templates": { + "usePrivacyTemplate": 3, + "textMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}" + }, + "textMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "mediaMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body_audio": "Has sent an {{message.type}}", + "body_file": "Has sent a {{message.type}}", + "body_image": "Has sent an {{message.type}}", + "body_video": "Has sent a {{message.type}}" + }, + "mediaMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body_audio": "New message", + "body_file": "New message", + "body_image": "New message", + "body_video": "New message" + }, + "customMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}", + "body_fallback": "New message" + }, + "customMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}", + "body_fallback": "New message" + }, + "interactiveFormTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{data.interactiveData.title}}" + }, + "interactiveFormTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "interactiveCardTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{data.interactiveData.text}}" + }, + "interactiveCardTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}}", + "body": "New message" + }, + "interactiveSchedulerTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New invite" + }, + "interactiveSchedulerTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New invite" + }, + "interactiveCustomTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "interactiveCustomTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + } + } + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "guid": "project-group", - "name": "Project Group", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "public", - "scope": "admin", - "membersCount": 1, - "joinedAt": 1638440784, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1638440784, - "owner": "cometchat-uid-4", - "tags": [ - "friends", - "project" - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Groups" - ], - "summary": "Delete", - "description": "Deletes a group with a given GUID.", - "operationId": "delete-group", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - } - ], - "responses": { - "200": { - "description": "Deleted Group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] + } + ] + }, + "patch": { + "tags": [ + "Notifications" + ], + "summary": "Update Preferences", + "description": "Update the preference for the given user.", + "operationId": "notifications-push-update-preferences", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pnUpdatePreferences" + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "Group with guid project-group has been deleted successfully." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/messages": { - "post": { - "tags": [ - "Messages" - ], - "summary": "Send Message", - "description": "Sends Message on behalf of a user.", - "operationId": "send-message", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "discriminator": { - "propertyName": "category", - "mapping": { - "message": "#/components/schemas/messageCategorySchema", - "custom": "#/components/schemas/customCategorySchema" - } + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "preferences": { + "group": { + "messagesSetting": 2, + "messagesOverride": true, + "repliesSetting": 2, + "repliesOverride": true, + "reactionsSetting": 2, + "reactionsOverride": true, + "memberLeftSetting": 1, + "memberLeftOverride": true, + "memberAddedSetting": 1, + "memberAddedOverride": true, + "memberJoinedSetting": 1, + "memberJoinedOverride": true, + "memberKickedSetting": 1, + "memberKickedOverride": true, + "memberBannedSetting": 1, + "memberBannedOverride": true, + "memberUnbannedSetting": 1, + "memberUnbannedOverride": true, + "memberScopeChangedSetting": 1, + "memberScopeChangedOverride": true + }, + "oneOnOne": { + "messagesSetting": 2, + "messagesOverride": true, + "repliesSetting": 2, + "repliesOverride": true, + "reactionsSetting": 2, + "reactionsOverride": true + }, + "mute": { + "dndPreferenceSetting": 1, + "dndPreferenceOverride": true, + "schedulePreferenceSetting": { + "monday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "tuesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "wednesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "thursday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "friday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "saturday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "sunday": { + "from": 0, + "to": 2359, + "dnd": false + } + }, + "schedulePreferenceOverride": true, + "mutedGroupsOverride": true, + "mutedOneOnOnesOverride": true + } + }, + "sound": { + "chat": "default", + "call": "default" + }, + "templates": { + "usePrivacyTemplate": 3, + "textMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}" + }, + "textMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "mediaMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body_audio": "Has sent an {{message.type}}", + "body_file": "Has sent a {{message.type}}", + "body_image": "Has sent an {{message.type}}", + "body_video": "Has sent a {{message.type}}" + }, + "mediaMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body_audio": "New message", + "body_file": "New message", + "body_image": "New message", + "body_video": "New message" + }, + "customMessageTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}", + "body_fallback": "New message" + }, + "customMessageTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{message.data.text}}", + "body_fallback": "New message" + }, + "interactiveFormTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{data.interactiveData.title}}" + }, + "interactiveFormTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "interactiveCardTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "{{data.interactiveData.text}}" + }, + "interactiveCardTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}}", + "body": "New message" + }, + "interactiveSchedulerTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New invite" + }, + "interactiveSchedulerTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New invite" + }, + "interactiveCustomTemplateDefault": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + }, + "interactiveCustomTemplatePrivacy": { + "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", + "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", + "body": "New message" + } + } + } + } + } + } + } }, - "oneOf": [ - { - "title": "Message", - "$ref": "#/components/schemas/messageCategorySchema" - }, - { - "title": "Custom", - "$ref": "#/components/schemas/customCategorySchema" - } + "security": [ + { + "apiKey": [] + } ] - }, - "examples": {} - } - } - }, - "responses": { - "200": { - "description": "Create Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Reset Preferences", + "description": "Reset the preferences for the given user.", + "operationId": "notifications-push-reset-preferences", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "groupPreferences": { + "groupMessages": 2, + "groupReplies": 2, + "groupReactions": 2, + "groupMemberLeft": 1, + "groupMemberAdded": 1, + "groupMemberJoined": 1, + "groupMemberKicked": 1, + "groupMemberBanned": 1, + "groupMemberUnbanned": 1, + "groupMemberScopeChanged": 1 + }, + "oneOnOnePreferences": { + "oneOnOneMessages": 2, + "oneOnOneReplies": 2, + "oneOnOneReactions": 2 + }, + "mutePreferences": { + "dnd": 1, + "schedule": { + "sunday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "monday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "tuesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "wednesday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "thursday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "friday": { + "from": 0, + "to": 2359, + "dnd": false + }, + "saturday": { + "from": 0, + "to": 2359, + "dnd": false + } + } + }, + "usePrivacyTemplate": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "id": "1", - "conversationId": "cometchat-uid-3_user_cometchat-uid-5", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-5", - "category": "message", - "type": "text", - "data": { - "text": "test hello", - "metadata": { - "key1": "val1" - }, - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550, - "conversationId": "cometchat-uid-3_user_cometchat-uid-5" - }, - "entityType": "user" - } - } - }, - "sentAt": 1638423490, - "updatedAt": 1638423490 - } - } - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Messages" - ], - "summary": "List Messages", - "description": "Fetches the messages list.", - "operationId": "list-all-messages", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "searchKey", - "in": "query", - "description": "Fetches messages that include the searchKey.", - "schema": { - "type": "string" - } - }, - { - "name": "hideMessagesFromBlockedUsers", - "in": "query", - "description": "Fetches messages sent by users who are blocked by the requesting user.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hasAttachments", - "in": "query", - "description": "Fetches messages that include attachments.", - "schema": { - "type": "boolean" - } - }, - { - "name": "attachmentTypes", - "in": "query", - "description": "Displays messages according to the type of attachment. Supported types include: image, video, audio, and file.", - "schema": { - "type": "string", - "enum": [ - "image", - "video", - "audio", - "file" - ], - "description": "Media message type." - } - }, - { - "name": "hasMentions", - "in": "query", - "description": "Fetches messages that include mentions.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hasLinks", - "in": "query", - "description": "Fetches messages that include links.", - "schema": { - "type": "boolean" - } - }, - { - "name": "mentionedUids", - "in": "query", - "description": "Fetches messages that include the mentioned comma-separated UIDs.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hasReactions", - "in": "query", - "description": "Fetches messages that include reactions.", - "schema": { - "type": "boolean" - } - }, - { - "name": "receiverType", - "in": "query", - "description": "Displays messages based on receiverType (user/group)", - "schema": { - "type": "string", - "enum": [ - "user", - "group" - ], - "description": "Receiver type. user: one-on-one. group: group conversation." - } - }, - { - "name": "affix", - "in": "query", - "description": "Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).", - "schema": { - "type": "string" - } - }, - { - "name": "id", - "in": "query", - "description": "Retrieves all those messages after the passed id.", - "schema": { - "type": "string" - } - }, - { - "name": "category", - "in": "query", - "description": "Filters messages by category. Possible values: message, action and custom.", - "schema": { - "type": "string", - "enum": [ - "message", - "action", - "custom" - ], - "description": "Message category filter." - } - }, - { - "name": "type", - "in": "query", - "description": "Filters messages by type.", - "schema": { - "type": "string" - } - }, - { - "name": "sender", - "in": "query", - "description": "Filters messages with sender. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", - "schema": { - "type": "string" - } - }, - { - "name": "mentionsWithBlockedInfo", - "in": "query", - "description": "For the mentioned users, provides blocked information with respect to the UID in onBehalfOf header.", - "schema": { - "type": "boolean" - } - }, - { - "name": "mentionsWithTagInfo", - "in": "query", - "description": "Provides user tags for the mentioned users.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hideDeleted", - "in": "query", - "description": "Hides deleted messages from List.", - "schema": { - "type": "boolean" - } - }, - { - "name": "onlyDeleted", - "in": "query", - "description": "Includes only deleted messages in List.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hideReplies", - "in": "query", - "description": "Shows only messages skipping the replies in the message thread.", - "schema": { - "type": "boolean" - } - }, - { - "name": "count", - "in": "query", - "description": "Includes unread message count in List.", - "schema": { - "type": "boolean" - } - }, - { - "name": "unread", - "in": "query", - "description": "Retrieves all the unread messages in a conversation. It must be used alongside count query parameter.", - "schema": { - "type": "boolean" - } - }, - { - "name": "sentAt", - "in": "query", - "description": "Fetches the messages list after a particular sentAt timestamp.", - "schema": { - "type": "integer" - } - }, - { - "name": "limit", - "in": "query", - "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000", - "schema": { - "type": "integer", - "default": "10" - } - }, - { - "name": "conversationId", - "in": "query", - "description": "Fetches all the messages belong to a particular conversation.", - "schema": { - "type": "string" - } - }, - { - "name": "withTags", - "in": "query", - "description": "This will fetch messages along with the tags.", - "schema": { - "type": "boolean" - } - }, - { - "name": "tags", - "in": "query", - "description": "This will fetch only those messages belonging to the mentioned tags.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "categories", - "in": "query", - "description": "Fetches messages based on multiple categories.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "types", - "in": "query", - "description": "Fetches messages based on multiple types.", - "schema": { - "type": "array", - "items": {} - } - }, - { - "name": "fromTimestamp", - "in": "query", - "description": "Fetches the messages from this timestamp.", - "schema": { - "type": "integer" - } - }, - { - "name": "toTimestamp", - "in": "query", - "description": "Fetches the messages till this timestamp. It will be ignored if fromTimestamp is missing or empty.", - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "List Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { + "/notifications/push/v1/tokens": { + "post": { + "tags": [ + "Notifications" + ], + "summary": "Register push token", + "description": "Register a push token for the given auth token.", + "operationId": "notifications-push-register-token", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/pnTokenSchema" + } + } + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Notifications" + ], + "summary": "List push tokens", + "description": "List push tokens for the given auth token.", + "operationId": "notifications-push-list-tokens", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "Displays all the tokens", + "schema": { + "type": "boolean" + } + }, + { + "name": "authToken", + "in": "query", + "description": "Fetches the results based on the auth Tokens", + "required": true, + "schema": { "type": "string" - }, - "data": { - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "pushTokens": [ + { + "authToken": "superhero3_1710141033938cf7e3c67cc44465440d4efac8de", + "pushTokenType": "chat", + "createdAt": "2024-03-11T07:27:59.412Z", + "platform": "fcm_android", + "providerId": "fcm-provider-2", + "pushToken": "{{uid3}}_fcm_android_asia_kolkata_4_new_mgmt", + "uid": "superhero3", + "updatedAt": "2024-03-13T11:24:47.776Z" + } + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Unregister push tokens for authToken", + "description": "Unregister push token(s) registered for the given auth token.", + "operationId": "notifications-push-unregister-tokens", + "parameters": [ + { + "name": "all", + "in": "query", + "description": "all=true: Deletes all the registered Push tokens for the user.\nall=false: Deletes the Push token registered for the current authToken.", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unregisterpnToken" + } + } + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "pushTokens": [ + { + "authToken": "superhero3_1710141033938cf7e3c67cc44465440d4efac8de", + "pushTokenType": "chat", + "createdAt": "2024-03-11T07:27:59.412Z", + "platform": "fcm_android", + "providerId": "fcm-provider-2", + "pushToken": "{{uid3}}_fcm_android_asia_kolkata_4_new_mgmt", + "uid": "superhero3", + "updatedAt": "2024-03-13T11:24:47.776Z" + } + ] + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/notifications/push/v1/tokens/{pushToken}": { + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete the given push token", + "description": "Deletes the given push token", + "operationId": "notifications-push-delete-token", + "parameters": [ + { + "$ref": "#/components/parameters/pushToken" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/unregisterpnToken" + } + } + } }, - "example": { - "data": [ - { - "id": "1", - "conversationId": "cometchat-uid-3_user_cometchat-uid-5", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-5", - "category": "message", - "type": "text", - "data": { - "text": "test hello", - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "createdAt": 1638361550 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "createdAt": 1638361550, - "conversationId": "cometchat-uid-3_user_cometchat-uid-5" - }, - "entityType": "user" - } - }, - "metadata": { - "key1": "val1" + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "pushTokens": [ + { + "authToken": "superhero3_1710141033938cf7e3c67cc44465440d4efac8de", + "pushTokenType": "chat", + "createdAt": "2024-03-11T07:27:59.412Z", + "platform": "fcm_android", + "providerId": "fcm-provider-2", + "pushToken": "{{uid3}}_fcm_android_asia_kolkata_4_new_mgmt", + "uid": "superhero3", + "updatedAt": "2024-03-13T11:24:47.776Z" + } + ] + } + } + } } - }, - "sentAt": 1638423490, - "updatedAt": 1638423490 } - ], - "meta": { - "current": { - "limit": 100, - "count": 1 - }, - "next": { - "affix": "append", - "sentAt": 1638423490, - "id": "1" + }, + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/messages/{id}": { - "get": { - "tags": [ - "Messages" - ], - "summary": "Get Message", - "description": "Fetches the details of a message.", - "operationId": "get-message-details", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message whose details are to be fetched.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - } - ], - "responses": { - "200": { - "description": "Retreived Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/v1/preferences/mute": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "List muted conversations", + "description": "List the conversations where notifications have been muted on behalf of the user.", + "operationId": "notifications-push-list-muted", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "mutedConversations": [] + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "id": "1", - "conversationId": "cometchat-uid-3_user_cometchat-uid-5", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-5", - "category": "message", - "type": "text", - "data": { - "text": "test hello", - "metadata": { - "key1": "val1" - }, - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550, - "conversationId": "cometchat-uid-3_user_cometchat-uid-5" - }, - "entityType": "user" - } - } - }, - "sentAt": 1638423490, - "updatedAt": 1638423490 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Messages" - ], - "summary": "Update Message", - "description": "Edits the message on behalf of a user.", - "operationId": "update-message", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message whose details are to be fetched.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "description": "The data that needs to be modified.", - "properties": { - "text": { - "type": "string" - }, - "metadata": { - "type": "object" - } - }, - "type": "object" - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "tag1" - ] - } + "put": { + "tags": [ + "Notifications" + ], + "summary": "Mute notifications for conversations", + "description": "Mute notifications for the conversations on behalf of the given user.", + "operationId": "notifications-push-mute-conversations", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "requestBody": { + "description": "List of conversations", + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "conversations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/muteConversation" + } + } + }, + "type": "object" + } + } + } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Updated Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "id": "402", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2", - "sender": "cometchat-uid-1", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "action", - "type": "message", - "data": { - "action": "edited", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Updated Name", - "status": "offline", - "role": "default", - "createdAt": 1639448370, - "updatedAt": 1640599553 - }, - "entityType": "user" - }, - "for": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "role": "default", - "createdAt": 1639448370 - }, - "entityType": "user" - }, - "on": { - "entity": { - "id": "69", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2", - "sender": "cometchat-uid-1", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "message", - "type": "text", - "data": { - "text": "hello spider", - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "status": "offline", - "createdAt": 1639448370 - }, - "entityType": "user" + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Unmute notifications for conversations", + "description": "Unmute notifications for the conversations on behalf of the given user.", + "operationId": "notifications-push-unmute-conversations", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "requestBody": { + "description": "Unmute Conversations", + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "conversations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/unmuteConversation" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" }, - "receiver": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1639448370, - "conversationId": "cometchat-uid-1_user_cometchat-uid-2" - }, - "entityType": "user" + "example": { + "data": { + "success": true + } } - } - }, - "sentAt": 1640171302, - "editedAt": 1641477338, - "editedBy": "app_system", - "updatedAt": 1641477338, - "tags": [ - "t6" - ] - }, - "entityType": "message" + } } - } - }, - "sentAt": 1641477338, - "updatedAt": 1641477338 - } - } - } + } + }, + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Messages" - ], - "summary": "Delete Message", - "description": "Deletes the message.", - "operationId": "delete-message", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message whose details are to be deleted.", - "required": true, - "schema": { - "type": "string" + "/notifications/v1/preferences/timezone": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Get timezone", + "description": "Get the timezone on behalf of the user.", + "operationId": "notifications-get-timezone", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "timezone": "Asia/Kolkata" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "permanent": { - "description": "Deletes the message permanently.", - "type": "boolean" - } + "patch": { + "tags": [ + "Notifications" + ], + "summary": "Update timezone", + "description": "Update the timezone on behalf of the user.", + "operationId": "notifications-update-timezone", + "parameters": [ + { + "$ref": "#/components/parameters/requiredUID" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "timezone": { + "description": "Input a valid Timezone Identifier. Eg: Asia/Tokyo", + "type": "string", + "example": "Asia/Tokyo" + } + }, + "type": "object" + } + } + } }, - "type": "object" - } + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "timezone": "Asia/Kolkata" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Deleted Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/v1/contact-details": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Get contact details", + "description": "Fetches the contact details like Email ID and Phone number for a given user.", + "operationId": "notifications-get-contact-details", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "email": "someone@example.com", + "phno": "+919591128691" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "id": "402", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2", - "sender": "cometchat-uid-1", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "action", - "type": "message", - "data": { - "action": "edited", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Updated Name", - "status": "offline", - "role": "default", - "createdAt": 1639448370 - }, - "entityType": "user" - }, - "for": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "role": "default", - "createdAt": 1639448370 - }, - "entityType": "user" - }, - "on": { - "entity": { - "id": "69", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2", - "sender": "cometchat-uid-1", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "message", - "type": "text", - "data": { - "text": "hello spider", - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "status": "offline", - "createdAt": 1639448370 - }, - "entityType": "user" + "security": [ + { + "apiKey": [] + } + ] + }, + "patch": { + "tags": [ + "Notifications" + ], + "summary": "Update contact details", + "description": "Updates the contact details like Email ID and Phone number for a given user.", + "operationId": "notifications-update-contact-details", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "email": { + "description": "The user's email address", + "type": "string", + "example": "someone@example.com" + }, + "phno": { + "description": "The user's phone number with country code (Ex: +1 for US, +91 for India, etc.)", + "type": "string", + "example": "+919591128691" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" }, - "receiver": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1639448370, - "conversationId": "cometchat-uid-1_user_cometchat-uid-2" - }, - "entityType": "user" + "example": { + "data": { + "email": "someone@example.com", + "phno": "+919591128691" + } } - } - }, - "sentAt": 1640171302, - "editedAt": 1641477338, - "editedBy": "app_system", - "updatedAt": 1641477338, - "tags": [ - "t6" - ] - }, - "entityType": "message" + } } - } - }, - "sentAt": 1641477338, - "updatedAt": 1641477338 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/messages/{id}/reactions": { - "get": { - "tags": [ - "Messages" - ], - "summary": "List all reactions", - "description": "Lists all the reactions for a message", - "operationId": "list-all-reactions", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message whose reactions are to be fetched.", - "required": true, - "schema": { - "type": "string" + } + }, + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - } - ], - "responses": { - "200": { - "description": "List Reactions", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "properties": { - "": { - "$ref": "#/components/schemas/reactionSchema" - } - }, - "type": "object" - } - }, - "meta": { - "properties": { - "": { - "$ref": "#/components/schemas/messageMetaSchema" + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete contact details", + "description": "Deletes the stored contact details for a given user.", + "operationId": "notifications-delete-contact-details", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + } + ], + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ - { - "id": "1", - "messageId": "2", - "reaction": ":reaction", - "uid": "cometchat-uid-1", - "reactedAt": 1700210335, - "reactedBy": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "status": "offline", - "role": "default", - "createdAt": 1698934972 - } - }, - { - "id": "2", - "messageId": "2", - "reaction": "😅", - "uid": "cometchat-uid-1", - "reactedAt": 1700210456, - "reactedBy": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "status": "offline", - "role": "default", - "createdAt": 1698934972 - } - }, - { - "id": "5", - "messageId": "2", - "reaction": "😒", - "uid": "cometchat-uid-2", - "reactedAt": 1700230866, - "reactedBy": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "status": "offline", - "role": "default", - "createdAt": 1698934987, - "conversationId": "cometchat-uid-1_user_cometchat-uid-2" - } - } - ], - "meta": { - "current": { - "limit": 100, - "count": 3 - }, - "next": { - "affix": "append", - "id": "5" + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/messages/{id}/reactions/{reaction}": { - "get": { - "tags": [ - "Messages" - ], - "summary": "List reactions with a specific emoji/unicodes", - "description": "List reactions with a specific emoji/unicodes for a message", - "operationId": "get-message-reactions", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message whose reactions are to be fetched.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - }, - { - "name": "reaction", - "in": "path", - "description": "reaction whose details are to be fetched.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Reaction", - "value": "😀" - } - } - } - ], - "responses": { - "200": { - "description": "Get Reactions", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "properties": { - "": { - "$ref": "#/components/schemas/reactionSchema" - } - }, - "type": "object" - } - }, - "meta": { - "properties": { - "": { - "$ref": "#/components/schemas/messageMetaSchema" + "/notifications/sms/v1/providers/twilio": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Get Twilio credentials", + "description": "Fetches the Twilio credentials stored for the app.", + "operationId": "notifications-sms-list-twilio-details", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "twilioAccountSID": "AC91e67951ff7e5e7be8122184e76ae0e6=", + "twilioAuthToken": "71c2301435733997e83db7a3445bc57", + "twilioSenderPhoneNumber": "+13611364718" + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ - { - "id": "1", - "messageId": "1", - "reaction": "😅", - "uid": "cometchat-uid-1", - "reactedAt": 1702638595, - "reactedBy": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "status": "available", - "role": "default", - "lastActiveAt": 1689082633, - "createdAt": 1684751861 - } - } - ], - "meta": { - "current": { - "limit": 100, - "count": 1 - }, - "next": { - "affix": "append", - "id": "1" + "security": [ + { + "apiKey": [] } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Messages" - ], - "summary": "Add reaction", - "description": "Adds a reaction to a message.", - "operationId": "add-message-reactions", - "parameters": [ - { - "$ref": "#/components/parameters/requiredonBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message to react.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - }, - { - "name": "reaction", - "in": "path", - "description": "reaction to react.", - "required": true, - "schema": { - "type": "string" + ] }, - "examples": { - "string": { - "summary": "Reaction", - "value": "😀" - } - } - } - ], - "responses": { - "200": { - "description": "Adding reaction", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/messageReactionSchema" + "post": { + "tags": [ + "Notifications" + ], + "summary": "Save Twilio credentials", + "description": "Store the Twilio credentials for the given app.", + "operationId": "notifications-sms-save-twilio-details", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "required": [ + "twilioAccountSID", + "twilioAuthToken", + "twilioSenderPhoneNumber" + ], + "properties": { + "twilioAccountSID": { + "description": "The Twilio Account SID", + "type": "string", + "example": "AC91e67951ff7e5e7be8122184e76ae0e6" + }, + "twilioAuthToken": { + "description": "The Twilio Auth Token", + "type": "string", + "example": "71c2301435733997e83db7a3445bc57" + }, + "twilioSenderPhoneNumber": { + "description": "The Twilio sender phone number", + "type": "string", + "example": "+13611364718" + }, + "isEnabled": { + "description": "Enable Twilio", + "type": "boolean" + } + }, + "type": "object" + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "id": "2", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2", - "sender": "cometchat-uid-1", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "message", - "type": "text", - "data": { - "text": "Hi,", - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "role": "default", - "status": "offline" - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "status": "offline", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2" - }, - "entityType": "user" - } - }, - "reactions": [ - { - "reaction": ":reaction", - "count": 1 - }, - { - "reaction": "😅", - "count": 1 - }, - { - "reaction": "😒", - "count": 1, - "reactedByMe": true - }, - { - "reaction": "🤨", - "count": 1, - "reactedByMe": true + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "twilioAccountSID": "AC91e67951ff7e5e7be8122184e76ae0e6=", + "twilioAuthToken": "71c2301435733997e83db7a3445bc57", + "twilioSenderPhoneNumber": "+13611364718" + } + } + } } - ] - }, - "sentAt": 1700210266, - "updatedAt": 1700210266 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Messages" - ], - "summary": "Remove reaction", - "description": "Removes a reaction from a message", - "operationId": "remove-message-reactions", - "parameters": [ - { - "$ref": "#/components/parameters/requiredonBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message whose reaction is to be removed.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - }, - { - "name": "reaction", - "in": "path", - "description": "reaction to be removed.", - "required": true, - "schema": { - "type": "string" + } + }, + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "Reaction", - "value": "😀" - } - } - } - ], - "responses": { - "200": { - "description": "Remove Reactions", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/messageReactionSchema" + "put": { + "tags": [ + "Notifications" + ], + "summary": "Update Twilio credentials", + "description": "Updates the Twilio credentials for the given app.", + "operationId": "notifications-sms-update-twilio-details", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "twilioAccountSID": { + "description": "The Twilio Account SID", + "type": "string", + "example": "AC91e67951ff7e5e7be8122184e76ae0e6" + }, + "twilioAuthToken": { + "description": "The Twilio Auth Token", + "type": "string", + "example": "71c2301435733997e83db7a3445bc57" + }, + "twilioSenderPhoneNumber": { + "description": "The Twilio sender phone number", + "type": "string", + "example": "+13611364718" + }, + "isEnabled": { + "description": "Enable Twilio", + "type": "boolean" + } + }, + "type": "object" + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "id": "2", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2", - "sender": "cometchat-uid-1", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "message", - "type": "text", - "data": { - "text": "Hi,", - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "role": "default", - "status": "offline" - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "status": "offline", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2" - }, - "entityType": "user" - } - }, - "reactions": [ - { - "reaction": ":reaction", - "count": 1 - }, - { - "reaction": "😅", - "count": 1 - }, - { - "reaction": "😒", - "count": 1, - "reactedByMe": true - } - ] - }, - "sentAt": 1700210266, - "updatedAt": 1700210266 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/conversations": { - "get": { - "tags": [ - "Conversations" - ], - "summary": "List conversations", - "description": "Fetching all the conversations", - "operationId": "list-all-conversations", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.\n\n\nIf onBehalfOf header is not passed,then list Conversations API will be ordered based on `uid`, `updatedAt` and then `conversationWith`\n\nIf onBehalfOf header is passed, then list Conversations API will be ordered based on `updatedAt` and then `conversationWith`.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "searchKey", - "in": "query", - "description": "Fetches conversations that include the specified searchKey, allowing you to search for conversations based on the name of a User or Group.", - "schema": { - "type": "string" - } - }, - { - "name": "conversationType", - "in": "query", - "description": "Retrieves only the specified conversation type (user and group) while fetching conversations list.", - "schema": { - "type": "string" - } - }, - { - "name": "withTags", - "in": "query", - "description": "Includes those groups that have tags.", - "schema": { - "type": "boolean" - } - }, - { - "name": "tags", - "in": "query", - "description": "Fetches only those groups that have these tags.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "withUserAndGroupTags", - "in": "query", - "description": "Retrieves conversations with tags", - "schema": { - "type": "boolean" - } - }, - { - "name": "userTags", - "in": "query", - "description": "Filters conversations by tags associated with the user entity in the conversationWith property.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "groupTags", - "in": "query", - "description": "Filters conversations by tags associated with the group entity in the conversationWith property.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - }, - { - "name": "unread", - "in": "query", - "description": "Lists only unread conversations by excluding the conversations with conversation.unreadMessageCount=0", - "schema": { - "type": "boolean" - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of conversations to be fetched in a request. The default value is 100 and the maximum value is 1000.", - "schema": { - "type": "integer", - "default": "100" - } - }, - { - "name": "page", - "in": "query", - "description": "Page number.", - "schema": { - "type": "integer", - "default": "1" - } - } - ], - "responses": { - "200": { - "description": "Get Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "conversationId": { - "type": "string" - }, - "conversationType": { - "type": "string" - }, - "unreadMessageCount": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "lastMessage": { - "type": "object" - }, - "conversationWith": { - "type": "object" - } + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "twilioAccountSID": "AC91e67951ff7e5e7be8122184e76ae0e6=-", + "twilioAuthToken": "71c2301435733997e83db7a3445bc57", + "twilioSenderPhoneNumber": "+13611364718" + } + } + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ - { - "conversationId": "group_project-group", - "conversationType": "group", - "unreadMessageCount": "0", - "createdAt": 1630071782, - "updatedAt": 1630481413, - "lastMessage": { - "id": "50", - "conversationId": "group_project-group", - "sender": "cometchat-uid-4", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "unbanned", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "createdAt": 1629869270 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-3", - "link": "https://data-us.cometchat.io/assets", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1629869270, - "updatedAt": 1629964825, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group1", - "type": "private", - "owner": "cometchat-uid-4", - "createdAt": 1630071341, - "updatedAt": 1630305525, - "updatedBy": "cometchat-uid-4", - "description": "project related discussions between members", - "membersCount": 4, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1630305562, - "updatedAt": 1630305562, - "receipts": { - "data": [ - [] - ] - } - }, - "conversationWith": { - "guid": "project-group", - "name": "Project Group1", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "private", - "scope": "participant", - "membersCount": 4, - "joinedAt": 1630071782, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1630071341, - "owner": "cometchat-uid-4", - "updatedAt": 1630308875, - "updatedBy": "cometchat-uid-4" - } - } - ], - "meta": { - "pagination": { - "total": 1, - "count": 1, - "per_page": 100, - "current_page": 1, - "total_pages": 1 + "security": [ + { + "apiKey": [] } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/conversations/{conversationId}": { - "get": { - "tags": [ - "Conversations" - ], - "summary": "Get conversation", - "description": "This API is deprecated please use Get User/Group ConversationAPI", - "operationId": "get-conversation", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/conversationId" - } - ], - "responses": { - "200": { - "description": "Get Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + ] + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete Twilio credentials", + "description": "Deletes the stored Twilio credentials for the given app.", + "operationId": "notifications-sms-delete-twilio-details", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": [ - { - "conversationId": "group_project-group", - "conversationType": "group", - "unreadMessageCount": "0", - "createdAt": 1630071782, - "updatedAt": 1630481413, - "lastMessage": { - "id": "50", - "conversationId": "group_project-group", - "sender": "cometchat-uid-4", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "unbanned", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "createdAt": 1629869270 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-3", - "link": "https://data-us.cometchat.io/assets", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1629869270, - "updatedAt": 1629964825, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group1", - "type": "private", - "owner": "cometchat-uid-4", - "createdAt": 1630071341, - "updatedAt": 1630305525, - "updatedBy": "cometchat-uid-4", - "description": "project related discussions between members", - "membersCount": 4, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1630305562, - "updatedAt": 1630305562, - "receipts": { - "data": [ - [] - ] - } - }, - "conversationWith": { - "guid": "project-group", - "name": "Project Group1", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "private", - "scope": "participant", - "membersCount": 4, - "joinedAt": 1630071782, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1630071341, - "owner": "cometchat-uid-4", - "updatedAt": 1630308875, - "updatedBy": "cometchat-uid-4" - } - } - ] - } - } - } - } - }, - "deprecated": true, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Conversations" - ], - "summary": "Delete Conversation", - "description": "This API is deprecated please use Reset User/GroupConversation API", - "operationId": "delete-conversation", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/conversationId" - } - ], - "responses": { - "200": { - "description": "Deleted Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "The conversation group_project-group has been deleted successfully for all the users." - } - } - } + ] } - } }, - "deprecated": true, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/conversation": { - "get": { - "tags": [ - "Conversations" - ], - "summary": "Get User Conversation", - "description": "Getting user conversation", - "operationId": "get-user-conversations", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/uid--conversation" - } - ], - "responses": { - "200": { - "description": "Get user Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/email/v1/providers/sendgrid": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Get SendGrid credentials", + "description": "Fetches the SendGrid credentials stored for the app.", + "operationId": "notifications-email-list-sendgrid-details", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "sendGridApiKey": "SG.9ipFP4b17yT-Fff2GGrH8FF0GqdkBohXAEI4GnTSj9Q=", + "sendGridTemplateID": "d-8284bb9646a040499d5cfa28d272a094", + "sendGridUnsubscribeGroupID": "33832", + "senderEmail": "noreply@em123.example.com", + "senderName": "Emailer" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": [ - { - "conversationId": "group_project-group", - "conversationType": "group", - "unreadMessageCount": "0", - "createdAt": 1630071782, - "updatedAt": 1630481413, - "lastMessage": { - "id": "50", - "conversationId": "group_project-group", - "sender": "cometchat-uid-4", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "unbanned", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "createdAt": 1629869270 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-3", - "link": "https://data-us.cometchat.io/assets", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1629869270, - "updatedAt": 1629964825, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group1", - "type": "private", - "owner": "cometchat-uid-4", - "createdAt": 1630071341, - "updatedAt": 1630305525, - "updatedBy": "cometchat-uid-4", - "description": "project related discussions between members", - "membersCount": 4, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1630305562, - "updatedAt": 1630305562 - }, - "conversationWith": { - "guid": "project-group", - "name": "Project Group1", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "private", - "scope": "participant", - "membersCount": 4, - "joinedAt": 1630071782, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1630071341, - "owner": "cometchat-uid-4", - "updatedAt": 1630308875, - "updatedBy": "cometchat-uid-4" - } - } - ] - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Conversations" - ], - "summary": "Update User Conversation", - "description": "Updating User Conversation", - "operationId": "update-user-conversation", - "parameters": [ - { - "$ref": "#/components/parameters/uid--conversation" - }, - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "tags": { - "description": "List of tags to identify specific conversation.", - "type": "array", - "items": { - "type": "string" + "security": [ + { + "apiKey": [] } - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Updated user Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + ] + }, + "post": { + "tags": [ + "Notifications" + ], + "summary": "Save SendGrid credentials", + "description": "Store the SendGrid credentials for the given app.", + "operationId": "notifications-email-save-sendgrid-details", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "required": [ + "sendGridApiKey", + "sendGridTemplateID", + "sendGridUnsubscribeGroupID", + "senderName", + "senderEmail", + "allowEmailReplies" + ], + "properties": { + "sendGridApiKey": { + "description": "The SendGrid API key", + "type": "string", + "example": "SG.9ipFP4b17yT-Fff2GGrH8FF0GqdkBohXAEI4GnTSj9Q=" + }, + "sendGridTemplateID": { + "description": "The SendGrid template ID", + "type": "string", + "example": "d-8284bb9646a040499d5cfa28d272a094" + }, + "sendGridUnsubscribeGroupID": { + "description": "The SendGrid unsubscribe group ID", + "type": "string", + "example": "33832" + }, + "senderName": { + "description": "The name of the sender", + "type": "string", + "example": "Emailer" + }, + "senderEmail": { + "description": "The email address of the sender", + "type": "string", + "example": "noreply@em123.example.com" + }, + "allowEmailReplies": { + "type": "boolean", + "default": false + }, + "senderEmailForReplies": { + "description": "The email address when replies are enabled (optional)", + "type": "string", + "example": "reply@em123.example.com", + "nullable": true + }, + "isEnabled": { + "description": "Enable SendGrid", + "type": "boolean" + } + }, + "type": "object" + } + } } - }, - "type": "object" - }, - "example": { - "data": [ - { - "conversationId": "group_project-group", - "conversationType": "group", - "unreadMessageCount": "0", - "createdAt": 1630071782, - "updatedAt": 1630481413, - "lastMessage": { - "id": "50", - "conversationId": "group_project-group", - "sender": "cometchat-uid-4", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "unbanned", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "createdAt": 1629869270 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-3", - "link": "https://data-us.cometchat.io/assets", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1629869270, - "updatedAt": 1629964825, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group1", - "type": "private", - "owner": "cometchat-uid-4", - "createdAt": 1630071341, - "updatedAt": 1630305525, - "updatedBy": "cometchat-uid-4", - "description": "project related discussions between members", - "membersCount": 4, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1630305562, - "updatedAt": 1630305562, - "receipts": { - "data": [ - [] - ] - } - }, - "conversationWith": { - "guid": "project-group", - "name": "Project Group1", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "private", - "scope": "participant", - "membersCount": 4, - "joinedAt": 1630071782, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1630071341, - "owner": "cometchat-uid-4", - "updatedAt": 1630308875, - "updatedBy": "cometchat-uid-4" - } - } - ] - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Conversations" - ], - "summary": "Reset User Conversation", - "description": "Resetting User Conversation", - "operationId": "reset-user-conversation", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/uid--conversation" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "conversationWith": { - "description": "UID of a user", - "type": "string" - }, - "deleteMessagesPermanently": { - "description": "Permanently deletes messages in that particular conversation", - "type": "boolean" - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Resetted user Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "allowEmailReplies": true, + "sendGridApiKey": "sendgrid_key", + "sendGridTemplateID": "template_id", + "sendGridUnsubscribeGroupID": "12312", + "senderEmail": "noreply@em123.example.com", + "senderEmailForReplies": "reply@em123.example.com", + "senderName": "Emailer", + "repliesWebhook": "https://notifications-us.cometchat.io/email/v1/sendgrid/replies?token=GY40_1kWlnc2Lo7Lk8vWWxiNJ6BmEEpV4eZsUeMr328" + } + } + } + } } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "The conversation cometchat-uid-1_user_cometchat-uid-2 has been deleted successfully for UID cometchat-uid-1." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/conversation/delivered": { - "post": { - "tags": [ - "Conversations" - ], - "summary": "Mark User Conversation As Delivered", - "description": "This API will mark the user conversation as delivered.", - "operationId": "mark-conversation-as-delivered", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the receiver of the message", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/uid--conversation" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "messageId": { - "description": "The id of the message upto which the conversation needs to be marked as delivered.", - "type": "integer" - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Marking Conversation as delivered", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Notifications" + ], + "summary": "Update SendGrid credentials", + "description": "Updates the SendGrid credentials for the given app.", + "operationId": "notifications-email-update-sendgrid-details", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "sendGridApiKey": { + "description": "The SendGrid API key", + "type": "string", + "example": "SG.9ipFP4b17yT-Fff2GGrH8FF0GqdkBohXAEI4GnTSj9Q=" + }, + "sendGridTemplateID": { + "description": "The SendGrid template ID", + "type": "string", + "example": "d-8284bb9646a040499d5cfa28d272a094" + }, + "sendGridUnsubscribeGroupID": { + "description": "The SendGrid unsubscribe group ID", + "type": "string", + "example": "33832" + }, + "senderName": { + "description": "The name of the sender", + "type": "string", + "example": "Emailer" + }, + "senderEmail": { + "description": "The email address of the sender", + "type": "string", + "example": "noreply@em123.example.com" + }, + "allowEmailReplies": { + "type": "boolean", + "default": false + }, + "senderEmailForReplies": { + "description": "The email address when replies are enabled (optional)", + "type": "string", + "example": "reply@em123.example.com", + "nullable": true + }, + "isEnabled": { + "description": "Enable SendGrid", + "type": "boolean" + } + }, + "type": "object" + } + } } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "Message": "All the messages from the user are marked as delivered for the requesting user." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/conversation/read": { - "post": { - "tags": [ - "Conversations" - ], - "summary": "Mark User Conversation As Read", - "description": "This API will mark the user conversation as read.", - "operationId": "mark-conversation-as-read", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the receiver of the message", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/uid--conversation" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "messageId": { - "description": "The id of the message upto which the conversation needs to be marked as read.", - "type": "integer" - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Marking Conversation as read", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "allowEmailReplies": true, + "sendGridApiKey": "sendgrid_key", + "sendGridTemplateID": "template_id", + "sendGridUnsubscribeGroupID": "12312", + "senderEmail": "noreply@em123.example.com", + "senderEmailForReplies": "reply@em123.example.com", + "senderName": "Emailer", + "repliesWebhook": "https://notifications-us.cometchat.io/email/v1/sendgrid/replies?token=GY40_1kWlnc2Lo7Lk8vWWxiNJ6BmEEpV4eZsUeMr328" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "Message": "All the messages from the user are marked as read for the requesting user." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Conversations" - ], - "summary": "Mark Conversation Messages As Unread", - "description": "Allows you to mark messages within a conversation as unread", - "operationId": "mark-conversation-as-unread", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the receiver of the message", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/uid--conversation" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "messageId": { - "description": "The id of the message upto which the conversation needs to be marked as unread.", - "type": "integer" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Marking Conversation as unread", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "The messages after the message id 340 from the user demo1 are marked as unread for the user demo3." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/conversation": { - "get": { - "tags": [ - "Conversations" - ], - "summary": "Get Group Conversation", - "description": "Getting group conversation", - "operationId": "get-group-conversations", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/guid--conversation" - } - ], - "responses": { - "200": { - "description": "Get user Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + ] + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete SendGrid credentials", + "description": "Deletes the stored SendGrid credentials for the given app.", + "operationId": "notifications-email-delete-sendgrid-details", + "responses": { + "200": { + "description": "A list of push notification's settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": {} + }, + "meta": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": [ - { - "conversationId": "group_project-group", - "conversationType": "group", - "unreadMessageCount": "0", - "createdAt": 1630071782, - "updatedAt": 1630481413, - "lastMessage": { - "id": "50", - "conversationId": "group_project-group", - "sender": "cometchat-uid-4", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "unbanned", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "createdAt": 1629869270 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-3", - "link": "https://data-us.cometchat.io/assets", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1629869270, - "updatedAt": 1629964825, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group1", - "type": "private", - "owner": "cometchat-uid-4", - "createdAt": 1630071341, - "updatedAt": 1630305525, - "updatedBy": "cometchat-uid-4", - "description": "project related discussions between members", - "membersCount": 4, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1630305562, - "updatedAt": 1630305562 - }, - "conversationWith": { - "guid": "project-group", - "name": "Project Group1", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "private", - "scope": "participant", - "membersCount": 4, - "joinedAt": 1630071782, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1630071341, - "owner": "cometchat-uid-4", - "updatedAt": 1630308875, - "updatedBy": "cometchat-uid-4" - } - } - ] - } - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Conversations" - ], - "summary": "Update Group Conversation", - "description": "Updating Group Conversation", - "operationId": "update-group-conversation", - "parameters": [ - { - "$ref": "#/components/parameters/guid--conversation" - }, - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "tags": { - "description": "List of tags to identify specific conversation.", - "type": "array", - "items": { - "type": "string" + "/notifications/push/v1/providers/custom": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Get Custom Provider for Push Notifications", + "description": "Fetches the custom provider for Push Notifications for a given app.", + "operationId": "notifications-list-push-custom-provider", + "responses": { + "200": { + "description": "A list of push notification's custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "pushProviders": [ + { + "basicAuthUsername": "user123", + "basicAuthPassword": "pass123", + "useBasicAuth": true, + "isEnabled": true, + "webhookURL": "https://trigger-push.example.com/cometchat" + } + ] + } + } + } + } } - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Updated user Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] + } + ] + }, + "post": { + "tags": [ + "Notifications" + ], + "summary": "Save Custom Provider for Push Notifications", + "description": "Saves the custom provider for Push Notifications for a given app.", + "operationId": "notifications-save-push-custom-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "isEnabled", + "webhookURL", + "basicAuthUsername", + "basicAuthPassword", + "useBasicAuth" + ], + "properties": { + "isEnabled": { + "description": "Use custom provider", + "type": "boolean" + }, + "webhookURL": { + "description": "The webhook URL to be triggered for the respective events.", + "type": "string" + }, + "useBasicAuth": { + "description": "To enable basic auth for the URL", + "type": "boolean" + }, + "basicAuthUsername": { + "description": "The username for Basic auth", + "type": "string" + }, + "basicAuthPassword": { + "description": "The password for Basic auth", + "type": "string" + } + }, + "type": "object" + } + } } - }, - "type": "object" }, - "example": { - "data": [ - { - "conversationId": "group_project-group", - "conversationType": "group", - "unreadMessageCount": "0", - "createdAt": 1630071782, - "updatedAt": 1630481413, - "lastMessage": { - "id": "50", - "conversationId": "group_project-group", - "sender": "cometchat-uid-4", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "unbanned", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "createdAt": 1629869270 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-3", - "link": "https://data-us.cometchat.io/assets", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "createdAt": 1629869270, - "updatedAt": 1629964825, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group1", - "type": "private", - "owner": "cometchat-uid-4", - "createdAt": 1630071341, - "updatedAt": 1630305525, - "updatedBy": "cometchat-uid-4", - "description": "project related discussions between members", - "membersCount": 4, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1630305562, - "updatedAt": 1630305562, - "receipts": { - "data": [ - [] - ] - } - }, - "conversationWith": { - "guid": "project-group", - "name": "Project Group1", - "description": "project related discussions between members", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "type": "private", - "scope": "participant", - "membersCount": 4, - "joinedAt": 1630071782, - "conversationId": "group_project-group", - "hasJoined": true, - "createdAt": 1630071341, - "owner": "cometchat-uid-4", - "updatedAt": 1630308875, - "updatedBy": "cometchat-uid-4" - } - } - ] - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Conversations" - ], - "summary": "Reset Group Conversation", - "description": "Resetting Group Conversation", - "operationId": "reset-group-conversation", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/guid--conversation" - } - ], - "responses": { - "200": { - "description": "Resetted user Conversations", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "Save push notification's custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "pushProviders": [ + { + "basicAuthUsername": "user123", + "basicAuthPassword": "pass123", + "useBasicAuth": true, + "isEnabled": true, + "webhookURL": "https://trigger-push.example.com/cometchat" + } + ] + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "The conversation cometchat-uid-1_user_cometchat-uid-2 has been deleted successfully for UID cometchat-uid-1." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/conversation/delivered": { - "post": { - "tags": [ - "Conversations" - ], - "summary": "Mark Group Conversation As Delivered", - "description": "This API will mark the group conversation as delivered.", - "operationId": "mark-group-conversation-as-delivered", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the receiver of the message", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/guid--conversation" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "messageId": { - "description": "The id of the message upto which the conversation needs to be marked as delivered.", - "type": "integer" - } + "security": [ + { + "apiKey": [] + } + ] + }, + "put": { + "tags": [ + "Notifications" + ], + "summary": "Update Custom Provider for Push Notifications", + "description": "Updates the custom provider for Push Notifications for a given app.", + "operationId": "notifications-update-push-custom-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "isEnabled": { + "description": "Use custom provider", + "type": "boolean" + }, + "webhookURL": { + "description": "The webhook URL to be triggered for the respective events.", + "type": "string" + }, + "useBasicAuth": { + "description": "To enable basic auth for the URL", + "type": "boolean" + }, + "basicAuthUsername": { + "description": "The username for Basic auth", + "type": "string" + }, + "basicAuthPassword": { + "description": "The password for Basic auth", + "type": "string" + } + }, + "type": "object" + } + } + } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Marking Conversation as delivered", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "A list of push notification's custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "pushProviders": [ + { + "basicAuthUsername": "user123", + "basicAuthPassword": "pass123", + "useBasicAuth": true, + "isEnabled": true, + "webhookURL": "https://trigger-push.example.com/cometchat" + } + ] + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "All the messages in the group are marked as delivered for the requesting user." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/conversation/read": { - "post": { - "tags": [ - "Conversations" - ], - "summary": "Mark Group Conversation As Read", - "description": "This API will mark the group conversation as read.", - "operationId": "mark-group-conversation-as-read", - "parameters": [ - { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the receiver of the message", - "required": true, - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/guid--conversation" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "messageId": { - "description": "The id of the message upto which the conversation needs to be marked as read.", - "type": "integer" - } + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete the Custom Provider for Push Notifications", + "description": "Deletes the custom provider for Push Notifications for a given app.", + "operationId": "notifications-delete-push-custom-provider", + "responses": { + "200": { + "description": "A list of push notification's custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } + } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Marking Conversation as read", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/sms/v1/providers/custom": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Get Custom Provider for SMS Notifications", + "description": "Fetches the custom provider for SMS Notifications for a given app.", + "operationId": "notifications-list-sms-custom-provider", + "responses": { + "200": { + "description": "A list of push notification's custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "basicAuthPassword": "user888", + "basicAuthUsername": "pass123", + "isEnabled": true, + "useBasicAuth": true, + "useStoredPhNo": false, + "webhookURL": "https://trigger-sms.example.com/cometchat" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "All the messages in the group are marked as read for the requesting user." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Conversations" - ], - "summary": "Mark Group Conversation As Unread", - "description": "This API will mark the group conversation as unread.", - "operationId": "mark-group-conversation-as-unread", - "parameters": [ - { - "$ref": "#/components/parameters/guid--conversation" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "messageId": { - "description": "The id of the message upto which the conversation needs to be marked as unread.", - "type": "integer" - } + "security": [ + { + "apiKey": [] + } + ] + }, + "post": { + "tags": [ + "Notifications" + ], + "summary": "Save Custom Provider for SMS Notifications", + "description": "Saves the custom provider for SMS Notifications for a given app.", + "operationId": "notifications-save-sms-custom-provider", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "required": [ + "isEnabled", + "useStoredPhNo", + "webhookURL", + "basicAuthUsername", + "basicAuthPassword", + "useBasicAuth" + ], + "properties": { + "useStoredPhNo": { + "description": "If enabled, the webhook will be triggered for a user only if their phone number is stored within CometChat.", + "type": "boolean", + "default": false + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/CustomSMSProviderConfig" + } + ] + } + } + } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Marking Conversation as unread", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "Save the push notification's SMS custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "basicAuthUsername": "user889", + "basicAuthPassword": "pass122", + "isEnabled": true, + "useBasicAuth": true, + "useStoredPhNo": false, + "webhookURL": "https://trigger-sms.example.com/cometchat" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "The messages after the message id 340 from the user demo1 are marked as unread for the user demo3." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/auth_tokens": { - "post": { - "tags": [ - "Auth Tokens" - ], - "summary": "Create", - "description": "Creates auth token for a user with the specified UID.", - "operationId": "create-authtoken", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "force": { - "description": "Generates new auth token forcefully.", - "type": "boolean" - } + "put": { + "tags": [ + "Notifications" + ], + "summary": "Update Custom Provider for SMS Notifications", + "description": "Updates the custom provider for SMS Notifications for a given app.", + "operationId": "notifications-update-sms-custom-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomSMSProviderConfig" + } + } + } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Created auth token", - "content": { - "application/json": { - "schema": { - "type": "object" + "responses": { + "200": { + "description": "Save the push notification's SMS custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "basicAuthUsername": "user889", + "basicAuthPassword": "pass122", + "isEnabled": true, + "useBasicAuth": true, + "useStoredPhNo": false, + "webhookURL": "https://trigger-sms.example.com/cometchat" + } + } + } + } + } }, - "example": { - "data": { - "uid": "cometchat-uid-1", - "authToken": "cometchat-uid-1_1630306819c3027ce530b2367f3c97b4106f0cb8", - "createdAt": 1630306819 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Auth Tokens" - ], - "summary": "List", - "description": "Lists auth tokens for a user with the specified UID.", - "operationId": "list-authtokens", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of auth tokens to return per page.", - "schema": { - "type": "number", - "default": 100 - } - }, - { - "name": "page", - "in": "query", - "description": "Page number for paginated results.", - "schema": { - "type": "number", - "default": 1 - } - } - ], - "responses": { - "200": { - "description": "A list of auth tokens", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "authToken": { - "type": "string", - "description": "The authentication token string" - }, - "uid": { - "type": "string", - "description": "UID of the user this token belongs to" - }, - "createdAt": { - "type": "integer", - "description": "Unix timestamp of token creation" - }, - "platform": { - "type": "string", - "description": "Platform the token was created for" - }, - "userAgent": { - "type": "string", - "description": "User agent string of the client" - }, - "appInfo": { - "type": "string", - "description": "Application information" - } + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete the Custom Provider for SMS Notifications", + "description": "Deletes the custom provider for SMS Notifications for a given app.", + "operationId": "notifications-delete-sms-custom-provider", + "responses": { + "200": { + "description": "Delete push notification's SMS custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ + "security": [ { - "uid": "cometchat-uid-1", - "authToken": "cometchat-uid-1_1630306819c3027ce530b2367f3c97b4106f0cb8", - "createdAt": 1630306819 - } - ], - "meta": { - "pagination": { - "total": 1, - "count": 1, - "per_page": 100, - "current_page": 1, - "total_pages": 1 + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Auth Tokens" - ], - "summary": "Flush", - "description": "Deletes all the auth tokens for the specified UID.", - "operationId": "flush-authtokens", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - } - ], - "responses": { - "200": { - "description": "A list of api keys", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/notifications/email/v1/providers/custom": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Get Custom Provider for Email Notifications", + "description": "Fetches the custom provider for Email Notifications for a given app.", + "operationId": "notifications-list-email-custom-provider", + "responses": { + "200": { + "description": "A list of push notification's email custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "basicAuthUsername": "user889", + "basicAuthPassword": "pass122", + "isEnabled": true, + "useBasicAuth": true, + "useStoredEmailID": false, + "webhookURL": "https://trigger-email.example.com/cometchat" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "Cleared Auth Tokens successfully for uid cometchat-uid-1." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/auth_tokens/{authToken}": { - "get": { - "tags": [ - "Auth Tokens" - ], - "summary": "Get", - "description": "Retrieves details of an auth token for the specified UID andauth token.", - "operationId": "get-authtoken", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - { - "$ref": "#/components/parameters/authToken" - } - ], - "responses": { - "200": { - "description": "Retrieve Auth Token", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "post": { + "tags": [ + "Notifications" + ], + "summary": "Save Custom Provider for Email Notifications", + "description": "Saves the custom provider for Email Notifications for a given app.", + "operationId": "notifications-save-email-custom-provider", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/CustomEmailProviderConfig" + }, + { + "required": [ + "isEnabled", + "useStoredEmailID", + "webhookURL", + "basicAuthUsername", + "basicAuthPassword", + "useBasicAuth" + ] + } + ] + } + } } - }, - "type": "object" }, - "example": { - "data": { - "uid": "cometchat-uid-1", - "authToken": "cometchat-uid-1_1630306819c3027ce530b2367f3c97b4106f0cb8", - "createdAt": 1630306819 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Auth Tokens" - ], - "summary": "Update", - "description": "Updates the details of an auth token for the specified UID andauth token.", - "operationId": "update-authtoken", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - { - "name": "authToken", - "in": "path", - "description": "An auth token of a user.", - "required": true, - "schema": { - "type": "string" + "responses": { + "200": { + "description": "Save the push notification's SMS custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "basicAuthUsername": "user889", + "basicAuthPassword": "pass122", + "isEnabled": true, + "useBasicAuth": true, + "useStoredEmailID": false, + "webhookURL": "https://trigger-email.example.com/cometchat" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "Auth Token", - "value": "cometchat-uid-1_1625206799abcdef" - } - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "platform": { - "description": "The platform on which the auth token is being used.", - "type": "string" - }, - "userAgent": { - "description": "userAgent from which the auth token is used.", - "type": "string" - }, - "appInfo": { - "description": "JSON data containing app information.", - "type": "object" - } + "put": { + "tags": [ + "Notifications" + ], + "summary": "Update Custom Provider for Email Notifications", + "description": "Updates the custom provider for Email Notifications for a given app.", + "operationId": "notifications-update-email-custom-provider", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomEmailProviderConfig" + } + } + } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Updated Auth Token", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "Update the push notification's Email custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "basicAuthUsername": "user889", + "basicAuthPassword": "pass122", + "isEnabled": true, + "useBasicAuth": true, + "useStoredEmailID": false, + "webhookURL": "https://trigger-email.example.com/cometchat" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "uid": "cometchat-uid-1", - "authToken": "cometchat-uid-1_1630306819c3027ce530b2367f3c97b4106f0cb8", - "createdAt": 1630306819 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Auth Tokens" - ], - "summary": "Delete", - "description": "Deletes an auth token for the specified UID.", - "operationId": "delete-authtoken", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - { - "name": "authToken", - "in": "path", - "description": "An auth token of a user.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "Auth Token", - "value": "cometchat-uid-1_1625206799abcdef" - } - } - } - ], - "responses": { - "200": { - "description": "Deleted Auth token", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "delete": { + "tags": [ + "Notifications" + ], + "summary": "Delete the Custom Provider for Email Notifications", + "description": "Deletes the custom provider for Email Notifications for a given app.", + "operationId": "notifications-delete-email-custom-provider", + "responses": { + "200": { + "description": "Delete push notification's Email custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "success": true + } + } + } + } } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "User with cometchat-uid-6 has been deleted successfully." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/members": { - "post": { - "tags": [ - "Group Members" - ], - "summary": "Add members", - "description": "Adds multiple users as per the scope.", - "operationId": "add-group-members", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "admins": { - "description": "UIDs of users to be made admins.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "moderators": { - "description": "UIDs of users to be made moderators.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "participants": { - "description": "UIDs of users to be made participants.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "usersToBan": { - "description": "UIDs of the users to be banned from the group.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Create Group Members", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "usersToBan": { - "cometchat-uid-6": { - "success": true - } + "/notifications/v1/logs": { + "get": { + "tags": [ + "Notifications" + ], + "summary": "Notifications logs", + "description": "Paginated API to fetch logs for notifications", + "operationId": "notifications-logs", + "parameters": [ + { + "name": "messageId", + "in": "query", + "description": "To filter based on the ID of message or reply.", + "required": false, + "schema": { + "type": "integer" + } }, - "admins": { - "cometchat-uid-1": { - "success": true, - "data": { - "id": "32", - "conversationId": "group_project-group", - "sender": "app_system", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "added", - "entities": { - "by": { - "entity": { - "uid": "app_system", - "name": "System", - "role": "default", - "status": "offline", - "createdAt": 1596537299 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "status": "offline", - "createdAt": 1596537299 - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group", - "tags": [ - "friends", - "project" - ], - "type": "public", - "owner": "cometchat-uid-2", - "createdAt": 1625460947, - "description": "project related discussions between members", - "membersCount": 2, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1625460972, - "updatedAt": 1625460972 + { + "name": "reactionId", + "in": "query", + "description": "To filter based on the ID of the reaction added.", + "required": false, + "schema": { + "type": "integer" } - } }, - "moderators": { - "cometchat-uid-3": { - "success": true, - "data": { - "id": "33", - "conversationId": "group_project-group", - "sender": "app_system", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "added", - "entities": { - "by": { - "entity": { - "uid": "app_system", - "name": "System", - "role": "default", - "status": "offline", - "createdAt": 1596537299 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "createdAt": 1596537299, - "updatedAt": 1625234590 - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group", - "tags": [ - "friends", - "project" - ], - "type": "public", - "owner": "cometchat-uid-2", - "createdAt": 1625460947, - "updatedAt": 1625460972, - "description": "project related discussions between members", - "membersCount": 3, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1625460973, - "updatedAt": 1625460973 + { + "name": "from", + "in": "query", + "description": "To get the logs for messages that are sent after the mentioned timestamp in milliseconds.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" } - } }, - "participants": { - "cometchat-uid-4": { - "success": true, - "data": { - "id": "34", - "conversationId": "group_project-group", - "sender": "app_system", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "added", - "entities": { - "by": { - "entity": { - "uid": "app_system", - "name": "System", - "role": "default", - "status": "offline", - "createdAt": 1596537299 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "createdAt": 1596537299 - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group", - "tags": [ - "friends", - "project" - ], - "type": "public", - "owner": "cometchat-uid-2", - "createdAt": 1625460947, - "updatedAt": 1625460973, - "description": "project related discussions between members", - "membersCount": 4, - "conversationId": "group_project-group" - }, - "entityType": "group" - } - } - }, - "sentAt": 1625460973, - "updatedAt": 1625460973 - } - }, - "cometchat-uid-5": { - "success": true, - "data": { - "id": "35", - "conversationId": "group_project-group", - "sender": "app_system", - "receiverType": "group", - "receiver": "project-group", - "category": "action", - "type": "groupMember", - "data": { - "action": "added", - "entities": { - "by": { - "entity": { - "uid": "app_system", - "name": "System", - "role": "default", - "status": "offline", - "createdAt": 1596537299 - }, - "entityType": "user" - }, - "on": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "createdAt": 1596537299 - }, - "entityType": "user" - }, - "for": { - "entity": { - "guid": "project-group", - "icon": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "name": "Project Group", - "tags": [ - "friends", - "project" - ], - "type": "public", - "owner": "cometchat-uid-2", - "createdAt": 1625460947, - "updatedAt": 1625460973, - "description": "project related discussions between members", - "membersCount": 5, - "conversationId": "group_project-group" + { + "name": "to", + "in": "query", + "description": "To get the logs for messages that are sent after the mentioned timestamp in milliseconds.", + "required": false, + "schema": { + "type": "integer", + "format": "int64" + } + }, + { + "name": "messageCategory", + "in": "query", + "description": "To filter logs based on the category of the message or reply. Values can be message, interactive.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "message", + "interactive" + ] + } + }, + { + "name": "messageType", + "in": "query", + "description": "To filter logs based on the type of the message or reply. Values are based on the message category.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "trigger", + "in": "query", + "description": "To filter based on the trigger value of the event that is responsible for triggering the notification.\nFor a message or a reply, the value of this field is after_message.\nFor message actions, the values are message_deleted or message_edited or message_reaction_added.\nFor default calling feature, the values are initiated, rejected, cancelled, unanswered.\nFor group events, the values are: after_group_joined, after_group_left, after_group_members_added, after_group_members_kicked, after_group_members_banned, after_group_members_unbanned, after_scope_changed.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "after_message", + "message_deleted", + "message_edited", + "message_reaction_added", + "initiated", + "rejected", + "cancelled", + "unanswered", + "after_group_joined", + "after_group_left", + "after_group_members_added", + "after_group_members_kicked", + "after_group_members_banned", + "after_group_members_unbanned", + "after_scope_changed" + ] + } + }, + { + "name": "sender", + "in": "query", + "description": "To filter based on the sender of the message. This has to be uid.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "reactionSender", + "in": "query", + "description": "To filter based on the user who reacted on a message.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "receiver", + "in": "query", + "description": "To filter based on the receiver of a message. This can be uid or guid based on the receiverType.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "receiverType", + "in": "query", + "description": "To filter based on the receiver's type. The value of this field can be user or group.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "user", + "group" + ] + } + }, + { + "name": "reactionReceiver", + "in": "query", + "description": "To filter based on the user who is notified when a reaction is added.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "member", + "in": "query", + "description": "To filter based on the user who is notified in a given group. This is only present when the receiverType is group.", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "channel", + "in": "query", + "description": "To filter based on whether the user was notified using push, email or sms notification.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "push", + "email", + "sms" + ] + } + }, + { + "name": "provider", + "in": "query", + "description": "To filter based on the provider.\nFor channel as push, the value of this field can be fcm, apns, custom.\nFor channel as email, the value of this field can be sendgrid or custom.\nFor channel as sms, the value of this field can be twilio or custom.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "fcm", + "apns", + "sendgrid", + "twilio", + "custom" + ] + } + }, + { + "name": "notificationTriggered", + "in": "query", + "description": "The value is true when the notification provider is triggered. If false, the notification was not triggered due to some preference that is mentioned in the reason field.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "reason", + "in": "query", + "description": "Available only when the value of notificationTriggered is false.\nThis contains the reason for not triggering the notification provider.\n\nTo filter logs using reason, use the following values: MESSAGES_PREFERENCE, REPLIES_PREFERENCE, MESSAGE_ACTIONS_PREFERENCE, REACTIONS_PREFERENCE, GROUP_ACTIONS_PREFERENCE, DND_PREFERENCE, MUTE_PREFERENCE, SCHEDULE_PREFERENCE, CALL_PREFERENCE, QUOTA_PREFERENCE, MISSING_EMAIL, MISSING_PHNO, INVALID_PUSH_PROVIDER_ID, TIMED_OUT, NOT_FOUND, TWILIO_CREATE_ERROR.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "MESSAGES_PREFERENCE", + "REPLIES_PREFERENCE", + "MESSAGE_ACTIONS_PREFERENCE", + "REACTIONS_PREFERENCE", + "GROUP_ACTIONS_PREFERENCE", + "DND_PREFERENCE", + "MUTE_PREFERENCE", + "SCHEDULE_PREFERENCE", + "CALL_PREFERENCE", + "QUOTA_PREFERENCE", + "MISSING_EMAIL", + "MISSING_PHNO", + "INVALID_PUSH_PROVIDER_ID", + "TIMED_OUT", + "NOT_FOUND", + "TWILIO_CREATE_ERROR" + ] + } + }, + { + "name": "success", + "in": "query", + "description": "Available only when the value of notificationTriggered is true.\n\nTo filter based on whether the HTTP request to the provider was successful or not, true indicating that the provider returned success while false indicating that the provider returned an error.", + "required": false, + "schema": { + "type": "boolean" + } + }, + { + "name": "affix", + "in": "query", + "description": "To paginate over logs use the value of affix as prepend or append.", + "required": false, + "schema": { + "type": "string", + "enum": [ + "prepend", + "append" + ] + } + }, + { + "name": "logId", + "in": "query", + "description": "To be used with affix for pagination.", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "A list of push notification's email custom provider", + "content": { + "application/json": { + "schema": { + "type": "object" }, - "entityType": "group" - } + "example": { + "data": [ + { + "_id": "67e3c56babf90e20e2652edb", + "processingStartedAtMS": 1742980459696, + "processingEndedAtMS": 1742980459738, + "totalProcessingTimeInMS": 42, + "component": "notifications-core", + "channel": "push", + "provider": "apns", + "messageId": 3939, + "reactionId": 69, + "trigger": "message_reaction_added", + "messageSentAtMS": 1742980459000, + "sender": "cometchat-uid-4", + "reactionSender": "cometchat-uid-1", + "receiver": "cometchat-guid-1", + "reactionReceiver": "g-muted-yes", + "receiverType": "group", + "member": "g-muted-yes", + "tokenType": "apns_ios_device", + "pushToken": "pushtoken123", + "providerId": "apns-provider", + "payload": { + "payload": { + "title": "cometchat-uid-1", + "body": "Reacted to your message: 😂", + "tag": "69", + "sender": "cometchat-uid-1", + "senderName": "cometchat-uid-1", + "receiver": "cometchat-guid-1", + "receiverName": "cometchat-guid-1", + "receiverType": "group", + "conversationId": "group_cometchat-guid-1", + "type": "chat", + "sessionId": null, + "callAction": null, + "callType": null, + "sentAt": null + }, + "contentAvailable": 1, + "mutableContent": 1, + "topic": "com.example.com", + "alert": { + "title": "cometchat-uid-1", + "body": "Reacted to your message: 😂" + }, + "priority": 10, + "pushType": "alert", + "sound": "default", + "collapseId": "69", + "expiry": 1742984059, + "type": "apns" + }, + "notificationTriggered": false, + "reason": "MUTE_PREFERENCE" + } + ], + "meta": { + "previous": { + "affix": "prepend", + "messageId": 3939 + }, + "current": { + "limit": 20, + "count": 20 + }, + "next": { + "affix": "append", + "messageId": 3939 + } + } + } } - }, - "sentAt": 1625460973, - "updatedAt": 1625460973 } - } } - } - } - } + }, + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Group Members" - ], - "summary": "List", - "description": "List the members of a group for a given GUID", - "operationId": "list-group-members", - "parameters": [ - { - "$ref": "#/components/parameters/guid" - }, - { - "name": "perPage", - "in": "query", - "description": "Number of users to be fetched in a request. The default value is 100 and the maximum value is 1000.", - "schema": { - "type": "integer", - "default": "100" - } - }, - { - "name": "status", - "in": "query", - "description": "Group members list can be fetched depending on the user status. (available,offline).", - "schema": { - "type": "string", - "enum": [ - "available", - "offline" - ], - "description": "User status filter." - } - }, - { - "name": "page", - "in": "query", - "description": "Page Number.", - "schema": { - "type": "integer", - "default": "1" - } - }, - { - "name": "scopes", - "in": "query", - "description": "Fetches group members based on multiple scope.", - "style": "form", - "explode": false, - "schema": { - "type": "array", - "items": {} - } - } - ], - "responses": { - "200": { - "description": "Create Group Members", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array" - }, - "meta": { - "type": "object" + "/moderation/rules": { + "post": { + "tags": [ + "Moderation" + ], + "summary": "Add Rule", + "description": "Create a new moderation rule to specify actions and conditions for detecting and handling inappropriate content.", + "operationId": "chat-api-create-rule", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModerationRequestBody" + } + } + } + }, + "responses": { + "200": { + "description": "Created Rule", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/ModerationData" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "moderation-test", + "name": "Video Moderation", + "description": "AI-powered video moderation to detect unsafe content.", + "enabled": true, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "image", + "category": "word", + "operator": "contains", + "value": [ + "violence_greaterThan_30" + ], + "message": [ + "Image contains violence with confidence greater than 30" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1720003247, + "updatedAt": 1720003247, + "revisionId": "253179cf5f665257_moderation-test_1" + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "get": { + "tags": [ + "Moderation" + ], + "summary": "List Rules", + "description": "Retrieve a list of all moderation rules.", + "operationId": "chat-api-list-rules", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "The number of records to fetch.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "List Rule", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "moderation-test", + "name": "Video Moderation", + "description": "AI-powered video moderation to detect unsafe content.", + "enabled": true, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "image", + "category": "word", + "operator": "contains", + "value": [ + "violence_greaterThan_30" + ], + "message": [ + "Image contains violence with confidence greater than 30" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1720003247, + "updatedAt": 1720003247, + "revisionId": "253179cf5f665257_moderation-test_1" + }, + { + "id": "video-moderation1", + "name": "Video Moderation", + "description": "AI-powered video moderation to detect unsafe content.", + "enabled": true, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "image", + "category": "word", + "operator": "contains", + "value": [ + "violence_greaterThan_30" + ], + "message": [ + "Image contains violence with confidence greater than 30" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1720000488, + "updatedAt": 1720000488, + "revisionId": "253179cf5f665257_video-moderation1_1" + }, + { + "id": "text-profanity-filter", + "name": "Text Profanity filter", + "description": "Detect and censor profanity in text messages.", + "enabled": true, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": true, + "isMediaPresent": false, + "entity": "message", + "operand": "text", + "category": "word", + "operator": "contains", + "value": [ + "profanity-list" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1718355386, + "updatedAt": 1720006272, + "revisionId": "253157108b5294c4_profanity-filter_25", + "default": true + }, + { + "id": "image-moderation", + "name": "AI Image Moderation", + "description": "AI-powered image moderation to detect unsafe content.", + "enabled": false, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "image", + "category": "word", + "operator": "contains", + "value": [ + "AnyOf_greaterThan_30" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1718350200, + "updatedAt": 1719932600, + "revisionId": "253157108b5294c4_image-moderation_11", + "default": true + }, + { + "id": "video-moderation", + "name": "AI Video Moderation", + "description": "AI-powered video moderation to detect unsafe content.", + "enabled": false, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "video", + "category": "word", + "operator": "contains", + "value": [ + "AnyOf_greaterThan_30" + ] + } + ], + "action": [ + "dropMessage" + ], + "active": true, + "createdAt": 1718350199, + "updatedAt": 1720006008, + "revisionId": "253157108b5294c4_video-moderation_10", + "default": true + }, + { + "id": "custom-profanity-filter", + "name": "Custom Profanity filter", + "description": "Detect and censor profanity in custom messages.", + "enabled": false, + "conditions": [ + { + "id": 1, + "isListReferencePresent": true, + "isMediaPresent": false, + "entity": "message", + "operand": "custom", + "category": "word", + "operator": "contains", + "value": [ + "profanity-list" + ] + } + ], + "action": [ + "dropMessage" + ], + "active": true, + "createdAt": 1718341200, + "updatedAt": 1719819136, + "revisionId": "253157108b5294c4_profanity-filter_8", + "default": true + }, + { + "id": "contact_details_filter", + "name": "Contact details filter", + "description": "Identifies and removes phone numbers from text", + "enabled": false, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": false, + "entity": "message", + "operand": "text", + "category": "pattern", + "operator": "contains", + "value": [ + "\\\\+?(\\\\d{1,3})?{-.\\\\s}?\\\\(?\\\\d{1,4}?\\\\)?{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,9}" + ] + }, + { + "id": 2, + "isKeywordsReferencePresent": false, + "isMediaPresent": false, + "entity": "message", + "operand": "custom", + "category": "pattern", + "operator": "contains", + "value": [ + "\\\\+?(\\\\d{1,3})?{-.\\\\s}?\\\\(?\\\\d{1,4}?\\\\)?{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,9}" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1718186338, + "updatedAt": 1719836048, + "revisionId": "2531882e5e289115_contact_details_filter_3", + "default": true + }, + { + "id": "email_filter", + "name": "Email filter", + "description": "Identify and remove email address from messages", + "enabled": false, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": false, + "entity": "message", + "operand": "text", + "category": "pattern", + "operator": "contains", + "value": [ + "^{a-zA-Z0-9._%+-}+@{a-zA-Z0-9.-}+\\\\.{a-zA-Z}{2,}$" + ] + }, + { + "id": 2, + "isKeywordsReferencePresent": false, + "isMediaPresent": false, + "entity": "message", + "operand": "custom", + "category": "pattern", + "operator": "contains", + "value": [ + "^{a-zA-Z0-9._%+-}+@{a-zA-Z0-9.-}+\\\\.{a-zA-Z}{2,}$" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1718099938, + "updatedAt": 1719836049, + "revisionId": "2531882e5e289115_contact_email_filter_5", + "default": true + } + ], + "meta": { + "current": { + "limit": 50, + "count": 8 + } + } + } + } + } } - }, - "type": "object" - }, - "example": { - "data": [ - { - "uid": "cometchat-uid-2", - "name": "George Alan", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "role": "default", - "scope": "participant", - "joinedAt": 1638360106, - "createdAt": 1629869270, - "updatedAt": 1630308676, - "conversationId": "cometchat-uid-2_user_cometchat-uid-4" - }, - { - "uid": "cometchat-uid-3", - "name": "George Alan", - "link": "https://data-us.cometchat.io/assets", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "metadata": { - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "default", - "scope": "participant", - "joinedAt": 1638360106, - "createdAt": 1629869270, - "updatedAt": 1638351060, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - { - "uid": "cometchat-uid-5", - "name": "John Paul", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "role": "default", - "scope": "moderator", - "joinedAt": 1638360106, - "createdAt": 1629869270, - "conversationId": "cometchat-uid-4_user_cometchat-uid-5" - }, - { - "uid": "cometchat-uid-4", - "name": "Susan Marie", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-4.webp", - "status": "offline", - "role": "default", - "scope": "admin", - "joinedAt": 1638359534, - "createdAt": 1629869270 - } - ], - "meta": { - "pagination": { - "total": 0, - "count": 5, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - } - }, - "cursor": { - "updatedAt": 1638354799, - "affix": "prepend" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/members/{uid}": { - "put": { - "tags": [ - "Group Members" - ], - "summary": "Change Scope", - "description": "Change scope of a member to the group for a given GUID and UID", - "operationId": "change-group-member-scope", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - }, - { - "$ref": "#/components/parameters/uid" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "scope": { - "description": "A scope for the user.", - "type": "string", - "default": "participant" - } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Changed Scope of Group Members", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "guid": { - "type": "string" - }, - "uid": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "joinedAt": { - "type": "integer" + "/moderation/rules/{ruleId}": { + "get": { + "tags": [ + "Moderation" + ], + "summary": "Get Rule", + "description": "Retrieve details of a specific moderation rule by its ID.", + "operationId": "chat-api-get-rule", + "parameters": [ + { + "$ref": "#/components/parameters/ruleId" + } + ], + "responses": { + "200": { + "description": "Get Rule", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "profanity-list", + "name": "Profane Words", + "category": "word", + "isCSV": false, + "searchTerms": [ + "fuck", + "damn", + "shit", + "cunt", + "nigga", + "nigger", + "wanker", + "cunt", + "fag", + "shithead", + "jizz", + "hellbitch", + "retard", + "cocksucker", + "cock", + "kill", + "kike", + "twat", + "bastard", + "death", + "asshole", + "wop", + "scumbag", + "penis", + "murder", + "dick", + "gook", + "vagina", + "rape", + "bastard", + "spic", + "spunk", + "beat" + ], + "createdAt": 1718354412, + "updatedAt": 1718354412, + "revisionId": "253157108b5294c4_profanity-list_1", + "active": true, + "default": true + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "guid": "cometchat-guid-1", - "uid": "cometchat-uid-2", - "scope": "participant", - "joinedAt": 1631690303 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Group Members" - ], - "summary": "Kick", - "description": "Removes a member with given UID from a group for a given GUID.", - "operationId": "kick-group-member", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - }, - { - "$ref": "#/components/parameters/uid" - } - ], - "responses": { - "200": { - "description": "Kicked Group Members", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "The member with cometchat-uid-3 has been kicked from the Group with cometchat-guid-1." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/bannedusers/{uid}": { - "post": { - "tags": [ - "Banned Users" - ], - "summary": "Ban", - "description": "Bans a member from a group for a given GUID and UID.", - "operationId": "ban-group-user", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - }, - { - "$ref": "#/components/parameters/uid" - } - ], - "responses": { - "200": { - "description": "Create Group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + ] + }, + "put": { + "tags": [ + "Moderation" + ], + "summary": "Update Rule", + "description": "Update an existing moderation rule with new actions or conditions.", + "operationId": "chat-api-update-rule", + "parameters": [ + { + "$ref": "#/components/parameters/ruleId" } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "The user with uid cometchat-uid-3 has been banned from the Group with cometchat-guid-1." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Banned Users" - ], - "summary": "Unban", - "description": "Unban a member with given UID from a group for a given GUID.", - "operationId": "unban-group-user", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - }, - { - "$ref": "#/components/parameters/uid" - } - ], - "responses": { - "200": { - "description": "Create Group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModerationRequestBody" + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "The user with uid cometchat-uid-3 has been banned from the Group with cometchat-guid-1." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/bannedusers": { - "get": { - "tags": [ - "Banned Users" - ], - "summary": "List", - "description": "Lists banned users from a group for a given GUID.", - "operationId": "list-banned-group-users", - "parameters": [ - { - "$ref": "#/components/parameters/guid" - }, - { - "name": "perPage", - "in": "query", - "description": "Number of banned users to return per page.", - "schema": { - "type": "number", - "default": 100 - } - }, - { - "name": "page", - "in": "query", - "description": "Page number for paginated results.", - "schema": { - "type": "number", - "default": 1 - } - } - ], - "responses": { - "200": { - "description": "get Banned User", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "link": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - } - } - }, - "meta": { - "type": "object" - }, - "cursor": { - "properties": { - "updatedAt": { - "type": "integer" - }, - "affix": { - "type": "string" + "responses": { + "200": { + "description": "Update Rule", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "moderation-test", + "name": "Video Moderation", + "description": "AI-powered video moderation to detect unsafe content.", + "enabled": true, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "image", + "category": "word", + "operator": "contains", + "value": [ + "violence_greaterThan_30" + ], + "message": [ + "Image contains violence with confidence greater than 30" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1720003247, + "updatedAt": 1720003247, + "revisionId": "253179cf5f665257_moderation-test_1" + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ - { - "uid": "cometchat-uid-6", - "name": "Barry Allen", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "metadata": { - "email": "user@email.com", - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "manager", - "createdAt": 1638354015, - "updatedAt": 1638354799, - "conversationId": "cometchat-uid-4_user_cometchat-uid-6" - }, - { - "uid": "cometchat-uid-2", - "name": "George Alan", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "role": "default", - "createdAt": 1629869270, - "updatedAt": 1630308676, - "conversationId": "cometchat-uid-2_user_cometchat-uid-4" - }, - { - "uid": "cometchat-uid-3", - "name": "George Alan", - "link": "https://data-us.cometchat.io/assets", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "metadata": { - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "default", - "blockedByMe": true, - "blockedByMeAt": 1638346853, - "blockedAt": 1638346853, - "createdAt": 1629869270, - "updatedAt": 1638351060, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - } - ], - "meta": { - "pagination": { - "total": 0, - "count": 5, - "per_page": 100, - "current_page": 1, - "total_pages": 1 + "security": [ + { + "apiKey": [] } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/friends": { - "post": { - "tags": [ - "Friends" - ], - "summary": "Add Friends", - "description": "The API allows to add multiple friends for a given UID.", - "operationId": "add-friend", - "parameters": [ - { - "$ref": "#/components/parameters/uid" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "accepted": { - "description": "The array of UIDs of the friends.", - "type": "array", - "items": { - "type": "string" + ] + }, + "delete": { + "tags": [ + "Moderation" + ], + "summary": "Remove rule", + "description": "Delete a specific moderation rule by its ID.", + "operationId": "chat-api-delete-rule", + "parameters": [ + { + "$ref": "#/components/parameters/ruleId" + } + ], + "responses": { + "200": { + "description": "Delete Rule", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Rule with id moderation-test has been deleted successfully." + } + } + } + } } - } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Added Friend", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "type": "object" - }, - "": { - "type": "object" + "/moderation/keywords": { + "post": { + "tags": [ + "Moderation" + ], + "summary": "Add Keywords", + "description": "Create a new keyword list for moderation.", + "operationId": "chat-api-create-rule-keyword", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/KeywordList" + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "accepted": { - "cometchat-uid-2": { - "success": true, - "message": "Created relationship with status accepted." - }, - "cometchat-uid-3": { - "success": true, - "message": "Created relationship with status accepted." - } - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Friends" - ], - "summary": "List Friends", - "description": "The API allows to fetch friends for a given UID.", - "operationId": "list-all-friends", - "parameters": [ - { - "$ref": "#/components/parameters/uid" - }, - { - "name": "searchKey", - "in": "query", - "description": "Searches for given keyword in friends list (either UID or name).", - "schema": { - "type": "string" - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of friends to be fetched in a request. The default value is 100 and the maximum value is 1000.", - "schema": { - "type": "integer", - "default": "100" - } - }, - { - "name": "page", - "in": "query", - "description": "Page Number.", - "schema": { - "type": "integer", - "default": "1" - } - } - ], - "responses": { - "200": { - "description": "A list of friends.", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "link": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } + "responses": { + "200": { + "description": "Created Keyword", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "profane-word-list-1", + "name": "profane word list", + "description": "Profane word list", + "category": "word", + "isCSV": true, + "searchTerms": [ + "\"a\"", + "\"b\"", + "\"c\"" + ], + "createdAt": 1720023805, + "updatedAt": 1720023805, + "revisionId": "253179cf5f665257_profane-word-list-1_1", + "active": true + } + } + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ - { - "uid": "cometchat-uid-6", - "name": "Barry Allen", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "metadata": { - "email": "user@email.com", - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "manager", - "createdAt": 1638354015, - "updatedAt": 1638354799, - "conversationId": "cometchat-uid-4_user_cometchat-uid-6" - }, - { - "uid": "cometchat-uid-2", - "name": "George Alan", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "role": "default", - "createdAt": 1629869270, - "updatedAt": 1630308676, - "conversationId": "cometchat-uid-2_user_cometchat-uid-4" - }, - { - "uid": "cometchat-uid-3", - "name": "George Alan", - "link": "https://data-us.cometchat.io/assets", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "metadata": { - "contactNumber": "0123456789" - }, - "status": "offline", - "role": "default", - "blockedByMe": true, - "blockedByMeAt": 1638346853, - "blockedAt": 1638346853, - "createdAt": 1629869270, - "updatedAt": 1638351060, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - } - ], - "meta": { - "pagination": { - "total": 0, - "count": 5, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - }, - "cursor": { - "updatedAt": 1638354799, - "affix": "prepend" + "security": [ + { + "apiKey": [] } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Friends" - ], - "summary": "Remove Friends", - "description": "The API removes friends for a given UID.", - "operationId": "remove-friend", - "parameters": [ - { - "$ref": "#/components/parameters/uid" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "friends": { - "description": "The array of friends to remove.", - "type": "array", - "items": { - "type": "string" + ] + }, + "get": { + "tags": [ + "Moderation" + ], + "summary": "List keywords", + "description": "Fetches all the keywords.", + "operationId": "chat-api-list-rule-keywords", + "responses": { + "200": { + "description": "List Keywords", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "_id": "66857afdb4bf371ddfba853b", + "id": "profane-word-list-1", + "appId": "253179cf5f665257", + "name": "profane word list", + "description": "Profane word list", + "category": "word", + "isCSV": true, + "searchTerms": [ + "\"a\"", + "\"b\"", + "\"c\"" + ], + "createdAt": 1720023805, + "updatedAt": 1720023805, + "revisionId": "253179cf5f665257_profane-word-list-1_1", + "active": true, + "__v": 0 + }, + { + "_id": "666c01eccfe97336757fb611", + "id": "profanity-list", + "name": "Profane Words", + "category": "word", + "isCSV": false, + "searchTerms": [ + "fuck", + "nigger", + "fuck", + "nigger", + "wanker", + "cunt", + "damn", + "shit", + "fag", + "shithead", + "jizz", + "hellbitch", + "retard", + "cocksucker", + "cock", + "kill", + "cunt", + "kike", + "twat", + "bastard", + "death", + "asshole", + "wop", + "scumbag", + "penis", + "murder", + "dick", + "gook", + "vagina", + "rape", + "bastard", + "spic", + "spunk", + "beat" + ], + "createdAt": 1718354412, + "updatedAt": 1718354412, + "revisionId": "253157108b5294c4_profanity-list_1", + "active": true, + "__v": 0, + "default": true, + "appId": "default" + } + ], + "meta": { + "current": { + "limit": 10, + "count": 2 + } + } + } + } + } } - } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "A list of api keys", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/moderation/keywords/{keywordId}": { + "get": { + "tags": [ + "Moderation" + ], + "summary": "Get keyword", + "description": "Retrieve details of a specific keyword list by its ID.", + "operationId": "chat-api-get-rule-keyword", + "parameters": [ + { + "$ref": "#/components/parameters/keywordId" + } + ], + "responses": { + "200": { + "description": "Get Keyword", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "profanity-list", + "name": "Profane Words", + "category": "word", + "isCSV": false, + "searchTerms": [ + "fuck", + "nigger", + "fuck", + "nigger", + "wanker", + "cunt", + "damn", + "shit", + "fag", + "shithead", + "jizz", + "hellbitch", + "retard", + "cocksucker", + "cock", + "kill", + "cunt", + "kike", + "twat", + "bastard", + "death", + "asshole", + "wop", + "scumbag", + "penis", + "murder", + "dick", + "gook", + "vagina", + "rape", + "bastard", + "spic", + "spunk", + "beat" + ], + "createdAt": 1718354412, + "updatedAt": 1718354412, + "revisionId": "253157108b5294c4_profanity-list_1", + "active": true, + "default": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "Deleted the friend relations succussfully" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/blockedusers": { - "post": { - "tags": [ - "Blocked Users" - ], - "summary": "Block User", - "operationId": "block-users", - "description": "Blocks the specified user", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" + "security": [ + { + "apiKey": [] + } + ] }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "blockedUids" + "put": { + "tags": [ + "Moderation" ], - "properties": { - "blockedUids": { - "description": "UIDs of the users to be blocked", - "type": "array", - "items": { - "type": "string" + "summary": "Update keyword", + "description": "Update an existing keyword list.", + "operationId": "chat-api-update-rule-keyword", + "parameters": [ + { + "$ref": "#/components/parameters/keywordId" + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/KeywordList" + } + } } - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Blocked user", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "type": "object" + "responses": { + "200": { + "description": "Update Keyword", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "id": "profanity-list", + "name": "Profane Words", + "category": "word", + "isCSV": false, + "searchTerms": [ + "fuck", + "nigger", + "fuck", + "nigger", + "wanker", + "cunt", + "damn", + "shit", + "fag", + "shithead", + "jizz", + "hellbitch", + "retard", + "cocksucker", + "cock", + "kill", + "cunt", + "kike", + "twat", + "bastard", + "death", + "asshole", + "wop", + "scumbag", + "penis", + "murder", + "dick", + "gook", + "vagina", + "rape", + "bastard", + "spic", + "spunk", + "beat" + ], + "createdAt": 1718354412, + "updatedAt": 1718354412, + "revisionId": "253157108b5294c4_profanity-list_1", + "active": true, + "default": true + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "cometchat-uid-4": { - "success": true, - "message": "The user with UID cometchat-uid-1 has blocked user with UID cometchat-uid-3 successfully." + "security": [ + { + "apiKey": [] } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Blocked Users" - ], - "summary": "Unblock User", - "operationId": "unblock-users", - "description": "Unblocks the specified user", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" + ] }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "blockedUids" + "delete": { + "tags": [ + "Moderation" ], - "properties": { - "blockedUids": { - "description": "UIDs of the users to be unblock", - "type": "array", - "items": { - "type": "string" + "summary": "Remove keyword", + "description": "Delete a keyword list by its ID.", + "operationId": "chat-api-delete-rule-keyword", + "parameters": [ + { + "$ref": "#/components/parameters/keywordId" } - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Blocked user", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "type": "object" + ], + "responses": { + "200": { + "description": "Delete Keyword", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Keyword with id profanity-list has been deleted successfully." + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "cometchat-uid-4": { - "success": true, - "message": "The user with UID cometchat-uid-1 has blocked user with UID cometchat-uid-3 successfully." + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Blocked Users" - ], - "summary": "List Blocked Users", - "operationId": "list-blocked-users", - "description": "Retrieves the blocked users", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of blocked users to return per page.", - "schema": { - "type": "number", - "default": 100 - } - }, - { - "name": "page", - "in": "query", - "description": "Page number for paginated results.", - "schema": { - "type": "number", - "default": 1 - } - } - ], - "responses": { - "200": { - "description": "Blocked user", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/userSchema" - }, - { - "$ref": "#/components/schemas/blockedUserSchema" - } - ] - } - }, - "meta": { - "type": "object" + "/moderation/rules/{ruleId}/revisions": { + "get": { + "tags": [ + "Moderation" + ], + "summary": "Get Rule Revisions", + "description": "Fetches a rule's revisions.", + "operationId": "chat-api-list-rule-revisions", + "parameters": [ + { + "$ref": "#/components/parameters/ruleId" + } + ], + "responses": { + "200": { + "description": "List Rule revisions", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "id": "moderation-test", + "name": "Video Moderation", + "description": "AI-powered video moderation to detect unsafe content.", + "enabled": true, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": false, + "entity": "message", + "operand": "text", + "category": "word", + "operator": "equals", + "value": [ + "paris" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": true, + "createdAt": 1720011899, + "updatedAt": 1720011905, + "revisionId": "253179cf5f665257_moderation-test_2" + }, + { + "id": "moderation-test", + "name": "Video Moderation", + "description": "AI-powered video moderation to detect unsafe content.", + "enabled": true, + "conditions": [ + { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "image", + "category": "word", + "operator": "contains", + "value": [ + "violence_greaterThan_30" + ], + "message": [ + "Image contains violence with confidence greater than 30" + ] + } + ], + "action": [ + "blockMessage" + ], + "active": false, + "createdAt": 1720011899, + "updatedAt": 1720011899, + "revisionId": "253179cf5f665257_moderation-test_1" + } + ], + "meta": { + "current": { + "limit": 10, + "count": 2 + } + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": [ - { - "uid": "cometchat-uid-6", - "name": "Barry Allen", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "metadata": { - "rawMetadata": "{'gender':'Male'}" - }, - "status": "offline", - "role": "manager", - "blockedByMe": true, - "blockedByMeAt": 1638346853, - "blockedAt": 1638346853, - "createdAt": 1629869270, - "updatedAt": 1638351060, - "conversationId": "cometchat-uid-3_user_cometchat-uid-4" - }, - { - "uid": "cometchat-uid-2", - "name": "George Alan", - "link": "https://cometchat.com", - "avatar": "https://assets.cometchat.io/sampleapp/v2/groups/cometchat-guid-1.webp", - "metadata": { - "rawMetadata": "{'gender':'Male'}" - }, - "status": "offline", - "role": "manager", - "blockedByMe": true, - "blockedByMeAt": 1638346853, - "blockedAt": 1638346853, - "createdAt": 1629869270, - "updatedAt": 1638351060, - "conversationId": "cometchat-uid-1_user_cometchat-uid-2" - } - ], - "meta": { - "pagination": { - "total": 0, - "count": 5, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - }, - "cursor": { - "updatedAt": 1638354799, - "affix": "prepend" + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/roles": { - "post": { - "tags": [ - "Roles" - ], - "summary": "Create", - "description": "Creates a new user role", - "operationId": "create-role", - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "role", - "name" + "/moderation/blocked-messages": { + "get": { + "tags": [ + "Moderation" ], - "properties": { - "role": { - "description": "A unique identifier for the role.", - "type": "string", - "default": "" - }, - "name": { - "description": "Friendly name of the role.", - "type": "string", - "default": "" - }, - "description": { - "description": "Description of the role.", - "type": "string", - "default": "" - }, - "metadata": { - "description": "Addition information about the role as JSON.", - "type": "object" - }, - "settings": { - "description": "Role settings that is used for restricting list users/send message. Possible values for listUsers & sendMessagesTo are all and friendsOnly", - "type": "object" - } + "summary": "List Blocked Messages", + "description": "Lists the messages blocked by the moderation service.", + "operationId": "chat-api-list-moderation-blocked-messages", + "responses": { + "200": { + "description": "List Blocked Messages", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": [ + { + "ruleId": "image-moderation", + "ruleName": "AI Image Moderation", + "revisionId": "253156be20433c97_image-moderation_4", + "condition": { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": true, + "entity": "message", + "operand": "image", + "category": "word", + "operator": "contains", + "value": [ + "Any unsafe content_greaterThan_70" + ], + "message": [ + "Image contains Any unsafe content with confidence greater than 70" + ], + "weight": 1 + }, + "message": { + "id": "65", + "muid": "_5zytzmceo", + "conversationId": "superhero1_user_superhero2", + "sender": "superhero1", + "receiverType": "user", + "receiver": "superhero2", + "category": "message", + "type": "image", + "data": { + "metadata": { + "file": [] + }, + "resource": "WEB-4_0_3-ffa565b2-476e-493d-aeb5-4c750aae3ab1-1719925738505", + "url": "https://data-eu.cometchat.io/2601293c931567f7/media/1719993037_336554568_9e044ea0ed5817381b189680f392bafe.jpeg", + "attachments": [ + { + "name": "download.jpeg", + "extension": "jpeg", + "size": 4761, + "mimeType": "image/jpeg", + "url": "https://data-eu.cometchat.io/2601293c931567f7/media/1719993037_336554568_9e044ea0ed5817381b189680f392bafe.jpeg" + } + ], + "entities": { + "sender": { + "entity": { + "uid": "superhero1", + "name": "Iron Man", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "status": "offline", + "role": "default" + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "superhero2", + "name": "Captain America", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/captainamerica.png", + "status": "offline", + "role": "default", + "conversationId": "superhero1_user_superhero2" + }, + "entityType": "user" + } + }, + "moderation": { + "status": "pending" + } + }, + "sentAt": 1719993037, + "updatedAt": 1719993037 + }, + "action": [ + "blockMessage" + ], + "createdAt": 1719993038, + "updatedAt": 1719993038 + } + ], + "meta": { + "current": { + "limit": 50, + "count": 20 + } + } + } + } + } + } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Created a new Role", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/moderation/blocked-messages/{messageId}": { + "patch": { + "tags": [ + "Moderation" + ], + "summary": "Approve Blocked Messages", + "description": "Approves the messages blocked by the moderation service.", + "operationId": "chat-api-approve-moderation-blocked-messages", + "parameters": [ + { + "$ref": "#/components/parameters/messageId" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "status" + ], + "properties": { + "status": { + "description": "Moderation status of the message.", + "type": "string", + "example": "approved" + } + }, + "type": "object" + } + } } - }, - "type": "object" }, - "example": { - "data": { - "role": "manager", - "name": "manager", - "description": "This role gives an update access", - "metadata": { - "email": "managers@gmail.com" - }, - "settings": { - "listUsers": "all", - "sendMessagesTo": "friendsOnly" - }, - "createdAt": 1638343994 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Roles" - ], - "summary": "List", - "description": "Lists the user roles", - "operationId": "list-roles", - "parameters": [ - { - "name": "perPage", - "in": "query", - "description": "Number of roles to return per page.", - "schema": { - "type": "number", - "default": 100 - } - }, - { - "name": "page", - "in": "query", - "description": "Page number for paginated results.", - "schema": { - "type": "number", - "default": 1 - } - } - ], - "responses": { - "200": { - "description": "Lists the user roles", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "role": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "settings": { - "type": "object" - }, - "createdAt": { - "type": "integer" - } + "responses": { + "200": { + "description": "Approve Blocked Messages", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "$ref": "#/components/schemas/webhookSchema" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Message with ID 268 has been approved." + } + } + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ - { - "role": "manager", - "name": "manager", - "description": "This role gives an update access", - "metadata": { - "email": "managers@gmail.com" - }, - "settings": { - "listUsers": "all", - "sendMessagesTo": "friendsOnly" - }, - "createdAt": 1638343994 - }, - { - "role": "default", - "name": "Default Role", - "description": "This role gives full access ", - "createdAt": 1629869270, - "updatedAt": 1630306291 - } - ], - "meta": { - "pagination": { - "total": 2, - "count": 2, - "per_page": 100, - "current_page": 1, - "total_pages": 1 + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/roles/{role}": { - "get": { - "tags": [ - "Roles" - ], - "summary": "Get", - "description": "Retrieves role details for a given role.", - "operationId": "get-role", - "parameters": [ - { - "name": "role", - "in": "path", - "description": "A role to get.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Role", - "value": "default" - } - } - } - ], - "responses": { - "200": { - "description": "Fetched the role", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/moderation/reasons": { + "post": { + "tags": [ + "Moderation" + ], + "summary": "Create Reasons", + "description": "Creates a new moderation reason in the app. This reason can then be selected by end users when flagging a message they find inappropriate.", + "operationId": "chat-api-create-reasons", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "description": "Unique identifier for the content type.", + "type": "string", + "example": "unfiltered-content" + }, + "name": { + "description": "Display name for the content type.", + "type": "string", + "example": "RawContent" + }, + "description": { + "description": "Description of the content type.", + "type": "string", + "example": "Content delivered without moderation or filtering." + } + }, + "type": "object" + }, + "examples": { + "Send Moderation Reason": { + "summary": "Send Moderation Message", + "value": { + "id": "unfiltered-content", + "name": "RawContent", + "description": "Content delivered without moderation or filtering." + } + } + } + } } - }, - "type": "object" - }, - "example": { - "data": { - "role": "manager", - "name": "manager", - "description": "This role gives an update access", - "metadata": { - "email": "managers@gmail.com" - }, - "settings": { - "listUsers": "all", - "sendMessagesTo": "friendsOnly" - }, - "createdAt": 1638343994 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Roles" - ], - "summary": "Update", - "description": "Updates a given role.", - "operationId": "update-role", - "parameters": [ - { - "name": "role", - "in": "path", - "description": "A role to update.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Role", - "value": "default" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "description": "Friendly name of the role.", - "type": "string", - "default": "" - }, - "description": { - "description": "Description of the role.", - "type": "string", - "default": "" - }, - "metadata": { - "description": "Additional information about the role.", - "type": "object", - "default": { - "email": "admin@yourcompany.com" - } - }, - "unset": { - "description": "The unsettable role attributes are settings, description and metadata.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "settings", - "description", - "metadata" - ], - "description": "Group attributes that can be unset." - }, - "default": [] - }, - "settings": { - "description": "Role settings that is used for restricting list users/send message. Possible values for listUsers & sendMessagesTo are all and friendsOnly", - "type": "object", - "default": [] - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Updated Role", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "responses": { + "200": { + "description": "Create Reasons", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "id": "unfiltered-content", + "name": "RawContent", + "description": "Content delivered without moderation or filtering.", + "createdAt": 1760449410, + "updatedAt": 1760449410 + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "role": "manager", - "name": "manager", - "description": "This role gives an update access", - "metadata": { - "email": "managers@gmail.com" - }, - "settings": { - "listUsers": "all", - "sendMessagesTo": "friendsOnly" - }, - "createdAt": 1638343994 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Roles" - ], - "summary": "Delete", - "description": "Deletes a role.", - "operationId": "delete-role", - "parameters": [ - { - "name": "role", - "in": "path", - "description": "A role to delete.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Role", - "value": "default" - } - } - } - ], - "responses": { - "200": { - "description": "Deleted Role", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "security": [ + { + "apiKey": [] } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "Role manager has been deleted successfully." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/roles/{role}/restrictedfeatures": { - "post": { - "tags": [ - "Restrict Features" - ], - "summary": "Restrict Features", - "description": "Restrict Features for a given role.", - "operationId": "restrict-features", - "parameters": [ - { - "name": "role", - "in": "path", - "description": "A role to which features to be restricted.", - "required": true, - "schema": { - "type": "string" + ] }, - "examples": { - "string": { - "summary": "Role", - "value": "default" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "featuresToRestrict" + "get": { + "tags": [ + "Moderation" ], - "properties": { - "featuresToRestrict": { - "description": "Keys of the features to be restricted.", - "type": "array", - "items": { - "type": "string" - }, - "default": "" - } + "summary": "List Reasons", + "description": "Retrieves a list of moderation reasons configured for the app.", + "operationId": "chat-api-list-reasons", + "responses": { + "200": { + "description": "List Reasons", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": [ + { + "id": "unfiltered-content", + "name": "RawContent", + "description": "Content delivered without moderation or filtering.", + "createdAt": "1760449410", + "updatedAt": "1760449410" + }, + { + "id": "spam", + "name": "Spam / Unwanted Content", + "description": "Repeated, promotional, or irrelevant content", + "createdAt": "1760443648", + "updatedAt": "1760443648", + "default": true + }, + { + "id": "sexual", + "name": "Sexual Content", + "createdAt": "1758000762", + "updatedAt": "1758000762", + "description": "Explicit or inappropriate content" + }, + { + "id": "harassment", + "name": "Harassment / Bullying", + "createdAt": "1758000761", + "updatedAt": "1758000761", + "description": "Insulting or threatening behavior" + } + ], + "meta": { + "current": { + "limit": 10, + "count": 4 + } + } + } + } + } + } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Restricts Features", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "u.listUsers": { - "type": "object" + "/moderation/reasons/{id}": { + "get": { + "tags": [ + "Moderation" + ], + "summary": "Get Reason details", + "description": "Retrieves detailed information about a specific moderation reason configured in the app.", + "operationId": "chat-api-get-reasons-details", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the reason which needs to be fetched.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Reason ID", + "value": "" + } + } + } + ], + "responses": { + "200": { + "description": "List Reasons", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "id": "spam", + "name": "Spam / Unwanted Content", + "description": "Repeated, promotional, or irrelevant content", + "createdAt": 1760443648, + "updatedAt": 1760443648, + "default": true + } + } + } } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "u.listUsers": { - "success": true, - "message": "The feature u.listUsers has been restricted successfully." + "security": [ + { + "apiKey": [] } - } - } - } - } - } - }, - "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": "default" - } - } - } - ], - "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": { + "put": { + "tags": [ + "Moderation" + ], + "summary": "Update Reason details", + "description": "Updates the details of an existing moderation reason", + "operationId": "chat-api-update-reasons-details", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the reason which needs to be updated.", + "required": true, + "schema": { "type": "string" - }, - "createdAt": { - "type": "integer" - } }, - "type": "object" - } - }, - "meta": { - "type": "object" + "examples": { + "string": { + "summary": "Reason ID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "name" + ], + "properties": { + "name": { + "description": "Updated display name for the content type.", + "type": "string", + "example": "Updated name for unfiltered content." + } + }, + "type": "object" + }, + "examples": { + "Send Moderation Reason": { + "summary": "Send Moderation Message", + "value": { + "name": "Updated name for unfiltered content." + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": [ + "responses": { + "200": { + "description": "Update Reasons Details", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "id": "spam", + "name": "Spam / Unwanted Content", + "description": "Repeated, promotional, or irrelevant content", + "createdAt": 1760443648, + "updatedAt": 1760443648, + "default": true + } + } + } + } + } + }, + "security": [ { - "title": "Delete Group", - "description": "Allows logged-in user to delete a group.", - "key": "u.deleteGroup", - "path": "/v3/groups/{{guid}}", - "createdAt": 1639448370 - }, + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Moderation" + ], + "summary": "Delete Reasons", + "description": "Deletes moderation reasons from the app configuration.", + "operationId": "chat-api-delete-reason", + "parameters": [ { - "title": "List Users", - "description": "Allows logged-in user to fetch the user list.", - "key": "u.listUsers", - "path": "/v3/users", - "createdAt": 1639448370 + "name": "id", + "in": "path", + "description": "Id of the reason which needs to be deleted.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Reason ID", + "value": "" + } + } } - ], - "meta": { - "pagination": { - "total": 2, - "count": 2, - "per_page": 100, - "current_page": 1, - "total_pages": 1 + ], + "responses": { + "200": { + "description": "Delete Reasons", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "success": true, + "message": "The reason with id spam has been deleted successfully." + } + } + } } - } - } - } - } - } - }, - "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": "default" - } - } - } - ], - "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" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Allows Restricted Features", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/messages/{id}/flagged": { + "post": { + "tags": [ + "Moderation" + ], + "summary": "Flag a message", + "description": "Flags a specific message for moderation review. The flagged message is presented to a moderator for evaluation, who can then decide to either block the message or approve it based on the review outcome.", + "operationId": "chat-api-flag-message", + "parameters": [ + { + "$ref": "#/components/parameters/requiredonBehalfOf" + }, + { + "name": "id", + "in": "path", + "description": "Id of the message of the message to be flagged.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Unique identifier of the moderation reason used to flag the message.", + "type": "string", + "example": "spam" + } + }, + "type": "object" + }, + "examples": { + "Flag Message": { + "summary": "Flag a message for moderation", + "value": { + "id": "spam" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "The feature has been allowed successfully." - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/messages/{id}/thread": { - "post": { - "tags": [ - "Messages" - ], - "summary": "Send Threaded Message", - "description": "Sends Threaded Message on behalf of a user.", - "operationId": "send-thread-message", - "parameters": [ - { - "$ref": "#/components/parameters/requiredonBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message for which thread message to be sent", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "receiver": { - "description": "The receiver of the message.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "category": { - "description": "Category of the message. The available categories are message and custom.", - "type": "string", - "default": "message", - "enum": [ - "message", - "custom" - ] - }, - "type": { - "description": "Type of the message. The available values are text, image, file, audio, video.", - "type": "string", - "default": "text", - "enum": [ - "text", - "image", - "file", - "audio", - "video" - ] - }, - "data": { - "description": "JSON containing message attributes.", - "type": "object", - "default": { - "text": "Hi Tom!", - "metadata": { - "key1": "value1", - "key2": "value2" - } - } - }, - "multipleReceivers": { - "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", - "type": "object", - "default": { - "uids": [ - "uid1", - "uid2" - ], - "guids": [ - "guid1" - ] - } - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - }, - "default": [ - "tag1" - ] - } + "responses": { + "200": { + "description": "Delete Reasons", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "success": true, + "message": "Message 540092 has been flagged successfully." + } + } + } + } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Create Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object", - "allOf": [ - { - "properties": { - "parentId": { - "readOnly": false - } - }, - "type": "object" + "/moderation/blocked-messages/{id}": { + "patch": { + "tags": [ + "Moderation" + ], + "summary": "Review Blocked Message", + "description": "Updates the review status of a previously blocked message. This endpoint allows approving or rejecting the message based on the moderation evaluation results.", + "operationId": "chat-api-review-blocked-message", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the message of the message to be flagged.", + "required": true, + "schema": { + "type": "string" }, - { - "$ref": "#/components/schemas/messageSchema" + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } } - ] } - }, - "type": "object" - }, - "example": { - "data": { - "id": "2", - "conversationId": "cometchat-uid-3_user_cometchat-uid-5", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-5", - "category": "message", - "type": "text", - "data": { - "text": "test hello", - "metadata": { - "key1": "val1" - }, - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550, - "conversationId": "cometchat-uid-3_user_cometchat-uid-5" - }, - "entityType": "user" - } - } - }, - "sentAt": 1638423490, - "updatedAt": 1638423490, - "parentId": "1" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Messages" - ], - "summary": "List Threaded Messages", - "description": "Fetches the messages list of a thread.", - "operationId": "list-all-thread-messages", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "name": "id", - "in": "path", - "description": "Id of the message whose thread messages are to be fetched.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - }, - { - "name": "perPage", - "in": "query", - "description": "Number of threaded messages to return per page.", - "schema": { - "type": "number", - "default": 100 - } - }, - { - "name": "page", - "in": "query", - "description": "Page number for paginated results.", - "schema": { - "type": "number", - "default": 1 - } - } - ], - "responses": { - "200": { - "description": "Create Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "allOf": [ - { - "properties": { - "parentId": { - "readOnly": false - } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "status", + "reviewed" + ], + "properties": { + "status": { + "description": "Indicates the review decision for the moderated message. Possible values: approved, rejected.", + "type": "string", + "example": "approved" + }, + "reviewed": { + "description": "Specifies whether the moderation request has been reviewed.", + "type": "boolean", + "example": true + } + }, + "type": "object" }, - "type": "object" - }, - { - "$ref": "#/components/schemas/messageSchema" - } - ] - } - }, - "meta": { - "type": "object" + "examples": { + "Review Moderation Request": { + "summary": "Approve or reject a moderated message", + "value": { + "status": "approved", + "reviewed": true + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": [ - { - "id": "2", - "conversationId": "cometchat-uid-3_user_cometchat-uid-5", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-5", - "category": "message", - "type": "text", - "data": { - "text": "test hello", - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "createdAt": 1638361550 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "createdAt": 1638361550, - "conversationId": "cometchat-uid-3_user_cometchat-uid-5" - }, - "entityType": "user" - } - }, - "metadata": { - "key1": "val1" + "responses": { + "200": { + "description": "Review Blocked Reasons", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "data": { + "success": true, + "message": "Message with ID 540185 has been reviewed successfully." + } + } + } } - }, - "sentAt": 1638423490, - "updatedAt": 1638423490, - "parentId": "1" } - ], - "meta": { - "current": { - "limit": 10, - "count": 1 - }, - "next": { - "affix": "append", - "sentAt": 1638423490, - "id": "3" + }, + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/users/{uid}/messages": { - "get": { - "tags": [ - "Messages" - ], - "summary": "List User Messages", - "description": "Fetches messages between onBehalfOfuid and an uid from path param.", - "operationId": "user-list-user-messages", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/uid" - }, - { - "name": "searchKey", - "in": "query", - "description": "searches for occurence of message.", - "schema": { - "type": "string" - } - }, - { - "name": "hasAttachments", - "in": "query", - "description": "Fetches messages that include attachments.", - "schema": { - "type": "boolean" - } - }, - { - "name": "attachmentTypes", - "in": "query", - "description": "Displays messages according to the type of attachment. Supported types include: image, video, audio, and file.", - "schema": { - "type": "string", - "enum": [ - "image", - "video", - "audio", - "file" - ], - "description": "Media message type." - } - }, - { - "name": "hasMentions", - "in": "query", - "description": "Fetches messages that include mentions.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hasLinks", - "in": "query", - "description": "Fetches messages that include links.", - "schema": { - "type": "boolean" - } - }, - { - "name": "mentionedUids", - "in": "query", - "description": "Fetches messages that include the mentioned comma-separated UIDs.", - "schema": { - "type": "boolean" - } - }, - { - "name": "unread", - "in": "query", - "description": "displays all the unread messages of the user.", - "schema": { - "type": "boolean" - } - }, - { - "name": "undelivered", - "in": "query", - "description": "displays all the messages those are undelivered.", - "schema": { - "type": "boolean" - } - }, - { - "name": "count", - "in": "query", - "description": "displays the count of messages as per group/user", - "schema": { - "type": "boolean" - } - }, - { - "name": "hideReplies", - "in": "query", - "description": "Shows only messages skipping the replies in the message thread.", - "schema": { - "type": "boolean" - } - }, - { - "name": "affix", - "in": "query", - "description": "Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).", - "schema": { - "type": "string", - "enum": [ - "append", - "prepend" - ], - "description": "Cursor pagination direction." - } - }, - { - "name": "id", - "in": "query", - "description": "Retrieves all those messages after the passed id.", - "schema": { - "type": "string" - } - }, - { - "name": "category", - "in": "query", - "description": "Fetches messages that belongs to specific category.", - "schema": { - "type": "string" - } - }, - { - "name": "categories", - "in": "query", - "description": "Fetches messages that contains multiple categories.", - "schema": { - "type": "array", - "items": {} - } - }, - { - "name": "type", - "in": "query", - "description": "Fetches messages that belongs to a specific type.", - "schema": { - "type": "string" - } - }, - { - "name": "types", - "in": "query", - "description": "Fetches messages with multiple types.", - "schema": { - "type": "array", - "items": {} - } - }, - { - "name": "myMentionsOnly", - "in": "query", - "description": "Filters messages with mentions for the UID in onBehalfOf header.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "hasReactions", - "in": "query", - "description": "Filters messages sent by a the uid given in sender query param and has reactions. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "sender", - "in": "query", - "description": "Filters messages with sender. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", - "schema": { - "type": "string" - } - }, - { - "name": "mentionsWithBlockedInfo", - "in": "query", - "description": "For the mentioned users, provides blocked information with respect to the UID in onBehalfOf header.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "mentionsWithTagInfo", - "in": "query", - "description": "Provides user tags for the mentioned users.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "perPage", - "in": "query", - "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000", - "schema": { - "type": "integer", - "default": "100" - } - }, - { - "name": "limit", - "in": "query", - "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000 (works alongside onBehalfOf header)", - "schema": { - "type": "integer", - "default": "10" - } - }, - { - "name": "fromTimestamp", - "in": "query", - "description": "Fetches the messages from this timestamp.", - "schema": { - "type": "integer" - } - }, - { - "name": "toTimestamp", - "in": "query", - "description": "Fetches the messages till this timestamp.", - "schema": { - "type": "integer" - } - }, - { - "name": "withTags", - "in": "query", - "description": "This will fetch messages along with the tags.", - "schema": { - "type": "boolean" - } - }, - { - "name": "tags", - "in": "query", - "description": "This will fetch only those messages belonging to the mentioned tags.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Get User Messages", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - } - } - }, - "meta": { - "type": "object" + "/moderation/flagged-messages": { + "get": { + "tags": [ + "Moderation" + ], + "summary": "List flagged messages", + "description": "Retrieves a list of messages that have been flagged for moderation review, including their current status, associated reasons, and review details.", + "operationId": "chat-api-list-flagged-messages", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "The number of items to return per page.", + "required": false, + "schema": { + "type": "integer", + "default": 50 + }, + "example": 50 } - }, - "type": "object" - }, - "example": { - "data": [ - { - "id": "1776", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3", - "sender": "cometchat-uid-2", - "receiverType": "user", - "receiver": "cometchat-uid-3", - "category": "call", - "type": "audio", - "data": { - "action": "initiated", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline" - }, - "entityType": "user" - }, - "on": { - "entity": { - "data": { - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline" - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3" - }, - "entityType": "user" - } + ], + "responses": { + "200": { + "description": "Delete Reasons", + "content": { + "application/json": { + "schema": { + "type": "object" }, - "metadata": { - "key": { - "one": "two" - } + "example": { + "data": [ + { + "appId": "253626bf6512389d", + "id": "540190", + "conversationId": "cometchat-uid-1_user_cometchat-uid-3", + "sender": "cometchat-uid-1", + "receiverType": "user", + "receiver": "cometchat-uid-3", + "category": "message", + "type": "text", + "data": { + "entities": { + "receiver": { + "entity": { + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", + "conversationId": "cometchat-uid-1_user_cometchat-uid-3", + "createdAt": 1730815502, + "lastActiveAt": 1754574851, + "name": "Nancy", + "role": "default", + "status": "offline", + "uid": "cometchat-uid-3", + "updatedAt": 1760607558 + }, + "entityType": "user" + }, + "sender": { + "entity": { + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", + "createdAt": 1730815502, + "lastActiveAt": 1761295157, + "name": "Andrew Joseph", + "role": "default", + "status": "online", + "uid": "cometchat-uid-1", + "updatedAt": 1738833132 + }, + "entityType": "user" + } + }, + "metadata": { + "@injected": { + "extensions": { + "link-preview": { + "links": [] + } + } + } + }, + "text": "heya man" + }, + "sentAt": 1761295196, + "updatedAt": 1761295196, + "flaggedBy": [ + { + "uid": "cometchat-uid-3", + "name": "Nancy", + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", + "role": "default", + "reasonId": "spam", + "reasonName": "Spam / Unwanted Content", + "description": "Repeated, promotional, or irrelevant content", + "remark": "He is continously spamming me", + "flaggedAt": 1761295210 + } + ], + "flaggedCount": 1 + } + ], + "meta": { + "current": { + "limit": 50, + "count": 1 + } + } } - }, - "type": "audio", - "sender": "cometchat-uid-2", - "status": "initiated", - "joinedAt": 1646995097, - "receiver": "cometchat-uid-3", - "sessionid": "16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba", - "wsChannel": { - "secret": "083c2a7f660150e42c2bf07a17231e90980b290d", - "service": "19757e59e8b9669.call", - "identity": "[19757e59e8b9669]16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba" - }, - "initiatedAt": 1646995097, - "receiverType": "user", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3" - }, - "entityType": "call" - }, - "for": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3" - }, - "entityType": "user" - } - } - }, - "sentAt": 1646995097, - "updatedAt": 1646995097 - }, - { - "id": "1777", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "call", - "type": "video", - "data": { - "action": "ongoing", - "entities": { - "by": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline" - }, - "entityType": "user" - }, - "on": { - "entity": { - "data": { - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline" - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3" - }, - "entityType": "user" - } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/moderation/reviewed-messages": { + "get": { + "tags": [ + "Moderation" + ], + "summary": "List Reviewed messages", + "description": "Retrieves a list of messages that have been reviewed by the moderator.", + "operationId": "chat-api-list-reviewed-messages", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "The number of items to return per page.", + "required": false, + "schema": { + "type": "integer", + "default": 50 + }, + "example": 50 + } + ], + "responses": { + "200": { + "description": "List Reviewed Messages", + "content": { + "application/json": { + "schema": { + "type": "object" }, - "metadata": { - "key": { - "one": "two" - } + "example": { + "data": [ + { + "ruleId": "toxicity", + "ruleName": "Toxicity Detection (English)", + "revisionId": "default_toxicity_1", + "condition": { + "id": 1, + "isKeywordsReferencePresent": false, + "isMediaPresent": false, + "entity": "message", + "operand": "text", + "category": "toxicity", + "operator": "contains", + "value": [ + "toxicity_greaterThan_70" + ], + "message": "Text message contains Toxicity greater than 70%", + "weight": 1 + }, + "message": { + "id": "390079", + "muid": "_b0zr29wvr", + "conversationId": "cometchat-uid-1_user_cometchat-uid-3", + "sender": "cometchat-uid-1", + "receiverType": "user", + "receiver": "cometchat-uid-3", + "category": "message", + "type": "text", + "data": { + "text": "nigger", + "resource": "WEB-4_1_1-7896d270-ea72-4510-b993-282ab6a6afdb-1757953564776", + "entities": { + "sender": { + "entity": { + "uid": "cometchat-uid-1", + "name": "Andrew Joseph", + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", + "status": "online", + "role": "default", + "lastActiveAt": 1757955944 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "cometchat-uid-3", + "name": "Nancy Grace", + "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", + "status": "offline", + "role": "default", + "lastActiveAt": 1754574851, + "conversationId": "cometchat-uid-1_user_cometchat-uid-3" + }, + "entityType": "user" + } + }, + "moderation": { + "status": "disapproved", + "rule": { + "id": "toxicity", + "name": "Toxicity Detection (English)" + } + } + }, + "sentAt": 1757955946, + "updatedAt": 1757955946 + }, + "action": [ + "blockMessage" + ], + "createdAt": 1757955951, + "updatedAt": 1757955951, + "blockedAt": "1757955951.000000000390079", + "appId": "253626bf6512389d" + } + ], + "meta": { + "current": { + "limit": 50, + "count": 46 + } + } } - }, - "type": "video", - "sender": "cometchat-uid-2", - "status": "ongoing", - "joinedAt": 1646995512, - "receiver": "cometchat-uid-3", - "sessionid": "16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba", - "startedAt": 1646995512, - "wsChannel": { - "secret": "083c2a7f660150e42c2bf07a17231e90980b290d", - "service": "19757e59e8b9669.call", - "identity": "[19757e59e8b9669]16469950973f7f6a1ea6d5166db11c929cdbde6a61902e10ba" - }, - "initiatedAt": 1646995097, - "receiverType": "user", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3" - }, - "entityType": "call" - }, - "for": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "conversationId": "cometchat-uid-2_user_cometchat-uid-3" - }, - "entityType": "user" - } + } } - }, - "sentAt": 1646995512, - "updatedAt": 1646995512 } - ], - "meta": { - "pagination": { - "total": 0, - "count": 2, - "per_page": 100, - "current_page": 1, - "total_pages": 1 - }, - "cursor": { - "id": 1786, - "affix": "prepend" + }, + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/groups/{guid}/messages": { - "get": { - "tags": [ - "Messages" - ], - "summary": "List Group Messages", - "description": "Fetches the group message list for a user.", - "operationId": "user-list-group-messages", - "parameters": [ - { - "$ref": "#/components/parameters/onBehalfOf" - }, - { - "$ref": "#/components/parameters/guid" - }, - { - "name": "searchKey", - "in": "query", - "description": "searches for occurence of message.", - "schema": { - "type": "string" - } - }, - { - "name": "hasAttachments", - "in": "query", - "description": "Fetches messages that include attachments.", - "schema": { - "type": "boolean" - } - }, - { - "name": "attachmentTypes", - "in": "query", - "description": "Displays messages according to the type of attachment. Supported types include: image, video, audio, and file.", - "schema": { - "type": "string", - "enum": [ - "image", - "video", - "audio", - "file" - ], - "description": "Media message type." - } - }, - { - "name": "hasMentions", - "in": "query", - "description": "Fetches messages that include mentions.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hasLinks", - "in": "query", - "description": "Fetches messages that include links.", - "schema": { - "type": "boolean" - } - }, - { - "name": "mentionedUids", - "in": "query", - "description": "Fetches messages that include the mentioned comma-separated UIDs.", - "schema": { - "type": "boolean" - } - }, - { - "name": "unread", - "in": "query", - "description": "displays all the unread messages of the user.", - "schema": { - "type": "boolean" - } - }, - { - "name": "undelivered", - "in": "query", - "description": "displays all the messages those are undelivered.", - "schema": { - "type": "boolean" - } - }, - { - "name": "count", - "in": "query", - "description": "displays the count of messages as per group/user", - "schema": { - "type": "boolean" - } - }, - { - "name": "hideMessagesFromBlockedUsers", - "in": "query", - "description": "Hides the messages from blocked users in group.", - "schema": { - "type": "boolean" - } - }, - { - "name": "hideReplies", - "in": "query", - "description": "Shows only messages skipping the replies in the message thread.", - "schema": { - "type": "boolean" - } - }, - { - "name": "affix", - "in": "query", - "description": "Determines whether to pull the messages either before or after any message id. Possible values are append(after) and prepend(before).", - "schema": { - "type": "string", - "enum": [ - "append", - "prepend" - ], - "description": "Cursor pagination direction." - } - }, - { - "name": "id", - "in": "query", - "description": "Retrieves all those messages after the passed id.", - "schema": { - "type": "string" - } - }, - { - "name": "category", - "in": "query", - "description": "Fetches messages that belongs to specific category.", - "schema": { - "type": "string" - } - }, - { - "name": "categories", - "in": "query", - "description": "Fetches messages that contains multiple categories.", - "schema": { - "type": "array", - "items": {} - } - }, - { - "name": "type", - "in": "query", - "description": "Fetches messages that belongs to a specific type.", - "schema": { - "type": "string" - } - }, - { - "name": "types", - "in": "query", - "description": "Fetches messages with multiple types.", - "schema": { - "type": "array", - "items": {} - } - }, - { - "name": "myMentionsOnly", - "in": "query", - "description": "Filters messages with mentions for the UID in onBehalfOf header.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "hasReactions", - "in": "query", - "description": "Filters messages sent by a the uid given in sender query param and has reactions. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "sender", - "in": "query", - "description": "Filters messages with sender. If onBehalfOf header is also set then the messages from their common conversations will be filtered.", - "schema": { - "type": "string" - } - }, - { - "name": "mentionsWithBlockedInfo", - "in": "query", - "description": "For the mentioned users, provides blocked information with respect to the UID in onBehalfOf header.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "mentionsWithTagInfo", - "in": "query", - "description": "Provides user tags for the mentioned users.", - "schema": { - "type": "boolean", - "default": "false" - } - }, - { - "name": "limit", - "in": "query", - "description": "The number of records to fetch. Minimum value: 1, Maximum value: 1000", - "schema": { - "type": "integer", - "default": "10" - } - }, - { - "name": "fromTimestamp", - "in": "query", - "description": "Fetches the messages from this timestamp.", - "schema": { - "type": "integer" - } - }, - { - "name": "toTimestamp", - "in": "query", - "description": "Fetches the messages till this timestamp.", - "schema": { - "type": "integer" - } - }, - { - "name": "withTags", - "in": "query", - "description": "This will fetch messages along with the tags.", - "schema": { - "type": "boolean" - } - }, - { - "name": "tags", - "in": "query", - "description": "This will fetch only those messages belonging to the mentioned tags.", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Retreived Group Messages", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { + "/moderation/flagged-messages/{id}": { + "patch": { + "tags": [ + "Moderation" + ], + "summary": "Block/Review Flagged Message", + "description": "Enables moderators to review flagged messages and take action by either approving acceptable content or blocking policy violations, automatically transferring flagged messages to the reviewed list for tracking purposes.", + "operationId": "chat-api-review-block-flagged-message", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Id of the message which needs to be reviewed.", + "required": true, + "schema": { "type": "string" - }, - "data": { - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } + }, + "examples": { + "string": { + "summary": "Message ID", + "value": "" + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" - }, - "example": { - "data": [ - { - "id": "1", - "conversationId": "cometchat-uid-3_user_cometchat-uid-5", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-5", - "category": "message", - "type": "text", - "data": { - "text": "test hello", - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "createdAt": 1638361550 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "role": "default", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "createdAt": 1638361550, - "conversationId": "cometchat-uid-3_user_cometchat-uid-5" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "description": "Specifies the moderation action to apply to the flagged message (approve or disapprove).", + "type": "string", + "enum": [ + "approved", + "disapproved" + ] + } + }, + "type": "object" }, - "entityType": "user" - } - }, - "metadata": { - "key1": "val1" + "examples": { + "Disapprove Flagged Message": { + "summary": "Disapprove Flagged Message", + "value": { + "status": "disapproved" + } + }, + "Approve Flagged Message": { + "summary": "Approve Flagged Message", + "value": { + "status": "approved" + } + } + } } - }, - "sentAt": 1638423490, - "updatedAt": 1638423490 } - ], - "meta": { - "current": { - "limit": 100, - "count": 1 - }, - "next": { - "affix": "append", - "sentAt": 1638423490, - "id": "1" + }, + "responses": { + "200": { + "description": "Review and Flag Message(s)", + "content": { + "application/json": { + "schema": { + "type": "object" + }, + "example": { + "success": true, + "message": "Message with id 2 has been unflagged successfully." + } + } + } } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/bots/{uid}/messages": { - "post": { - "tags": [ - "Messages" - ], - "summary": "Send Bot Message", - "description": "Sends Message from a Bot.", - "operationId": "send-bot-message", - "parameters": [ - { - "name": "uid", - "in": "path", - "description": "An UID of the Bot.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Message ID", - "value": "100" - } - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "discriminator": { - "propertyName": "category", - "mapping": { - "message": "#/components/schemas/messageCategorySchema", - "custom": "#/components/schemas/customCategorySchema" - } }, - "oneOf": [ - { - "title": "Message", - "$ref": "#/components/schemas/messageCategorySchema" - }, - { - "title": "Custom", - "$ref": "#/components/schemas/customCategorySchema" - } + "security": [ + { + "apiKey": [] + } ] - }, - "examples": {} } - } }, - "responses": { - "200": { - "description": "Send Bot Message", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "/stats": { + "get": { + "tags": [ + "Metrics" + ], + "summary": "Usage Metrics", + "description": "Usage metrics of an app.", + "operationId": "usage-metrics", + "parameters": [ + { + "name": "fromDate", + "in": "query", + "description": "Unix timestamp from which usage has to be fetched.", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "toDate", + "in": "query", + "description": "Unix timestamp till which usage has to be fetched.", + "required": true, + "schema": { + "type": "integer" + } } - }, - "type": "object" - }, - "example": { - "data": { - "id": "1", - "conversationId": "cometchat-uid-3_user_cometchat-uid-5", - "sender": "cometchat-uid-3", - "receiverType": "user", - "receiver": "cometchat-uid-5", - "category": "message", - "type": "text", - "data": { - "text": "test hello", - "metadata": { - "key1": "val1" - }, - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-3", - "name": "Nancy Grace", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-3.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "cometchat-uid-5", - "name": "John Paul", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-5.webp", - "status": "offline", - "role": "default", - "createdAt": 1638361550, - "conversationId": "cometchat-uid-3_user_cometchat-uid-5" - }, - "entityType": "user" - } - } - }, - "sentAt": 1638423490, - "updatedAt": 1638423490 - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/v1/settings": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "List Settings", - "description": "List preferences, templates and sounds for the given app.", - "operationId": "notifications-push-list-settings", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "group": { - "type": "object" - }, - "bypassPreferencesForMentions": { - "type": "boolean" - }, - "call": { - "type": "object" - }, - "oneOnOne": { - "type": "object" - }, - "mute": { - "type": "object" - }, - "email": { - "type": "object" - }, - "sms": { - "type": "object" - }, - "push": { - "type": "object" - } + ], + "responses": { + "200": { + "description": "Usage metrics of an app.", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "metrics": { + "audio_minutes": 0, + "video_minutes": 0, + "recorded_minutes": 0, + "active_users": 0, + "concurrent_users": 0 + }, + "time_range": { + "fromDate": 1630164253000, + "toDate": 1632842653000 + } + } + } + } } - } - }, - "meta": { - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "preferences": { - "group": { - "messagesSetting": 2, - "messageEditedSetting": 2, - "messagesOverride": true, - "repliesSetting": 2, - "repliesOverride": true, - "quotedRepliesSetting": 2, - "quotedRepliesOverride": true, - "messageDeletedSetting": 2, - "reactionsSetting": 2, - "reactionsOverride": true, - "memberLeftSetting": 1, - "memberLeftOverride": true, - "memberAddedSetting": 1, - "memberAddedOverride": true, - "memberJoinedSetting": 1, - "memberJoinedOverride": true, - "memberKickedSetting": 1, - "memberKickedOverride": true, - "memberBannedSetting": 1, - "memberBannedOverride": true, - "memberUnbannedSetting": 1, - "memberUnbannedOverride": true, - "memberScopeChangedSetting": 1, - "memberScopeChangedOverride": true - }, - "bypassPreferencesForMentions": false, - "call": { - "busySetting": 1, - "cancelledSetting": 1, - "endedSetting": 1, - "initiatedSetting": 1, - "ongoingSetting": 1, - "rejectedSetting": 1, - "unansweredSetting": 1, - "initiatedOverride": false, - "ongoingOverride": false, - "cancelledOverride": false, - "rejectedOverride": false, - "unansweredOverride": false, - "busyOverride": false, - "endedOverride": false - }, - "oneOnOne": { - "messagesSetting": 2, - "messagesOverride": true, - "repliesSetting": 2, - "repliesOverride": true, - "quotedRepliesSetting": 2, - "quotedRepliesOverride": true, - "messageEditedSetting": 2, - "messageDeletedSetting": 2, - "reactionsSetting": 2, - "reactionsOverride": true - }, - "mute": { - "dndPreferenceSetting": 1, - "dndPreferenceOverride": true, - "schedulePreferenceSetting": { - "monday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "tuesday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "wednesday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "thursday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "friday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "saturday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "sunday": { - "from": 0, - "to": 2359, - "dnd": false - } - }, - "schedulePreferenceOverride": true, - "mutedGroupsOverride": true, - "mutedOneOnOnesOverride": true - }, - "email": { - "notifyForUnreadOnly": true, - "intervalInSeconds": 7200, - "maxPerDay": 20, - "maxPerDayPerConversation": 2 - }, - "sms": { - "notifyForUnreadOnly": true, - "intervalInSeconds": 7200, - "maxPerDay": 20, - "maxPerDayPerConversation": 2 - }, - "push": { - "includeMessageObjectSetting": false, - "includeSenderMetadataSetting": true, - "includeReceiverMetadataSetting": true, - "trimTextFieldSetting": false, - "includeMessageMetadataSetting": true, - "customJson": { - "hello": "world" - } - } - }, - "sound": { - "chat": "default", - "call": "default" - }, - "templates": { - "usePrivacyTemplate": 3, - "textMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}" - }, - "textMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "New message" - }, - "mediaMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body_audio": "🔈 Has sent an audio", - "body_file": "📄 Has sent a file", - "body_image": "📷 Has sent an image", - "body_video": "🎥 Has sent a video" - }, - "mediaMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body_audio": "New audio message", - "body_file": "New file message", - "body_image": "New image message", - "body_video": "New video message" - }, - "pollMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "pollMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "reminderMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "reminderMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "customMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "New message" - }, - "customMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "New message", - "body_fallback": "New message" - }, - "emailSubjectTemplateDefault": { - "subjectGroup": "New messages in {{groupDetails.name}}", - "subjectOneOnOne": "New messages from {{senderDetails.name}}" - }, - "emailSubjectTemplatePrivacy": { - "subjectGroup": "New messages in {{groupDetails.name}}", - "subjectOneOnOne": "New messages from {{senderDetails.name}}" - }, - "smsContentTemplateDefault": { - "bodyGroup": "You've received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.", - "bodyOneOnOne": "You've received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com." - }, - "smsContentTemplatePrivacy": { - "bodyGroup": "You've received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.", - "bodyOneOnOne": "You've received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com." - } - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "patch": { - "tags": [ - "Notifications" - ], - "summary": "Update Settings", - "description": "Update preferences, templates and sounds for the given app.", - "operationId": "notifications-push-update-settings", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/pnSettingSchema" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "security": [ + { + "apiKey": [] } - }, - "type": "object" - }, - "example": { - "data": { - "success": true - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Reset Settings", - "description": "Reset preferences, templates and sounds to default values for the given app.", - "operationId": "notifications-push-reset-settings", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "/stats/messages": { + "get": { + "tags": [ + "Metrics" + ], + "summary": "Message Metrics", + "description": "Gives the number of messages sent and receipts received in an interval of five minutes.", + "operationId": "message-receipt-metrics", + "responses": { + "200": { + "description": "Gives the number of messages sent and receipts received in an interval of five minutes.", + "content": { + "application/json": { + "schema": { + "properties": { + "dataPoints": { + "type": "array", + "items": {} + } + }, + "type": "object" + }, + "example": { + "data": { + "startTime": "1682676600000", + "endTime": "1682680200000", + "dataPoints": [ + { + "messagesSent": 0, + "readReceipts": 0, + "deliveryReceipts": 0, + "startTime": "1682676600000", + "endTime": "1682676900000" + }, + { + "messagesSent": 0, + "readReceipts": 0, + "deliveryReceipts": 0, + "startTime": "1682676900000", + "endTime": "1682677200000" + } + ], + "appId": "235391c94852dc7d" + } + } + } + } } - }, - "type": "object" }, - "example": { - "data": { - "success": true - } - } - } + "security": [ + { + "apiKey": [] + } + ] } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } + } }, - "/notifications/push/v1/providers/fcm": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "List FCM Providers", - "description": "List the configured FCM providers for the given app.", - "operationId": "notifications-push-list-fcm-providers", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } + "components": { + "schemas": { + "APIKeySchema": { + "description": "Response data", + "properties": { + "apiKey": { + "type": "string" + }, + "name": { + "type": "string" }, - "meta": { - "type": "object" + "scope": { + "type": "string" + }, + "createdAt": { + "type": "integer" } - }, - "type": "object" }, - "example": { - "data": { - "pushProviders": [] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Notifications" - ], - "summary": "Add FCM Provider", - "description": "Add new FCM provider for the given app.", - "operationId": "notifications-push-add-fcm-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/fcmCreateProviderSchema" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "type": "object" + }, + "CategoryType": { + "description": "Type of entries in the list", + "type": "string", + "enum": [ + "word", + "pattern", + "sentence-similarity" + ] + }, + "CommonFields": { + "properties": { + "authToken": { + "type": "string", + "example": "superhero3_1710141033938cf7e3c67cc44465440d" }, - "meta": { - "type": "object" + "timezone": { + "type": "string", + "example": "Asia/Kolkata" } - }, - "type": "object" }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update FCM Provider", - "description": "Update existing FCM provider for the given app.", - "operationId": "notifications-push-update-fcm-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "properties": { - "providerId": { - "type": "string" - } + "type": "object" + }, + "Condition": { + "properties": { + "id": { + "description": "Unique identifier of a condition", + "type": "integer", + "example": 1 }, - "type": "object" - }, - { - "$ref": "#/components/schemas/fcmCreateProviderSchema" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "entity": { + "description": "Entity type in which moderation will be performed.", + "type": "string", + "example": "message" }, - "meta": { - "type": "object" + "operand": { + "description": "Type of message content to moderate (e.g., text, image, video, custom).", + "type": "string", + "enum": [ + "text", + "image", + "video", + "custom" + ], + "example": "image" + }, + "operator": { + "description": "Operation to be performed for condition evaluation (e.g., contains, equals).", + "type": "string", + "enum": [ + "contains", + "equals" + ], + "example": "contains" + }, + "category": { + "description": "Type of entries for evaluation, either 'word' or 'pattern'.", + "type": "string", + "enum": [ + "word", + "pattern" + ], + "example": "word" + }, + "isKeywordReferencePresent": { + "description": "Indicates if the value contains a reference to a keyword list.", + "type": "boolean", + "example": false + }, + "isMediaPresent": { + "description": "Indicates if the incoming message contains media content.", + "type": "boolean", + "example": true + }, + "value": { + "description": "Actual value for the condition, or reference ID if isKeywordReferencePresent is true, or a formula if isMediaPresent is true.", + "type": "string", + "example": "violence_greaterThan_30" } - }, - "type": "object" }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/providers/fcm/{providerId}": { - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete FCM Provider", - "description": "Delete an FCM provider for the given app.", - "operationId": "notifications-push-delete-fcm-provider", - "parameters": [ - { - "$ref": "#/components/parameters/providerId" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "type": "object" + }, + "CustomEmailProviderConfig": { + "properties": { + "isEnabled": { + "description": "Use custom provider", + "type": "boolean" + }, + "useStoredEmailID": { + "description": "If enabled, the webhook will be triggered for a user only if their email address is stored within CometChat.", + "type": "boolean" + }, + "webhookURL": { + "description": "The webhook URL to be triggered for the respective events.", + "type": "string" + }, + "useBasicAuth": { + "description": "To enable basic auth for the URL", + "type": "boolean" }, - "meta": { - "type": "object" + "basicAuthUsername": { + "description": "The username for Basic auth", + "type": "string" + }, + "basicAuthPassword": { + "description": "The password for Basic auth", + "type": "string" } - }, - "type": "object" }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/providers/fcm/default/{providerId}": { - "put": { - "tags": [ - "Notifications" - ], - "summary": "Change default FCM Provider", - "description": "Change the default FCM provider for the given app.", - "operationId": "notifications-push-default-fcm-provider", - "parameters": [ - { - "$ref": "#/components/parameters/providerId" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "type": "object" + }, + "CustomSMSProviderConfig": { + "properties": { + "isEnabled": { + "description": "Use custom provider", + "type": "boolean" + }, + "useStoredPhNo": { + "description": "If enabled, the webhook will be triggered for a user only if their phone number is stored within CometChat.", + "type": "boolean" + }, + "webhookURL": { + "description": "The webhook URL triggered for respective events", + "type": "string" + }, + "useBasicAuth": { + "description": "To enable basic auth for the URL", + "type": "boolean" + }, + "basicAuthUsername": { + "description": "The username for Basic auth", + "type": "string" }, - "meta": { - "type": "object" + "basicAuthPassword": { + "description": "The password for Basic auth", + "type": "string" } - }, - "type": "object" }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/providers/apns": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "List APNS Providers", - "description": "List the configured APNS providers for the given app.", - "operationId": "notifications-push-list-apns-providers", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": {}, - "meta": { - "type": "object" + "type": "object" + }, + "Day": { + "properties": { + "from": { + "type": "integer", + "format": "int32", + "maximum": 2359, + "minimum": 0 + }, + "to": { + "type": "integer", + "format": "int32", + "maximum": 2359, + "minimum": 0 + }, + "dnd": { + "type": "boolean" } - }, - "type": "object" }, - "example": { - "data": { - "pushProviders": [] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update APNS Providers", - "description": "Update existing APNS provider for the given app.", - "operationId": "notifications-push-update-apns-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "properties": { - "providerId": { - "type": "string" - } + "type": "object" + }, + "Group": { + "properties": { + "messagesSetting": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] }, - "type": "object" - }, - { - "$ref": "#/components/schemas/createApnsProvider" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": {} - }, - "type": "object" + "messagesOverride": { + "type": "boolean" + }, + "repliesSetting": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "repliesOverride": { + "type": "boolean" + }, + "reactionsSetting": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "reactionsOverride": { + "type": "boolean" + }, + "memberLeftSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberLeftOverride": { + "type": "boolean" + }, + "memberAddedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberAddedOverride": { + "type": "boolean" + }, + "memberJoinedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberJoinedOverride": { + "type": "boolean" + }, + "memberKickedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberKickedOverride": { + "type": "boolean" + }, + "memberBannedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberBannedOverride": { + "type": "boolean" + }, + "memberUnbannedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberUnbannedOverride": { + "type": "boolean" + }, + "memberScopeChangedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberScopeChangedOverride": { + "type": "boolean" + }, + "messageEditedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "messageDeletedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + } }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Notifications" - ], - "summary": "Add APNS Provider", - "description": "Add new APNS provider for the given app.", - "operationId": "notifications-push-add-apns-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/createApnsProvider" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": {} - }, - "type": "object" + "type": "object" + }, + "GroupFilter": { + "required": [ + "entity", + "operand", + "operator", + "value", + "type" + ], + "properties": { + "entity": { + "description": "Type of entity for group filter", + "type": "string", + "enum": [ + "group" + ] + }, + "operand": { + "description": "Field to apply the filter on for 'group'", + "type": "string", + "enum": [ + "guid", + "name", + "type", + "tags", + "createdAt" + ] + }, + "operator": { + "description": "Operator to use for filtering", + "type": "string", + "enum": [ + "equals", + "notEquals", + "in", + "notIn", + "startsWith", + "endsWith", + "lessThan", + "greaterThan" + ], + "example": "equals" + }, + "value": { + "description": "Value for the filter", + "type": "string", + "example": "exampleValue" + }, + "type": { + "description": "Type of the filter, specifying sender or receiver", + "type": "string", + "enum": [ + "sender", + "receiver" + ], + "example": "sender" + } }, - "example": { - "data": { - "pushProviders": [] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/providers/apns/{providerId}": { - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete APNS Providers", - "description": "Delete an APNS provider for the given app.", - "operationId": "notifications-push-delete-apns-provider", - "parameters": [ - { - "$ref": "#/components/parameters/providerId" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": {} - }, - "type": "object" + "type": "object" + }, + "KeywordList": { + "discriminator": { + "propertyName": "category", + "mapping": { + "word": "#/components/schemas/WordPatternSchema", + "pattern": "#/components/schemas/PatternSchema", + "sentence-similarity": "#/components/schemas/SentenceSimilaritySchema" + } }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/providers/apns/default/{providerId}": { - "put": { - "tags": [ - "Notifications" - ], - "summary": "Change default APNS Provider", - "description": "Change the default APNS provider for the given app.", - "operationId": "notifications-push-default-apns-provider", - "parameters": [ - { - "$ref": "#/components/parameters/providerId" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": {} - }, - "type": "object" + "oneOf": [ + { + "$ref": "#/components/schemas/WordPatternSchema" + }, + { + "$ref": "#/components/schemas/PatternSchema" + }, + { + "$ref": "#/components/schemas/SentenceSimilaritySchema" + } + ] + }, + "MediaMessageTemplate": { + "properties": { + "titleOneOnOne": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}}" + }, + "titleGroup": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" + }, + "body_image": { + "type": "string", + "example": "Has sent an {{message.type}}" + }, + "body_audio": { + "type": "string", + "example": "Has sent an {{message.type}}" + }, + "body_video": { + "type": "string", + "example": "Has sent a {{message.type}}" + }, + "body_file": { + "type": "string", + "example": "Has sent a {{message.type}}" + } }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/v1/preferences": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "List Preferences", - "description": "List the configured preferences for the given user.", - "operationId": "notifications-push-list-preferences", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "group": { - "type": "object" - }, - "oneOnOne": { - "type": "object" - }, - "mute": { - "type": "object" - } + "type": "object" + }, + "ModerationData": { + "properties": { + "id": { + "type": "string", + "example": "moderation-test" + }, + "name": { + "type": "string", + "example": "Video Moderation" + }, + "description": { + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + }, + "enabled": { + "type": "boolean", + "example": true + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } + }, + "action": { + "type": "array", + "items": { + "type": "string", + "example": "blockMessage" } - } }, - "meta": { - "type": "object" + "active": { + "type": "boolean", + "example": true + }, + "createdAt": { + "type": "integer", + "example": 1720003247 + }, + "updatedAt": { + "type": "integer", + "example": 1720003247 + }, + "revisionId": { + "type": "string", + "example": "253179cf5f665257_moderation-test_1" } - }, - "type": "object" }, - "example": { - "data": { - "preferences": { - "group": { - "messagesSetting": 2, - "messagesOverride": true, - "repliesSetting": 2, - "repliesOverride": true, - "quotedRepliesSetting": 2, - "quotedRepliesOverride": true, - "reactionsSetting": 2, - "reactionsOverride": true, - "memberLeftSetting": 1, - "memberLeftOverride": true, - "memberAddedSetting": 1, - "memberAddedOverride": true, - "memberJoinedSetting": 1, - "memberJoinedOverride": true, - "memberKickedSetting": 1, - "memberKickedOverride": true, - "memberBannedSetting": 1, - "memberBannedOverride": true, - "memberUnbannedSetting": 1, - "memberUnbannedOverride": true, - "memberScopeChangedSetting": 1, - "memberScopeChangedOverride": true - }, - "oneOnOne": { - "messagesSetting": 2, - "messagesOverride": true, - "repliesSetting": 2, - "repliesOverride": true, - "quotedRepliesSetting": 2, - "quotedRepliesOverride": true, - "reactionsSetting": 2, - "reactionsOverride": true - }, - "mute": { - "dndPreferenceSetting": 1, - "dndPreferenceOverride": true, - "schedulePreferenceSetting": { - "monday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "tuesday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "wednesday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "thursday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "friday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "saturday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "sunday": { - "from": 0, - "to": 2359, - "dnd": false - } - }, - "schedulePreferenceOverride": true, - "mutedGroupsOverride": true, - "mutedOneOnOnesOverride": true - } + "type": "object" + }, + "ModerationRequestBody": { + "properties": { + "id": { + "description": "Unique identifier for the moderation rule.", + "type": "string", + "example": "moderation-test" }, - "sound": { - "chat": "default", - "call": "default" + "name": { + "description": "Descriptive name for the moderation rule.", + "type": "string", + "example": "Video Moderation" }, - "templates": { - "usePrivacyTemplate": 3, - "textMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}" - }, - "textMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "New message" - }, - "mediaMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body_audio": "Has sent an {{message.type}}", - "body_file": "Has sent a {{message.type}}", - "body_image": "Has sent an {{message.type}}", - "body_video": "Has sent a {{message.type}}" - }, - "mediaMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body_audio": "New message", - "body_file": "New message", - "body_image": "New message", - "body_video": "New message" - }, - "pollMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "pollMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "reminderMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "reminderMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "customMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "New message" - }, - "customMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "New message" - } - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "patch": { - "tags": [ - "Notifications" - ], - "summary": "Update Preferences", - "description": "Update the preference for the given user.", - "operationId": "notifications-push-update-preferences", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/pnUpdatePreferences" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "enabled": { + "description": "Indicates whether the rule is active.", + "type": "boolean", + "example": true + }, + "description": { + "description": "Detailed explanation of the rule's purpose.", + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + }, + "action": { + "description": "Actions to be taken when a violation is detected.", + "type": "array", + "items": { + "type": "string", + "example": "blockMessage" + } + }, + "filters": { + "description": "List of filters to apply", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserFilter" + }, + { + "$ref": "#/components/schemas/GroupFilter" + } + ] + } }, - "meta": { - "type": "object" + "conditions": { + "description": "List of conditions that must be met for the rule to trigger.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } } - }, - "type": "object" }, - "example": { - "data": { - "preferences": { - "group": { - "messagesSetting": 2, - "messagesOverride": true, - "repliesSetting": 2, - "repliesOverride": true, - "quotedRepliesSetting": 2, - "quotedRepliesOverride": true, - "reactionsSetting": 2, - "reactionsOverride": true, - "memberLeftSetting": 1, - "memberLeftOverride": true, - "memberAddedSetting": 1, - "memberAddedOverride": true, - "memberJoinedSetting": 1, - "memberJoinedOverride": true, - "memberKickedSetting": 1, - "memberKickedOverride": true, - "memberBannedSetting": 1, - "memberBannedOverride": true, - "memberUnbannedSetting": 1, - "memberUnbannedOverride": true, - "memberScopeChangedSetting": 1, - "memberScopeChangedOverride": true - }, - "oneOnOne": { - "messagesSetting": 2, - "messagesOverride": true, - "repliesSetting": 2, - "repliesOverride": true, - "quotedRepliesSetting": 2, - "quotedRepliesOverride": true, - "reactionsSetting": 2, - "reactionsOverride": true - }, - "mute": { - "dndPreferenceSetting": 1, - "dndPreferenceOverride": true, - "schedulePreferenceSetting": { - "monday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "tuesday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "wednesday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "thursday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "friday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "saturday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "sunday": { - "from": 0, - "to": 2359, - "dnd": false - } - }, - "schedulePreferenceOverride": true, - "mutedGroupsOverride": true, - "mutedOneOnOnesOverride": true - } + "type": "object" + }, + "Mute": { + "properties": { + "dndPreferenceOverride": { + "type": "boolean" }, - "sound": { - "chat": "default", - "call": "default" + "mutedGroupsOverride": { + "type": "boolean" }, - "templates": { - "usePrivacyTemplate": 3, - "textMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}" - }, - "textMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "New message" - }, - "mediaMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body_audio": "Has sent an {{message.type}}", - "body_file": "Has sent a {{message.type}}", - "body_image": "Has sent an {{message.type}}", - "body_video": "Has sent a {{message.type}}" - }, - "mediaMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body_audio": "New message", - "body_file": "New message", - "body_image": "New message", - "body_video": "New message" - }, - "pollMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "pollMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "reminderMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "reminderMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "" - }, - "customMessageTemplateDefault": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "New message" - }, - "customMessageTemplatePrivacy": { - "titleOneOnOne": "{{message.data.entities.sender.entity.name}}", - "titleGroup": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}", - "body": "{{message.data.text}}", - "body_fallback": "New message" - } - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Reset Preferences", - "description": "Reset the preferences for the given user.", - "operationId": "notifications-push-reset-preferences", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "mutedOneOnOnesOverride": { + "type": "boolean" + }, + "schedulePreferenceSetting": { + "properties": { + "monday": { + "$ref": "#/components/schemas/Day" + }, + "tuesday": { + "$ref": "#/components/schemas/Day" + }, + "wednesday": { + "$ref": "#/components/schemas/Day" + }, + "thursday": { + "$ref": "#/components/schemas/Day" + }, + "friday": { + "$ref": "#/components/schemas/Day" + }, + "saturday": { + "$ref": "#/components/schemas/Day" + }, + "sunday": { + "$ref": "#/components/schemas/Day" + } + }, + "type": "object" }, - "meta": { - "type": "object" + "schedulePreferenceOverride": { + "type": "boolean" } - }, - "type": "object" }, - "example": { - "data": { - "groupPreferences": { - "groupMessages": 2, - "groupReplies": 2, - "groupQuotedReplies": 2, - "groupReactions": 2, - "groupMemberLeft": 1, - "groupMemberAdded": 1, - "groupMemberJoined": 1, - "groupMemberKicked": 1, - "groupMemberBanned": 1, - "groupMemberUnbanned": 1, - "groupMemberScopeChanged": 1 + "type": "object" + }, + "MutePreferences": { + "properties": { + "dnd": { + "description": "1: Disable DND\n2: Enable DND", + "type": "integer", + "enum": [ + 1, + 2 + ] }, - "oneOnOnePreferences": { - "oneOnOneMessages": 2, - "oneOnOneReplies": 2, - "oneOnOneQuotedReplies": 2, - "oneOnOneReactions": 2 + "schedule": { + "$ref": "#/components/schemas/Schedule" + } + }, + "type": "object" + }, + "PNSuccess": { + "properties": { + "success": { + "type": "boolean" + } + }, + "type": "object" + }, + "PatternSchema": { + "required": [ + "category", + "searchTerms" + ], + "properties": { + "file": { + "description": "CSV file containing the keywords or regex patterns for the list.", + "type": "string", + "format": "binary" }, - "mutePreferences": { - "dnd": 1, - "schedule": { - "sunday": { - "from": 0, - "to": 2359, - "dnd": false - }, - "monday": { - "from": 0, - "to": 2359, - "dnd": false + "id": { + "description": "Unique identifier for the pattern list.", + "type": "string", + "example": "ID-of-the-pattern-list" + }, + "name": { + "description": "Descriptive name for the pattern list.", + "type": "string", + "example": "Name of the pattern list" + }, + "description": { + "description": "Detailed explanation of the pattern list's purpose.", + "type": "string", + "example": "Description of the pattern list" + }, + "category": { + "$ref": "#/components/schemas/CategoryType" + }, + "searchTerms": { + "description": "Comma-separated values of keywords or regex patterns if no file is provided.", + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + } + }, + "type": "object" + }, + "PlatformAPNS": { + "allOf": [ + { + "properties": { + "platform": { + "type": "string", + "enum": [ + "apns_ios_device", + "apns_flutter_device", + "apns_react_native_device", + "apns_ionic_cordova_device" + ] + }, + "providerId": { + "type": "string", + "example": "apns-provider-2" + }, + "deviceToken": { + "type": "string" + } }, - "tuesday": { - "from": 0, - "to": 2359, - "dnd": false + "type": "object" + }, + { + "$ref": "#/components/schemas/CommonFields" + } + ] + }, + "PlatformFCM": { + "allOf": [ + { + "properties": { + "platform": { + "type": "string", + "enum": [ + "fcm_android", + "fcm_ios", + "fcm_web", + "fcm_flutter_android", + "fcm_flutter_ios", + "fcm_react_native_android", + "fcm_react_native_ios", + "fcm_ionic_cordova_android", + "fcm_ionic_cordova_ios" + ] + }, + "providerId": { + "type": "string", + "example": "fcm-provider-2" + }, + "fcmToken": { + "type": "string" + } }, - "wednesday": { - "from": 0, - "to": 2359, - "dnd": false + "type": "object" + }, + { + "$ref": "#/components/schemas/CommonFields" + } + ] + }, + "PlatformVOIP": { + "allOf": [ + { + "properties": { + "platform": { + "type": "string", + "enum": [ + "apns_ios_voip", + "apns_flutter_voip", + "apns_ionic_cordova_voip", + "apns_react_native_voip" + ] + }, + "providerId": { + "type": "string", + "example": "apns-provider-2" + }, + "voipToken": { + "type": "string" + } }, - "thursday": { - "from": 0, - "to": 2359, - "dnd": false + "type": "object" + }, + { + "$ref": "#/components/schemas/CommonFields" + } + ] + }, + "Preferences": { + "properties": { + "push": { + "properties": { + "includeMessageObjectSetting": { + "description": "Include the message object in the push payload", + "type": "boolean" + }, + "includeSenderMetadataSetting": { + "description": "Include the sender's metadata as part of the message object", + "type": "boolean" + }, + "includeReceiverMetadataSetting": { + "description": "Include the receiver's metadata as part of the message object", + "type": "boolean" + }, + "trimTextFieldSetting": { + "description": "Trim the text field if present.", + "type": "boolean" + }, + "includeMessageMetadataSetting": { + "description": "Include the message's metadata as part of the message object", + "type": "boolean" + }, + "customJson": { + "description": "A custom JSON object for miscellaneous data", + "type": "object" + } }, - "friday": { - "from": 0, - "to": 2359, - "dnd": false + "type": "object" + }, + "call": { + "properties": { + "initiatedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "ongoingSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "cancelledSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "busySetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "rejectedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "unansweredSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "endedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + } }, - "saturday": { - "from": 0, - "to": 2359, - "dnd": false - } - } + "type": "object" }, - "usePrivacyTemplate": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/tokens": { - "post": { - "tags": [ - "Notifications" - ], - "summary": "Register push token", - "description": "Register a push token for the given auth token.", - "operationId": "notifications-push-register-token", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/pnTokenSchema" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "bypassPreferencesForMentions": { + "type": "boolean" }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "get": { - "tags": [ - "Notifications" - ], - "summary": "List push tokens", - "description": "List push tokens for the given auth token.", - "operationId": "notifications-push-list-tokens", - "parameters": [ - { - "name": "all", - "in": "query", - "description": "Displays all the tokens", - "schema": { - "type": "boolean" - } - }, - { - "name": "authToken", - "in": "query", - "description": "Fetches the results based on the auth Tokens", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } + "bypassPreferencesForGroupMentions": { + "type": "boolean" + }, + "group": { + "$ref": "#/components/schemas/Group" + }, + "oneOnOne": { + "$ref": "#/components/schemas/oneOnOne" }, - "meta": { - "type": "object" + "mute": { + "$ref": "#/components/schemas/Mute" + }, + "email": { + "$ref": "#/components/schemas/email" + }, + "sms": { + "$ref": "#/components/schemas/sms" } - }, - "type": "object" }, - "example": { - "data": { - "pushTokens": [ - { - "authToken": "cometchat-uid-3_1710141033938cf7e3c67cc44465440d4efac8de", - "pushTokenType": "chat", - "createdAt": "2024-03-11T07:27:59.412Z", - "platform": "fcm_android", - "providerId": "fcm-provider-2", - "pushToken": "{{uid3}}_fcm_android_asia_kolkata_4_new_mgmt", - "uid": "cometchat-uid-3", - "updatedAt": "2024-03-13T11:24:47.776Z" - } - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Unregister push tokens for authToken", - "description": "Unregister push token(s) registered for the given auth token.", - "operationId": "notifications-push-unregister-tokens", - "parameters": [ - { - "name": "all", - "in": "query", - "description": "all=true: Deletes all the registered Push tokens for the user.\nall=false: Deletes the Push token registered for the current authToken.", - "schema": { - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/unregisterpnToken" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "type": "object" + }, + "RolePermissionSchema": { + "description": "Role permission mapping", + "properties": { + "role": { + "description": "Role name", + "type": "string", + "example": "admin" }, - "meta": { - "type": "object" + "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" }, - "example": { - "data": { - "pushTokens": [ - { - "authToken": "cometchat-uid-3_1710141033938cf7e3c67cc44465440d4efac8de", - "pushTokenType": "chat", - "createdAt": "2024-03-11T07:27:59.412Z", - "platform": "fcm_android", - "providerId": "fcm-provider-2", - "pushToken": "{{uid3}}_fcm_android_asia_kolkata_4_new_mgmt", - "uid": "cometchat-uid-3", - "updatedAt": "2024-03-13T11:24:47.776Z" - } - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/tokens/{pushToken}": { - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete the given push token", - "description": "Deletes the given push token", - "operationId": "notifications-push-delete-token", - "parameters": [ - { - "$ref": "#/components/parameters/pushToken" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/unregisterpnToken" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "type": "object" + }, + "Schedule": { + "properties": { + "monday": { + "$ref": "#/components/schemas/Day" + }, + "tuesday": { + "$ref": "#/components/schemas/Day" + }, + "wednesday": { + "$ref": "#/components/schemas/Day" + }, + "thursday": { + "$ref": "#/components/schemas/Day" }, - "meta": { - "type": "object" + "friday": { + "$ref": "#/components/schemas/Day" + }, + "saturday": { + "$ref": "#/components/schemas/Day" + }, + "sunday": { + "$ref": "#/components/schemas/Day" } - }, - "type": "object" }, - "example": { - "data": { - "pushTokens": [ - { - "authToken": "cometchat-uid-3_1710141033938cf7e3c67cc44465440d4efac8de", - "pushTokenType": "chat", - "createdAt": "2024-03-11T07:27:59.412Z", - "platform": "fcm_android", - "providerId": "fcm-provider-2", - "pushToken": "{{uid3}}_fcm_android_asia_kolkata_4_new_mgmt", - "uid": "cometchat-uid-3", - "updatedAt": "2024-03-13T11:24:47.776Z" - } - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/v1/preferences/mute": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "List muted conversations", - "description": "List the conversations where notifications have been muted on behalf of the user.", - "operationId": "notifications-push-list-muted", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { + "type": "object" + }, + "SchedulerSchema": { + "required": [ + "interactionGoal", + "allowSenderInteraction", + "interactiveData" + ], + "properties": { + "interactionGoal": { + "required": [ + "type", + "elementIds" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "anyAction", + "allOf", + "oneOf", + "none" + ] + }, + "elementIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "allowSenderInteraction": { + "type": "boolean" + }, + "interactiveData": { + "required": [ + "title", + "avatarUrl", + "bufferTime", + "icsFileUrl", + "availability", + "timezoneCode", + "duration", + "scheduleElement", + "goalCompletionText", + "dateRangeStart", + "dateRangeEnd" + ], + "properties": { + "title": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "bufferTime": { + "type": "integer" + }, + "icsFileUrl": { + "type": "string" + }, + "timezoneCode": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "scheduleElement": { + "required": [ + "action", + "elementId", + "buttonText", + "elementType", + "disableAfterInteracted" + ], + "properties": { + "action": { + "required": [ + "url", + "actionType", + "method", + "dataKey", + "headers", + "payload" + ], + "properties": { + "url": { + "type": "string" + }, + "actionType": { + "type": "string" + }, + "method": { + "type": "string" + }, + "dataKey": { + "type": "string" + }, + "headers": { + "type": "object" + }, + "payload": { + "required": [ + "data", + "type", + "category", + "receiver", + "receiverType" + ], + "properties": { + "data": { + "properties": { + "text": { + "type": "string" + } + }, + "type": "object" + }, + "type": { + "type": "string" + }, + "category": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "receiverType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "elementId": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "elementType": { + "type": "string" + }, + "disableAfterInteracted": { + "type": "boolean" + } + }, + "type": "object" + }, + "goalCompletionText": { + "type": "string" + }, + "dateRangeStart": { + "type": "string", + "format": "date" + }, + "dateRangeEnd": { + "type": "string", + "format": "date" + } + }, "type": "object" - } - }, - "meta": { - "type": "object" } - }, - "type": "object" - }, - "example": { - "data": { - "mutedConversations": [] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Mute notifications for conversations", - "description": "Mute notifications for the conversations on behalf of the given user.", - "operationId": "notifications-push-mute-conversations", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "requestBody": { - "description": "List of conversations", - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "conversations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/muteConversation" - } - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "ScopePermissionSchema": { + "description": "Scope permission details", + "properties": { + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "users" }, - "meta": { - "type": "object" + "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" }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Unmute notifications for conversations", - "description": "Unmute notifications for the conversations on behalf of the given user.", - "operationId": "notifications-push-unmute-conversations", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "requestBody": { - "description": "Unmute Conversations", - "required": true, - "content": { - "application/json": { - "schema": { + "type": "object" + }, + "SentenceSimilaritySchema": { + "required": [ + "category", + "disallowedSentences" + ], "properties": { - "conversations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/unmuteConversation" + "file": { + "description": "CSV file containing the keywords or regex patterns for the list.", + "type": "string", + "format": "binary" + }, + "id": { + "description": "Unique identifier for the keyword list.", + "type": "string", + "example": "ID-of-the-sentences-list" + }, + "name": { + "description": "Descriptive name for the keyword list.", + "type": "string", + "example": "Name of the sentences list" + }, + "description": { + "description": "Detailed explanation of the keyword list's purpose.", + "type": "string", + "example": "Description of the sentences list" + }, + "category": { + "$ref": "#/components/schemas/CategoryType" + }, + "disallowedSentences": { + "description": "Comma-separated sentences that are disallowed if the category is 'sentence-similarity'.", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Hello, let's connect on Whatsapp." + ] } - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "ServiceAccountCreds": { + "properties": { + "project_id": { + "type": "string" }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/v1/preferences/timezone": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get timezone", - "description": "Get the timezone on behalf of the user.", - "operationId": "notifications-get-timezone", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "client_email": { + "type": "string" + }, + "private_key": { + "type": "string" }, - "meta": { - "type": "object" + "private_key_id": { + "type": "string" } - }, - "type": "object" - }, - "example": { - "data": { - "timezone": "Asia/Kolkata" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "patch": { - "tags": [ - "Notifications" - ], - "summary": "Update timezone", - "description": "Update the timezone on behalf of the user.", - "operationId": "notifications-update-timezone", - "parameters": [ - { - "$ref": "#/components/parameters/requiredUID" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "timezone": { - "description": "Input a valid Timezone Identifier. Eg: Asia/Tokyo", - "type": "string", - "example": "Asia/Tokyo" - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "SetRolePermissionSchema": { + "description": "Set role permission response", + "properties": { + "role": { + "description": "Role identifier", + "type": "string", + "example": "default" }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "timezone": "Asia/Kolkata" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/v1/contact-details": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get contact details", - "description": "Fetches the contact details like Email ID and Phone number for a given user.", - "operationId": "notifications-get-contact-details", - "parameters": [ - { - "$ref": "#/components/parameters/requiredonBehalfOf" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "permissions": { + "description": "Permissions configuration for the role", + "type": "object", + "example": { + "createGroup": "allow", + "listUsers.mode": "friends", + "createGroup.allowedGroupTypes": [ + "public" + ] + }, + "additionalProperties": true }, - "meta": { - "type": "object" + "updatedAt": { + "description": "Timestamp when permissions were last updated", + "type": "integer", + "example": 1640000000 } - }, - "type": "object" - }, - "example": { - "data": { - "email": "someone@example.com", - "phno": "+919591128691" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "patch": { - "tags": [ - "Notifications" - ], - "summary": "Update contact details", - "description": "Updates the contact details like Email ID and Phone number for a given user.", - "operationId": "notifications-update-contact-details", - "parameters": [ - { - "$ref": "#/components/parameters/requiredonBehalfOf" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "email": { - "description": "The user's email address", - "type": "string", - "example": "someone@example.com" - }, - "phno": { - "description": "The user's phone number with country code (Ex: +1 for US, +91 for India, etc.)", - "type": "string", - "example": "+919591128691" - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "SetScopePermissionSchema": { + "description": "Set scope permission response", + "properties": { + "guid": { + "description": "Group identifier", + "type": "string", + "example": "supergroup" }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "email": "someone@example.com", - "phno": "+919591128691" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete contact details", - "description": "Deletes the stored contact details for a given user.", - "operationId": "notifications-delete-contact-details", - "parameters": [ - { - "$ref": "#/components/parameters/requiredonBehalfOf" - } - ], - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "scope": { + "description": "Scope identifier", + "type": "string", + "example": "admin" }, - "meta": { - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/sms/v1/providers/twilio": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get Twilio credentials", - "description": "Fetches the Twilio credentials stored for the app.", - "operationId": "notifications-sms-list-twilio-details", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } + "permissions": { + "description": "Permissions configuration for the scope", + "type": "object", + "example": { + "sendMessage": "deny", + "initiateCall": "friends" + }, + "additionalProperties": true }, - "meta": { - "type": "object" + "updatedAt": { + "description": "Timestamp when permissions were last updated", + "type": "integer", + "example": 1640000000 } - }, - "type": "object" - }, - "example": { - "data": { - "twilioAccountSID": "AC91e67951ff7e5e7be8122184e76ae0e6=", - "twilioAuthToken": "71c2301435733997e83db7a3445bc57", - "twilioSenderPhoneNumber": "+13611364718" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Notifications" - ], - "summary": "Save Twilio credentials", - "description": "Store the Twilio credentials for the given app.", - "operationId": "notifications-sms-save-twilio-details", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "required": [ - "twilioAccountSID", - "twilioAuthToken", - "twilioSenderPhoneNumber" - ], - "properties": { - "twilioAccountSID": { - "description": "The Twilio Account SID", - "type": "string", - "example": "AC91e67951ff7e5e7be8122184e76ae0e6" - }, - "twilioAuthToken": { - "description": "The Twilio Auth Token", - "type": "string", - "example": "71c2301435733997e83db7a3445bc57" - }, - "twilioSenderPhoneNumber": { - "description": "The Twilio sender phone number", - "type": "string", - "example": "+13611364718" - }, - "isEnabled": { - "description": "Enable Twilio", - "type": "boolean" - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "SilentNotification": { + "properties": { + "chat": { + "type": "boolean" }, - "meta": { - "type": "object" + "call": { + "type": "boolean" } - }, - "type": "object" - }, - "example": { - "data": { - "twilioAccountSID": "AC91e67951ff7e5e7be8122184e76ae0e6=", - "twilioAuthToken": "71c2301435733997e83db7a3445bc57", - "twilioSenderPhoneNumber": "+13611364718" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update Twilio credentials", - "description": "Updates the Twilio credentials for the given app.", - "operationId": "notifications-sms-update-twilio-details", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "twilioAccountSID": { - "description": "The Twilio Account SID", - "type": "string", - "example": "AC91e67951ff7e5e7be8122184e76ae0e6" - }, - "twilioAuthToken": { - "description": "The Twilio Auth Token", - "type": "string", - "example": "71c2301435733997e83db7a3445bc57" - }, - "twilioSenderPhoneNumber": { - "description": "The Twilio sender phone number", - "type": "string", - "example": "+13611364718" - }, - "isEnabled": { - "description": "Enable Twilio", - "type": "boolean" - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "Sound": { + "properties": { + "chat": { + "type": "string" }, - "meta": { - "type": "object" + "call": { + "type": "string" } - }, - "type": "object" }, - "example": { - "data": { - "twilioAccountSID": "AC91e67951ff7e5e7be8122184e76ae0e6=-", - "twilioAuthToken": "71c2301435733997e83db7a3445bc57", - "twilioSenderPhoneNumber": "+13611364718" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete Twilio credentials", - "description": "Deletes the stored Twilio credentials for the given app.", - "operationId": "notifications-sms-delete-twilio-details", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "type": "object" + }, + "Template": { + "properties": { + "titleOneOnOne": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}}" }, - "meta": { - "type": "object" + "titleGroup": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" + }, + "body": { + "type": "string", + "example": "New text message" } - }, - "type": "object" }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/email/v1/providers/sendgrid": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get SendGrid credentials", - "description": "Fetches the SendGrid credentials stored for the app.", - "operationId": "notifications-email-list-sendgrid-details", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { + "type": "object" + }, + "Templates": { + "properties": { + "usePrivacyTemplate": { + "description": "1: Use default templates\n2: Use privacy templates\n3: Use default templates with end-user privacy override", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "textMessageTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "textMessageTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "mediaMessageTemplateDefault": { + "$ref": "#/components/schemas/MediaMessageTemplate" + }, + "mediaMessageTemplatePrivacy": { + "$ref": "#/components/schemas/MediaMessageTemplate" + }, + "customMessageTemplateDefault": { + "allOf": [ + { + "properties": { + "body_fallback": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/Template" + } + ] + }, + "customMessageTemplatePrivacy": { + "allOf": [ + { + "properties": { + "body_fallback": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/Template" + } + ] + }, + "interactiveFormTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveFormTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCardTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCardTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "interactiveSchedulerTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveSchedulerTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCustomTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCustomTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "emailSubjectTemplateDefault": { + "properties": { + "subjectGroup": { + "type": "string", + "example": "While you were away..." + }, + "subjectOneOnOne": { + "type": "string", + "example": "While you were away..." + } + }, + "type": "object" + }, + "emailSubjectTemplatePrivacy": { + "properties": { + "subjectGroup": { + "type": "string", + "example": "While you were away..." + }, + "subjectOneOnOne": { + "type": "string", + "example": "While you were away..." + } + }, + "type": "object" + }, + "smsContentTemplateDefault": { + "properties": { + "bodyGroup": { + "type": "string", + "example": "You've received new messages in {{groupDetails.name}}! You can read the message at https://your-website.com." + }, + "bodyOneOnOne": { + "type": "string", + "example": "You've received new messages from {{sender.name}}! You can read the message at https://your-website.com." + } + }, "type": "object" - } }, - "meta": { - "type": "object" + "smsContentTemplatePrivacy": { + "properties": { + "bodyGroup": { + "type": "string", + "example": "You've received new messages in {{groupDetails.name}}! You can read the message at https://your-website.com." + }, + "bodyOneOnOne": { + "type": "string", + "example": "You've received new messages from {{sender.name}}! You can read the message at https://your-website.com." + } + }, + "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "sendGridApiKey": "SG.9ipFP4b17yT-Fff2GGrH8FF0GqdkBohXAEI4GnTSj9Q=", - "sendGridTemplateID": "d-8284bb9646a040499d5cfa28d272a094", - "sendGridUnsubscribeGroupID": "33832", - "senderEmail": "noreply@em123.example.com", - "senderName": "Emailer" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Notifications" - ], - "summary": "Save SendGrid credentials", - "description": "Store the SendGrid credentials for the given app.", - "operationId": "notifications-email-save-sendgrid-details", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { + "type": "object" + }, + "TimeRange": { "required": [ - "sendGridApiKey", - "sendGridTemplateID", - "sendGridUnsubscribeGroupID", - "senderName", - "senderEmail", - "allowEmailReplies" + "from", + "to" ], "properties": { - "sendGridApiKey": { - "description": "The SendGrid API key", - "type": "string", - "example": "SG.9ipFP4b17yT-Fff2GGrH8FF0GqdkBohXAEI4GnTSj9Q=" - }, - "sendGridTemplateID": { - "description": "The SendGrid template ID", - "type": "string", - "example": "d-8284bb9646a040499d5cfa28d272a094" - }, - "sendGridUnsubscribeGroupID": { - "description": "The SendGrid unsubscribe group ID", - "type": "string", - "example": "33832" - }, - "senderName": { - "description": "The name of the sender", - "type": "string", - "example": "Emailer" - }, - "senderEmail": { - "description": "The email address of the sender", - "type": "string", - "example": "noreply@em123.example.com" - }, - "allowEmailReplies": { - "type": "boolean", - "default": false - }, - "senderEmailForReplies": { - "description": "The email address when replies are enabled (optional)", - "type": "string", - "example": "reply@em123.example.com", - "nullable": true - }, - "isEnabled": { - "description": "Enable SendGrid", - "type": "boolean" - } + "from": { + "type": "string" + }, + "to": { + "type": "string" + } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "UnsetRolePermissionSchema": { + "description": "Unset role permission response", + "properties": { + "role": { + "description": "Role identifier", + "type": "string", + "example": "default" }, - "meta": { - "type": "object" + "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" - }, - "example": { - "data": { - "allowEmailReplies": true, - "sendGridApiKey": "sendgrid_key", - "sendGridTemplateID": "template_id", - "sendGridUnsubscribeGroupID": "12312", - "senderEmail": "noreply@em123.example.com", - "senderEmailForReplies": "reply@em123.example.com", - "senderName": "Emailer", - "repliesWebhook": "https://notifications-us.cometchat.io/email/v1/sendgrid/replies?token=GY40_1kWlnc2Lo7Lk8vWWxiNJ6BmEEpV4eZsUeMr328" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update SendGrid credentials", - "description": "Updates the SendGrid credentials for the given app.", - "operationId": "notifications-email-update-sendgrid-details", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "sendGridApiKey": { - "description": "The SendGrid API key", - "type": "string", - "example": "SG.9ipFP4b17yT-Fff2GGrH8FF0GqdkBohXAEI4GnTSj9Q=" - }, - "sendGridTemplateID": { - "description": "The SendGrid template ID", - "type": "string", - "example": "d-8284bb9646a040499d5cfa28d272a094" - }, - "sendGridUnsubscribeGroupID": { - "description": "The SendGrid unsubscribe group ID", - "type": "string", - "example": "33832" - }, - "senderName": { - "description": "The name of the sender", - "type": "string", - "example": "Emailer" - }, - "senderEmail": { - "description": "The email address of the sender", - "type": "string", - "example": "noreply@em123.example.com" - }, - "allowEmailReplies": { - "type": "boolean", - "default": false - }, - "senderEmailForReplies": { - "description": "The email address when replies are enabled (optional)", - "type": "string", - "example": "reply@em123.example.com", - "nullable": true - }, - "isEnabled": { - "description": "Enable SendGrid", - "type": "boolean" - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + }, + "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" }, - "meta": { - "type": "object" + "status": { + "description": "Status of the operation", + "type": "string", + "example": "removed" + }, + "updatedAt": { + "description": "Timestamp when permission was removed", + "type": "integer", + "example": 1640000000 } - }, - "type": "object" }, - "example": { - "data": { - "allowEmailReplies": true, - "sendGridApiKey": "sendgrid_key", - "sendGridTemplateID": "template_id", - "sendGridUnsubscribeGroupID": "12312", - "senderEmail": "noreply@em123.example.com", - "senderEmailForReplies": "reply@em123.example.com", - "senderName": "Emailer", - "repliesWebhook": "https://notifications-us.cometchat.io/email/v1/sendgrid/replies?token=GY40_1kWlnc2Lo7Lk8vWWxiNJ6BmEEpV4eZsUeMr328" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete SendGrid credentials", - "description": "Deletes the stored SendGrid credentials for the given app.", - "operationId": "notifications-email-delete-sendgrid-details", - "responses": { - "200": { - "description": "A list of push notification's settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": {} + "type": "object" + }, + "UserFilter": { + "required": [ + "entity", + "operand", + "operator", + "value", + "type" + ], + "properties": { + "type": { + "description": "Type of the filter, specifying sender or receiver", + "type": "string", + "enum": [ + "sender", + "receiver" + ], + "example": "sender" + }, + "entity": { + "description": "Type of entity for user filter", + "type": "string", + "enum": [ + "user" + ] + }, + "operand": { + "description": "Field to apply the filter on for 'user'", + "type": "string", + "enum": [ + "uid", + "name", + "role", + "tags", + "createdAt" + ] + }, + "operator": { + "description": "Operator to use for filtering", + "type": "string", + "enum": [ + "equals", + "not equals", + "in", + "not in", + "startsWith" + ], + "example": "equals" }, - "meta": { - "type": "object" + "value": { + "description": "Value for the filter", + "type": "string", + "example": "admin" } - }, - "type": "object" - }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/push/v1/providers/custom": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get Custom Provider for Push Notifications", - "description": "Fetches the custom provider for Push Notifications for a given app.", - "operationId": "notifications-list-push-custom-provider", - "responses": { - "200": { - "description": "A list of push notification's custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" }, - "example": { - "data": { - "pushProviders": [ - { - "basicAuthUsername": "user123", - "basicAuthPassword": "pass123", - "useBasicAuth": true, - "isEnabled": true, - "webhookURL": "https://trigger-push.example.com/cometchat" - } - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Notifications" - ], - "summary": "Save Custom Provider for Push Notifications", - "description": "Saves the custom provider for Push Notifications for a given app.", - "operationId": "notifications-save-push-custom-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { + "type": "object" + }, + "WordPatternSchema": { "required": [ - "isEnabled", - "webhookURL", - "basicAuthUsername", - "basicAuthPassword", - "useBasicAuth" + "category", + "searchTerms" ], "properties": { - "isEnabled": { - "description": "Use custom provider", - "type": "boolean" - }, - "webhookURL": { - "description": "The webhook URL to be triggered for the respective events.", - "type": "string" - }, - "useBasicAuth": { - "description": "To enable basic auth for the URL", - "type": "boolean" - }, - "basicAuthUsername": { - "description": "The username for Basic auth", - "type": "string" - }, - "basicAuthPassword": { - "description": "The password for Basic auth", - "type": "string" - } + "file": { + "description": "CSV file containing the keywords or regex patterns for the list.", + "type": "string", + "format": "binary" + }, + "id": { + "description": "Unique identifier for the word list.", + "type": "string", + "example": "ID-of-the-word-list" + }, + "name": { + "description": "Descriptive name for the word list.", + "type": "string", + "example": "Name of the word list" + }, + "description": { + "description": "Detailed explanation of the word list's purpose.", + "type": "string", + "example": "Description of the word list" + }, + "category": { + "$ref": "#/components/schemas/CategoryType" + }, + "searchTerms": { + "description": "Comma-separated values of keywords or regex patterns if no file is provided.", + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Save push notification's custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "pushProviders": [ - { - "basicAuthUsername": "user123", - "basicAuthPassword": "pass123", - "useBasicAuth": true, - "isEnabled": true, - "webhookURL": "https://trigger-push.example.com/cometchat" - } - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update Custom Provider for Push Notifications", - "description": "Updates the custom provider for Push Notifications for a given app.", - "operationId": "notifications-update-push-custom-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { + }, + "authTokenSchema": { + "description": "Response data", "properties": { - "isEnabled": { - "description": "Use custom provider", - "type": "boolean" - }, - "webhookURL": { - "description": "The webhook URL to be triggered for the respective events.", - "type": "string" - }, - "useBasicAuth": { - "description": "To enable basic auth for the URL", - "type": "boolean" - }, - "basicAuthUsername": { - "description": "The username for Basic auth", - "type": "string" - }, - "basicAuthPassword": { - "description": "The password for Basic auth", - "type": "string" - } + "uid": { + "type": "string" + }, + "authToken": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "A list of push notification's custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "pushProviders": [ - { - "basicAuthUsername": "user123", - "basicAuthPassword": "pass123", - "useBasicAuth": true, - "isEnabled": true, - "webhookURL": "https://trigger-push.example.com/cometchat" - } - ] - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete the Custom Provider for Push Notifications", - "description": "Deletes the custom provider for Push Notifications for a given app.", - "operationId": "notifications-delete-push-custom-provider", - "responses": { - "200": { - "description": "A list of push notification's custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/sms/v1/providers/custom": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get Custom Provider for SMS Notifications", - "description": "Fetches the custom provider for SMS Notifications for a given app.", - "operationId": "notifications-list-sms-custom-provider", - "responses": { - "200": { - "description": "A list of push notification's custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "basicAuthPassword": "user888", - "basicAuthUsername": "pass123", - "isEnabled": true, - "useBasicAuth": true, - "useStoredPhNo": false, - "webhookURL": "https://trigger-sms.example.com/cometchat" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Notifications" - ], - "summary": "Save Custom Provider for SMS Notifications", - "description": "Saves the custom provider for SMS Notifications for a given app.", - "operationId": "notifications-save-sms-custom-provider", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "required": [ - "isEnabled", - "useStoredPhNo", - "webhookURL", - "basicAuthUsername", - "basicAuthPassword", - "useBasicAuth" - ], - "properties": { - "useStoredPhNo": { - "description": "If enabled, the webhook will be triggered for a user only if their phone number is stored within CometChat.", - "type": "boolean", - "default": false - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/CustomSMSProviderConfig" - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "Save the push notification's SMS custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "basicAuthUsername": "user889", - "basicAuthPassword": "pass122", - "isEnabled": true, - "useBasicAuth": true, - "useStoredPhNo": false, - "webhookURL": "https://trigger-sms.example.com/cometchat" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update Custom Provider for SMS Notifications", - "description": "Updates the custom provider for SMS Notifications for a given app.", - "operationId": "notifications-update-sms-custom-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CustomSMSProviderConfig" - } - } - } - }, - "responses": { - "200": { - "description": "Save the push notification's SMS custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "basicAuthUsername": "user889", - "basicAuthPassword": "pass122", - "isEnabled": true, - "useBasicAuth": true, - "useStoredPhNo": false, - "webhookURL": "https://trigger-sms.example.com/cometchat" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete the Custom Provider for SMS Notifications", - "description": "Deletes the custom provider for SMS Notifications for a given app.", - "operationId": "notifications-delete-sms-custom-provider", - "responses": { - "200": { - "description": "Delete push notification's SMS custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/email/v1/providers/custom": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get Custom Provider for Email Notifications", - "description": "Fetches the custom provider for Email Notifications for a given app.", - "operationId": "notifications-list-email-custom-provider", - "responses": { - "200": { - "description": "A list of push notification's email custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "basicAuthUsername": "user889", - "basicAuthPassword": "pass122", - "isEnabled": true, - "useBasicAuth": true, - "useStoredEmailID": false, - "webhookURL": "https://trigger-email.example.com/cometchat" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "post": { - "tags": [ - "Notifications" - ], - "summary": "Save Custom Provider for Email Notifications", - "description": "Saves the custom provider for Email Notifications for a given app.", - "operationId": "notifications-save-email-custom-provider", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/CustomEmailProviderConfig" - }, - { - "required": [ - "isEnabled", - "useStoredEmailID", - "webhookURL", - "basicAuthUsername", - "basicAuthPassword", - "useBasicAuth" - ] - } - ] - } - } - } - }, - "responses": { - "200": { - "description": "Save the push notification's SMS custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "basicAuthUsername": "user889", - "basicAuthPassword": "pass122", - "isEnabled": true, - "useBasicAuth": true, - "useStoredEmailID": false, - "webhookURL": "https://trigger-email.example.com/cometchat" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update Custom Provider for Email Notifications", - "description": "Updates the custom provider for Email Notifications for a given app.", - "operationId": "notifications-update-email-custom-provider", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CustomEmailProviderConfig" - } - } - } - }, - "responses": { - "200": { - "description": "Update the push notification's Email custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" - }, - "example": { - "data": { - "basicAuthUsername": "user889", - "basicAuthPassword": "pass122", - "isEnabled": true, - "useBasicAuth": true, - "useStoredEmailID": false, - "webhookURL": "https://trigger-email.example.com/cometchat" - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete the Custom Provider for Email Notifications", - "description": "Deletes the custom provider for Email Notifications for a given app.", - "operationId": "notifications-delete-email-custom-provider", - "responses": { - "200": { - "description": "Delete push notification's Email custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" + }, + "bannedUserSchema": { + "description": "Response data", + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "isBanned": { + "type": "boolean" + }, + "joinedAt": { + "type": "integer" + }, + "createdAt": { + "type": "integer" + } }, - "example": { - "data": { - "success": true - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/notifications/v1/logs": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Notifications logs", - "description": "Paginated API to fetch logs for notifications", - "operationId": "notifications-logs", - "parameters": [ - { - "name": "messageId", - "in": "query", - "description": "To filter based on the ID of message or reply.", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "reactionId", - "in": "query", - "description": "To filter based on the ID of the reaction added.", - "required": false, - "schema": { - "type": "integer" - } - }, - { - "name": "from", - "in": "query", - "description": "To get the logs for messages that are sent after the mentioned timestamp in milliseconds.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "to", - "in": "query", - "description": "To get the logs for messages that are sent after the mentioned timestamp in milliseconds.", - "required": false, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "messageCategory", - "in": "query", - "description": "To filter logs based on the category of the message or reply. Values can be message.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "message" - ], - "description": "Message category filter." - } - }, - { - "name": "messageType", - "in": "query", - "description": "To filter logs based on the type of the message or reply. Values are based on the message category.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "trigger", - "in": "query", - "description": "To filter based on the trigger value of the event that is responsible for triggering the notification.\nFor a message or a reply, the value of this field is after_message.\nFor message actions, the values are message_deleted or message_edited or message_reaction_added.\nFor default calling feature, the values are initiated, rejected, cancelled, unanswered.\nFor group events, the values are: after_group_joined, after_group_left, after_group_members_added, after_group_members_kicked, after_group_members_banned, after_group_members_unbanned, after_scope_changed.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "after_message", - "message_deleted", - "message_edited", - "message_reaction_added", - "initiated", - "rejected", - "cancelled", - "unanswered", - "after_group_joined", - "after_group_left", - "after_group_members_added", - "after_group_members_kicked", - "after_group_members_banned", - "after_group_members_unbanned", - "after_scope_changed" - ], - "description": "Webhook event trigger type." - } - }, - { - "name": "sender", - "in": "query", - "description": "To filter based on the sender of the message. This has to be uid.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "reactionSender", - "in": "query", - "description": "To filter based on the user who reacted on a message.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "receiver", - "in": "query", - "description": "To filter based on the receiver of a message. This can be uid or guid based on the receiverType.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "receiverType", - "in": "query", - "description": "To filter based on the receiver's type. The value of this field can be user or group.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "user", - "group" - ], - "description": "Receiver type. user: one-on-one. group: group conversation." - } - }, - { - "name": "reactionReceiver", - "in": "query", - "description": "To filter based on the user who is notified when a reaction is added.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "member", - "in": "query", - "description": "To filter based on the user who is notified in a given group. This is only present when the receiverType is group.", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "channel", - "in": "query", - "description": "To filter based on whether the user was notified using push, email or sms notification.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "push", - "email", - "sms" - ], - "description": "Notification channel type." - } - }, - { - "name": "provider", - "in": "query", - "description": "To filter based on the provider.\nFor channel as push, the value of this field can be fcm, apns, custom.\nFor channel as email, the value of this field can be sendgrid or custom.\nFor channel as sms, the value of this field can be twilio or custom.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "fcm", - "apns", - "sendgrid", - "twilio", - "custom" - ], - "description": "Notification provider type." - } - }, - { - "name": "notificationTriggered", - "in": "query", - "description": "The value is true when the notification provider is triggered. If false, the notification was not triggered due to some preference that is mentioned in the reason field.", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "reason", - "in": "query", - "description": "Available only when the value of notificationTriggered is false.\nThis contains the reason for not triggering the notification provider.\n\nTo filter logs using reason, use the following values: MESSAGES_PREFERENCE, REPLIES_PREFERENCE, QUOTED_REPLIES_PREFERENCE, MESSAGE_ACTIONS_PREFERENCE, REACTIONS_PREFERENCE, GROUP_ACTIONS_PREFERENCE, DND_PREFERENCE, MUTE_PREFERENCE, SCHEDULE_PREFERENCE, CALL_PREFERENCE, QUOTA_PREFERENCE, MISSING_EMAIL, MISSING_PHNO, INVALID_PUSH_PROVIDER_ID, TIMED_OUT, NOT_FOUND, TWILIO_CREATE_ERROR.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "MESSAGES_PREFERENCE", - "REPLIES_PREFERENCE", - "QUOTED_REPLIES_PREFERENCE", - "MESSAGE_ACTIONS_PREFERENCE", - "REACTIONS_PREFERENCE", - "GROUP_ACTIONS_PREFERENCE", - "DND_PREFERENCE", - "MUTE_PREFERENCE", - "SCHEDULE_PREFERENCE", - "CALL_PREFERENCE", - "QUOTA_PREFERENCE", - "MISSING_EMAIL", - "MISSING_PHNO", - "INVALID_PUSH_PROVIDER_ID", - "TIMED_OUT", - "NOT_FOUND", - "TWILIO_CREATE_ERROR" - ], - "description": "Notification log status or reason code." - } - }, - { - "name": "success", - "in": "query", - "description": "Available only when the value of notificationTriggered is true.\n\nTo filter based on whether the HTTP request to the provider was successful or not, true indicating that the provider returned success while false indicating that the provider returned an error.", - "required": false, - "schema": { - "type": "boolean" - } - }, - { - "name": "affix", - "in": "query", - "description": "To paginate over logs use the value of affix as prepend or append.", - "required": false, - "schema": { - "type": "string", - "enum": [ - "prepend", - "append" - ], - "description": "Cursor pagination direction." - } - }, - { - "name": "logId", - "in": "query", - "description": "To be used with affix for pagination.", - "required": false, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "A list of push notification's email custom provider", - "content": { - "application/json": { - "schema": { - "type": "object" + "type": "object" + }, + "blockedUserSchema": { + "description": "Response data", + "properties": { + "blockedByMe": { + "type": "boolean" + }, + "blockedByMeAt": { + "type": "integer" + }, + "blockedAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } }, - "example": { - "data": [ - { - "_id": "67e3c56babf90e20e2652edb", - "processingStartedAtMS": 1742980459696, - "processingEndedAtMS": 1742980459738, - "totalProcessingTimeInMS": 42, - "component": "notifications-core", - "channel": "push", - "provider": "apns", - "messageId": 3939, - "reactionId": 69, - "trigger": "message_reaction_added", - "messageSentAtMS": 1742980459000, - "sender": "cometchat-uid-4", - "reactionSender": "cometchat-uid-1", - "receiver": "cometchat-guid-1", - "reactionReceiver": "g-muted-yes", - "receiverType": "group", - "member": "g-muted-yes", - "tokenType": "apns_ios_device", - "pushToken": "pushtoken123", - "providerId": "apns-provider", - "payload": { - "payload": { - "title": "cometchat-uid-1", - "body": "Reacted to your message: 😂", - "tag": "69", - "sender": "cometchat-uid-1", - "senderName": "cometchat-uid-1", - "receiver": "cometchat-guid-1", - "receiverName": "cometchat-guid-1", - "receiverType": "group", - "conversationId": "group_cometchat-guid-1", - "type": "chat", - "sessionId": null, - "callAction": null, - "callType": null, - "sentAt": null - }, - "contentAvailable": 1, - "mutableContent": 1, - "topic": "com.example.com", - "alert": { - "title": "cometchat-uid-1", - "body": "Reacted to your message: 😂" + "type": "object" + }, + "conversationSchema": { + "description": "Response data", + "properties": { + "conversationId": { + "type": "string" + }, + "conversationType": { + "type": "string" + }, + "unreadMessageCount": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "lastMessage": { + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "allOf": [ + { + "properties": { + "action": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/objectEntitySchema" + } + ] + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "receipts": { + "properties": { + "data": { + "type": "array", + "items": {} + } + }, + "type": "object" + } }, - "priority": 10, - "pushType": "alert", - "sound": "default", - "collapseId": "69", - "expiry": 1742984059, - "type": "apns" - }, - "notificationTriggered": false, - "reason": "MUTE_PREFERENCE" - } - ], - "meta": { - "previous": { - "affix": "prepend", - "messageId": 3939 - }, - "current": { - "limit": 20, - "count": 20 + "type": "object" }, - "next": { - "affix": "append", - "messageId": 3939 - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/stats": { - "get": { - "tags": [ - "Metrics" - ], - "summary": "Usage Metrics", - "description": "Usage metrics of an app.", - "operationId": "usage-metrics", - "parameters": [ - { - "name": "fromDate", - "in": "query", - "description": "Unix timestamp from which usage has to be fetched.", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "toDate", - "in": "query", - "description": "Unix timestamp till which usage has to be fetched.", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Usage metrics of an app.", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + "conversationWith": { + "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "metrics": { - "audio_minutes": 0, - "video_minutes": 0, - "recorded_minutes": 0, - "active_users": 0, - "concurrent_users": 0 + "type": "object" + }, + "conversationWithSchema": { + "properties": { + "guid": { + "type": "string" }, - "time_range": { - "fromDate": 1630164253000, - "toDate": 1632842653000 + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "membersCount": { + "type": "integer" + }, + "joinedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + }, + "hasJoined": { + "type": "boolean", + "default": "true" + }, + "createdAt": { + "type": "integer" + }, + "owner": { + "type": "string" + }, + "updatedAt": { + "type": "integer" + }, + "updatedBy": { + "type": "string" } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/stats/messages": { - "get": { - "tags": [ - "Metrics" - ], - "summary": "Message Metrics", - "description": "Gives the number of messages sent and receipts received in an interval of five minutes.", - "operationId": "message-receipt-metrics", - "responses": { - "200": { - "description": "Gives the number of messages sent and receipts received in an interval of five minutes.", - "content": { - "application/json": { - "schema": { - "properties": { - "dataPoints": { - "type": "array", - "items": {} + }, + "type": "object" + }, + "createApnsProvider": { + "properties": { + "providerId": { + "type": "string" + }, + "keyId": { + "type": "string" + }, + "teamId": { + "type": "string" + }, + "bundleId": { + "type": "string" + }, + "p8KeyFilename": { + "type": "string" + }, + "p8Key": { + "type": "string" + }, + "includeContentAvailable": { + "type": "boolean" + }, + "includeMutableContent": { + "type": "boolean" + }, + "productionMode": { + "type": "boolean" } - }, - "type": "object" }, - "example": { - "data": { - "startTime": "1682676600000", - "endTime": "1682680200000", - "dataPoints": [ - { - "messagesSent": 0, - "readReceipts": 0, - "deliveryReceipts": 0, - "startTime": "1682676600000", - "endTime": "1682676900000" - }, - { - "messagesSent": 0, - "readReceipts": 0, - "deliveryReceipts": 0, - "startTime": "1682676900000", - "endTime": "1682677200000" - } - ], - "appId": "235391c94852dc7d" - } - } - } - } - } - }, - "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": { + "type": "object" + }, + "customCategorySchema": { + "properties": { + "receiver": { + "description": "The receiver of the message.", + "type": "string" + }, + "muid": { + "description": "The muid will be a unique Identifier of the message.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" + ] + }, + "category": { + "description": "Category of the message. The available categories is custom.", + "type": "string", + "default": "custom", + "enum": [ + "custom" + ] + }, + "quotedMessageId": { + "description": "ID of the message being quoted.\nIf provided, the send message response will include a `quotedMessage` node\nin the response containing the referenced message object.", + "type": "string", + "default": "message", + "enum": [ + "message" + ] + }, + "type": { + "description": "Type of the message.", + "type": "string" + }, "data": { - "type": "array", - "items": { - "type": "object", + "description": "JSON containing message attributes.", "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "dataType": { - "type": "string" - }, - "availableValues": { - "type": "array", - "items": {} - }, - "defaultValue": { + "customData": { + "description": "when category==”custom”, this property can have any JSON object.", + "type": "object" + } + }, + "type": "object" + }, + "multipleReceivers": { + "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", + "properties": { + "uids": { + "type": "array", + "items": { + "type": "string" + } + }, + "guids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } } - } - }, - "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 + "type": "object" + }, + "customInteractiveSchema": { + "title": "Custom Interactive Schema", + "properties": { + "data": { + "type": "object" } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ], - "parameters": [ - { - "name": "role", - "in": "path", - "description": "The role identifier to update permissions for", - "required": true, - "schema": { - "type": "string", - "example": "default" - } - } - ] - }, - "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" - ], + }, + "type": "object" + }, + "dataPointSchema": { + "description": "Response data", "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 - } + "messagesSent": { + "type": "integer" + }, + "readReceipts": { + "type": "integer" + }, + "deliveryReceipts": { + "type": "integer" + }, + "startTime": { + "type": "integer" + }, + "endTime": { + "type": "integer" + } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Role permissions updated successfully", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "object" + }, + "deleteSchema": { + "properties": { + "success": { + "type": "boolean" + }, + "message": { + "type": "string" } - }, - "type": "object" }, - "example": { - "data": { - "sendMessage": { - "success": true, - "message": "Permission with id sendMessage have been mapped successfully to role default." + "type": "object" + }, + "email": { + "properties": { + "notifyForUnreadOnly": { + "description": "If the value is false, the notification will contain all the messages, not just unread.", + "type": "boolean" }, - "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": [] - } - ] - } - }, - "/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" + "intervalInSeconds": { + "type": "integer" + }, + "maxPerDay": { + "type": "integer" + }, + "maxPerDayPerConversation": { + "type": "integer" + }, + "includeMessageObjectSetting": { + "description": "Includes the message object in the email payload", + "type": "boolean" + }, + "includeSenderMetadataSetting": { + "description": "Includes sender metadata in the message object", + "type": "boolean" + }, + "includeReceiverMetadataSetting": { + "description": "Includes receiver metadata in the message object", + "type": "boolean" + }, + "includeMessageMetadataSetting": { + "description": "Includes message metadata in the message object", + "type": "boolean" } - }, - "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": { - "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": { + "type": "object" + }, + "fcmCreateProviderSchema": { + "properties": { + "providerId": { + "type": "string" + }, + "serviceAccountFilename": { + "type": "string" + }, + "serviceAccountCreds": { + "$ref": "#/components/schemas/ServiceAccountCreds" + }, + "notificationInPayload": { + "properties": { + "ios": { + "$ref": "#/components/schemas/SilentNotification" + }, + "android": { + "$ref": "#/components/schemas/SilentNotification" + }, + "web": { + "$ref": "#/components/schemas/SilentNotification" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "groupEntitySchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, "data": { - "type": "array", - "items": { - "type": "object", "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "dataType": { - "type": "string" - }, - "availableValues": { - "type": "array", - "items": {} - }, - "defaultValue": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - } - } + "action": { + "type": "string" + }, + "entities": { + "properties": { + "by": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "on": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "for": { + "properties": { + "entity": { + "properties": { + "guid": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "membersCount": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "avatar": { + "type": "string" + }, + "metadata": { + "properties": { + "email": { + "type": "string" + } + }, + "type": "object" + }, + "status": { + "type": "string" }, - "meta": { - "type": "object" + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" } - }, - "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": [] - } - ], - "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" - } - } - ] - }, - "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" - ], + "type": "object" + }, + "groupMemberListSchema": { + "description": "Response data", "properties": { - "permissions": { - "description": "Permissions object containing key-value pairs for scope permissions", - "type": "object", - "example": { - "sendMessage": "deny", - "initiateCall": "friends" + "uid": { + "type": "string" }, - "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." + "name": { + "type": "string" }, - "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": [] - } - ] - } - }, - "/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" + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "joinedAt": { + "type": "integer" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" } - }, - "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": [] - } - ] - } - }, - "/moderation/reasons": { - "post": { - "operationId": "create-reason", - "summary": "Create Reasons", - "description": "Creates a new moderation reason in the app. This reason can then be selected by end users when flagging a message they find inappropriate.", - "tags": [ - "Moderation - Reasons" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "name" - ], + "type": "object" + }, + "groupMemberSchema": { + "description": "Response data", "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the content type.", - "example": "unfiltered-content" - }, - "name": { - "type": "string", - "description": "Display name for the content type.", - "example": "RawContent" - }, - "description": { - "type": "string", - "description": "Description of the content type.", - "example": "Content delivered without moderation or filtering." - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Reason created successfully.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "unfiltered-content" - }, - "name": { - "type": "string", - "example": "RawContent" - }, - "description": { - "type": "string", - "example": "Content delivered without moderation or filtering." - }, - "createdAt": { - "type": "integer", - "example": 1760449410 - }, - "updatedAt": { - "type": "integer", - "example": 1760449410 - } - } - } - } - } - } - } - } - } - }, - "get": { - "operationId": "list-reasons", - "summary": "List Reasons", - "description": "Lists all moderation reasons configured in the app.", - "tags": [ - "Moderation - Reasons" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - } - ], - "responses": { - "200": { - "description": "List of moderation reasons.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "type": "object", + "usersToBan": { "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "updatedAt": { - "type": "string" - }, - "default": { - "type": "boolean" - } - } - } - }, - "meta": { - "type": "object", - "properties": { - "current": { - "type": "object", - "properties": { - "limit": { - "type": "integer" - }, - "count": { - "type": "integer" + "": { + "properties": { + "success": { + "type": "boolean" + } + }, + "type": "object" } - } - } - } - } - } - } - } - } - } - } - } - }, - "/moderation/reasons/{id}": { - "get": { - "operationId": "get-reason-details", - "summary": "Get Reason details", - "description": "Retrieves detailed information about a specific moderation reason configured in the app.", - "tags": [ - "Moderation - Reasons" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - }, - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Id of the reason which needs to be fetched." - } - ], - "responses": { - "200": { - "description": "Reason details.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" }, - "name": { - "type": "string" + "type": "object" + }, + "admins": { + "properties": { + "": { + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } }, - "description": { - "type": "string" + "type": "object" + }, + "moderators": { + "properties": { + "": { + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } }, - "createdAt": { - "type": "string" + "type": "object" + }, + "participants": { + "properties": { + "": { + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } }, - "updatedAt": { - "type": "string" - } - } + "type": "object" } - } - } - } - } - } - } - }, - "put": { - "operationId": "update-reason-details", - "summary": "Update Reason details", - "description": "Updates the details of an existing moderation reason.", - "tags": [ - "Moderation - Reasons" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - }, - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" + }, + "type": "object" }, - "description": "Id of the reason which needs to be updated." - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", + "groupReceiverDetails": { + "required": [ + "guid", + "name", + "type" + ], "properties": { - "name": { - "type": "string", - "description": "Updated display name for the content type.", - "example": "Updated name for unfiltered content." - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Reason updated successfully.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "createdAt": { - "type": "string" + "guid": { + "description": "The primary-key/ unique identifier of the group.", + "type": "string" + }, + "name": { + "description": "Name of the group.", + "type": "string" + }, + "icon": { + "description": "An URL for a group icon.", + "type": "string" + }, + "type": { + "description": "Type of the group. Can be public, password or private.", + "type": "string", + "enum": [ + "public", + "password", + "private" + ] + }, + "password": { + "description": "A password required to join the the group with type password", + "type": "string" + }, + "owner": { + "description": "Owner of the group.", + "type": "string" + }, + "createdAt": { + "description": " A 10-digit UNIX timestamp at which the group was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional data for the group.", + "type": "object" + }, + "tags": { + "description": "A string array containing grouptags.", + "type": "array", + "items": { + "type": "string" }, - "updatedAt": { - "type": "string" - } - } + "default": [] } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-reason", - "summary": "Delete Reasons", - "description": "Deletes moderation reasons from the app configuration.", - "tags": [ - "Moderation - Reasons" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - }, - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" + }, + "type": "object" }, - "description": "Id of the reason which needs to be deleted." - } - ], - "responses": { - "200": { - "description": "Reason deleted successfully.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "example": true + "groupSchema": { + "description": "Response data", + "properties": { + "guid": { + "type": "string" }, - "message": { - "type": "string", - "example": "The reason with id spam has been deleted successfully." + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "membersCount": { + "type": "integer" + }, + "joinedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + }, + "hasJoined": { + "type": "boolean" + }, + "owner": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "createdAt": { + "type": "integer" } - } - } - } - } - } - } - } - }, - "/messages/{id}/flagged": { - "post": { - "operationId": "flag-a-message", - "summary": "Flag a message", - "description": "Flags a specific message for moderation review. The flagged message is presented to a moderator for evaluation, who can then decide to either block the message or approve it based on the review outcome.", - "tags": [ - "Moderation - Flagged Messages" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - }, - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Id of the message to be flagged." - }, - { - "name": "onBehalfOf", - "in": "header", - "required": true, - "schema": { - "type": "string" + }, + "type": "object" }, - "description": "UID of the user on whose behalf the action is performed." - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", + "interactionCardSchema": { + "title": "Card Schema", "properties": { - "reasonId": { - "type": "string", - "description": "Unique identifier of the moderation reason used to flag the message." - }, - "remark": { - "type": "string", - "description": "Additional remark or comment about why the message is being flagged." - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Message flagged successfully.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "/moderation/flagged-messages": { - "get": { - "operationId": "list-flagged-messages", - "summary": "List flagged messages", - "description": "Lists all messages that have been flagged for moderation review.", - "tags": [ - "Moderation - Flagged Messages" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - } - ], - "responses": { - "200": { - "description": "List of flagged messages.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { + "interactionGoal": { + "properties": { + "type": { + "type": "string", + "enum": [ + "anyOf", + "allOf", + "oneOf", + "none" + ] + }, + "elementIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, "type": "object" - } - }, - "meta": { - "type": "object", - "properties": { - "current": { - "type": "object", - "properties": { - "limit": { - "type": "integer" + }, + "allowSenderInteraction": { + "type": "boolean" + }, + "interactiveData": { + "properties": { + "text": { + "type": "string" + }, + "cardActions": { + "type": "array", + "items": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "defaultValue": { + "type": "string" + }, + "label": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "maxLines": { + "type": "integer" + }, + "placeholder": { + "type": "object" + } + }, + "type": "object" + } }, - "count": { - "type": "integer" + "submitElement": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "disableAfterInteracted": { + "type": "boolean" + }, + "optional": { + "type": "boolean" + }, + "action": { + "properties": { + "url": { + "type": "string" + }, + "method": { + "type": "string" + }, + "payload": { + "type": "object" + }, + "headers": { + "type": "object" + }, + "dataKey": { + "type": "string" + }, + "actionType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" } - } - } - } + }, + "type": "object" } - } - } - } - } - } - } - } - }, - "/moderation/flagged-messages/{id}": { - "patch": { - "operationId": "blockreview-flagged-message", - "summary": "Block/Review Flagged Message", - "description": "Enables moderators to review flagged messages and take action by either approving acceptable content or blocking policy violations, automatically transferring flagged messages to the reviewed list for tracking purposes.", - "tags": [ - "Moderation - Flagged Messages" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - }, - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" + }, + "type": "object" }, - "description": "Id of the message which needs to be reviewed." - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", + "interactionFormSchema": { + "title": "Form Schema", "properties": { - "status": { - "type": "string", - "description": "Specifies the moderation action to apply to the flagged message.", - "enum": [ - "approved", - "disapproved" - ] - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Flagged message reviewed successfully.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object" - } - } - } - } - } - } - } - } - }, - "/moderation/reviewed-messages": { - "get": { - "operationId": "list-reviewed-messages", - "summary": "List Reviewed messages", - "description": "Lists all messages that have been reviewed by moderators.", - "tags": [ - "Moderation - Reviewed Messages" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - } - ], - "responses": { - "200": { - "description": "List of reviewed messages.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { + "interactionGoal": { + "properties": { + "type": { + "type": "string", + "enum": [ + "anyOf", + "allOf", + "oneOf", + "none" + ] + }, + "elementIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, "type": "object" - } - }, - "meta": { - "type": "object", - "properties": { - "current": { - "type": "object", - "properties": { - "limit": { - "type": "integer" + }, + "allowSenderInteraction": { + "type": "boolean" + }, + "interactiveData": { + "properties": { + "text": { + "type": "string" }, - "count": { - "type": "integer" + "formFields": { + "type": "array", + "items": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "defaultValue": { + "type": "string" + }, + "label": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "maxLines": { + "type": "integer" + }, + "placeholder": { + "type": "object" + } + }, + "type": "object" + } + }, + "submitElement": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "disableAfterInteracted": { + "type": "boolean" + }, + "optional": { + "type": "boolean" + }, + "action": { + "properties": { + "url": { + "type": "string" + }, + "method": { + "type": "string" + }, + "payload": { + "type": "object" + }, + "headers": { + "type": "object" + }, + "dataKey": { + "type": "string" + }, + "actionType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" } - } - } - } - } - } - } - } - } - } - } - } - }, - "/moderation/blocked-messages/{id}": { - "patch": { - "operationId": "review-blocked-message", - "summary": "Review Blocked Message", - "description": "Updates the review status of a previously blocked message. This endpoint allows approving or rejecting the message based on the moderation evaluation results.", - "tags": [ - "Moderation - Blocked Messages" - ], - "parameters": [ - { - "$ref": "#/components/parameters/apikey" - }, - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "string" - }, - "description": "Id of the blocked message to review." - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "status": { - "type": "string", - "description": "Indicates the review decision for the moderated message.", - "enum": [ - "approved", - "rejected" - ] - }, - "reviewed": { - "type": "boolean", - "description": "Specifies whether the moderation request has been reviewed." - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Blocked message reviewed successfully.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "success": { - "type": "boolean", - "example": true }, - "message": { - "type": "string", - "example": "Message with ID 540185 has been reviewed successfully." - } - } - } - } - } - } - } - } - } - } - }, - "/moderation/rules": { - "post": { - "tags": [ - "Moderation" - ], - "summary": "Add Rule", - "description": "Create a new moderation rule to specify actions and conditions for detecting and handling inappropriate content.", - "operationId": "create-rule", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModerationRequestBody" - } - } - } - }, - "responses": { - "200": { - "description": "Created Rule", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/ModerationData" - } - }, - "type": "object" + "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "id": "moderation-test", - "name": "Video Moderation", - "description": "AI-powered video moderation to detect unsafe content.", - "enabled": true, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "image", - "category": "word", - "operator": "contains", - "value": [ - "violence_greaterThan_30" - ], - "message": [ - "Image contains violence with confidence greater than 30" + "type": "object" + }, + "interactiveCategorySchema": { + "properties": { + "receiver": { + "description": "The receiver of the message.", + "type": "string" + }, + "muid": { + "description": "The muid will be a unique Identifier of the message.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1720003247, - "updatedAt": 1720003247, - "revisionId": "253179cf5f665257_moderation-test_1" - } - } - } - } - } - } - }, - "get": { - "tags": [ - "Moderation" - ], - "summary": "List Rules", - "description": "Retrieve a list of all moderation rules.", - "operationId": "list-rules", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - }, - { - "name": "limit", - "in": "query", - "description": "The number of records to fetch.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "List Rule", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" }, - "meta": { - "properties": { - "": { - "$ref": "#/components/schemas/metaSchema" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": [ - { - "id": "moderation-test", - "name": "Video Moderation", - "description": "AI-powered video moderation to detect unsafe content.", - "enabled": true, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "image", - "category": "word", - "operator": "contains", - "value": [ - "violence_greaterThan_30" - ], - "message": [ - "Image contains violence with confidence greater than 30" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1720003247, - "updatedAt": 1720003247, - "revisionId": "253179cf5f665257_moderation-test_1" - }, - { - "id": "video-moderation1", - "name": "Video Moderation", - "description": "AI-powered video moderation to detect unsafe content.", - "enabled": true, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "image", - "category": "word", - "operator": "contains", - "value": [ - "violence_greaterThan_30" - ], - "message": [ - "Image contains violence with confidence greater than 30" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1720000488, - "updatedAt": 1720000488, - "revisionId": "253179cf5f665257_video-moderation1_1" - }, - { - "id": "text-profanity-filter", - "name": "Text Profanity filter", - "description": "Detect and censor profanity in text messages.", - "enabled": true, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": true, - "isMediaPresent": false, - "entity": "message", - "operand": "text", - "category": "word", - "operator": "contains", - "value": [ - "profanity-list" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1718355386, - "updatedAt": 1720006272, - "revisionId": "253157108b5294c4_profanity-filter_25", - "default": true - }, - { - "id": "image-moderation", - "name": "AI Image Moderation", - "description": "AI-powered image moderation to detect unsafe content.", - "enabled": false, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "image", - "category": "word", - "operator": "contains", - "value": [ - "AnyOf_greaterThan_30" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1718350200, - "updatedAt": 1719932600, - "revisionId": "253157108b5294c4_image-moderation_11", - "default": true - }, - { - "id": "video-moderation", - "name": "AI Video Moderation", - "description": "AI-powered video moderation to detect unsafe content.", - "enabled": false, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "video", - "category": "word", - "operator": "contains", - "value": [ - "AnyOf_greaterThan_30" - ] - } - ], - "action": [ - "dropMessage" - ], - "active": true, - "createdAt": 1718350199, - "updatedAt": 1720006008, - "revisionId": "253157108b5294c4_video-moderation_10", - "default": true - }, - { - "id": "custom-profanity-filter", - "name": "Custom Profanity filter", - "description": "Detect and censor profanity in custom messages.", - "enabled": false, - "conditions": [ - { - "id": 1, - "isListReferencePresent": true, - "isMediaPresent": false, - "entity": "message", - "operand": "custom", - "category": "word", - "operator": "contains", - "value": [ - "profanity-list" - ] - } - ], - "action": [ - "dropMessage" - ], - "active": true, - "createdAt": 1718341200, - "updatedAt": 1719819136, - "revisionId": "253157108b5294c4_profanity-filter_8", - "default": true - }, - { - "id": "contact_details_filter", - "name": "Contact details filter", - "description": "Identifies and removes phone numbers from text", - "enabled": false, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": false, - "entity": "message", - "operand": "text", - "category": "pattern", - "operator": "contains", - "value": [ - "\\\\+?(\\\\d{1,3})?{-.\\\\s}?\\\\(?\\\\d{1,4}?\\\\)?{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,9}" - ] - }, - { - "id": 2, - "isKeywordsReferencePresent": false, - "isMediaPresent": false, - "entity": "message", - "operand": "custom", - "category": "pattern", - "operator": "contains", - "value": [ - "\\\\+?(\\\\d{1,3})?{-.\\\\s}?\\\\(?\\\\d{1,4}?\\\\)?{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,4}{-.\\\\s}?\\\\d{1,9}" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1718186338, - "updatedAt": 1719836048, - "revisionId": "2531882e5e289115_contact_details_filter_3", - "default": true - }, - { - "id": "email_filter", - "name": "Email filter", - "description": "Identify and remove email address from messages", - "enabled": false, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": false, - "entity": "message", - "operand": "text", - "category": "pattern", - "operator": "contains", - "value": [ - "^{a-zA-Z0-9._%+-}+@{a-zA-Z0-9.-}+\\\\.{a-zA-Z}{2,}$" - ] - }, - { - "id": 2, - "isKeywordsReferencePresent": false, - "isMediaPresent": false, - "entity": "message", - "operand": "custom", - "category": "pattern", - "operator": "contains", - "value": [ - "^{a-zA-Z0-9._%+-}+@{a-zA-Z0-9.-}+\\\\.{a-zA-Z}{2,}$" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1718099938, - "updatedAt": 1719836049, - "revisionId": "2531882e5e289115_contact_email_filter_5", - "default": true - } - ], - "meta": { - "current": { - "limit": 50, - "count": 8 - } - } - } - } - } - } - } - } - }, - "/moderation/rules/{ruleId}": { - "get": { - "tags": [ - "Moderation" - ], - "summary": "Get Rule", - "description": "Retrieve details of a specific moderation rule by its ID.", - "operationId": "get-rule", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - }, - { - "$ref": "#/components/parameters/ruleId" - } - ], - "responses": { - "200": { - "description": "Get Rule", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "id": "profanity-list", - "name": "Profane Words", - "category": "word", - "isCSV": false, - "searchTerms": [ - "fuck", - "damn", - "shit", - "cunt", - "nigga", - "nigger", - "wanker", - "cunt", - "fag", - "shithead", - "jizz", - "hellbitch", - "retard", - "cocksucker", - "cock", - "kill", - "kike", - "twat", - "bastard", - "death", - "asshole", - "wop", - "scumbag", - "penis", - "murder", - "dick", - "gook", - "vagina", - "rape", - "bastard", - "spic", - "spunk", - "beat" - ], - "createdAt": 1718354412, - "updatedAt": 1718354412, - "revisionId": "253157108b5294c4_profanity-list_1", - "active": true, - "default": true - } - } - } - } - } - } - }, - "put": { - "tags": [ - "Moderation" - ], - "summary": "Update Rule", - "description": "Update an existing moderation rule with new actions or conditions.", - "operationId": "update-rule", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - }, - { - "$ref": "#/components/parameters/ruleId" - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ModerationRequestBody" - } - } - } - }, - "responses": { - "200": { - "description": "Update Rule", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "id": "moderation-test", - "name": "Video Moderation", - "description": "AI-powered video moderation to detect unsafe content.", - "enabled": true, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "image", - "category": "word", - "operator": "contains", - "value": [ - "violence_greaterThan_30" - ], - "message": [ - "Image contains violence with confidence greater than 30" + "category": { + "description": "Category of the message. The available categories is interactive.", + "type": "string", + "default": "interactive", + "enum": [ + "interactive" + ] + }, + "type": { + "description": "Type of the message. The available values are card, form and customInteractive.", + "type": "string", + "default": "card", + "enum": [ + "card", + "form", + "customInteractive", + "scheduler" ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1720003247, - "updatedAt": 1720003247, - "revisionId": "253179cf5f665257_moderation-test_1" - } - } - } - } - } - } - }, - "delete": { - "tags": [ - "Moderation" - ], - "summary": "Remove rule", - "description": "Delete a specific moderation rule by its ID.", - "operationId": "delete-rule", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - }, - { - "$ref": "#/components/parameters/ruleId" - } - ], - "responses": { - "200": { - "description": "Delete Rule", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "success": true, - "message": "Rule with id moderation-test has been deleted successfully." - } - } - } - } - } - } - } - }, - "/moderation/keywords": { - "post": { - "tags": [ - "Moderation" - ], - "summary": "Add Keywords", - "description": "Create a new keyword list for moderation.", - "operationId": "create-rule-keyword", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/KeywordList" - } - } - } - }, - "responses": { - "200": { - "description": "Created Keyword", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "id": "profane-word-list-1", - "name": "profane word list", - "description": "Profane word list", - "category": "word", - "isCSV": true, - "searchTerms": [ - "\"a\"", - "\"b\"", - "\"c\"" - ], - "createdAt": 1720023805, - "updatedAt": 1720023805, - "revisionId": "253179cf5f665257_profane-word-list-1_1", - "active": true - } - } - } - } - } - } - }, - "get": { - "tags": [ - "Moderation" - ], - "summary": "List keywords", - "description": "Fetches all the keywords.", - "operationId": "list-rule-keywords", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - } - ], - "responses": { - "200": { - "description": "List Keywords", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" }, - "meta": { - "properties": { - "": { - "$ref": "#/components/schemas/metaSchema" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": [ - { - "_id": "66857afdb4bf371ddfba853b", - "id": "profane-word-list-1", - "appId": "253179cf5f665257", - "name": "profane word list", - "description": "Profane word list", - "category": "word", - "isCSV": true, - "searchTerms": [ - "\"a\"", - "\"b\"", - "\"c\"" - ], - "createdAt": 1720023805, - "updatedAt": 1720023805, - "revisionId": "253179cf5f665257_profane-word-list-1_1", - "active": true, - "__v": 0 - }, - { - "_id": "666c01eccfe97336757fb611", - "id": "profanity-list", - "name": "Profane Words", - "category": "word", - "isCSV": false, - "searchTerms": [ - "fuck", - "nigger", - "fuck", - "nigger", - "wanker", - "cunt", - "damn", - "shit", - "fag", - "shithead", - "jizz", - "hellbitch", - "retard", - "cocksucker", - "cock", - "kill", - "cunt", - "kike", - "twat", - "bastard", - "death", - "asshole", - "wop", - "scumbag", - "penis", - "murder", - "dick", - "gook", - "vagina", - "rape", - "bastard", - "spic", - "spunk", - "beat" - ], - "createdAt": 1718354412, - "updatedAt": 1718354412, - "revisionId": "253157108b5294c4_profanity-list_1", - "active": true, - "__v": 0, - "default": true, - "appId": "default" - } - ], - "meta": { - "current": { - "limit": 10, - "count": 2 - } - } - } - } - } - } - } - } - }, - "/moderation/keywords/{keywordId}": { - "get": { - "tags": [ - "Moderation" - ], - "summary": "Get keyword", - "description": "Retrieve details of a specific keyword list by its ID.", - "operationId": "get-rule-keyword", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/keywordId" - }, - { - "$ref": "#/components/parameters/appId" - } - ], - "responses": { - "200": { - "description": "Get Keyword", - "content": { - "application/json": { - "schema": { - "properties": { "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" + "description": "JSON containing message attributes. Please select the appropriate schema based on the type property.", + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/interactionFormSchema" + }, + { + "$ref": "#/components/schemas/interactionCardSchema" + }, + { + "$ref": "#/components/schemas/SchedulerSchema" + }, + { + "$ref": "#/components/schemas/customInteractiveSchema" + } + ] + }, + "multipleReceivers": { + "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", + "properties": { + "uids": { + "type": "array", + "items": { + "type": "string" + } + }, + "guids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { + "type": "string" } - }, - "type": "object" } - }, - "type": "object" }, + "type": "object", "example": { - "data": { - "id": "profanity-list", - "name": "Profane Words", - "category": "word", - "isCSV": false, - "searchTerms": [ - "fuck", - "nigger", - "fuck", - "nigger", - "wanker", - "cunt", - "damn", - "shit", - "fag", - "shithead", - "jizz", - "hellbitch", - "retard", - "cocksucker", - "cock", - "kill", - "cunt", - "kike", - "twat", - "bastard", - "death", - "asshole", - "wop", - "scumbag", - "penis", - "murder", - "dick", - "gook", - "vagina", - "rape", - "bastard", - "spic", - "spunk", - "beat" - ], - "createdAt": 1718354412, - "updatedAt": 1718354412, - "revisionId": "253157108b5294c4_profanity-list_1", - "active": true, - "default": true - } - } - } - } - } - } - }, - "put": { - "tags": [ - "Moderation" - ], - "summary": "Update keyword", - "description": "Update an existing keyword list.", - "operationId": "update-rule-keyword", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/keywordId" - }, - { - "$ref": "#/components/parameters/appId" - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/KeywordList" - } - } - } - }, - "responses": { - "200": { - "description": "Update Keyword", - "content": { - "application/json": { - "schema": { - "properties": { + "receiverType": "user", "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" + "interactionGoal": { + "type": "allOf", + "elementIds": [ + "element8" + ] + }, + "allowSenderInteraction": true, + "interactiveData": { + "title": "Form Title", + "formFields": [ + { + "elementType": "textInput", + "elementId": "element1", + "defaultValue": "vivek", + "label": "Name", + "optional": false, + "maxLines": 1, + "placeholder": { + "text": "write your name here" + } + }, + { + "elementType": "textInput", + "elementId": "element2", + "label": "Last Name", + "optional": false, + "maxLines": 1 + }, + { + "elementType": "textInput", + "elementId": "element3", + "label": "Address", + "optional": false, + "maxLines": 5 + }, + { + "elementType": "dropdown", + "elementId": "element4", + "label": "Country", + "optional": false, + "defaultValue": "option1", + "options": [ + { + "value": "option1", + "label": "INDIA" + }, + { + "value": "option2", + "label": "AUSTRALIA" + } + ] + }, + { + "elementType": "checkbox", + "elementId": "element5", + "optional": true, + "label": "Services", + "options": [ + { + "value": "option1", + "label": "Garbage" + }, + { + "value": "option2", + "label": "Electricity Bill" + }, + { + "value": "option3", + "label": "Lift" + } + ], + "defaultValue": [ + "option1", + "option2" + ] + }, + { + "elementType": "singleSelect", + "elementId": "element6", + "optional": false, + "label": "Wing", + "defaultValue": "option1", + "options": [ + { + "value": "option1", + "label": "A Wing" + }, + { + "value": "option2", + "label": "B Wing" + } + ] + }, + { + "elementType": "button", + "elementId": "element9", + "buttonText": "About us", + "disableAfterInteracted": true, + "action": { + "actionType": "urlNavigation", + "url": "https://www.cometchat.com" + } + } + ], + "submitElement": { + "elementType": "button", + "elementId": "element8", + "buttonText": "Submit", + "disableAfterInteracted": true, + "action": { + "actionType": "apiAction", + "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", + "method": "POST", + "payload": { + "category": "message", + "type": "text", + "data": { + "text": "Thanks For filling the Form!" + }, + "receiver": "superhero2", + "receiverType": "user" + }, + "headers": { + "appId": "10893f2ae68f59", + "Content-Type": "application/json", + "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", + "onBehalfOf": "superhero1" + }, + "dataKey": "CometChatData" + } + } } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "id": "profanity-list", - "name": "Profane Words", - "category": "word", - "isCSV": false, - "searchTerms": [ - "fuck", - "nigger", - "fuck", - "nigger", - "wanker", - "cunt", - "damn", - "shit", - "fag", - "shithead", - "jizz", - "hellbitch", - "retard", - "cocksucker", - "cock", - "kill", - "cunt", - "kike", - "twat", - "bastard", - "death", - "asshole", - "wop", - "scumbag", - "penis", - "murder", - "dick", - "gook", - "vagina", - "rape", - "bastard", - "spic", - "spunk", - "beat" - ], - "createdAt": 1718354412, - "updatedAt": 1718354412, - "revisionId": "253157108b5294c4_profanity-list_1", - "active": true, - "default": true - } + }, + "category": "interactive", + "type": "form", + "receiver": "superhero1", + "tags": [ + "tag1" + ] } - } - } - } - } - }, - "delete": { - "tags": [ - "Moderation" - ], - "summary": "Remove keyword", - "description": "Delete a keyword list by its ID.", - "operationId": "delete-rule-keyword", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/keywordId" - }, - { - "$ref": "#/components/parameters/appId" - } - ], - "responses": { - "200": { - "description": "Delete Keyword", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" + }, + "interactiveMessageSchema": { + "properties": { + "current": { + "properties": { + "limit": { + "type": "integer" + }, + "count": { + "type": "integer" + } + }, + "type": "object" + }, + "next": { + "properties": { + "affix": { + "type": "string" + }, + "sentAt": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "Keyword with id profanity-list has been deleted successfully." - } - } - } - } - } - } - } - }, - "/moderation/rules/{ruleId}/revisions": { - "get": { - "tags": [ - "Moderation" - ], - "summary": "Get Rule Revisions", - "description": "Fetches a rule's revisions.", - "operationId": "list-rule-revisions", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - }, - { - "$ref": "#/components/parameters/ruleId" - } - ], - "responses": { - "200": { - "description": "List Rule revisions", - "content": { - "application/json": { - "schema": { - "properties": { + "type": "object" + }, + "messageCategorySchema": { + "properties": { + "receiver": { + "description": "The receiver of the message.", + "type": "string" + }, + "muid": { + "description": "The muid will be a unique Identifier of the message.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" + ] + }, + "category": { + "description": "Category of the message. The available categories are message and custom.", + "type": "string", + "default": "message", + "enum": [ + "message" + ] + }, + "quotedMessageId": { + "description": "ID of the message being quoted.\nIf provided, the send message response will include a `quotedMessage` node\nin the response containing the referenced message object.", + "type": "string" + }, + "type": { + "description": "Type of the message. The available values are text, image, file, audio, video.", + "type": "string", + "default": "text", + "enum": [ + "text", + "image", + "file", + "audio", + "video" + ] + }, "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" + "description": "JSON containing message attributes.", + "properties": { + "text": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "attachments": { + "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", + "type": "array", + "items": { + "properties": { + "url": { + "description": "Contains the URL of the attachment.", + "type": "string" + }, + "name": { + "description": "Name of the attachment.", + "type": "string" + }, + "mimeType": { + "description": "Mime Type of attachment.", + "type": "string" + }, + "extension": { + "description": "The extension of the attachment.", + "type": "string" + }, + "size": { + "description": "The size of the attachment(in bytes).", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "multipleReceivers": { + "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", + "properties": { + "uids": { + "type": "array", + "items": { + "type": "string" + } + }, + "guids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" }, - "meta": { - "properties": { - "": { - "$ref": "#/components/schemas/metaSchema" + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { + "type": "string" } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": [ - { - "id": "moderation-test", - "name": "Video Moderation", - "description": "AI-powered video moderation to detect unsafe content.", - "enabled": true, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": false, - "entity": "message", - "operand": "text", - "category": "word", - "operator": "equals", - "value": [ - "paris" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": true, - "createdAt": 1720011899, - "updatedAt": 1720011905, - "revisionId": "253179cf5f665257_moderation-test_2" - }, - { - "id": "moderation-test", - "name": "Video Moderation", - "description": "AI-powered video moderation to detect unsafe content.", - "enabled": true, - "conditions": [ - { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "image", - "category": "word", - "operator": "contains", - "value": [ - "violence_greaterThan_30" - ], - "message": [ - "Image contains violence with confidence greater than 30" - ] - } - ], - "action": [ - "blockMessage" - ], - "active": false, - "createdAt": 1720011899, - "updatedAt": 1720011899, - "revisionId": "253179cf5f665257_moderation-test_1" - } - ], - "meta": { + "type": "object" + }, + "messageMetaSchema": { + "properties": { "current": { - "limit": 10, - "count": 2 - } - } - } - } - } - } - } - } - }, - "/moderation/blocked-messages": { - "get": { - "tags": [ - "Moderation" - ], - "summary": "List Blocked Messages", - "description": "Lists the messages blocked by the moderation service.", - "operationId": "list-moderation-blocked-messages", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - } - ], - "responses": { - "200": { - "description": "List Blocked Messages", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" - } - }, - "type": "object" + "properties": { + "limit": { + "type": "integer" + }, + "count": { + "type": "integer" + } + }, + "type": "object" }, - "meta": { - "properties": { - "": { - "$ref": "#/components/schemas/metaSchema" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": [ - { - "ruleId": "image-moderation", - "ruleName": "AI Image Moderation", - "revisionId": "253156be20433c97_image-moderation_4", - "condition": { - "id": 1, - "isKeywordsReferencePresent": false, - "isMediaPresent": true, - "entity": "message", - "operand": "image", - "category": "word", - "operator": "contains", - "value": [ - "Any unsafe content_greaterThan_70" - ], - "message": [ - "Image contains Any unsafe content with confidence greater than 70" - ], - "weight": 1 - }, - "message": { - "id": "65", - "muid": "_5zytzmceo", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2", - "sender": "cometchat-uid-1", - "receiverType": "user", - "receiver": "cometchat-uid-2", - "category": "message", - "type": "image", - "data": { - "metadata": { - "file": [] - }, - "resource": "WEB-4_0_3-ffa565b2-476e-493d-aeb5-4c750aae3ab1-1719925738505", - "url": "https://data-eu.cometchat.io/2601293c931567f7/media/1719993037_336554568_9e044ea0ed5817381b189680f392bafe.jpeg", - "attachments": [ - { - "name": "download.jpeg", - "extension": "jpeg", - "size": 4761, - "mimeType": "image/jpeg", - "url": "https://data-eu.cometchat.io/2601293c931567f7/media/1719993037_336554568_9e044ea0ed5817381b189680f392bafe.jpeg" - } - ], - "entities": { - "sender": { - "entity": { - "uid": "cometchat-uid-1", - "name": "Andrew Joseph", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "status": "offline", - "role": "default" - }, - "entityType": "user" + "next": { + "properties": { + "affix": { + "type": "string" }, - "receiver": { - "entity": { - "uid": "cometchat-uid-2", - "name": "George Alan", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp", - "status": "offline", - "role": "default", - "conversationId": "cometchat-uid-1_user_cometchat-uid-2" - }, - "entityType": "user" - } - }, - "moderation": { - "status": "pending" - } + "sentAt": { + "type": "integer" + }, + "id": { + "type": "string" + } }, - "sentAt": 1719993037, - "updatedAt": 1719993037 - }, - "action": [ - "blockMessage" - ], - "createdAt": 1719993038, - "updatedAt": 1719993038 - } - ], - "meta": { - "current": { - "limit": 50, - "count": 20 + "type": "object" } - } - } - } - } - } - } - } - }, - "/moderation/blocked-messages/{messageId}": { - "patch": { - "tags": [ - "Moderation" - ], - "summary": "Approve Blocked Messages", - "description": "Approves the messages blocked by the moderation service.", - "operationId": "approve-moderation-blocked-messages", - "parameters": [ - { - "$ref": "#/components/parameters/key" - }, - { - "$ref": "#/components/parameters/secret" - }, - { - "$ref": "#/components/parameters/appId" - }, - { - "$ref": "#/components/parameters/messageId" - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "status" - ], - "properties": { - "status": { - "description": "Moderation status of the message.", - "type": "string", - "example": "approved" - } }, "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Approve Blocked Messages", - "content": { - "application/json": { - "schema": { - "properties": { + }, + "messageReactionSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, "data": { - "properties": { - "": { - "$ref": "#/components/schemas/webhookSchema" + "properties": { + "text": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "entities": { + "properties": { + "sender": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "receiver": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "reactions": { + "type": "array", + "items": { + "properties": { + "reaction": { + "type": "string" + }, + "count": { + "type": "integer" + }, + "reactedByMe": { + "type": "boolean" + } + }, + "type": "object" } - }, - "type": "object" + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" } - }, - "type": "object" }, - "example": { - "data": { - "success": true, - "message": "Message with ID 268 has been approved." - } - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "APIKeySchema": { - "description": "Response data", - "properties": { - "apiKey": { - "type": "string" - }, - "name": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "CommonFields": { - "properties": { - "authToken": { - "type": "string", - "example": "cometchat-uid-3_1710141033938cf7e3c67cc44465440d" - }, - "timezone": { - "type": "string", - "example": "Asia/Kolkata" - } - }, - "type": "object" - }, - "CustomEmailProviderConfig": { - "properties": { - "isEnabled": { - "description": "Use custom provider", - "type": "boolean" - }, - "useStoredEmailID": { - "description": "If enabled, the webhook will be triggered for a user only if their email address is stored within CometChat.", - "type": "boolean" - }, - "webhookURL": { - "description": "The webhook URL to be triggered for the respective events.", - "type": "string" - }, - "useBasicAuth": { - "description": "To enable basic auth for the URL", - "type": "boolean" - }, - "basicAuthUsername": { - "description": "The username for Basic auth", - "type": "string" - }, - "basicAuthPassword": { - "description": "The password for Basic auth", - "type": "string" - } - }, - "type": "object" - }, - "CustomSMSProviderConfig": { - "properties": { - "isEnabled": { - "description": "Use custom provider", - "type": "boolean" - }, - "useStoredPhNo": { - "description": "If enabled, the webhook will be triggered for a user only if their phone number is stored within CometChat.", - "type": "boolean" - }, - "webhookURL": { - "description": "The webhook URL triggered for respective events", - "type": "string" - }, - "useBasicAuth": { - "description": "To enable basic auth for the URL", - "type": "boolean" - }, - "basicAuthUsername": { - "description": "The username for Basic auth", - "type": "string" - }, - "basicAuthPassword": { - "description": "The password for Basic auth", - "type": "string" - } - }, - "type": "object" - }, - "Day": { - "properties": { - "from": { - "type": "integer", - "format": "int32", - "maximum": 2359, - "minimum": 0 - }, - "to": { - "type": "integer", - "format": "int32", - "maximum": 2359, - "minimum": 0 - }, - "dnd": { - "type": "boolean" - } - }, - "type": "object" - }, - "Group": { - "properties": { - "messagesSetting": { - "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "messagesOverride": { - "type": "boolean" - }, - "repliesSetting": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "repliesOverride": { - "type": "boolean" - }, - "quotedRepliesSetting": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "quotedRepliesOverride": { - "type": "boolean" - }, - "reactionsSetting": { - "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "reactionsOverride": { - "type": "boolean" - }, - "memberLeftSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberLeftOverride": { - "type": "boolean" - }, - "memberAddedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberAddedOverride": { - "type": "boolean" - }, - "memberJoinedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberJoinedOverride": { - "type": "boolean" - }, - "memberKickedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberKickedOverride": { - "type": "boolean" - }, - "memberBannedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberBannedOverride": { - "type": "boolean" - }, - "memberUnbannedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberUnbannedOverride": { - "type": "boolean" - }, - "memberScopeChangedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberScopeChangedOverride": { - "type": "boolean" - }, - "messageEditedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "messageDeletedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - } - }, - "type": "object" - }, - "MediaMessageTemplate": { - "properties": { - "titleOneOnOne": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}}" - }, - "titleGroup": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" - }, - "body_image": { - "type": "string", - "example": "Has sent an {{message.type}}" - }, - "body_audio": { - "type": "string", - "example": "Has sent an {{message.type}}" - }, - "body_video": { - "type": "string", - "example": "Has sent a {{message.type}}" - }, - "body_file": { - "type": "string", - "example": "Has sent a {{message.type}}" - } - }, - "type": "object" - }, - "Mute": { - "properties": { - "dndPreferenceOverride": { - "type": "boolean" - }, - "mutedGroupsOverride": { - "type": "boolean" - }, - "mutedOneOnOnesOverride": { - "type": "boolean" - }, - "schedulePreferenceSetting": { - "properties": { - "monday": { - "$ref": "#/components/schemas/Day" - }, - "tuesday": { - "$ref": "#/components/schemas/Day" - }, - "wednesday": { - "$ref": "#/components/schemas/Day" - }, - "thursday": { - "$ref": "#/components/schemas/Day" - }, - "friday": { - "$ref": "#/components/schemas/Day" - }, - "saturday": { - "$ref": "#/components/schemas/Day" - }, - "sunday": { - "$ref": "#/components/schemas/Day" - } - }, - "type": "object" - }, - "schedulePreferenceOverride": { - "type": "boolean" - } - }, - "type": "object" - }, - "MutePreferences": { - "properties": { - "dnd": { - "description": "1: Disable DND\n2: Enable DND", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "schedule": { - "$ref": "#/components/schemas/Schedule" - } - }, - "type": "object" - }, - "PNSuccess": { - "properties": { - "success": { - "type": "boolean" - } - }, - "type": "object" - }, - "PlatformAPNS": { - "allOf": [ - { - "properties": { - "platform": { - "type": "string", - "enum": [ - "apns_ios_device", - "apns_flutter_device", - "apns_react_native_device", - "apns_ionic_cordova_device" - ], - "description": "APNS device push token platform." - }, - "providerId": { - "type": "string", - "example": "apns-provider-2" - }, - "deviceToken": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/CommonFields" - } - ] - }, - "PlatformFCM": { - "allOf": [ - { - "properties": { - "platform": { - "type": "string", - "enum": [ - "fcm_android", - "fcm_ios", - "fcm_web", - "fcm_flutter_android", - "fcm_flutter_ios", - "fcm_react_native_android", - "fcm_react_native_ios", - "fcm_ionic_cordova_android", - "fcm_ionic_cordova_ios" - ], - "description": "FCM push token platform." - }, - "providerId": { - "type": "string", - "example": "fcm-provider-2" - }, - "fcmToken": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/CommonFields" - } - ] - }, - "PlatformVOIP": { - "allOf": [ - { - "properties": { - "platform": { - "type": "string", - "enum": [ - "apns_ios_voip", - "apns_flutter_voip", - "apns_ionic_cordova_voip", - "apns_react_native_voip" - ], - "description": "APNS VoIP push token platform." - }, - "providerId": { - "type": "string", - "example": "apns-provider-2" - }, - "voipToken": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/CommonFields" - } - ] - }, - "Preferences": { - "properties": { - "push": { - "properties": { - "includeMessageObjectSetting": { - "description": "Include the message object in the push payload", - "type": "boolean" - }, - "includeSenderMetadataSetting": { - "description": "Include the sender's metadata as part of the message object", - "type": "boolean" - }, - "includeReceiverMetadataSetting": { - "description": "Include the receiver's metadata as part of the message object", - "type": "boolean" - }, - "trimTextFieldSetting": { - "description": "Trim the text field if present.", - "type": "boolean" - }, - "includeMessageMetadataSetting": { - "description": "Include the message's metadata as part of the message object", - "type": "boolean" - }, - "customJson": { - "description": "A custom JSON object for miscellaneous data", "type": "object" - } - }, - "type": "object" - }, - "call": { - "properties": { - "initiatedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ], - "example": 2 - }, - "ongoingSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ], - "example": 2 - }, - "cancelledSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ], - "example": 2 - }, - "busySetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ], - "example": 2 - }, - "rejectedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ], - "example": 2 - }, - "unansweredSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ], - "example": 2 - }, - "endedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ], - "example": 2 - } }, - "type": "object" - }, - "bypassPreferencesForMentions": { - "type": "boolean" - }, - "group": { - "$ref": "#/components/schemas/Group" - }, - "oneOnOne": { - "$ref": "#/components/schemas/oneOnOne" - }, - "mute": { - "$ref": "#/components/schemas/Mute" - }, - "email": { - "$ref": "#/components/schemas/email" - }, - "sms": { - "$ref": "#/components/schemas/sms" - } - }, - "type": "object" - }, - "Schedule": { - "properties": { - "monday": { - "$ref": "#/components/schemas/Day" - }, - "tuesday": { - "$ref": "#/components/schemas/Day" - }, - "wednesday": { - "$ref": "#/components/schemas/Day" - }, - "thursday": { - "$ref": "#/components/schemas/Day" - }, - "friday": { - "$ref": "#/components/schemas/Day" - }, - "saturday": { - "$ref": "#/components/schemas/Day" - }, - "sunday": { - "$ref": "#/components/schemas/Day" - } - }, - "type": "object" - }, - "ServiceAccountCreds": { - "properties": { - "project_id": { - "type": "string" - }, - "client_email": { - "type": "string" - }, - "private_key": { - "type": "string" - }, - "private_key_id": { - "type": "string" - } - }, - "type": "object" - }, - "SilentNotification": { - "properties": { - "chat": { - "type": "boolean" - }, - "call": { - "type": "boolean" - } - }, - "type": "object" - }, - "Sound": { - "properties": { - "chat": { - "type": "string" - }, - "call": { - "type": "string" - } - }, - "type": "object" - }, - "Template": { - "properties": { - "titleOneOnOne": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}}" - }, - "titleGroup": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" - }, - "body": { - "type": "string", - "example": "New text message" - } - }, - "type": "object" - }, - "Templates": { - "properties": { - "usePrivacyTemplate": { - "description": "1: Use default templates\n2: Use privacy templates\n3: Use default templates with end-user privacy override", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "textMessageTemplateDefault": { - "$ref": "#/components/schemas/Template" - }, - "textMessageTemplatePrivacy": { - "$ref": "#/components/schemas/Template" - }, - "mediaMessageTemplateDefault": { - "$ref": "#/components/schemas/MediaMessageTemplate" - }, - "mediaMessageTemplatePrivacy": { - "$ref": "#/components/schemas/MediaMessageTemplate" - }, - "pollMessageTemplateDefault": { - "description": "Default template for poll messages (category: custom, type: extension_poll).", - "allOf": [ - { + "messageSchema": { + "description": "Response data", "properties": { - "body_fallback": { - "type": "string" - } + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "properties": { + "text": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "entities": { + "properties": { + "sender": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "receiver": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } }, "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - }, - "pollMessageTemplatePrivacy": { - "description": "Privacy template for poll messages (category: custom, type: extension_poll).", - "allOf": [ - { + }, + "metaSchema": { "properties": { - "body_fallback": { - "type": "string" - } + "pagination": { + "properties": { + "total": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "per_page": { + "type": "integer" + }, + "current_page": { + "type": "integer" + }, + "total_pages": { + "type": "integer" + } + }, + "type": "object" + } }, "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - }, - "reminderMessageTemplateDefault": { - "description": "Default template for reminder messages (category: custom, type: extension_reminders).", - "allOf": [ - { + }, + "moderationMessageData": { + "description": "Can contain any additional properties except for the key properties.", "properties": { - "body_fallback": { - "type": "string" - } + "text": { + "description": "The meaning of the `data.text` property depends on the values of `category` and `type`:\n1. When `category` is `'message'` and `type` is `'text'`, it represents the text content of the message.\n2. When `category` is `'message'` and `type` is not `'text'`, it represents the caption associated with the attachment.", + "type": "string" + }, + "customData": { + "description": "when category==”custom”, this property can have any JSON object.", + "type": "object" + }, + "attachments": { + "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", + "type": "array", + "items": { + "required": [ + "name", + "mimeType", + "extension", + "url" + ], + "properties": { + "url": { + "description": "Contains the URL of the attachment. The developer has to make sure that the URL is accessible while calling the API. The API will be downloading the attachment from its current location and upload it to CometChat’s attachment storage.", + "type": "string" + }, + "name": { + "description": "Name of the attachment.", + "type": "string" + }, + "mimeType": { + "description": "Mime Type of attachment.", + "type": "string" + }, + "extension": { + "description": "The extension of the attachment.", + "type": "string" + }, + "size": { + "description": "The size of the attachment(in bytes).", + "type": "string" + } + }, + "type": "object" + } + }, + "metadata": { + "type": "object" + } }, "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - }, - "reminderMessageTemplatePrivacy": { - "description": "Privacy template for reminder messages (category: custom, type: extension_reminders).", - "allOf": [ - { + }, + "muteConversation": { "properties": { - "body_fallback": { - "type": "string" - } + "id": { + "description": "uid or guid", + "type": "string" + }, + "type": { + "description": "oneOnOne or group", + "type": "string", + "enum": [ + "oneOnOne", + "group" + ] + }, + "until": { + "description": "This is a valid timestamp from the future, E.g: 1710696964705", + "type": "integer", + "format": "int64" + } }, "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - }, - "customMessageTemplateDefault": { - "allOf": [ - { + }, + "objectEntitySchema": { "properties": { - "body_fallback": { - "type": "string" - } + "entities": { + "properties": { + "by": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "for": { + "properties": { + "entity": { + "properties": { + "guid": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "updatedBy": { + "type": "integer" + }, + "description": { + "type": "integer" + }, + "membersCount": { + "type": "integer" + }, + "conversationId": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "on": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "link": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } }, "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - }, - "customMessageTemplatePrivacy": { - "allOf": [ - { + }, + "oneOnOne": { "properties": { - "body_fallback": { - "type": "string" - } + "messagesSetting": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "messagesOverride": { + "type": "boolean" + }, + "repliesSetting": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "repliesOverride": { + "type": "boolean" + }, + "reactionsSetting": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "reactionsOverride": { + "type": "boolean" + }, + "messageEditedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "messageDeletedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + } }, "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - }, - "emailSubjectTemplateDefault": { - "properties": { - "subjectGroup": { - "type": "string", - "example": "While you were away..." - }, - "subjectOneOnOne": { - "type": "string", - "example": "While you were away..." - } - }, - "type": "object" - }, - "emailSubjectTemplatePrivacy": { - "properties": { - "subjectGroup": { - "type": "string", - "example": "While you were away..." - }, - "subjectOneOnOne": { - "type": "string", - "example": "While you were away..." - } - }, - "type": "object" - }, - "smsContentTemplateDefault": { - "properties": { - "bodyGroup": { - "type": "string", - "example": "You've received new messages in {{groupDetails.name}}! You can read the message at https://your-website.com." - }, - "bodyOneOnOne": { - "type": "string", - "example": "You've received new messages from {{sender.name}}! You can read the message at https://your-website.com." - } - }, - "type": "object" - }, - "smsContentTemplatePrivacy": { - "properties": { - "bodyGroup": { - "type": "string", - "example": "You've received new messages in {{groupDetails.name}}! You can read the message at https://your-website.com." - }, - "bodyOneOnOne": { - "type": "string", - "example": "You've received new messages from {{sender.name}}! You can read the message at https://your-website.com." - } }, - "type": "object" - }, - "userMentionTemplatePrivacy": { - "$ref": "#/components/schemas/UserMentionTemplate" - }, - "groupMentionTemplatePrivacy": { - "$ref": "#/components/schemas/GroupMentionTemplate" - }, - "groupMentionTemplateDefault": { - "$ref": "#/components/schemas/GroupMentionTemplate" - }, - "userMentionTemplateDefault": { - "$ref": "#/components/schemas/UserMentionTemplate" - } - }, - "type": "object" - }, - "TimeRange": { - "required": [ - "from", - "to" - ], - "properties": { - "from": { - "type": "string" - }, - "to": { - "type": "string" - } - }, - "type": "object" - }, - "authTokenSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "authToken": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "bannedUserSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "isBanned": { - "type": "boolean" - }, - "joinedAt": { - "type": "integer" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "blockedUserSchema": { - "description": "Response data", - "properties": { - "blockedByMe": { - "type": "boolean" - }, - "blockedByMeAt": { - "type": "integer" - }, - "blockedAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "conversationSchema": { - "description": "Response data", - "properties": { - "conversationId": { - "type": "string" - }, - "conversationType": { - "type": "string" - }, - "unreadMessageCount": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "lastMessage": { - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "type": "object", - "allOf": [ - { - "properties": { - "action": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/objectEntitySchema" - } - ] - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "receipts": { + "pnSettingSchema": { + "description": "Response data", "properties": { - "data": { - "type": "array", - "items": {} - } + "preferences": { + "$ref": "#/components/schemas/Preferences" + }, + "sound": { + "$ref": "#/components/schemas/Sound" + }, + "templates": { + "$ref": "#/components/schemas/Templates" + } }, "type": "object" - } }, - "type": "object" - }, - "conversationWith": { - "type": "object" - } - }, - "type": "object" - }, - "conversationWithSchema": { - "properties": { - "guid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "type": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "membersCount": { - "type": "integer" - }, - "joinedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - }, - "hasJoined": { - "type": "boolean", - "default": "true" - }, - "createdAt": { - "type": "integer" - }, - "owner": { - "type": "string" - }, - "updatedAt": { - "type": "integer" - }, - "updatedBy": { - "type": "string" - } - }, - "type": "object" - }, - "createApnsProvider": { - "properties": { - "providerId": { - "type": "string" - }, - "keyId": { - "type": "string" - }, - "teamId": { - "type": "string" - }, - "bundleId": { - "type": "string" - }, - "p8KeyFilename": { - "type": "string" - }, - "p8Key": { - "type": "string" - }, - "includeContentAvailable": { - "type": "boolean" - }, - "includeMutableContent": { - "type": "boolean" - }, - "productionMode": { - "type": "boolean" - } - }, - "type": "object" - }, - "customCategorySchema": { - "properties": { - "receiver": { - "description": "The receiver of the message.", - "type": "string" - }, - "muid": { - "description": "The muid will be a unique Identifier of the message.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "category": { - "description": "Category of the message. The available categories is custom.", - "type": "string", - "default": "custom", - "enum": [ - "custom" - ] - }, - "type": { - "description": "Type of the message.", - "type": "string" - }, - "data": { - "description": "JSON containing message attributes.", - "properties": { - "customData": { - "description": "when category==”custom”, this property can have any JSON object.", - "type": "object" - } - }, - "type": "object" - }, - "multipleReceivers": { - "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", - "properties": { - "uids": { - "type": "array", - "items": { - "type": "string" - } - }, - "guids": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "dataPointSchema": { - "description": "Response data", - "properties": { - "messagesSent": { - "type": "integer" - }, - "readReceipts": { - "type": "integer" - }, - "deliveryReceipts": { - "type": "integer" - }, - "startTime": { - "type": "integer" - }, - "endTime": { - "type": "integer" - } - }, - "type": "object" - }, - "deleteSchema": { - "properties": { - "success": { - "type": "boolean" - }, - "message": { - "type": "string" - } - }, - "type": "object" - }, - "email": { - "properties": { - "notifyForUnreadOnly": { - "description": "If the value is false, the notification will contain all the messages, not just unread.", - "type": "boolean" - }, - "intervalInSeconds": { - "type": "integer" - }, - "maxPerDay": { - "type": "integer" - }, - "maxPerDayPerConversation": { - "type": "integer" - } - }, - "type": "object" - }, - "fcmCreateProviderSchema": { - "properties": { - "providerId": { - "type": "string" - }, - "serviceAccountFilename": { - "type": "string" - }, - "serviceAccountCreds": { - "$ref": "#/components/schemas/ServiceAccountCreds" - }, - "notificationInPayload": { - "properties": { - "ios": { - "$ref": "#/components/schemas/SilentNotification" - }, - "android": { - "$ref": "#/components/schemas/SilentNotification" - }, - "web": { - "$ref": "#/components/schemas/SilentNotification" - } + "pnTokenSchema": { + "description": "Response data", + "oneOf": [ + { + "$ref": "#/components/schemas/PlatformFCM" + }, + { + "$ref": "#/components/schemas/PlatformAPNS" + }, + { + "$ref": "#/components/schemas/PlatformVOIP" + } + ] }, - "type": "object" - } - }, - "type": "object" - }, - "groupEntitySchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "action": { - "type": "string" - }, - "entities": { + "pnUpdatePreferences": { + "description": "Response data", "properties": { - "by": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - }, - "on": { - "properties": { - "entity": { + "groupPreferences": { "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } + "groupMessages": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "groupReplies": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "groupReactions": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "groupMemberLeft": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberAdded": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberJoined": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberKicked": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberBanned": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberUnbanned": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberScopeChanged": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + } }, "type": "object" - }, - "entityType": { - "type": "string" - } }, - "type": "object" - }, - "for": { - "properties": { - "entity": { + "oneOnOnePreferences": { "properties": { - "guid": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "name": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" + "oneOnOneMessages": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "oneOnOneReplies": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "oneOnOneReactions": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] } - }, - "type": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "membersCount": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } }, "type": "object" - }, - "entityType": { - "type": "string" - } }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "avatar": { - "type": "string" - }, - "metadata": { - "properties": { - "email": { - "type": "string" - } - }, - "type": "object" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "groupMemberListSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "joinedAt": { - "type": "integer" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "groupMemberSchema": { - "description": "Response data", - "properties": { - "usersToBan": { - "properties": { - "": { - "properties": { - "success": { - "type": "boolean" - } + "mutePreferences": { + "$ref": "#/components/schemas/MutePreferences" + }, + "usePrivacyTemplate": { + "type": "boolean" + } }, "type": "object" - } }, - "type": "object" - }, - "admins": { - "properties": { - "": { + "pushNotificationSchema": { "properties": { - "success": { - "type": "boolean" - }, - "data": { - "type": "object" - } + "success": { + "type": "boolean" + } }, "type": "object" - } }, - "type": "object" - }, - "moderators": { - "properties": { - "": { - "properties": { - "success": { - "type": "boolean" - }, - "data": { - "type": "object" - } - }, - "type": "object" - } + "pushProviders": { + "description": "Response data", + "type": "array", + "items": {} }, - "type": "object" - }, - "participants": { - "properties": { - "": { + "reactionSchema": { + "description": "Response data", "properties": { - "success": { - "type": "boolean" - }, - "data": { - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "groupSchema": { - "description": "Response data", - "properties": { - "guid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "type": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "membersCount": { - "type": "integer" - }, - "joinedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - }, - "hasJoined": { - "type": "boolean" - }, - "owner": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "interactionCardSchema": { - "title": "Card Schema", - "properties": {}, - "type": "object" - }, - "interactionFormSchema": { - "title": "Form Schema", - "properties": {}, - "type": "object" - }, - "messageCategorySchema": { - "properties": { - "receiver": { - "description": "The receiver of the message.", - "type": "string" - }, - "muid": { - "description": "The muid will be a unique Identifier of the message.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "category": { - "description": "Category of the message. The available categories are message and custom.", - "type": "string", - "default": "message", - "enum": [ - "message" - ] - }, - "type": { - "description": "Type of the message. The available values are text, image, file, audio, video.", - "type": "string", - "default": "text", - "enum": [ - "text", - "image", - "file", - "audio", - "video" - ] - }, - "data": { - "description": "JSON containing message attributes.", - "properties": { - "text": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "attachments": { - "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", - "type": "array", - "items": { - "properties": { - "url": { - "description": "Contains the URL of the attachment.", - "type": "string" + "id": { + "type": "string" }, - "name": { - "description": "Name of the attachment.", - "type": "string" + "messageId": { + "type": "string" + }, + "reaction": { + "type": "string" }, - "mimeType": { - "description": "Mime Type of attachment.", - "type": "string" + "uid": { + "type": "string" }, - "extension": { - "description": "The extension of the attachment.", - "type": "string" + "reactedAt": { + "type": "integer" }, - "size": { - "description": "The size of the attachment(in bytes).", - "type": "string" + "reactedBy": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" } - }, - "type": "object" - } - } - }, - "type": "object" - }, - "multipleReceivers": { - "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", - "properties": { - "uids": { - "type": "array", - "items": { - "type": "string" - } - }, - "guids": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "messageMetaSchema": { - "properties": { - "current": { - "properties": { - "limit": { - "type": "integer" - }, - "count": { - "type": "integer" - } - }, - "type": "object" - }, - "next": { - "properties": { - "affix": { - "type": "string" - }, - "sentAt": { - "type": "integer" - }, - "id": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "messageReactionSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "text": { - "type": "string" - }, - "metadata": { + }, "type": "object" - }, - "entities": { + }, + "roleSchema": { + "description": "Response data", "properties": { - "sender": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, + "role": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { "type": "object" - }, - "entityType": { + }, + "email": { "type": "string" - } }, - "type": "object" - }, - "receiver": { - "properties": { - "entity": { + "settings": { "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } + "listUsers": { + "type": "string" + }, + "sendMessagesTo": { + "type": "string" + } }, "type": "object" - }, - "entityType": { - "type": "string" - } }, - "type": "object" - } + "createdAt": { + "type": "integer" + } }, "type": "object" - } }, - "type": "object" - }, - "reactions": { - "type": "array", - "items": { - "properties": { - "reaction": { - "type": "string" - }, - "count": { - "type": "integer" - }, - "reactedByMe": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "messageSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "text": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "entities": { + "sms": { "properties": { - "sender": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "notifyForUnreadOnly": { + "description": "If the value is false, the notification will contain all the messages, not just unread.", + "type": "boolean" }, - "type": "object" - }, - "receiver": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "intervalInSeconds": { + "type": "integer" + }, + "maxPerDay": { + "type": "integer" + }, + "maxPerDayPerConversation": { + "type": "integer" + }, + "includeMessageObjectSetting": { + "description": "Includes the message object in the SMS payload", + "type": "boolean" + }, + "includeSenderMetadataSetting": { + "description": "Includes sender metadata in the message object", + "type": "boolean" + }, + "includeReceiverMetadataSetting": { + "description": "Includes receiver metadata in the message object", + "type": "boolean" }, - "type": "object" - } + "includeMessageMetadataSetting": { + "description": "Includes message metadata in the message object", + "type": "boolean" + } }, "type": "object" - } - }, - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "metaSchema": { - "properties": { - "pagination": { - "properties": { - "total": { - "type": "integer" - }, - "count": { - "type": "integer" - }, - "per_page": { - "type": "integer" - }, - "current_page": { - "type": "integer" - }, - "total_pages": { - "type": "integer" - } }, - "type": "object" - } - }, - "type": "object" - }, - "muteConversation": { - "properties": { - "id": { - "description": "uid or guid", - "type": "string" - }, - "type": { - "description": "oneOnOne or group", - "type": "string", - "enum": [ - "oneOnOne", - "group" - ] - }, - "until": { - "description": "This is a valid timestamp from the future, E.g: 1710696964705", - "type": "integer", - "format": "int64" - } - }, - "type": "object" - }, - "objectEntitySchema": { - "properties": { - "entities": { - "properties": { - "by": { + "triggerSchema": { + "description": "Response data", "properties": { - "entity": { - "properties": { - "uid": { + "id": { "type": "string" - }, - "name": { + }, + "category": { "type": "string" - }, - "status": { + }, + "description": { "type": "string" - }, - "role": { + } + }, + "type": "object" + }, + "unmuteConversation": { + "properties": { + "id": { + "description": "uid or guid", "type": "string" - }, - "createdAt": { - "type": "integer" - } }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "type": { + "description": "oneOnOne or group", + "type": "string", + "enum": [ + "oneOnOne", + "group" + ] + } }, "type": "object" - }, - "for": { + }, + "unregisterpnToken": { + "required": [ + "authToken" + ], "properties": { - "entity": { - "properties": { - "guid": { - "type": "string" - }, - "icon": { + "authToken": { "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "updatedBy": { - "type": "integer" - }, - "description": { - "type": "integer" - }, - "membersCount": { - "type": "integer" - }, - "conversationId": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } + } }, "type": "object" - }, - "on": { + }, + "updatemessageSchema": { + "description": "Response data", "properties": { - "entity": { - "properties": { - "uid": { + "id": { "type": "string" - }, - "link": { + }, + "conversationId": { "type": "string" - }, - "name": { + }, + "sender": { "type": "string" - }, - "role": { + }, + "receiverType": { "type": "string" - }, - "avatar": { + }, + "receiver": { "type": "string" - }, - "status": { + }, + "category": { "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { + }, + "type": { "type": "string" - } }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "data": { + "properties": { + "action": { + "type": "string" + }, + "entities": { + "properties": { + "by": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "for": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "on": { + "properties": { + "entity": { + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "properties": { + "text": { + "type": "string" + }, + "entities": { + "properties": { + "sender": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "receiver": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "sentAt": { + "type": "integer" + }, + "editedAt": { + "type": "integer" + }, + "editedBy": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": {} + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } }, "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "oneOnOne": { - "properties": { - "messagesSetting": { - "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "messagesOverride": { - "type": "boolean" - }, - "repliesSetting": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "repliesOverride": { - "type": "boolean" - }, - "quotedRepliesSetting": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "quotedRepliesOverride": { - "type": "boolean" - }, - "reactionsSetting": { - "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "reactionsOverride": { - "type": "boolean" - }, - "messageEditedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "messageDeletedSetting": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - } - }, - "type": "object" - }, - "pnSettingSchema": { - "description": "Response data", - "properties": { - "preferences": { - "$ref": "#/components/schemas/Preferences" - }, - "sound": { - "$ref": "#/components/schemas/Sound" - }, - "templates": { - "$ref": "#/components/schemas/Templates" - } - }, - "type": "object" - }, - "pnTokenSchema": { - "description": "Response data", - "oneOf": [ - { - "title": "PlatformFCM", - "$ref": "#/components/schemas/PlatformFCM" - }, - { - "title": "PlatformAPNS", - "$ref": "#/components/schemas/PlatformAPNS" - }, - { - "title": "PlatformVOIP", - "$ref": "#/components/schemas/PlatformVOIP" - } - ] - }, - "pnUpdatePreferences": { - "description": "Response data", - "properties": { - "groupPreferences": { - "properties": { - "groupMessages": { - "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "groupReplies": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "groupQuotedReplies": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "groupReactions": { - "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "groupMemberLeft": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberAdded": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberJoined": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberKicked": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberBanned": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberUnbanned": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberScopeChanged": { - "description": "1: Don't notify\n2: Notify", - "type": "integer", - "enum": [ - 1, - 2 - ] - } - }, - "type": "object" - }, - "oneOnOnePreferences": { - "properties": { - "oneOnOneMessages": { - "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "oneOnOneReplies": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "oneOnOneQuotedReplies": { - "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "oneOnOneReactions": { - "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - } - }, - "type": "object" - }, - "mutePreferences": { - "$ref": "#/components/schemas/MutePreferences" - }, - "usePrivacyTemplate": { - "type": "boolean" - } - }, - "type": "object" - }, - "pushNotificationSchema": { - "properties": { - "success": { - "type": "boolean" - } - }, - "type": "object" - }, - "pushProviders": { - "description": "Response data", - "type": "array", - "items": {} - }, - "reactionSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "messageId": { - "type": "string" - }, - "reaction": { - "type": "string" - }, - "uid": { - "type": "string" - }, - "reactedAt": { - "type": "integer" - }, - "reactedBy": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "roleSchema": { - "description": "Response data", - "properties": { - "role": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "email": { - "type": "string" - }, - "settings": { - "properties": { - "listUsers": { - "type": "string" - }, - "sendMessagesTo": { - "type": "string" - } }, - "type": "object" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "sms": { - "properties": { - "notifyForUnreadOnly": { - "description": "If the value is false, the notification will contain all the messages, not just unread.", - "type": "boolean" - }, - "intervalInSeconds": { - "type": "integer" - }, - "maxPerDay": { - "type": "integer" - }, - "maxPerDayPerConversation": { - "type": "integer" - } - }, - "type": "object" - }, - "triggerSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "category": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "type": "object" - }, - "unmuteConversation": { - "properties": { - "id": { - "description": "uid or guid", - "type": "string" - }, - "type": { - "description": "oneOnOne or group", - "type": "string", - "enum": [ - "oneOnOne", - "group" - ] - } - }, - "type": "object" - }, - "unregisterpnToken": { - "required": [ - "authToken" - ], - "properties": { - "authToken": { - "type": "string" - } - }, - "type": "object" - }, - "updatemessageSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "action": { - "type": "string" - }, - "entities": { + "usageMetricsSchema": { + "description": "Response data", "properties": { - "by": { - "properties": { - "entity": { + "metrics": { "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } + "audio_minutes": { + "type": "integer" + }, + "video_minutes": { + "type": "integer" + }, + "recorded_minutes": { + "type": "integer" + }, + "active_users": { + "type": "integer" + }, + "concurrent_users": { + "type": "integer" + } }, "type": "object" - }, - "entityType": { - "type": "string" - } }, - "type": "object" - }, - "for": { - "properties": { - "entity": { + "time_range": { "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } + "fromDate": { + "type": "integer" + }, + "toDate": { + "type": "integer" + } }, "type": "object" - }, - "entityType": { + } + }, + "type": "object" + }, + "userConversationSchema": { + "description": "Response data", + "properties": { + "conversationId": { + "type": "string" + }, + "conversationType": { + "type": "string" + }, + "unreadMessageCount": { "type": "string" - } }, - "type": "object" - }, - "on": { - "properties": { - "entity": { + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "lastMessage": { "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "text": { + "id": { "type": "string" - }, - "entities": { - "properties": { - "sender": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - }, - "receiver": { - "properties": { - "entity": { + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "allOf": [ + { "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } + "action": { + "type": "string" + } }, "type": "object" - }, - "entityType": { - "type": "string" - } }, - "type": "object" - } - }, - "type": "object" - } + { + "$ref": "#/components/schemas/objectEntitySchema" + } + ] }, - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "editedAt": { - "type": "integer" - }, - "editedBy": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "tags": { - "type": "array", - "items": {} - } + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } }, "type": "object" - }, - "entityType": { - "type": "string" - } }, - "type": "object" - } + "conversationWith": { + "type": "object" + } }, "type": "object" - } }, - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "usageMetricsSchema": { - "description": "Response data", - "properties": { - "metrics": { - "properties": { - "audio_minutes": { - "type": "integer" - }, - "video_minutes": { - "type": "integer" - }, - "recorded_minutes": { - "type": "integer" - }, - "active_users": { - "type": "integer" - }, - "concurrent_users": { - "type": "integer" - } + "userReceiverDetails": { + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the receiver.", + "type": "string" + }, + "name": { + "description": "Name of the receiver.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the user receiving the message.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the receiver.", + "type": "string" + }, + "role": { + "description": "Role of the receiver. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the receiver was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the receiver.", + "type": "object" + }, + "tags": { + "description": "A string array containing receiver tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "type": "object" }, - "type": "object" - }, - "time_range": { - "properties": { - "fromDate": { - "type": "integer" - }, - "toDate": { - "type": "integer" - } + "userSchema": { + "description": "Response data", + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "metadata": { + "properties": { + "email": { + "type": "string" + } + }, + "type": "object" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" }, - "type": "object" - } - }, - "type": "object" - }, - "userConversationSchema": { - "description": "Response data", - "properties": { - "conversationId": { - "type": "string" - }, - "conversationType": { - "type": "string" - }, - "unreadMessageCount": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "lastMessage": { - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "type": "object", - "allOf": [ - { - "properties": { - "action": { + "userSenderDetails": { + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the sender.", "type": "string" - } }, - "type": "object" - }, - { - "$ref": "#/components/schemas/objectEntitySchema" - } - ] - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } + "name": { + "description": "Name of the sender.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the user sending the message.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the sender.", + "type": "string" + }, + "role": { + "description": "Role of the sender. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the sender was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the sender.", + "type": "object" + }, + "tags": { + "description": "A string array containing sender tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "type": "object" }, - "type": "object" - }, - "conversationWith": { - "type": "object" - } + "webhookSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "webhookURL": { + "type": "string" + }, + "useBasicAuth": { + "type": "boolean" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + } }, - "type": "object" - }, - "userSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "metadata": { - "properties": { - "email": { - "type": "string" - } + "parameters": { + "authToken": { + "name": "authToken", + "in": "path", + "description": "An auth token of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Auth Token", + "value": "" + } + } }, - "type": "object" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "webhookSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "webhookURL": { - "type": "string" - }, - "useBasicAuth": { - "type": "boolean" - }, - "username": { - "type": "string" - }, - "password": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "UserMentionTemplate": { - "description": "Push notification template for user @mentions. User mentions can occur in both one-on-one and group conversations.", - "properties": { - "titleOneOnOne": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}}" - }, - "titleGroup": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" - }, - "bodyOneOnOne": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} mentioned you: {{message.data.text}}" - }, - "bodyGroup": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} mentioned you in {{message.data.entities.receiver.entity.name}}: {{message.data.text}}" - }, - "body_fallback": { - "type": "string", - "example": "New mention" - } - }, - "type": "object" - }, - "GroupMentionTemplate": { - "description": "Push notification template for @all mentions.", - "properties": { - "titleGroup": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" - }, - "body": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} mentioned everyone: {{message.data.text}}" - }, - "body_fallback": { - "type": "string", - "example": "New mention" - } - }, - "type": "object" - } - }, - "parameters": { - "authToken": { - "name": "authToken", - "in": "path", - "description": "An auth token of a user.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "Auth Token", - "value": "cometchat-uid-1_1625206799abcdef" - } - } - }, - "conversationId": { - "name": "conversationId", - "in": "path", - "description": "(Required) conversation id", - "required": true, - "schema": { - "type": "string" - } - }, - "uid--conversation": { - "name": "uid", - "in": "path", - "description": "UID of the user whose conversation is being accessed.", - "required": true, - "schema": { - "type": "string" - } - }, - "guid--conversation": { - "name": "guid", - "in": "path", - "description": "GUID of the group whose conversation is being accessed.", - "required": true, - "schema": { - "type": "string" - } - }, - "uid": { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" - }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - "guid": { - "name": "guid", - "in": "path", - "description": "A GUID of a group.", - "required": true, - "schema": { - "type": "string" + "conversationId": { + "name": "conversationId", + "in": "path", + "description": "(Required) conversation id", + "required": true, + "schema": { + "type": "string" + } + }, + "uid--conversation": { + "name": "uid", + "in": "path", + "description": "UID of the user whose conversation needs to be fetched.", + "required": true, + "schema": { + "type": "string" + } + }, + "guid--conversation": { + "name": "guid", + "in": "path", + "description": "GUID of the group whose conversation needs to be fetched.", + "required": true, + "schema": { + "type": "string" + } + }, + "uid": { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + "guid": { + "name": "guid", + "in": "path", + "description": "A GUID of a group.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "GUID", + "value": "" + } + } + }, + "requiredonBehalfOf": { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + "requiredAppId": { + "name": "appId", + "in": "header", + "description": "(Required) App ID", + "required": true, + "schema": { + "type": "string" + } + }, + "onBehalfOf": { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "schema": { + "type": "string" + } + }, + "messageId": { + "name": "messageId", + "in": "path", + "description": "messageId for the moderation service", + "required": true, + "schema": { + "type": "string" + } + }, + "ruleId": { + "name": "ruleId", + "in": "path", + "description": "Rule ID", + "required": true, + "schema": { + "type": "string" + } + }, + "keywordId": { + "name": "keywordId", + "in": "path", + "description": "Keyword ID", + "required": true, + "schema": { + "type": "string" + } + }, + "pushToken": { + "name": "pushToken", + "in": "path", + "description": "(Required) Push Token", + "required": true, + "schema": { + "type": "string" + } + }, + "providerId": { + "name": "providerId", + "in": "path", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Provider ID", + "value": "" + } + } + }, + "requiredUID": { + "name": "uid", + "in": "query", + "description": "(Required) UID", + "required": true, + "schema": { + "type": "string" + } + } }, "examples": { - "string": { - "summary": "GUID", - "value": "cometchat-guid-1" - } - } - }, - "requiredonBehalfOf": { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - "requiredAppId": { - "name": "appId", - "in": "header", - "description": "(Required) App ID", - "required": true, - "schema": { - "type": "string" - } - }, - "onBehalfOf": { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "schema": { - "type": "string" - } - }, - "pushToken": { - "name": "pushToken", - "in": "path", - "description": "(Required) Push Token", - "required": true, - "schema": { - "type": "string" - } - }, - "providerId": { - "name": "providerId", - "in": "path", - "description": "Provider ID.", - "required": true, - "schema": { - "type": "string" + "text-message": { + "summary": "Text Message example", + "value": { + "receiver": "cometchat-uid-2", + "receiverType": "user", + "category": "message", + "type": "text", + "data": { + "text": "Hello" + } + } + }, + "custom-message": { + "summary": "Custom Message example", + "value": { + "receiverType": "user", + "data": { + "customData": { + "text": "Hello there!" + } + }, + "category": "custom", + "type": "text", + "receiver": "cometchat-uid-2", + "tags": [ + "tag1" + ] + } + }, + "media-message": { + "summary": "Media Message example", + "value": { + "receiverType": "user", + "data": { + "text": "Hello there!", + "attachments": [ + { + "name": "ironman.png", + "extension": "png", + "mimeType": "image/png", + "url": "https: //files-.cometchat.io//media/.png?fat=" + } + ] + }, + "category": "message", + "type": "image", + "receiver": "cometchat-uid-2" + } + } }, - "examples": { - "string": { - "summary": "Provider ID", - "value": "provider_12345" - } - } - }, - "requiredUID": { - "name": "uid", - "in": "query", - "description": "(Required) UID", - "required": true, - "schema": { - "type": "string" + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "description": "API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).", + "name": "apikey", + "in": "header" + } } - } }, - "securitySchemes": { - "apiKey": { - "type": "apiKey", - "description": "API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).", - "name": "apikey", - "in": "header" - } - } - }, - "tags": [ - { - "name": "API Keys", - "description": "The API keys are used to authorise the APIs" - }, - { - "name": "Roles", - "description": "The roles are used to give user access rights" - }, - { - "name": "Users", - "description": "The REST collection for users." - }, - { - "name": "Auth Tokens", - "description": "The auth tokens are used to login end users using client SDKs." - }, - { - "name": "Blocked Users", - "description": "The REST collections for blocked users." - }, - { - "name": "Friends", - "description": "List,add and remove friends by passing UID in path variables" - }, - { - "name": "Groups", - "description": "The REST collections for groups." - }, - { - "name": "Banned Users", - "description": "Ban and Unban user by passing other UID in path variables." - }, - { - "name": "Group Members", - "description": "The REST collections for group members." - }, - { - "name": "Messages", - "description": "The REST collections for messages." - }, - { - "name": "Conversations", - "description": "The REST collections for conversations." - }, - { - "name": "Restrict Features", - "description": "Allows Restricting Features" - }, - { - "name": "Metrics", - "description": "Allows accessing Data Metrics" - }, - { - "name": "Triggers", - "description": "Allows adding triggers to a webhook." - }, - { - "name": "Webhooks", - "description": "Allows accessing Webhooks." - }, - { - "name": "Notifications", - "description": "Allows configuring Notifications core." - } - ] -} + "tags": [ + { + "name": "API Keys", + "description": "The API keys are used to authorise the APIs" + }, + { + "name": "Roles", + "description": "The roles are used to give user access rights" + }, + { + "name": "Users", + "description": "The REST collection for users." + }, + { + "name": "Auth Tokens", + "description": "The auth tokens are used to login end users using client SDKs." + }, + { + "name": "Blocked Users", + "description": "The REST collections for blocked users." + }, + { + "name": "Friends", + "description": "List,add and remove friends by passing UID in path variables" + }, + { + "name": "Groups", + "description": "The REST collections for groups." + }, + { + "name": "Banned Users", + "description": "Ban and Unban user by passing other UID in path variables." + }, + { + "name": "Group Members", + "description": "The REST collections for group members." + }, + { + "name": "Messages", + "description": "The REST collections for messages." + }, + { + "name": "Conversations", + "description": "The REST collections for conversations." + }, + { + "name": "Restrict Features", + "description": "Allows Restricting Features" + }, + { + "name": "Metrics", + "description": "Allows accessing Data Metrics" + }, + { + "name": "Triggers", + "description": "Allows adding triggers to a webhook." + }, + { + "name": "Webhooks", + "description": "Allows accessing Webhooks." + }, + { + "name": "Notifications", + "description": "Allows configuring Notifications core." + }, + { + "name": "Moderation", + "description": "The REST collections for Moderations." + } + ] +} \ No newline at end of file diff --git a/data-import-apis.json b/data-import-apis.json index 5585c22e2..2678590ca 100644 --- a/data-import-apis.json +++ b/data-import-apis.json @@ -1,3896 +1,5838 @@ { - "openapi": "3.0.0", - "info": { - "title": "Data Import APIs", - "description": "Manage messages, users, groups for a particular app using our Chat API.", - "version": "3.0" - }, - "servers": [ - { - "url": "https://{appId}.api-{region}.cometchat.io/v3", - "variables": { - "appId": { - "default": "appId", - "description": "(Required) App ID" - }, - "region": { - "enum": [ - "us", - "eu", - "in" - ], - "default": "us", - "description": "Select Region" + "openapi": "3.0.0", + "info": { + "title": "Data Import APIs", + "description": "Manage messages, users, groups for a particular app using our Chat API.", + "version": "3.0" + }, + "servers": [ + { + "url": "https://{appId}.api-{region}.cometchat.io/v3", + "variables": { + "appId": { + "default": "appId", + "description": "(Required) App ID" + }, + "region": { + "enum": [ + "us", + "eu", + "in" + ], + "default": "us", + "description": "Select Region" + } + } } - } - } - ], - "paths": { - "/data_import/messages": { - "post": { - "tags": [ - "Messages" - ], - "summary": "Import Messages", - "description": "The CometChat message import API allows customers to import their messages’ data into the CometChat systems.", - "operationId": "import-messages", - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "guid", - "name", - "type" + ], + "paths": { + "/data_import/messages": { + "post": { + "tags": [ + "Messages" ], - "properties": { - "messages": { - "description": "Wrapper for the messages.", - "required": [ - "muid" - ], - "properties": { - "": { - "description": "Wraps a single message object. The <muid> will be a primary key/unique Identifier of the message.", - "required": [ - "muid", - "sender", - "receiverType", - "receiver", - "sentAt" - ], - "properties": { - "muid": { - "description": "The value should be the same as value of the placeholder <muid> which wraps the message object.", - "type": "string" - }, - "sender": { - "description": "UID of the sender.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "receiver": { - "description": "If the receiverType == “user” the UID of a user receiving the message. else GUID of the group.", - "type": "string" - }, - "category": { - "description": "Category of the message. The available categories are message and custom.", - "type": "string", - "enum": [ - "message", - "custom" - ] - }, - "type": { - "description": "If category==”message” then the allowed values for the type are: text: for a plain text message. image: for an image message audio: for an audio message video: for a video message file: for any file if category==”custom” the customized type can be used. The developer can send the type as any random string and can use it in the implementation at the UI", - "type": "string", - "enum": [ - "text", - "image", - "file", - "audio", - "video" - ] - }, - "data": { - "description": "Can contain any additional properties except for the key properties.", - "properties": { - "text": { - "description": "The property has a fixed meaning for: 1. category==”message” && type ==”text” ⇒ it stores the text message 2. category==”message” && type !=”text” ⇒ it stores a caption for the attachment", - "type": "string" - }, - "customData": { - "description": "when category==”custom”, this property can have any JSON object.", - "type": "object" - }, - "attachments": { - "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", - "type": "array", - "items": { - "required": [ + "summary": "Import Messages", + "description": "The CometChat message import API allows customers to import their messages’ data into the CometChat systems.", + "operationId": "import-messages", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "guid", "name", - "mimeType", - "extension", - "url" - ], - "properties": { - "url": { - "description": "Contains the URL of the attachment. The developer has to make sure that the URL is accessible while calling the data_import API. The API will be downloading the attachment from its current location and upload it to CometChat’s attachment storage.", - "type": "string" - }, - "name": { - "description": "Name of the attachment.", - "type": "string" - }, - "mimeType": { - "description": "Mime Type of attachment.", - "type": "string" - }, - "extension": { - "description": "The extension of the attachment.", - "type": "string" - }, - "size": { - "description": "The size of the attachment(in bytes).", - "type": "string" + "type" + ], + "properties": { + "messages": { + "description": "Wrapper for the messages.", + "required": [ + "muid" + ], + "properties": { + "": { + "description": "Wraps a single message object. The **<muid>** will be a primary key/unique Identifier of the message.", + "required": [ + "muid", + "sender", + "receiverType", + "receiver", + "sentAt" + ], + "properties": { + "muid": { + "description": "The value should be the same as value of the placeholder **<muid>** which wraps the message object.", + "type": "string" + }, + "sender": { + "description": "UID of the sender.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" + ] + }, + "receiver": { + "description": "If the receiverType == “user” the UID of a user receiving the message. else GUID of the group.", + "type": "string" + }, + "category": { + "description": "Category of the message. The available categories are message and custom.", + "type": "string", + "enum": [ + "message", + "custom" + ] + }, + "type": { + "description": "If category==”message” then the allowed values for the type are: text: for a plain text message. image: for an image message audio: for an audio message video: for a video message file: for any file if category==”custom” the customized type can be used. The developer can send the type as any random string and can use it in the implementation at the UI", + "type": "string", + "enum": [ + "text", + "image", + "file", + "audio", + "video" + ] + }, + "data": { + "description": "Can contain any additional properties except for the key properties.", + "properties": { + "text": { + "description": "The property has a fixed meaning for: 1. category==”message” && type ==”text” ⇒ it stores the text message 2. category==”message” && type !=”text” ⇒ it stores a caption for the attachment", + "type": "string" + }, + "customData": { + "description": "when category==”custom”, this property can have any JSON object.", + "type": "object" + }, + "attachments": { + "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", + "type": "array", + "items": { + "required": [ + "name", + "mimeType", + "extension", + "url" + ], + "properties": { + "url": { + "description": "Publicly accessible URL of the attachment.", + "type": "string" + }, + "name": { + "description": "Name of the attachment.", + "type": "string" + }, + "mimeType": { + "description": "Mime Type of attachment.", + "type": "string" + }, + "extension": { + "description": "The extension of the attachment.", + "type": "string" + }, + "size": { + "description": "The size of the attachment(in bytes).", + "type": "string" + } + }, + "type": "object" + } + }, + "metadata": { + "type": "object" + } + }, + "type": "object" + }, + "tags": { + "description": "String array containing developer defined tags.", + "type": "array", + "items": { + "type": "string" + } + }, + "sentAt": { + "description": "10-digit UNIX timestamp for the time at which the message was sent.", + "type": "integer" + }, + "deliveredAt": { + "description": "A 10-digit UNIX timestamp at which the message was delivered to the receiver.", + "type": "integer" + }, + "readAt": { + "description": "A 10-digit UNIX timestamp at which the message was read by the receiver.", + "type": "integer" + }, + "senderUserDetails": { + "description": "If all the users are imported before importing the messages. The JSON object contains the user details of the sender.", + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the sender.", + "type": "string" + }, + "name": { + "description": "Name of the sender.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the user sending the message.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the sender.", + "type": "string" + }, + "role": { + "description": "Role of the sender. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the sender was created.", + "type": "integer" + }, + "lastActiveAt": { + "description": "A 10-digit UNIX timestamp at which the sender was most recently online.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the sender.", + "type": "object" + }, + "tags": { + "description": "A string array containing sender tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "deactivatedAt": { + "description": "A 10-digit UNIX timestamp at which the sender was deactivated/soft-deleted/blocked to use the chat services.", + "type": "integer" + } + }, + "type": "object" + }, + "receiverUserDetails": { + "description": "If all the users are imported before importing the messages or else required if receiverType==”user”. The JSON object contains the user details of the receiver.", + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the user receiving the message.", + "type": "string" + }, + "name": { + "description": "Name of the receiver.", + "type": "string" + }, + "avatar": { + "description": " URL to the profile picture of the receiver.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the receiver.", + "type": "string" + }, + "role": { + "description": "Role of the receiver. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the receiver was created.", + "type": "integer" + }, + "lastActiveAt": { + "description": "A 10-digit UNIX timestamp at which the receiver was most recently online.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the receiver.", + "type": "object" + }, + "tags": { + "description": "A string array containing receiver tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "deactivatedAt": { + "description": "A 10-digit UNIX timestamp at which the receiver was deactivated/soft-deleted/blocked to use the chat services.", + "type": "integer" + } + }, + "type": "object" + }, + "receiverGroupDetails": { + "description": "The JSON object contains the group details of the receiver.", + "required": [ + "guid", + "name", + "type" + ], + "properties": { + "guid": { + "description": "The primary-key/ unique identifier of the group.", + "type": "string" + }, + "name": { + "description": "Name of the group.", + "type": "string" + }, + "icon": { + "description": "An URL for a group icon.", + "type": "string" + }, + "type": { + "description": "Type of the group. Can be public, password or private.", + "type": "string", + "enum": [ + "public", + "password", + "private" + ] + }, + "password": { + "description": "A password required to join the the group with type password", + "type": "string" + }, + "owner": { + "description": "Owner of the group.", + "type": "string" + }, + "createdAt": { + "description": " A 10-digit UNIX timestamp at which the group was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional data for the group.", + "type": "object" + }, + "tags": { + "description": "A string array containing grouptags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "type": "object" + }, + "receiverGroupOwnerDetails": { + "description": "The JSON object contains the user details of the owner.", + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the owner.", + "type": "string" + }, + "name": { + "description": "Name of the owner.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the owner.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the owner.", + "type": "string" + }, + "role": { + "description": "Role of the owner. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the owner was created.", + "type": "integer" + }, + "lastActiveAt": { + "description": "A 10-digit UNIX timestamp at which the owner was most recently online.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the owner.", + "type": "object" + }, + "tags": { + "description": "A string array containing owner tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "deactivatedAt": { + "description": "A 10-digit UNIX timestamp at which the owner was deactivated/soft-deleted/blocked to use the chat services.", + "type": "integer" + } + }, + "type": "object" + }, + "mentionedUserDetails": { + "description": "Optional field that provides user details when data.text includes a mention, formatted using CometChat’s mention template (<@uid:UID>).", + "properties": { + "": { + "description": "A map where each key is a user’s unique identifier (UID) and the value is that user’s details. The <uid> will be replaced by the mentioned user’s primary key.", + "properties": { + "": { + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the owner. The value should be the same as value of the placeholder which wraps the mentionedUserDetails object.", + "type": "string" + }, + "name": { + "description": "Name of the owner.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the owner.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the owner.", + "type": "string" + }, + "role": { + "description": "Role of the owner. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the owner was created.", + "type": "integer" + }, + "lastActiveAt": { + "description": "A 10-digit UNIX timestamp at which the owner was most recently online.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the owner.", + "type": "object" + }, + "tags": { + "description": "A string array containing owner tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "deactivatedAt": { + "description": "A 10-digit UNIX timestamp at which the owner was deactivated/soft-deleted/blocked to use the chat services.", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object", + "example": { + "3118": { + "muid": "3118", + "sender": "s12", + "receiverType": "user", + "receiver": "r123", + "type": "text", + "category": "message", + "data": { + "text": "Hi there", + "attachments": [ + { + "name": "hi.png", + "extension": "png", + "size": "350.2", + "mimeType": "image/png", + "url": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png" + } + ], + "metadata": { + "key": "value" + }, + "custodata": { + "key": "value" + } + }, + "sentAt": "1674104348", + "deliveredAt": "1674224684", + "readAt": "1674224684", + "senderUserDetails": { + "uid": "s12", + "name": "user1", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "createdAt": "1674228536", + "metadata": { + "key": "value" + } + }, + "receiverUserDetails": { + "uid": "r123", + "name": "superhero", + "type": "public", + "description": "Hello group", + "icon": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "owner": "superhero1", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "createdAt": "1674228536", + "metadata": { + "key": "value" + } + }, + "tags": [ + "tag1" + ], + "mentionedUserDetails": { + "example-uid-new": { + "uid": "example-uid-new", + "name": "example-uid" + } + } + } + } } - }, - "type": "object" - } - }, - "metadata": { - "type": "object" - } - }, - "type": "object" - }, - "tags": { - "description": "String array containing developer defined tags.", - "type": "array", - "items": { - "type": "string" - } - }, - "sentAt": { - "description": "10-digit UNIX timestamp for the time at which the message was sent.", - "type": "integer" - }, - "deliveredAt": { - "description": "A 10-digit UNIX timestamp at which the message was delivered to the receiver.", - "type": "integer" - }, - "readAt": { - "description": "A 10-digit UNIX timestamp at which the message was read by the receiver.", - "type": "integer" - }, - "senderUserDetails": { - "description": "If all the users are imported before importing the messages. The JSON object contains the user details of the sender.", - "required": [ - "uid", - "name" - ], - "properties": { - "uid": { - "description": "The primary-key/ unique identifier of the sender.", - "type": "string" - }, - "name": { - "description": "Name of the sender.", - "type": "string" - }, - "avatar": { - "description": "URL to the profile picture of the user sending the message.", - "type": "string" - }, - "link": { - "description": "Profile page URL of the sender.", - "type": "string" - }, - "role": { - "description": "Role of the sender. Should be created already via the Create role API.", - "type": "string" - }, - "createdAt": { - "description": "A 10-digit timestamp at which the sender was created.", - "type": "integer" - }, - "lastActiveAt": { - "description": "A 10-digit UNIX timestamp at which the sender was most recently online.", - "type": "integer" - }, - "metadata": { - "description": "Additional details about the sender.", - "type": "object" - }, - "tags": { - "description": "A string array containing sender tags.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "deactivatedAt": { - "description": "A 10-digit UNIX timestamp at which the sender was deactivated/soft-deleted/blocked to use the chat services.", - "type": "integer" - } - }, - "type": "object" - }, - "receiverUserDetails": { - "description": "If all the users are imported before importing the messages or else required if receiverType==”user”. The JSON object contains the user details of the receiver.", - "required": [ - "uid", - "name" - ], - "properties": { - "uid": { - "description": "The primary-key/ unique identifier of the user receiving the message.", - "type": "string" - }, - "name": { - "description": "Name of the receiver.", - "type": "string" - }, - "avatar": { - "description": " URL to the profile picture of the receiver.", - "type": "string" - }, - "link": { - "description": "Profile page URL of the receiver.", - "type": "string" - }, - "role": { - "description": "Role of the receiver. Should be created already via the Create role API.", - "type": "string" - }, - "createdAt": { - "description": "A 10-digit timestamp at which the receiver was created.", - "type": "integer" - }, - "lastActiveAt": { - "description": "A 10-digit UNIX timestamp at which the receiver was most recently online.", - "type": "integer" - }, - "metadata": { - "description": "Additional details about the receiver.", - "type": "object" - }, - "tags": { - "description": "A string array containing receiver tags.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "deactivatedAt": { - "description": "A 10-digit UNIX timestamp at which the receiver was deactivated/soft-deleted/blocked to use the chat services.", - "type": "integer" - } - }, - "type": "object" - }, - "receiverGroupDetails": { - "description": "The JSON object contains the group details of the receiver.", - "required": [ - "guid", - "name", - "type" - ], - "properties": { - "guid": { - "description": "The primary-key/ unique identifier of the group.", - "type": "string" - }, - "name": { - "description": "Name of the group.", - "type": "string" - }, - "icon": { - "description": "An URL for a group icon.", - "type": "string" - }, - "type": { - "description": "Type of the group. Can be public, password or private.", - "type": "string", - "enum": [ - "public", - "password", - "private" - ] - }, - "password": { - "description": "A password required to join the the group with type password", - "type": "string" - }, - "owner": { - "description": "Owner of the group.", - "type": "string" - }, - "createdAt": { - "description": " A 10-digit UNIX timestamp at which the group was created.", - "type": "integer" - }, - "metadata": { - "description": "Additional data for the group.", - "type": "object" - }, - "tags": { - "description": "A string array containing grouptags.", - "type": "array", - "items": { - "type": "string" }, - "default": [] - } - }, - "type": "object" - }, - "receiverGroupOwnerDetails": { - "description": "The JSON object contains the user details of the owner.", - "required": [ - "uid", - "name" - ], - "properties": { - "uid": { - "description": "The primary-key/ unique identifier of the owner.", - "type": "string" - }, - "name": { - "description": "Name of the owner.", - "type": "string" - }, - "avatar": { - "description": "URL to the profile picture of the owner.", - "type": "string" - }, - "link": { - "description": "Profile page URL of the owner.", - "type": "string" - }, - "role": { - "description": "Role of the owner. Should be created already via the Create role API.", - "type": "string" - }, - "createdAt": { - "description": "A 10-digit timestamp at which the owner was created.", - "type": "integer" - }, - "lastActiveAt": { - "description": "A 10-digit UNIX timestamp at which the owner was most recently online.", - "type": "integer" - }, - "metadata": { - "description": "Additional details about the owner.", "type": "object" - }, - "tags": { - "description": "A string array containing owner tags.", - "type": "array", - "items": { - "type": "string" + } + } + } + }, + "responses": { + "200": { + "description": "Import Message(s)", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "type": "object", + "allOf": [ + { + "properties": { + "sentAt": {}, + "deliveredAt": {}, + "readAt": {} + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/messageSchema" + } + ] + } + }, + "type": "object" + } + }, + "type": "object" }, - "default": [] - }, - "deactivatedAt": { - "description": "A 10-digit UNIX timestamp at which the owner was deactivated/soft-deleted/blocked to use the chat services.", - "type": "integer" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object", - "example": { - "3118": { - "muid": "3118", - "sender": "s12", - "receiverType": "user", - "receiver": "r123", - "type": "text", - "category": "message", - "data": { - "text": "Hi there,", - "attachments": [ - { - "name": "hi.png", - "extension": "png", - "size": "350.2", - "mimeType": "image/png", - "url": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp" + "example": { + "data": { + "3117": { + "success": true, + "data": { + "id": "1029", + "muid": "3117", + "conversationId": "r123_user_s12", + "sender": "s12", + "receiverType": "user", + "receiver": "r123", + "category": "message", + "type": "text", + "data": { + "text": "Hi there,", + "attachments": [ + { + "name": "hi.png", + "extension": "png", + "size": "350.2", + "mimeType": "image/png", + "url": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png" + } + ], + "metad2ata": { + "key": "value" + }, + "custodata": { + "key": "value" + }, + "entities": { + "sender": { + "entity": { + "uid": "s12", + "name": "user1", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "metadata": { + "key": "value" + }, + "status": "offline", + "role": "default", + "createdAt": 1674228536, + "updatedAt": 1674232131 + }, + "entityType": "user" + }, + "receiver": { + "entity": { + "uid": "r123", + "name": "superhero", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "metadata": { + "key": "value" + }, + "status": "offline", + "role": "default", + "createdAt": 1674228536, + "updatedAt": 1674232131, + "conversationId": "r123_user_s12" + }, + "entityType": "user" + } + } + }, + "sentAt": 1674104348, + "deliveredAt": 1674224684, + "readAt": 1674224684, + "updatedAt": 1674104348, + "tags": [ + "tag1" + ] + } + } + } + } } - ], - "metadata": { - "key": "value" - }, - "custodata": { - "key": "value" - } - }, - "sentAt": "1674104348", - "deliveredAt": "1674224684", - "readAt": "1674224684", - "senderUserDetails": { - "uid": "s12", - "name": "user1", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "createdAt": "1674228536", - "metadata": { - "key": "value" - } - }, - "receiverUserDetails": { - "uid": "r123", - "name": "cometchat-uid-", - "type": "public", - "description": "Hello group", - "icon": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "owner": "cometchat-uid-1", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "createdAt": "1674228536", - "metadata": { - "key": "value" - } - }, - "tags": [ - "tag1" - ] - } + } } - } }, - "type": "object" - } + "security": [ + { + "apiKey": [] + } + ] } - } }, - "responses": { - "200": { - "description": "Import Message(s)", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "type": "object", - "allOf": [ - { - "properties": { - "sentAt": { - "type": "integer", - "description": "Unix timestamp" - }, - "deliveredAt": { - "type": "integer", - "description": "Unix timestamp" + "/data_import/users": { + "post": { + "tags": [ + "Users" + ], + "summary": "Import Users", + "description": "The CometChat user import API allows customers to import their users’ data into the CometChat systems.", + "operationId": "import-users", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "users": { + "description": "Wrapper for the users.", + "required": [ + "uid" + ], + "properties": { + "": { + "description": "Wraps a user object. The **<uid>** will be a primary key/unique Identifier of the user.", + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The value should be the same as value of the placeholder **<uid>** which wraps the user object.", + "type": "string" + }, + "name": { + "description": "name of the user.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the user.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the user.", + "type": "string" + }, + "role": { + "description": "Role of the user. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": " A 10-digit UNIX timestamp at which the user was created.", + "type": "integer" + }, + "lastActiveAt": { + "description": "A 10-digit UNIX timestamp at which the user was most recently online.", + "type": "integer" + }, + "metadata": { + "description": "JSON object containing Additional user information.", + "type": "object" + }, + "tags": { + "description": "A string array containing usertags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "deactivatedAt": { + "description": "A 10-digit UNIX timestamp at which the user was deactivated/soft-deleted/blocked to use the chat services.", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object", + "example": { + "uid1": { + "uid": "uid1", + "name": "uid1", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "createdAt": "1673421419", + "metadata": { + "key": "value" + }, + "lastActiveAt": "1673421425" + } + } + } }, - "readAt": { - "type": "integer", - "description": "Unix timestamp" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/messageSchema" + "type": "object" } - ] } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "3117": { - "success": true, - "data": { - "id": "1029", - "muid": "3117", - "conversationId": "r123_user_s12", - "sender": "s12", - "receiverType": "user", - "receiver": "r123", - "category": "message", - "type": "text", - "data": { - "text": "Hi there,", - "attachments": [ - { - "name": "hi.png", - "extension": "png", - "size": "350.2", - "mimeType": "image/png", - "url": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp" - } - ], - "metad2ata": { - "key": "value" - }, - "custodata": { - "key": "value" - }, - "entities": { - "sender": { - "entity": { - "uid": "s12", - "name": "user1", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "metadata": { - "key": "value" - }, - "status": "offline", - "role": "default", - "createdAt": 1674228536, - "updatedAt": 1674232131 - }, - "entityType": "user" - }, - "receiver": { - "entity": { - "uid": "r123", - "name": "cometchat-uid-", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "metadata": { - "key": "value" + "responses": { + "200": { + "description": "Import User(s)", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "type": "object", + "allOf": [ + { + "properties": { + "lastActiveAt": {}, + "deactivatedAt": {} + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/userSchema" + } + ] + } + }, + "type": "object" + } + }, + "type": "object" }, - "status": "offline", - "role": "default", - "createdAt": 1674228536, - "updatedAt": 1674232131, - "conversationId": "r123_user_s12" - }, - "entityType": "user" + "example": { + "data": { + "uid1": { + "success": true, + "data": { + "uid": "uid1", + "name": "uid1", + "avatar": "https://data-eu.cometchat.io/assets/images/avatars/ironman.png", + "metadata": { + "key": "value" + }, + "status": "offline", + "role": "default", + "lastActiveAt": 1673421425, + "createdAt": 1673421419 + } + } + } + } } - } - }, - "sentAt": 1674104348, - "deliveredAt": 1674224684, - "readAt": 1674224684, - "updatedAt": 1674104348, - "tags": [ - "tag1" - ] - } + } } - } - } - } + }, + "security": [ + { + "apiKey": [] + } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/data_import/users": { - "post": { - "tags": [ - "Users" - ], - "summary": "Import Users", - "description": "The CometChat user import API allows customers to import their users’ data into the CometChat systems.", - "operationId": "import-users", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "users": { - "description": "Wrapper for the users.", - "required": [ - "uid" - ], - "properties": { - "": { - "description": "Wraps a user object. The <uid> will be a primary key/unique Identifier of the user.", - "required": [ - "uid", - "name" - ], - "properties": { - "uid": { - "description": "The value should be the same as value of the placeholder <uid> which wraps the user object.", - "type": "string" - }, - "name": { - "description": "name of the user.", - "type": "string" - }, - "avatar": { - "description": "URL to the profile picture of the user.", - "type": "string" - }, - "link": { - "description": "Profile page URL of the user.", - "type": "string" - }, - "role": { - "description": "Role of the user. Should be created already via the Create role API.", - "type": "string" - }, - "createdAt": { - "description": " A 10-digit UNIX timestamp at which the user was created.", - "type": "integer" - }, - "lastActiveAt": { - "description": "A 10-digit UNIX timestamp at which the user was most recently online.", - "type": "integer" - }, - "metadata": { - "description": "JSON object containing Additional user information.", - "type": "object" - }, - "tags": { - "description": "A string array containing usertags.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "deactivatedAt": { - "description": "A 10-digit UNIX timestamp at which the user was deactivated/soft-deleted/blocked to use the chat services.", - "type": "integer" - } - }, - "type": "object" - } - }, - "type": "object", - "example": { - "uid1": { - "uid": "uid1", - "name": "uid1", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "createdAt": "1673421419", - "metadata": { - "key": "value" - }, - "lastActiveAt": "1673421425" - } + "/data_import/groups": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Import Groups", + "description": "The CometChat group import API allows customers to import their groups’ data into the CometChat systems.", + "operationId": "import-groups", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "groups": { + "description": "Wrapper for the groups.", + "required": [ + "guid" + ], + "properties": { + "": { + "description": "Wraps a group object. The **<guid>** will be a primary key/unique Identifier of the group.", + "required": [ + "guid", + "name", + "type" + ], + "properties": { + "guid": { + "description": "The value should be the same as value of the placeholder **<guid>** which wraps the group object.", + "type": "string" + }, + "name": { + "description": "name of the group.", + "type": "string" + }, + "icon": { + "description": "An URL for a group icon.", + "type": "string" + }, + "type": { + "description": "Type of the group. Can be public, password or private.", + "type": "string", + "enum": [ + "public", + "password", + "private" + ] + }, + "password": { + "description": "A password required to join the the group with type password", + "type": "string" + }, + "owner": { + "description": "Owner of the group.", + "type": "string" + }, + "createdAt": { + "description": " A 10-digit UNIX timestamp at which the group was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional data for the group.", + "type": "object" + }, + "tags": { + "description": "A string array containing grouptags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "groupOwnerDetails": { + "description": "The JSON object contains the user details of the owner.", + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the owner.", + "type": "string" + }, + "name": { + "description": "Name of the owner.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the owner.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the owner.", + "type": "string" + }, + "role": { + "description": "Role of the owner. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the owner was created.", + "type": "integer" + }, + "lastActiveAt": { + "description": "A 10-digit UNIX timestamp at which the owner was most recently online.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the owner.", + "type": "object" + }, + "tags": { + "description": "A string array containing owner tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "deactivatedAt": { + "description": "A 10-digit UNIX timestamp at which the owner was deactivated/soft-deleted/blocked to use the chat services.", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object", + "example": { + "guid1": { + "guid": "guid1", + "name": "guid1", + "createdAt": "1673421419", + "type": "public", + "owner": "superhero1", + "groupOwnerDetails": { + "uid": "superhero1", + "name": "superhero1" + } + } + } + } + }, + "type": "object" + } + } } - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Import User(s)", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "type": "object", - "allOf": [ - { - "properties": { - "lastActiveAt": { - "type": "integer", - "description": "Unix timestamp" + "responses": { + "200": { + "description": "Import Group(s)", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/groupSchema" + } + ] + } + }, + "type": "object" + } + }, + "type": "object" }, - "deactivatedAt": { - "type": "integer", - "description": "Unix timestamp" + "example": { + "data": { + "guid1": { + "success": true, + "data": { + "guid": "guid1", + "name": "guid1", + "type": "public", + "conversationId": "group_guid1", + "createdAt": 1673421419, + "owner": "superhero1" + } + } + } } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/userSchema" } - ] } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "uid1": { - "success": true, - "data": { - "uid": "uid1", - "name": "uid1", - "avatar": "https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp", - "metadata": { - "key": "value" - }, - "status": "offline", - "role": "default", - "lastActiveAt": 1673421425, - "createdAt": 1673421419 - } + "security": [ + { + "apiKey": [] } - } - } - } + ] } - } }, - "security": [ - { - "apiKey": [] - } - ] - } - }, - "/data_import/groups": { - "post": { - "tags": [ - "Groups" - ], - "summary": "Import Groups", - "description": "The CometChat group import API allows customers to import their groups’ data into the CometChat systems.", - "operationId": "import-groups", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "groups": { - "description": "Wrapper for the groups.", - "required": [ - "guid" - ], - "properties": { - "": { - "description": "Wraps a group object. The <guid> will be a primary key/unique Identifier of the group.", - "required": [ - "guid", - "name", - "type" - ], - "properties": { - "guid": { - "description": "The value should be the same as value of the placeholder <guid> which wraps the group object.", - "type": "string" - }, - "name": { - "description": "name of the group.", - "type": "string" - }, - "icon": { - "description": "An URL for a group icon.", - "type": "string" - }, - "type": { - "description": "Type of the group. Can be public, password or private.", - "type": "string", - "enum": [ - "public", - "password", - "private" - ] - }, - "password": { - "description": "A password required to join the the group with type password", - "type": "string" - }, - "owner": { - "description": "Owner of the group.", - "type": "string" - }, - "createdAt": { - "description": " A 10-digit UNIX timestamp at which the group was created.", - "type": "integer" - }, - "metadata": { - "description": "Additional data for the group.", - "type": "object" - }, - "tags": { - "description": "A string array containing grouptags.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "groupOwnerDetails": { - "description": "The JSON object contains the user details of the owner.", - "required": [ - "uid", - "name" - ], - "properties": { - "uid": { - "description": "The primary-key/ unique identifier of the owner.", - "type": "string" - }, - "name": { - "description": "Name of the owner.", - "type": "string" - }, - "avatar": { - "description": "URL to the profile picture of the owner.", - "type": "string" - }, - "link": { - "description": "Profile page URL of the owner.", - "type": "string" - }, - "role": { - "description": "Role of the owner. Should be created already via the Create role API.", - "type": "string" - }, - "createdAt": { - "description": "A 10-digit timestamp at which the owner was created.", - "type": "integer" - }, - "lastActiveAt": { - "description": "A 10-digit UNIX timestamp at which the owner was most recently online.", - "type": "integer" - }, - "metadata": { - "description": "Additional details about the owner.", - "type": "object" - }, - "tags": { - "description": "A string array containing owner tags.", - "type": "array", - "items": { - "type": "string" + "/data_import/members": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Import Group Members", + "description": "The CometChat group member import API allows customers to import their group members’ data into the CometChat systems.", + "operationId": "import-members", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "members": { + "description": "Wrapper for the members.", + "required": [ + "memberId" + ], + "properties": { + "_member_": { + "description": "Wraps a single member object. The **<guid>_member_<uid>** will will be a primary key/unique Identifier of the member.", + "required": [ + "memberId", + "guid", + "uid" + ], + "properties": { + "memberId": { + "description": "The value should be the same as value of the placeholder **<guid>_member_<uid>** which wraps the member object.", + "type": "string" + }, + "guid": { + "description": "Id of the group.", + "type": "string" + }, + "uid": { + "description": "Id of user.", + "type": "string" + }, + "scope": { + "description": "Scope of the member in group.", + "type": "string" + }, + "isBanned": { + "description": "Specify if user is banned in group.", + "type": "boolean" + }, + "joinedAt": { + "description": " A 10-digit UNIX timestamp at which the member joined the group.", + "type": "integer" + }, + "groupDetails": { + "description": "The JSON object contains the group details of the member.", + "required": [ + "guid", + "name", + "type" + ], + "properties": { + "guid": { + "description": "The primary-key/ unique identifier of the group.", + "type": "string" + }, + "name": { + "description": "Name of the group.", + "type": "string" + }, + "icon": { + "description": "An URL for a group icon.", + "type": "string" + }, + "type": { + "description": "Type of the group. Can be public, password or private.", + "type": "string", + "enum": [ + "public", + "password", + "private" + ] + }, + "password": { + "description": "A password required to join the the group with type password", + "type": "string" + }, + "owner": { + "description": "Owner of the group.", + "type": "string" + }, + "createdAt": { + "description": " A 10-digit UNIX timestamp at which the group was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional data for the group.", + "type": "object" + }, + "tags": { + "description": "A string array containing grouptags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "type": "object" + }, + "userDetails": { + "description": "The JSON object contains the user details of the member.", + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the member.", + "type": "string" + }, + "name": { + "description": "Name of the member.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the member.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the user.", + "type": "string" + }, + "role": { + "description": "Role of the user. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the member was created.", + "type": "integer" + }, + "lastActiveAt": { + "description": "A 10-digit UNIX timestamp at which the member was most recently online.", + "type": "integer" + }, + "metadata": { + "description": "JSON object containing Additional member information.", + "type": "object" + }, + "tags": { + "description": "A string array containing member tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "deactivatedAt": { + "description": "A 10-digit UNIX timestamp at which the member was deactivated/soft-deleted/blocked to use the chat services.", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object", + "example": { + "guid1_member_uid2": { + "memberId": "guid1_member_uid2", + "uid": "uid2", + "guid": "guid1", + "joinedAt": "1673421419", + "scope": "admin", + "groupDetails": { + "guid": "guid1", + "name": "guid1", + "type": "public", + "owner": "uid1", + "createdAt": "1673421419" + }, + "userDetails": { + "uid": "uid2", + "name": "uid2" + } + } + } + } }, - "default": [] - }, - "deactivatedAt": { - "description": "A 10-digit UNIX timestamp at which the owner was deactivated/soft-deleted/blocked to use the chat services.", - "type": "integer" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object", - "example": { - "guid1": { - "guid": "guid1", - "name": "guid1", - "createdAt": "1673421419", - "type": "public", - "owner": "cometchat-uid-1", - "groupOwnerDetails": { - "uid": "cometchat-uid-1", - "name": "cometchat-uid-1" + "type": "object" + } } - } } - } }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Import Group(s)", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/groupSchema" + "responses": { + "200": { + "description": "Import Group Member(s)", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "properties": { + "": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/groupMemberSchema" + } + ] + } + }, + "type": "object" + } + }, + "type": "object" + }, + "example": { + "data": { + "guid1_member_uid2": { + "success": true, + "data": { + "guid": "guid1", + "uid": "uid2", + "scope": "admin", + "joinedAt": 1673421419 + } + } + } + } } - ] } - }, - "type": "object" } - }, - "type": "object" }, - "example": { - "data": { - "guid1": { - "success": true, - "data": { - "guid": "guid1", - "name": "guid1", - "type": "public", - "conversationId": "group_guid1", - "createdAt": 1673421419, - "owner": "cometchat-uid-1" - } - } - } - } - } + "security": [ + { + "apiKey": [] + } + ] } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } + } }, - "/data_import/members": { - "post": { - "tags": [ - "Groups" - ], - "summary": "Import Group Members", - "description": "The CometChat group member import API allows customers to import their group members’ data into the CometChat systems.", - "operationId": "import-members", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "members": { - "description": "Wrapper for the members.", - "required": [ - "memberId" - ], - "properties": { - "_member_": { - "description": "Wraps a single member object. The <guid>_member_<uid> will will be a primary key/unique Identifier of the member.", - "required": [ - "memberId", - "guid", - "uid" - ], - "properties": { - "memberId": { - "description": "The value should be the same as value of the placeholder <guid>_member_<uid> which wraps the member object.", - "type": "string" - }, - "guid": { - "description": "Id of the group.", - "type": "string" - }, - "uid": { - "description": "Id of user.", - "type": "string" - }, - "scope": { - "description": "Scope of the member in group.", - "type": "string" - }, - "isBanned": { - "description": "Specify if user is banned in group.", - "type": "boolean" - }, - "joinedAt": { - "description": " A 10-digit UNIX timestamp at which the member joined the group.", - "type": "integer" - }, - "groupDetails": { - "description": "The JSON object contains the group details of the member.", - "required": [ - "guid", - "name", - "type" - ], - "properties": { - "guid": { - "description": "The primary-key/ unique identifier of the group.", - "type": "string" - }, - "name": { - "description": "Name of the group.", - "type": "string" - }, - "icon": { - "description": "An URL for a group icon.", - "type": "string" - }, - "type": { - "description": "Type of the group. Can be public, password or private.", - "type": "string", - "enum": [ - "public", - "password", - "private" - ] - }, - "password": { - "description": "A password required to join the the group with type password", - "type": "string" - }, - "owner": { - "description": "Owner of the group.", - "type": "string" - }, - "createdAt": { - "description": " A 10-digit UNIX timestamp at which the group was created.", - "type": "integer" - }, - "metadata": { - "description": "Additional data for the group.", - "type": "object" - }, - "tags": { - "description": "A string array containing grouptags.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - } - }, - "type": "object" - }, - "userDetails": { - "description": "The JSON object contains the user details of the member.", - "required": [ - "uid", - "name" - ], - "properties": { - "uid": { - "description": "The primary-key/ unique identifier of the member.", - "type": "string" - }, - "name": { - "description": "Name of the member.", - "type": "string" - }, - "avatar": { - "description": "URL to the profile picture of the member.", - "type": "string" - }, - "link": { - "description": "Profile page URL of the user.", - "type": "string" - }, - "role": { - "description": "Role of the user. Should be created already via the Create role API.", - "type": "string" - }, - "createdAt": { - "description": "A 10-digit timestamp at which the member was created.", - "type": "integer" - }, - "lastActiveAt": { - "description": "A 10-digit UNIX timestamp at which the member was most recently online.", - "type": "integer" - }, - "metadata": { - "description": "JSON object containing Additional member information.", - "type": "object" - }, - "tags": { - "description": "A string array containing member tags.", - "type": "array", - "items": { - "type": "string" - }, - "default": [] - }, - "deactivatedAt": { - "description": "A 10-digit UNIX timestamp at which the member was deactivated/soft-deleted/blocked to use the chat services.", - "type": "integer" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object", - "example": { - "guid1_member_uid2": { - "memberId": "guid1_member_uid2", - "uid": "uid2", - "guid": "guid1", - "joinedAt": "1673421419", - "scope": "admin", - "groupDetails": { - "guid": "guid1", - "name": "guid1", - "type": "public", - "owner": "uid1", - "createdAt": "1673421419" - }, - "userDetails": { - "uid": "uid2", - "name": "uid2" - } - } - } - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "Import Group Member(s)", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "properties": { - "": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/groupMemberSchema" - } - ] - } - }, - "type": "object" - } - }, - "type": "object" - }, - "example": { - "data": { - "guid1_member_uid2": { - "success": true, - "data": { - "guid": "guid1", - "uid": "uid2", - "scope": "admin", - "joinedAt": 1673421419 - } - } - } - } - } - } - } - }, - "security": [ - { - "apiKey": [] - } - ] - } - } - }, - "components": { - "schemas": { - "APIKeySchema": { - "description": "Response data", - "properties": { - "apiKey": { - "type": "string" - }, - "name": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "CommonFields": { - "properties": { - "authToken": { - "type": "string", - "example": "cometchat-uid-3_1710141033938cf7e3c67cc44465440d" - }, - "timezone": { - "type": "string", - "example": "Asia/Kolkata" - } - }, - "type": "object" - }, - "Day": { - "properties": { - "from": { - "type": "integer", - "format": "int32", - "maximum": 2359, - "minimum": 0 - }, - "to": { - "type": "integer", - "format": "int32", - "maximum": 2359, - "minimum": 0 - }, - "dnd": { - "type": "boolean" - } - }, - "type": "object" - }, - "Group": { - "properties": { - "messagesSetting": { - "description": "1: Don't subscribe\n2: Subscribe to all messages\n3: Subscribe to messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "messagesOverride": { - "type": "boolean" - }, - "repliesSetting": { - "description": "1: Don't subscribe\n2: Subscribe to all replies\n3: Subscribe to replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "repliesOverride": { - "type": "boolean" - }, - "reactionsSetting": { - "description": "1: Don't subscribe\n2: Subscribe to reactions for own messages\n3: Subscribe to reactions for all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "reactionsOverride": { - "type": "boolean" - }, - "memberLeftSetting": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberLeftOverride": { - "type": "boolean" - }, - "memberAddedSetting": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberAddedOverride": { - "type": "boolean" - }, - "memberJoinedSetting": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberJoinedOverride": { - "type": "boolean" - }, - "memberKickedSetting": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberKickedOverride": { - "type": "boolean" - }, - "memberBannedSetting": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberBannedOverride": { - "type": "boolean" - }, - "memberUnbannedSetting": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberUnbannedOverride": { - "type": "boolean" - }, - "memberScopeChangedSetting": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "memberScopeChangedOverride": { - "type": "boolean" - } - }, - "type": "object" - }, - "MediaMessageTemplate": { - "properties": { - "titleOneOnOne": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}}" - }, - "titleGroup": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" - }, - "body_image": { - "type": "string", - "example": "Has sent an {{message.type}}" - }, - "body_audio": { - "type": "string", - "example": "Has sent an {{message.type}}" - }, - "body_video": { - "type": "string", - "example": "Has sent a {{message.type}}" - }, - "body_file": { - "type": "string", - "example": "Has sent a {{message.type}}" - } - }, - "type": "object" - }, - "Mute": { - "properties": { - "dndPreferenceOverride": { - "type": "boolean" - }, - "mutedGroupsOverride": { - "type": "boolean" - }, - "mutedOneOnOnesOverride": { - "type": "boolean" - }, - "schedulePreferenceSetting": { - "properties": { - "monday": { - "$ref": "#/components/schemas/Day" - }, - "tuesday": { - "$ref": "#/components/schemas/Day" - }, - "wednesday": { - "$ref": "#/components/schemas/Day" - }, - "thursday": { - "$ref": "#/components/schemas/Day" - }, - "friday": { - "$ref": "#/components/schemas/Day" - }, - "saturday": { - "$ref": "#/components/schemas/Day" - }, - "sunday": { - "$ref": "#/components/schemas/Day" - } - }, - "type": "object" - }, - "schedulePreferenceOverride": { - "type": "boolean" - } - }, - "type": "object" - }, - "MutePreferences": { - "properties": { - "dnd": { - "description": "1: Disable DND\n2: Enable DND", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "schedule": { - "$ref": "#/components/schemas/Schedule" - } - }, - "type": "object" - }, - "PNSuccess": { - "properties": { - "success": { - "type": "boolean" - } - }, - "type": "object" - }, - "PlatformAPNS": { - "allOf": [ - { - "properties": { - "platform": { - "type": "string", - "enum": [ - "apns_ios_device", - "apns_flutter_device", - "apns_react_native_device", - "apns_ionic_cordova_device" - ], - "description": "Allowed values: apns_ios_device, apns_flutter_device, apns_react_native_device, apns_ionic_cordova_device" - }, - "providerId": { - "type": "string", - "example": "apns-provider-2" - }, - "deviceToken": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/CommonFields" - } - ] - }, - "PlatformFCM": { - "allOf": [ - { - "properties": { - "platform": { - "type": "string", - "enum": [ - "fcm_android", - "fcm_ios", - "fcm_web", - "fcm_flutter_android", - "fcm_flutter_ios", - "fcm_react_native_android", - "fcm_react_native_ios", - "fcm_ionic_cordova_android", - "fcm_ionic_cordova_ios" - ], - "description": "Allowed values: fcm_android, fcm_ios, fcm_web, fcm_flutter_android, fcm_flutter_ios, fcm_react_native_android, fcm_react_native_ios, fcm_ionic_cordova_android, fcm_ionic_cordova_ios" - }, - "providerId": { - "type": "string", - "example": "fcm-provider-2" - }, - "fcmToken": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/CommonFields" - } - ] - }, - "PlatformVOIP": { - "allOf": [ - { - "properties": { - "platform": { - "type": "string", - "enum": [ - "apns_ios_voip", - "apns_flutter_voip", - "apns_ionic_cordova_voip", - "apns_react_native_voip" - ], - "description": "Allowed values: apns_ios_voip, apns_flutter_voip, apns_ionic_cordova_voip, apns_react_native_voip" - }, - "providerId": { - "type": "string", - "example": "apns-provider-2" - }, - "voipToken": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/CommonFields" - } - ] - }, - "Preferences": { - "properties": { - "group": { - "$ref": "#/components/schemas/Group" - }, - "oneOnOne": { - "$ref": "#/components/schemas/oneOnOne" - }, - "mute": { - "$ref": "#/components/schemas/Mute" - } - }, - "type": "object" - }, - "Schedule": { - "properties": { - "monday": { - "$ref": "#/components/schemas/Day" - }, - "tuesday": { - "$ref": "#/components/schemas/Day" - }, - "wednesday": { - "$ref": "#/components/schemas/Day" - }, - "thursday": { - "$ref": "#/components/schemas/Day" - }, - "friday": { - "$ref": "#/components/schemas/Day" - }, - "saturday": { - "$ref": "#/components/schemas/Day" - }, - "sunday": { - "$ref": "#/components/schemas/Day" - } - }, - "type": "object" - }, - "ServiceAccountCreds": { - "properties": { - "project_id": { - "type": "string" - }, - "client_email": { - "type": "string" - }, - "private_key": { - "type": "string" - }, - "private_key_id": { - "type": "string" - } - }, - "type": "object" - }, - "SilentNotification": { - "properties": { - "chat": { - "type": "boolean" - }, - "call": { - "type": "boolean" - } - }, - "type": "object" - }, - "Sound": { - "properties": { - "chat": { - "type": "string" - }, - "call": { - "type": "string" - } - }, - "type": "object" - }, - "Template": { - "properties": { - "titleOneOnOne": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}}" - }, - "titleGroup": { - "type": "string", - "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" - }, - "body": { - "type": "string", - "example": "New text message" - } - }, - "type": "object" - }, - "Templates": { - "properties": { - "usePrivacyTemplate": { - "description": "1: Use default templates\n2: Use privacy templates\n3: Use default templates with end-user privacy override", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "textMessageTemplateDefault": { - "$ref": "#/components/schemas/Template" - }, - "textMessageTemplatePrivacy": { - "$ref": "#/components/schemas/Template" - }, - "mediaMessageTemplateDefault": { - "$ref": "#/components/schemas/MediaMessageTemplate" - }, - "mediaMessageTemplatePrivacy": { - "$ref": "#/components/schemas/MediaMessageTemplate" - }, - "customMessageTemplateDefault": { - "allOf": [ - { - "properties": { - "body_fallback": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - }, - "customMessageTemplatePrivacy": { - "allOf": [ - { + "components": { + "schemas": { + "APIKeySchema": { + "description": "Response data", "properties": { - "body_fallback": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/Template" - } - ] - } - }, - "type": "object" - }, - "authTokenSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "authToken": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "bannedUserSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "isBanned": { - "type": "boolean" - }, - "joinedAt": { - "type": "integer" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "blockedUserSchema": { - "description": "Response data", - "properties": { - "blockedByMe": { - "type": "boolean" - }, - "blockedByMeAt": { - "type": "integer" - }, - "blockedAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "conversationSchema": { - "description": "Response data", - "properties": { - "conversationId": { - "type": "string" - }, - "conversationType": { - "type": "string" - }, - "unreadMessageCount": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "lastMessage": { - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "type": "object", - "allOf": [ - { - "properties": { - "action": { + "apiKey": { "type": "string" - } }, - "type": "object" - }, - { - "$ref": "#/components/schemas/objectEntitySchema" - } - ] - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "receipts": { - "properties": { - "data": { - "type": "array", - "items": {} - } - }, - "type": "object" - } - }, - "type": "object" - }, - "conversationWith": { - "type": "object" - } - }, - "type": "object" - }, - "conversationWithSchema": { - "properties": { - "guid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "type": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "membersCount": { - "type": "integer" - }, - "joinedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - }, - "hasJoined": { - "type": "boolean", - "default": "true" - }, - "createdAt": { - "type": "integer" - }, - "owner": { - "type": "string" - }, - "updatedAt": { - "type": "integer" - }, - "updatedBy": { - "type": "string" - } - }, - "type": "object" - }, - "createApnsProvider": { - "properties": { - "providerId": { - "type": "string" - }, - "keyId": { - "type": "string" - }, - "teamId": { - "type": "string" - }, - "bundleId": { - "type": "string" - }, - "p8KeyFilename": { - "type": "string" - }, - "p8Key": { - "type": "string" - }, - "includeContentAvailable": { - "type": "boolean" - }, - "includeMutableContent": { - "type": "boolean" - }, - "productionMode": { - "type": "boolean" - } - }, - "type": "object" - }, - "customCategorySchema": { - "properties": { - "receiver": { - "description": "The receiver of the message.", - "type": "string" - }, - "muid": { - "description": "The muid will be a unique Identifier of the message.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "category": { - "description": "Category of the message. The available categories is custom.", - "type": "string", - "default": "custom", - "enum": [ - "custom" - ] - }, - "type": { - "description": "Type of the message.", - "type": "string" - }, - "data": { - "description": "JSON containing message attributes.", - "properties": { - "customData": { - "description": "when category==”custom”, this property can have any JSON object.", - "type": "object" - } - }, - "type": "object" - }, - "multipleReceivers": { - "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", - "properties": { - "uids": { - "type": "array", - "items": { - "type": "string" - } - }, - "guids": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "dataPointSchema": { - "description": "Response data", - "properties": { - "messagesSent": { - "type": "integer" - }, - "readReceipts": { - "type": "integer" - }, - "deliveryReceipts": { - "type": "integer" - }, - "startTime": { - "type": "integer" - }, - "endTime": { - "type": "integer" - } - }, - "type": "object" - }, - "deleteSchema": { - "properties": { - "success": { - "type": "boolean" - }, - "message": { - "type": "string" - } - }, - "type": "object" - }, - "fcmCreateProviderSchema": { - "properties": { - "providerId": { - "type": "string" - }, - "serviceAccountFilename": { - "type": "string" - }, - "serviceAccountCreds": { - "$ref": "#/components/schemas/ServiceAccountCreds" - }, - "notificationInPayload": { - "properties": { - "ios": { - "$ref": "#/components/schemas/SilentNotification" - }, - "android": { - "$ref": "#/components/schemas/SilentNotification" - }, - "web": { - "$ref": "#/components/schemas/SilentNotification" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "groupEntitySchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "action": { - "type": "string" - }, - "entities": { - "properties": { - "by": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { + "name": { "type": "string" - } }, - "type": "object" - }, - "on": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { + "scope": { "type": "string" - } }, - "type": "object" - }, - "for": { - "properties": { - "entity": { - "properties": { - "guid": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "name": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "description": { - "type": "string" - }, - "membersCount": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "avatar": { - "type": "string" - }, - "metadata": { - "properties": { - "email": { - "type": "string" - } - }, - "type": "object" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "groupMemberListSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "joinedAt": { - "type": "integer" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "groupMemberSchema": { - "description": "Response data", - "properties": { - "usersToBan": { - "properties": { - "": { - "properties": { - "success": { - "type": "boolean" - } + "createdAt": { + "type": "integer" + } }, "type": "object" - } }, - "type": "object" - }, - "admins": { - "properties": { - "": { - "properties": { - "success": { - "type": "boolean" - }, - "data": { - "type": "object" - } - }, - "type": "object" - } + "CategoryType": { + "description": "Type of entries in the list", + "type": "string", + "enum": [ + "word", + "pattern", + "sentence-similarity" + ] }, - "type": "object" - }, - "moderators": { - "properties": { - "": { + "CommonFields": { "properties": { - "success": { - "type": "boolean" - }, - "data": { - "type": "object" - } + "authToken": { + "type": "string", + "example": "superhero3_1710141033938cf7e3c67cc44465440d" + }, + "timezone": { + "type": "string", + "example": "Asia/Kolkata" + } }, "type": "object" - } }, - "type": "object" - }, - "participants": { - "properties": { - "": { + "Condition": { "properties": { - "success": { - "type": "boolean" - }, - "data": { - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "groupSchema": { - "description": "Response data", - "properties": { - "guid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "type": { - "type": "string" - }, - "scope": { - "type": "string" - }, - "membersCount": { - "type": "integer" - }, - "joinedAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - }, - "hasJoined": { - "type": "boolean" - }, - "owner": { - "type": "string" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "messageCategorySchema": { - "properties": { - "receiver": { - "description": "The receiver of the message.", - "type": "string" - }, - "muid": { - "description": "The muid will be a unique Identifier of the message.", - "type": "string" - }, - "receiverType": { - "description": "The receiverType of the message. either user or group", - "type": "string", - "enum": [ - "user", - "group" - ] - }, - "category": { - "description": "Category of the message. The available categories are message and custom.", - "type": "string", - "default": "message", - "enum": [ - "message" - ] - }, - "type": { - "description": "Type of the message. The available values are text, image, file, audio, video.", - "type": "string", - "default": "text", - "enum": [ - "text", - "image", - "file", - "audio", - "video" - ] - }, - "data": { - "description": "JSON containing message attributes.", - "properties": { - "text": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "attachments": { - "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", - "type": "array", - "items": { - "properties": { - "url": { - "description": "Contains the URL of the attachment.", - "type": "string" + "id": { + "description": "Unique identifier of a condition", + "type": "integer", + "example": 1 }, - "name": { - "description": "Name of the attachment.", - "type": "string" + "entity": { + "description": "Entity type in which moderation will be performed.", + "type": "string", + "example": "message" }, - "mimeType": { - "description": "Mime Type of attachment.", - "type": "string" + "operand": { + "description": "Type of message content to moderate (e.g., text, image, video, custom).", + "type": "string", + "enum": [ + "text", + "image", + "video", + "custom" + ], + "example": "image" }, - "extension": { - "description": "The extension of the attachment.", - "type": "string" + "operator": { + "description": "Operation to be performed for condition evaluation (e.g., contains, equals).", + "type": "string", + "enum": [ + "contains", + "equals" + ], + "example": "contains" }, - "size": { - "description": "The size of the attachment(in bytes).", - "type": "string" - } - }, - "type": "object" - } - } - }, - "type": "object" - }, - "multipleReceivers": { - "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", - "properties": { - "uids": { - "type": "array", - "items": { - "type": "string" - } - }, - "guids": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "tags": { - "description": "A list of tags to identify specific messages.", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - }, - "messageMetaSchema": { - "properties": { - "current": { - "properties": { - "limit": { - "type": "integer" - }, - "count": { - "type": "integer" - } - }, - "type": "object" - }, - "next": { - "properties": { - "affix": { - "type": "string" - }, - "sentAt": { - "type": "integer" - }, - "id": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "messageReactionSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "text": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "entities": { - "properties": { - "sender": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "category": { + "description": "Type of entries for evaluation, either 'word' or 'pattern'.", + "type": "string", + "enum": [ + "word", + "pattern" + ], + "example": "word" }, - "type": "object" - }, - "receiver": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "isKeywordReferencePresent": { + "description": "Indicates if the value contains a reference to a keyword list.", + "type": "boolean", + "example": false }, - "type": "object" - } + "isMediaPresent": { + "description": "Indicates if the incoming message contains media content.", + "type": "boolean", + "example": true + }, + "value": { + "description": "Actual value for the condition, or reference ID if isKeywordReferencePresent is true, or a formula if isMediaPresent is true.", + "type": "string", + "example": "violence_greaterThan_30" + } }, "type": "object" - } }, - "type": "object" - }, - "reactions": { - "type": "array", - "items": { - "properties": { - "reaction": { - "type": "string" - }, - "count": { - "type": "integer" - }, - "reactedByMe": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "messageSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "text": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "entities": { - "properties": { - "sender": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { + "CustomEmailProviderConfig": { + "properties": { + "isEnabled": { + "description": "Use custom provider", + "type": "boolean" + }, + "useStoredEmailID": { + "description": "If enabled, the webhook will be triggered for a user only if their email address is stored within CometChat.", + "type": "boolean" + }, + "webhookURL": { + "description": "The webhook URL to be triggered for the respective events.", "type": "string" - } }, - "type": "object" - }, - "receiver": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { + "useBasicAuth": { + "description": "To enable basic auth for the URL", + "type": "boolean" + }, + "basicAuthUsername": { + "description": "The username for Basic auth", "type": "string" - } }, - "type": "object" - } + "basicAuthPassword": { + "description": "The password for Basic auth", + "type": "string" + } }, "type": "object" - } }, - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "metaSchema": { - "properties": { - "pagination": { - "properties": { - "total": { - "type": "integer" - }, - "count": { - "type": "integer" - }, - "per_page": { - "type": "integer" - }, - "current_page": { - "type": "integer" - }, - "total_pages": { - "type": "integer" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "muteConversation": { - "properties": { - "id": { - "description": "uid or guid", - "type": "string" - }, - "type": { - "description": "oneOnOne or group", - "type": "string", - "enum": [ - "oneOnOne", - "group" - ] - }, - "until": { - "description": "This is a valid timestamp from the future, E.g: 1710696964705", - "type": "integer", - "format": "int64" - } - }, - "type": "object" - }, - "objectEntitySchema": { - "properties": { - "entities": { - "properties": { - "by": { + "CustomSMSProviderConfig": { "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { + "isEnabled": { + "description": "Use custom provider", + "type": "boolean" + }, + "useStoredPhNo": { + "description": "If enabled, the webhook will be triggered for a user only if their phone number is stored within CometChat.", + "type": "boolean" + }, + "webhookURL": { + "description": "The webhook URL triggered for respective events", "type": "string" - }, - "role": { + }, + "useBasicAuth": { + "description": "To enable basic auth for the URL", + "type": "boolean" + }, + "basicAuthUsername": { + "description": "The username for Basic auth", "type": "string" - }, - "createdAt": { - "type": "integer" - } }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "basicAuthPassword": { + "description": "The password for Basic auth", + "type": "string" + } }, "type": "object" - }, - "for": { + }, + "Day": { "properties": { - "entity": { - "properties": { - "guid": { - "type": "string" - }, - "icon": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "updatedBy": { - "type": "integer" - }, - "description": { - "type": "integer" - }, - "membersCount": { - "type": "integer" - }, - "conversationId": { - "type": "integer" - } + "from": { + "type": "integer", + "format": "int32", + "maximum": 2359, + "minimum": 0 }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "to": { + "type": "integer", + "format": "int32", + "maximum": 2359, + "minimum": 0 + }, + "dnd": { + "type": "boolean" + } }, "type": "object" - }, - "on": { + }, + "Group": { "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "link": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { + "messagesSetting": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "messagesOverride": { + "type": "boolean" + }, + "repliesSetting": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "repliesOverride": { + "type": "boolean" + }, + "reactionsSetting": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "reactionsOverride": { + "type": "boolean" + }, + "memberLeftSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberLeftOverride": { + "type": "boolean" + }, + "memberAddedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberAddedOverride": { + "type": "boolean" + }, + "memberJoinedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberJoinedOverride": { + "type": "boolean" + }, + "memberKickedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberKickedOverride": { + "type": "boolean" + }, + "memberBannedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberBannedOverride": { + "type": "boolean" + }, + "memberUnbannedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberUnbannedOverride": { + "type": "boolean" + }, + "memberScopeChangedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "memberScopeChangedOverride": { + "type": "boolean" + }, + "messageEditedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "messageDeletedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + } + }, + "type": "object" + }, + "GroupFilter": { + "required": [ + "entity", + "operand", + "operator", + "value", + "type" + ], + "properties": { + "entity": { + "description": "Type of entity for group filter", + "type": "string", + "enum": [ + "group" + ] + }, + "operand": { + "description": "Field to apply the filter on for 'group'", + "type": "string", + "enum": [ + "guid", + "name", + "type", + "tags", + "createdAt" + ] + }, + "operator": { + "description": "Operator to use for filtering", + "type": "string", + "enum": [ + "equals", + "notEquals", + "in", + "notIn", + "startsWith", + "endsWith", + "lessThan", + "greaterThan" + ], + "example": "equals" + }, + "value": { + "description": "Value for the filter", + "type": "string", + "example": "exampleValue" + }, + "type": { + "description": "Type of the filter, specifying sender or receiver", + "type": "string", + "enum": [ + "sender", + "receiver" + ], + "example": "sender" + } + }, + "type": "object" + }, + "KeywordList": { + "discriminator": { + "propertyName": "category", + "mapping": { + "word": "#/components/schemas/WordPatternSchema", + "pattern": "#/components/schemas/PatternSchema", + "sentence-similarity": "#/components/schemas/SentenceSimilaritySchema" + } + }, + "oneOf": [ + { + "$ref": "#/components/schemas/WordPatternSchema" + }, + { + "$ref": "#/components/schemas/PatternSchema" + }, + { + "$ref": "#/components/schemas/SentenceSimilaritySchema" + } + ] + }, + "MediaMessageTemplate": { + "properties": { + "titleOneOnOne": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}}" + }, + "titleGroup": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" + }, + "body_image": { + "type": "string", + "example": "Has sent an {{message.type}}" + }, + "body_audio": { + "type": "string", + "example": "Has sent an {{message.type}}" + }, + "body_video": { + "type": "string", + "example": "Has sent a {{message.type}}" + }, + "body_file": { + "type": "string", + "example": "Has sent a {{message.type}}" + } + }, + "type": "object" + }, + "ModerationData": { + "properties": { + "id": { + "type": "string", + "example": "moderation-test" + }, + "name": { + "type": "string", + "example": "Video Moderation" + }, + "description": { + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + }, + "enabled": { + "type": "boolean", + "example": true + }, + "conditions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } + }, + "action": { + "type": "array", + "items": { + "type": "string", + "example": "blockMessage" + } + }, + "active": { + "type": "boolean", + "example": true + }, + "createdAt": { + "type": "integer", + "example": 1720003247 + }, + "updatedAt": { + "type": "integer", + "example": 1720003247 + }, + "revisionId": { + "type": "string", + "example": "253179cf5f665257_moderation-test_1" + } + }, + "type": "object" + }, + "ModerationRequestBody": { + "properties": { + "id": { + "description": "Unique identifier for the moderation rule.", + "type": "string", + "example": "moderation-test" + }, + "name": { + "description": "Descriptive name for the moderation rule.", + "type": "string", + "example": "Video Moderation" + }, + "enabled": { + "description": "Indicates whether the rule is active.", + "type": "boolean", + "example": true + }, + "description": { + "description": "Detailed explanation of the rule's purpose.", + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + }, + "action": { + "description": "Actions to be taken when a violation is detected.", + "type": "array", + "items": { + "type": "string", + "example": "blockMessage" + } + }, + "filters": { + "description": "List of filters to apply", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserFilter" + }, + { + "$ref": "#/components/schemas/GroupFilter" + } + ] + } + }, + "conditions": { + "description": "List of conditions that must be met for the rule to trigger.", + "type": "array", + "items": { + "$ref": "#/components/schemas/Condition" + } + } + }, + "type": "object" + }, + "Mute": { + "properties": { + "dndPreferenceOverride": { + "type": "boolean" + }, + "mutedGroupsOverride": { + "type": "boolean" + }, + "mutedOneOnOnesOverride": { + "type": "boolean" + }, + "schedulePreferenceSetting": { + "properties": { + "monday": { + "$ref": "#/components/schemas/Day" + }, + "tuesday": { + "$ref": "#/components/schemas/Day" + }, + "wednesday": { + "$ref": "#/components/schemas/Day" + }, + "thursday": { + "$ref": "#/components/schemas/Day" + }, + "friday": { + "$ref": "#/components/schemas/Day" + }, + "saturday": { + "$ref": "#/components/schemas/Day" + }, + "sunday": { + "$ref": "#/components/schemas/Day" + } + }, + "type": "object" + }, + "schedulePreferenceOverride": { + "type": "boolean" + } + }, + "type": "object" + }, + "MutePreferences": { + "properties": { + "dnd": { + "description": "1: Disable DND\n2: Enable DND", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "schedule": { + "$ref": "#/components/schemas/Schedule" + } + }, + "type": "object" + }, + "PNSuccess": { + "properties": { + "success": { + "type": "boolean" + } + }, + "type": "object" + }, + "PatternSchema": { + "required": [ + "category", + "searchTerms" + ], + "properties": { + "file": { + "description": "CSV file containing the keywords or regex patterns for the list.", + "type": "string", + "format": "binary" + }, + "id": { + "description": "Unique identifier for the pattern list.", + "type": "string", + "example": "ID-of-the-pattern-list" + }, + "name": { + "description": "Descriptive name for the pattern list.", + "type": "string", + "example": "Name of the pattern list" + }, + "description": { + "description": "Detailed explanation of the pattern list's purpose.", + "type": "string", + "example": "Description of the pattern list" + }, + "category": { + "$ref": "#/components/schemas/CategoryType" + }, + "searchTerms": { + "description": "Comma-separated values of keywords or regex patterns if no file is provided.", + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + } + }, + "type": "object" + }, + "PlatformAPNS": { + "allOf": [ + { + "properties": { + "platform": { + "type": "string", + "enum": [ + "apns_ios_device", + "apns_flutter_device", + "apns_react_native_device", + "apns_ionic_cordova_device" + ] + }, + "providerId": { + "type": "string", + "example": "apns-provider-2" + }, + "deviceToken": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/CommonFields" + } + ] + }, + "PlatformFCM": { + "allOf": [ + { + "properties": { + "platform": { + "type": "string", + "enum": [ + "fcm_android", + "fcm_ios", + "fcm_web", + "fcm_flutter_android", + "fcm_flutter_ios", + "fcm_react_native_android", + "fcm_react_native_ios", + "fcm_ionic_cordova_android", + "fcm_ionic_cordova_ios" + ] + }, + "providerId": { + "type": "string", + "example": "fcm-provider-2" + }, + "fcmToken": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/CommonFields" + } + ] + }, + "PlatformVOIP": { + "allOf": [ + { + "properties": { + "platform": { + "type": "string", + "enum": [ + "apns_ios_voip", + "apns_flutter_voip", + "apns_ionic_cordova_voip", + "apns_react_native_voip" + ] + }, + "providerId": { + "type": "string", + "example": "apns-provider-2" + }, + "voipToken": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/CommonFields" + } + ] + }, + "Preferences": { + "properties": { + "push": { + "properties": { + "includeMessageObjectSetting": { + "description": "Include the message object in the push payload", + "type": "boolean" + }, + "includeSenderMetadataSetting": { + "description": "Include the sender's metadata as part of the message object", + "type": "boolean" + }, + "includeReceiverMetadataSetting": { + "description": "Include the receiver's metadata as part of the message object", + "type": "boolean" + }, + "trimTextFieldSetting": { + "description": "Trim the text field if present.", + "type": "boolean" + }, + "includeMessageMetadataSetting": { + "description": "Include the message's metadata as part of the message object", + "type": "boolean" + }, + "customJson": { + "description": "A custom JSON object for miscellaneous data", + "type": "object" + } + }, + "type": "object" + }, + "call": { + "properties": { + "initiatedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "ongoingSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "cancelledSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "busySetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "rejectedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "unansweredSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + }, + "endedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ], + "example": 2 + } + }, + "type": "object" + }, + "bypassPreferencesForMentions": { + "type": "boolean" + }, + "bypassPreferencesForGroupMentions": { + "type": "boolean" + }, + "group": { + "$ref": "#/components/schemas/Group" + }, + "oneOnOne": { + "$ref": "#/components/schemas/oneOnOne" + }, + "mute": { + "$ref": "#/components/schemas/Mute" + }, + "email": { + "$ref": "#/components/schemas/email" + }, + "sms": { + "$ref": "#/components/schemas/sms" + } + }, + "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": { + "$ref": "#/components/schemas/Day" + }, + "tuesday": { + "$ref": "#/components/schemas/Day" + }, + "wednesday": { + "$ref": "#/components/schemas/Day" + }, + "thursday": { + "$ref": "#/components/schemas/Day" + }, + "friday": { + "$ref": "#/components/schemas/Day" + }, + "saturday": { + "$ref": "#/components/schemas/Day" + }, + "sunday": { + "$ref": "#/components/schemas/Day" + } + }, + "type": "object" + }, + "SchedulerSchema": { + "required": [ + "interactionGoal", + "allowSenderInteraction", + "interactiveData" + ], + "properties": { + "interactionGoal": { + "required": [ + "type", + "elementIds" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "anyAction", + "allOf", + "oneOf", + "none" + ] + }, + "elementIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "allowSenderInteraction": { + "type": "boolean" + }, + "interactiveData": { + "required": [ + "title", + "avatarUrl", + "bufferTime", + "icsFileUrl", + "availability", + "timezoneCode", + "duration", + "scheduleElement", + "goalCompletionText", + "dateRangeStart", + "dateRangeEnd" + ], + "properties": { + "title": { + "type": "string" + }, + "avatarUrl": { + "type": "string" + }, + "bufferTime": { + "type": "integer" + }, + "icsFileUrl": { + "type": "string" + }, + "timezoneCode": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "scheduleElement": { + "required": [ + "action", + "elementId", + "buttonText", + "elementType", + "disableAfterInteracted" + ], + "properties": { + "action": { + "required": [ + "url", + "actionType", + "method", + "dataKey", + "headers", + "payload" + ], + "properties": { + "url": { + "type": "string" + }, + "actionType": { + "type": "string" + }, + "method": { + "type": "string" + }, + "dataKey": { + "type": "string" + }, + "headers": { + "type": "object" + }, + "payload": { + "required": [ + "data", + "type", + "category", + "receiver", + "receiverType" + ], + "properties": { + "data": { + "properties": { + "text": { + "type": "string" + } + }, + "type": "object" + }, + "type": { + "type": "string" + }, + "category": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "receiverType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "elementId": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "elementType": { + "type": "string" + }, + "disableAfterInteracted": { + "type": "boolean" + } + }, + "type": "object" + }, + "goalCompletionText": { + "type": "string" + }, + "dateRangeStart": { + "type": "string", + "format": "date" + }, + "dateRangeEnd": { + "type": "string", + "format": "date" + } + }, + "type": "object" + } + }, + "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", + "disallowedSentences" + ], + "properties": { + "file": { + "description": "CSV file containing the keywords or regex patterns for the list.", + "type": "string", + "format": "binary" + }, + "id": { + "description": "Unique identifier for the keyword list.", + "type": "string", + "example": "ID-of-the-sentences-list" + }, + "name": { + "description": "Descriptive name for the keyword list.", + "type": "string", + "example": "Name of the sentences list" + }, + "description": { + "description": "Detailed explanation of the keyword list's purpose.", + "type": "string", + "example": "Description of the sentences list" + }, + "category": { + "$ref": "#/components/schemas/CategoryType" + }, + "disallowedSentences": { + "description": "Comma-separated sentences that are disallowed if the category is 'sentence-similarity'.", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Hello, let's connect on Whatsapp." + ] + } + }, + "type": "object" + }, + "ServiceAccountCreds": { + "properties": { + "project_id": { + "type": "string" + }, + "client_email": { + "type": "string" + }, + "private_key": { + "type": "string" + }, + "private_key_id": { + "type": "string" + } + }, + "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": { + "type": "boolean" + }, + "call": { + "type": "boolean" + } + }, + "type": "object" + }, + "Sound": { + "properties": { + "chat": { + "type": "string" + }, + "call": { + "type": "string" + } + }, + "type": "object" + }, + "Template": { + "properties": { + "titleOneOnOne": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}}" + }, + "titleGroup": { + "type": "string", + "example": "{{message.data.entities.sender.entity.name}} @ {{message.data.entities.receiver.entity.name}}" + }, + "body": { + "type": "string", + "example": "New text message" + } + }, + "type": "object" + }, + "Templates": { + "properties": { + "usePrivacyTemplate": { + "description": "1: Use default templates\n2: Use privacy templates\n3: Use default templates with end-user privacy override", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "textMessageTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "textMessageTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "mediaMessageTemplateDefault": { + "$ref": "#/components/schemas/MediaMessageTemplate" + }, + "mediaMessageTemplatePrivacy": { + "$ref": "#/components/schemas/MediaMessageTemplate" + }, + "customMessageTemplateDefault": { + "allOf": [ + { + "properties": { + "body_fallback": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/Template" + } + ] + }, + "customMessageTemplatePrivacy": { + "allOf": [ + { + "properties": { + "body_fallback": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/Template" + } + ] + }, + "interactiveFormTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveFormTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCardTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCardTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "interactiveSchedulerTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveSchedulerTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCustomTemplateDefault": { + "$ref": "#/components/schemas/Template" + }, + "interactiveCustomTemplatePrivacy": { + "$ref": "#/components/schemas/Template" + }, + "emailSubjectTemplateDefault": { + "properties": { + "subjectGroup": { + "type": "string", + "example": "While you were away..." + }, + "subjectOneOnOne": { + "type": "string", + "example": "While you were away..." + } + }, + "type": "object" + }, + "emailSubjectTemplatePrivacy": { + "properties": { + "subjectGroup": { + "type": "string", + "example": "While you were away..." + }, + "subjectOneOnOne": { + "type": "string", + "example": "While you were away..." + } + }, + "type": "object" + }, + "smsContentTemplateDefault": { + "properties": { + "bodyGroup": { + "type": "string", + "example": "You've received new messages in {{groupDetails.name}}! You can read the message at https://your-website.com." + }, + "bodyOneOnOne": { + "type": "string", + "example": "You've received new messages from {{sender.name}}! You can read the message at https://your-website.com." + } + }, + "type": "object" + }, + "smsContentTemplatePrivacy": { + "properties": { + "bodyGroup": { + "type": "string", + "example": "You've received new messages in {{groupDetails.name}}! You can read the message at https://your-website.com." + }, + "bodyOneOnOne": { + "type": "string", + "example": "You've received new messages from {{sender.name}}! You can read the message at https://your-website.com." + } + }, + "type": "object" + } + }, + "type": "object" + }, + "TimeRange": { + "required": [ + "from", + "to" + ], + "properties": { + "from": { + "type": "string" + }, + "to": { + "type": "string" + } + }, + "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", + "operand", + "operator", + "value", + "type" + ], + "properties": { + "type": { + "description": "Type of the filter, specifying sender or receiver", + "type": "string", + "enum": [ + "sender", + "receiver" + ], + "example": "sender" + }, + "entity": { + "description": "Type of entity for user filter", + "type": "string", + "enum": [ + "user" + ] + }, + "operand": { + "description": "Field to apply the filter on for 'user'", + "type": "string", + "enum": [ + "uid", + "name", + "role", + "tags", + "createdAt" + ] + }, + "operator": { + "description": "Operator to use for filtering", + "type": "string", + "enum": [ + "equals", + "not equals", + "in", + "not in", + "startsWith" + ], + "example": "equals" + }, + "value": { + "description": "Value for the filter", + "type": "string", + "example": "admin" + } + }, + "type": "object" + }, + "WordPatternSchema": { + "required": [ + "category", + "searchTerms" + ], + "properties": { + "file": { + "description": "CSV file containing the keywords or regex patterns for the list.", + "type": "string", + "format": "binary" + }, + "id": { + "description": "Unique identifier for the word list.", + "type": "string", + "example": "ID-of-the-word-list" + }, + "name": { + "description": "Descriptive name for the word list.", + "type": "string", + "example": "Name of the word list" + }, + "description": { + "description": "Detailed explanation of the word list's purpose.", + "type": "string", + "example": "Description of the word list" + }, + "category": { + "$ref": "#/components/schemas/CategoryType" + }, + "searchTerms": { + "description": "Comma-separated values of keywords or regex patterns if no file is provided.", + "type": "string", + "example": "AI-powered video moderation to detect unsafe content." + } + }, + "type": "object" + }, + "authTokenSchema": { + "description": "Response data", + "properties": { + "uid": { + "type": "string" + }, + "authToken": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "bannedUserSchema": { + "description": "Response data", + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "isBanned": { + "type": "boolean" + }, + "joinedAt": { + "type": "integer" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "blockedUserSchema": { + "description": "Response data", + "properties": { + "blockedByMe": { + "type": "boolean" + }, + "blockedByMeAt": { + "type": "integer" + }, + "blockedAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "conversationSchema": { + "description": "Response data", + "properties": { + "conversationId": { + "type": "string" + }, + "conversationType": { + "type": "string" + }, + "unreadMessageCount": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "lastMessage": { + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "allOf": [ + { + "properties": { + "action": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/objectEntitySchema" + } + ] + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "receipts": { + "properties": { + "data": { + "type": "array", + "items": {} + } + }, + "type": "object" + } + }, + "type": "object" + }, + "conversationWith": { + "type": "object" + } + }, + "type": "object" + }, + "conversationWithSchema": { + "properties": { + "guid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "membersCount": { + "type": "integer" + }, + "joinedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + }, + "hasJoined": { + "type": "boolean", + "default": "true" + }, + "createdAt": { + "type": "integer" + }, + "owner": { + "type": "string" + }, + "updatedAt": { + "type": "integer" + }, + "updatedBy": { + "type": "string" + } + }, + "type": "object" + }, + "createApnsProvider": { + "properties": { + "providerId": { + "type": "string" + }, + "keyId": { + "type": "string" + }, + "teamId": { + "type": "string" + }, + "bundleId": { + "type": "string" + }, + "p8KeyFilename": { + "type": "string" + }, + "p8Key": { + "type": "string" + }, + "includeContentAvailable": { + "type": "boolean" + }, + "includeMutableContent": { + "type": "boolean" + }, + "productionMode": { + "type": "boolean" + } + }, + "type": "object" + }, + "customCategorySchema": { + "properties": { + "receiver": { + "description": "The receiver of the message.", + "type": "string" + }, + "muid": { + "description": "The muid will be a unique Identifier of the message.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" + ] + }, + "category": { + "description": "Category of the message. The available categories is custom.", + "type": "string", + "default": "custom", + "enum": [ + "custom" + ] + }, + "quotedMessageId": { + "description": "ID of the message being quoted.\nIf provided, the send message response will include a `quotedMessage` node\nin the response containing the referenced message object.", + "type": "string", + "default": "message", + "enum": [ + "message" + ] + }, + "type": { + "description": "Type of the message.", + "type": "string" + }, + "data": { + "description": "JSON containing message attributes.", + "properties": { + "customData": { + "description": "when category==”custom”, this property can have any JSON object.", + "type": "object" + } + }, + "type": "object" + }, + "multipleReceivers": { + "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", + "properties": { + "uids": { + "type": "array", + "items": { + "type": "string" + } + }, + "guids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "customInteractiveSchema": { + "title": "Custom Interactive Schema", + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "dataPointSchema": { + "description": "Response data", + "properties": { + "messagesSent": { + "type": "integer" + }, + "readReceipts": { + "type": "integer" + }, + "deliveryReceipts": { + "type": "integer" + }, + "startTime": { + "type": "integer" + }, + "endTime": { + "type": "integer" + } + }, + "type": "object" + }, + "deleteSchema": { + "properties": { + "success": { + "type": "boolean" + }, + "message": { + "type": "string" + } + }, + "type": "object" + }, + "email": { + "properties": { + "notifyForUnreadOnly": { + "description": "If the value is false, the notification will contain all the messages, not just unread.", + "type": "boolean" + }, + "intervalInSeconds": { + "type": "integer" + }, + "maxPerDay": { + "type": "integer" + }, + "maxPerDayPerConversation": { + "type": "integer" + }, + "includeMessageObjectSetting": { + "description": "Includes the message object in the email payload", + "type": "boolean" + }, + "includeSenderMetadataSetting": { + "description": "Includes sender metadata in the message object", + "type": "boolean" + }, + "includeReceiverMetadataSetting": { + "description": "Includes receiver metadata in the message object", + "type": "boolean" + }, + "includeMessageMetadataSetting": { + "description": "Includes message metadata in the message object", + "type": "boolean" + } + }, + "type": "object" + }, + "fcmCreateProviderSchema": { + "properties": { + "providerId": { + "type": "string" + }, + "serviceAccountFilename": { + "type": "string" + }, + "serviceAccountCreds": { + "$ref": "#/components/schemas/ServiceAccountCreds" + }, + "notificationInPayload": { + "properties": { + "ios": { + "$ref": "#/components/schemas/SilentNotification" + }, + "android": { + "$ref": "#/components/schemas/SilentNotification" + }, + "web": { + "$ref": "#/components/schemas/SilentNotification" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "groupEntitySchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "properties": { + "action": { + "type": "string" + }, + "entities": { + "properties": { + "by": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "on": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "for": { + "properties": { + "entity": { + "properties": { + "guid": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "name": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "membersCount": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "avatar": { + "type": "string" + }, + "metadata": { + "properties": { + "email": { + "type": "string" + } + }, + "type": "object" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "groupMemberListSchema": { + "description": "Response data", + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "joinedAt": { + "type": "integer" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "groupMemberSchema": { + "description": "Response data", + "properties": { + "usersToBan": { + "properties": { + "": { + "properties": { + "success": { + "type": "boolean" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "admins": { + "properties": { + "": { + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "moderators": { + "properties": { + "": { + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "participants": { + "properties": { + "": { + "properties": { + "success": { + "type": "boolean" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "groupReceiverDetails": { + "required": [ + "guid", + "name", + "type" + ], + "properties": { + "guid": { + "description": "The primary-key/ unique identifier of the group.", + "type": "string" + }, + "name": { + "description": "Name of the group.", + "type": "string" + }, + "icon": { + "description": "An URL for a group icon.", + "type": "string" + }, + "type": { + "description": "Type of the group. Can be public, password or private.", + "type": "string", + "enum": [ + "public", + "password", + "private" + ] + }, + "password": { + "description": "A password required to join the the group with type password", + "type": "string" + }, + "owner": { + "description": "Owner of the group.", + "type": "string" + }, + "createdAt": { + "description": " A 10-digit UNIX timestamp at which the group was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional data for the group.", + "type": "object" + }, + "tags": { + "description": "A string array containing grouptags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "type": "object" + }, + "groupSchema": { + "description": "Response data", + "properties": { + "guid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "type": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "membersCount": { + "type": "integer" + }, + "joinedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + }, + "hasJoined": { + "type": "boolean" + }, + "owner": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "interactionCardSchema": { + "title": "Card Schema", + "properties": { + "interactionGoal": { + "properties": { + "type": { + "type": "string", + "enum": [ + "anyOf", + "allOf", + "oneOf", + "none" + ] + }, + "elementIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "allowSenderInteraction": { + "type": "boolean" + }, + "interactiveData": { + "properties": { + "text": { + "type": "string" + }, + "cardActions": { + "type": "array", + "items": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "defaultValue": { + "type": "string" + }, + "label": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "maxLines": { + "type": "integer" + }, + "placeholder": { + "type": "object" + } + }, + "type": "object" + } + }, + "submitElement": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "disableAfterInteracted": { + "type": "boolean" + }, + "optional": { + "type": "boolean" + }, + "action": { + "properties": { + "url": { + "type": "string" + }, + "method": { + "type": "string" + }, + "payload": { + "type": "object" + }, + "headers": { + "type": "object" + }, + "dataKey": { + "type": "string" + }, + "actionType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "interactionFormSchema": { + "title": "Form Schema", + "properties": { + "interactionGoal": { + "properties": { + "type": { + "type": "string", + "enum": [ + "anyOf", + "allOf", + "oneOf", + "none" + ] + }, + "elementIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "allowSenderInteraction": { + "type": "boolean" + }, + "interactiveData": { + "properties": { + "text": { + "type": "string" + }, + "formFields": { + "type": "array", + "items": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "defaultValue": { + "type": "string" + }, + "label": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "maxLines": { + "type": "integer" + }, + "placeholder": { + "type": "object" + } + }, + "type": "object" + } + }, + "submitElement": { + "properties": { + "elementType": { + "type": "string" + }, + "elementId": { + "type": "string" + }, + "buttonText": { + "type": "string" + }, + "disableAfterInteracted": { + "type": "boolean" + }, + "optional": { + "type": "boolean" + }, + "action": { + "properties": { + "url": { + "type": "string" + }, + "method": { + "type": "string" + }, + "payload": { + "type": "object" + }, + "headers": { + "type": "object" + }, + "dataKey": { + "type": "string" + }, + "actionType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "interactiveCategorySchema": { + "properties": { + "receiver": { + "description": "The receiver of the message.", + "type": "string" + }, + "muid": { + "description": "The muid will be a unique Identifier of the message.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" + ] + }, + "category": { + "description": "Category of the message. The available categories is interactive.", + "type": "string", + "default": "interactive", + "enum": [ + "interactive" + ] + }, + "type": { + "description": "Type of the message. The available values are card, form and customInteractive.", + "type": "string", + "default": "card", + "enum": [ + "card", + "form", + "customInteractive", + "scheduler" + ] + }, + "data": { + "description": "JSON containing message attributes. Please select the appropriate schema based on the type property.", + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/interactionFormSchema" + }, + { + "$ref": "#/components/schemas/interactionCardSchema" + }, + { + "$ref": "#/components/schemas/SchedulerSchema" + }, + { + "$ref": "#/components/schemas/customInteractiveSchema" + } + ] + }, + "multipleReceivers": { + "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", + "properties": { + "uids": { + "type": "array", + "items": { + "type": "string" + } + }, + "guids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object", + "example": { + "receiverType": "user", + "data": { + "interactionGoal": { + "type": "allOf", + "elementIds": [ + "element8" + ] + }, + "allowSenderInteraction": true, + "interactiveData": { + "title": "Form Title", + "formFields": [ + { + "elementType": "textInput", + "elementId": "element1", + "defaultValue": "vivek", + "label": "Name", + "optional": false, + "maxLines": 1, + "placeholder": { + "text": "write your name here" + } + }, + { + "elementType": "textInput", + "elementId": "element2", + "label": "Last Name", + "optional": false, + "maxLines": 1 + }, + { + "elementType": "textInput", + "elementId": "element3", + "label": "Address", + "optional": false, + "maxLines": 5 + }, + { + "elementType": "dropdown", + "elementId": "element4", + "label": "Country", + "optional": false, + "defaultValue": "option1", + "options": [ + { + "value": "option1", + "label": "INDIA" + }, + { + "value": "option2", + "label": "AUSTRALIA" + } + ] + }, + { + "elementType": "checkbox", + "elementId": "element5", + "optional": true, + "label": "Services", + "options": [ + { + "value": "option1", + "label": "Garbage" + }, + { + "value": "option2", + "label": "Electricity Bill" + }, + { + "value": "option3", + "label": "Lift" + } + ], + "defaultValue": [ + "option1", + "option2" + ] + }, + { + "elementType": "singleSelect", + "elementId": "element6", + "optional": false, + "label": "Wing", + "defaultValue": "option1", + "options": [ + { + "value": "option1", + "label": "A Wing" + }, + { + "value": "option2", + "label": "B Wing" + } + ] + }, + { + "elementType": "button", + "elementId": "element9", + "buttonText": "About us", + "disableAfterInteracted": true, + "action": { + "actionType": "urlNavigation", + "url": "https://www.cometchat.com" + } + } + ], + "submitElement": { + "elementType": "button", + "elementId": "element8", + "buttonText": "Submit", + "disableAfterInteracted": true, + "action": { + "actionType": "apiAction", + "url": "https://10893f2ae68f59.api-us.cometchat-staging.com/v3.0/messages", + "method": "POST", + "payload": { + "category": "message", + "type": "text", + "data": { + "text": "Thanks For filling the Form!" + }, + "receiver": "superhero2", + "receiverType": "user" + }, + "headers": { + "appId": "10893f2ae68f59", + "Content-Type": "application/json", + "apiKey": "5797f2d3d103d7d78f085eb46bfd14d5c45ddfdf", + "onBehalfOf": "superhero1" + }, + "dataKey": "CometChatData" + } + } + } + }, + "category": "interactive", + "type": "form", + "receiver": "superhero1", + "tags": [ + "tag1" + ] + } + }, + "interactiveMessageSchema": { + "properties": { + "current": { + "properties": { + "limit": { + "type": "integer" + }, + "count": { + "type": "integer" + } + }, + "type": "object" + }, + "next": { + "properties": { + "affix": { + "type": "string" + }, + "sentAt": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "messageCategorySchema": { + "properties": { + "receiver": { + "description": "The receiver of the message.", + "type": "string" + }, + "muid": { + "description": "The muid will be a unique Identifier of the message.", + "type": "string" + }, + "receiverType": { + "description": "The receiverType of the message. either user or group", + "type": "string", + "enum": [ + "user", + "group" + ] + }, + "category": { + "description": "Category of the message. The available categories are message and custom.", + "type": "string", + "default": "message", + "enum": [ + "message" + ] + }, + "quotedMessageId": { + "description": "ID of the message being quoted.\nIf provided, the send message response will include a `quotedMessage` node\nin the response containing the referenced message object.", + "type": "string" + }, + "type": { + "description": "Type of the message. The available values are text, image, file, audio, video.", + "type": "string", + "default": "text", + "enum": [ + "text", + "image", + "file", + "audio", + "video" + ] + }, + "data": { + "description": "JSON containing message attributes.", + "properties": { + "text": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "attachments": { + "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", + "type": "array", + "items": { + "properties": { + "url": { + "description": "Contains the URL of the attachment.", + "type": "string" + }, + "name": { + "description": "Name of the attachment.", + "type": "string" + }, + "mimeType": { + "description": "Mime Type of attachment.", + "type": "string" + }, + "extension": { + "description": "The extension of the attachment.", + "type": "string" + }, + "size": { + "description": "The size of the attachment(in bytes).", + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "multipleReceivers": { + "description": "JSON containing array of UIDs and GUID for whom the message must be sent. Format for multiple receivers - {\"uids\": [\"uid1\",\"uid2\"], \"guids\":[\"guid1\"]}", + "properties": { + "uids": { + "type": "array", + "items": { + "type": "string" + } + }, + "guids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "tags": { + "description": "A list of tags to identify specific messages.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" + }, + "messageMetaSchema": { + "properties": { + "current": { + "properties": { + "limit": { + "type": "integer" + }, + "count": { + "type": "integer" + } + }, + "type": "object" + }, + "next": { + "properties": { + "affix": { + "type": "string" + }, + "sentAt": { + "type": "integer" + }, + "id": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "messageReactionSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "properties": { + "text": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "entities": { + "properties": { + "sender": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "receiver": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "reactions": { + "type": "array", + "items": { + "properties": { + "reaction": { + "type": "string" + }, + "count": { + "type": "integer" + }, + "reactedByMe": { + "type": "boolean" + } + }, + "type": "object" + } + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + }, + "messageSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "properties": { + "text": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "entities": { + "properties": { + "sender": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "receiver": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + }, + "metaSchema": { + "properties": { + "pagination": { + "properties": { + "total": { + "type": "integer" + }, + "count": { + "type": "integer" + }, + "per_page": { + "type": "integer" + }, + "current_page": { + "type": "integer" + }, + "total_pages": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "moderationMessageData": { + "description": "Can contain any additional properties except for the key properties.", + "properties": { + "text": { + "description": "The meaning of the `data.text` property depends on the values of `category` and `type`:\n1. When `category` is `'message'` and `type` is `'text'`, it represents the text content of the message.\n2. When `category` is `'message'` and `type` is not `'text'`, it represents the caption associated with the attachment.", + "type": "string" + }, + "customData": { + "description": "when category==”custom”, this property can have any JSON object.", + "type": "object" + }, + "attachments": { + "description": "For the messages with image, video, audio or file type (i.e. category==\"message\" && type !=\"text\"), the property contains an array of attachment objects.", + "type": "array", + "items": { + "required": [ + "name", + "mimeType", + "extension", + "url" + ], + "properties": { + "url": { + "description": "Contains the URL of the attachment. The developer has to make sure that the URL is accessible while calling the API. The API will be downloading the attachment from its current location and upload it to CometChat’s attachment storage.", + "type": "string" + }, + "name": { + "description": "Name of the attachment.", + "type": "string" + }, + "mimeType": { + "description": "Mime Type of attachment.", + "type": "string" + }, + "extension": { + "description": "The extension of the attachment.", + "type": "string" + }, + "size": { + "description": "The size of the attachment(in bytes).", + "type": "string" + } + }, + "type": "object" + } + }, + "metadata": { + "type": "object" + } + }, + "type": "object" + }, + "muteConversation": { + "properties": { + "id": { + "description": "uid or guid", + "type": "string" + }, + "type": { + "description": "oneOnOne or group", + "type": "string", + "enum": [ + "oneOnOne", + "group" + ] + }, + "until": { + "description": "This is a valid timestamp from the future, E.g: 1710696964705", + "type": "integer", + "format": "int64" + } + }, + "type": "object" + }, + "objectEntitySchema": { + "properties": { + "entities": { + "properties": { + "by": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "for": { + "properties": { + "entity": { + "properties": { + "guid": { + "type": "string" + }, + "icon": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "owner": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "updatedBy": { + "type": "integer" + }, + "description": { + "type": "integer" + }, + "membersCount": { + "type": "integer" + }, + "conversationId": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "on": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "link": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "oneOnOne": { + "properties": { + "messagesSetting": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "messagesOverride": { + "type": "boolean" + }, + "repliesSetting": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "repliesOverride": { + "type": "boolean" + }, + "reactionsSetting": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "reactionsOverride": { + "type": "boolean" + }, + "messageEditedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "messageDeletedSetting": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + } + }, + "type": "object" + }, + "pnSettingSchema": { + "description": "Response data", + "properties": { + "preferences": { + "$ref": "#/components/schemas/Preferences" + }, + "sound": { + "$ref": "#/components/schemas/Sound" + }, + "templates": { + "$ref": "#/components/schemas/Templates" + } + }, + "type": "object" + }, + "pnTokenSchema": { + "description": "Response data", + "oneOf": [ + { + "$ref": "#/components/schemas/PlatformFCM" + }, + { + "$ref": "#/components/schemas/PlatformAPNS" + }, + { + "$ref": "#/components/schemas/PlatformVOIP" + } + ] + }, + "pnUpdatePreferences": { + "description": "Response data", + "properties": { + "groupPreferences": { + "properties": { + "groupMessages": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "groupReplies": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "groupReactions": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "groupMemberLeft": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberAdded": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberJoined": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberKicked": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberBanned": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberUnbanned": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "groupMemberScopeChanged": { + "description": "1: Don't notify\n2: Notify", + "type": "integer", + "enum": [ + 1, + 2 + ] + } + }, + "type": "object" + }, + "oneOnOnePreferences": { + "properties": { + "oneOnOneMessages": { + "description": "1: Don't notify\n2: Notify for all messages\n3: Notify for messages with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "oneOnOneReplies": { + "description": "1: Don't notify\n2: Notify for all replies\n3: Notify for replies with mentions", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "oneOnOneReactions": { + "description": "1: Don't notify\n2: Notify for reactions received on own messages\n3: Notify for reactions received on all messages", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + } + }, + "type": "object" + }, + "mutePreferences": { + "$ref": "#/components/schemas/MutePreferences" + }, + "usePrivacyTemplate": { + "type": "boolean" + } + }, + "type": "object" + }, + "pushNotificationSchema": { + "properties": { + "success": { + "type": "boolean" + } + }, + "type": "object" + }, + "pushProviders": { + "description": "Response data", + "type": "array", + "items": {} + }, + "reactionSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "messageId": { + "type": "string" + }, + "reaction": { + "type": "string" + }, + "uid": { + "type": "string" + }, + "reactedAt": { + "type": "integer" + }, + "reactedBy": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "roleSchema": { + "description": "Response data", + "properties": { + "role": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object" + }, + "email": { + "type": "string" + }, + "settings": { + "properties": { + "listUsers": { + "type": "string" + }, + "sendMessagesTo": { + "type": "string" + } + }, + "type": "object" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "sms": { + "properties": { + "notifyForUnreadOnly": { + "description": "If the value is false, the notification will contain all the messages, not just unread.", + "type": "boolean" + }, + "intervalInSeconds": { + "type": "integer" + }, + "maxPerDay": { + "type": "integer" + }, + "maxPerDayPerConversation": { + "type": "integer" + }, + "includeMessageObjectSetting": { + "description": "Includes the message object in the SMS payload", + "type": "boolean" + }, + "includeSenderMetadataSetting": { + "description": "Includes sender metadata in the message object", + "type": "boolean" + }, + "includeReceiverMetadataSetting": { + "description": "Includes receiver metadata in the message object", + "type": "boolean" + }, + "includeMessageMetadataSetting": { + "description": "Includes message metadata in the message object", + "type": "boolean" + } + }, + "type": "object" + }, + "triggerSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "category": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "type": "object" + }, + "unmuteConversation": { + "properties": { + "id": { + "description": "uid or guid", + "type": "string" + }, + "type": { + "description": "oneOnOne or group", + "type": "string", + "enum": [ + "oneOnOne", + "group" + ] + } + }, + "type": "object" + }, + "unregisterpnToken": { + "required": [ + "authToken" + ], + "properties": { + "authToken": { + "type": "string" + } + }, + "type": "object" + }, + "updatemessageSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "properties": { + "action": { + "type": "string" + }, + "entities": { + "properties": { + "by": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "for": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "on": { + "properties": { + "entity": { + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "properties": { + "text": { + "type": "string" + }, + "entities": { + "properties": { + "sender": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + }, + "receiver": { + "properties": { + "entity": { + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "status": { + "type": "string" + }, + "createdAt": { + "type": "string" + }, + "conversationId": { + "type": "string" + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "sentAt": { + "type": "integer" + }, + "editedAt": { + "type": "integer" + }, + "editedBy": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": {} + } + }, + "type": "object" + }, + "entityType": { + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + }, + "usageMetricsSchema": { + "description": "Response data", + "properties": { + "metrics": { + "properties": { + "audio_minutes": { + "type": "integer" + }, + "video_minutes": { + "type": "integer" + }, + "recorded_minutes": { + "type": "integer" + }, + "active_users": { + "type": "integer" + }, + "concurrent_users": { + "type": "integer" + } + }, + "type": "object" + }, + "time_range": { + "properties": { + "fromDate": { + "type": "integer" + }, + "toDate": { + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "userConversationSchema": { + "description": "Response data", + "properties": { + "conversationId": { + "type": "string" + }, + "conversationType": { + "type": "string" + }, + "unreadMessageCount": { + "type": "string" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + }, + "lastMessage": { + "properties": { + "id": { + "type": "string" + }, + "conversationId": { + "type": "string" + }, + "sender": { + "type": "string" + }, + "receiverType": { + "type": "string" + }, + "receiver": { + "type": "string" + }, + "category": { + "type": "string" + }, + "type": { + "type": "string" + }, + "data": { + "type": "object", + "allOf": [ + { + "properties": { + "action": { + "type": "string" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/objectEntitySchema" + } + ] + }, + "sentAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + }, + "conversationWith": { + "type": "object" + } + }, + "type": "object" + }, + "userReceiverDetails": { + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the receiver.", + "type": "string" + }, + "name": { + "description": "Name of the receiver.", + "type": "string" + }, + "avatar": { + "description": "URL to the profile picture of the user receiving the message.", + "type": "string" + }, + "link": { + "description": "Profile page URL of the receiver.", + "type": "string" + }, + "role": { + "description": "Role of the receiver. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the receiver was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the receiver.", + "type": "object" + }, + "tags": { + "description": "A string array containing receiver tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "type": "object" + }, + "userSchema": { + "description": "Response data", + "properties": { + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "avatar": { + "type": "string" + }, + "metadata": { + "properties": { + "email": { + "type": "string" + } + }, + "type": "object" + }, + "status": { + "type": "string" + }, + "role": { + "type": "string" + }, + "createdAt": { + "type": "integer" + } + }, + "type": "object" + }, + "userSenderDetails": { + "required": [ + "uid", + "name" + ], + "properties": { + "uid": { + "description": "The primary-key/ unique identifier of the sender.", + "type": "string" + }, + "name": { + "description": "Name of the sender.", "type": "string" - }, - "status": { + }, + "avatar": { + "description": "URL to the profile picture of the user sending the message.", "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "conversationId": { + }, + "link": { + "description": "Profile page URL of the sender.", "type": "string" - } }, - "type": "object" - }, - "entityType": { - "type": "string" - } + "role": { + "description": "Role of the sender. Should be created already via the Create role API.", + "type": "string" + }, + "createdAt": { + "description": "A 10-digit timestamp at which the sender was created.", + "type": "integer" + }, + "metadata": { + "description": "Additional details about the sender.", + "type": "object" + }, + "tags": { + "description": "A string array containing sender tags.", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } }, "type": "object" - } }, - "type": "object" - } + "webhookSchema": { + "description": "Response data", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "webhookURL": { + "type": "string" + }, + "useBasicAuth": { + "type": "boolean" + }, + "username": { + "type": "string" + }, + "password": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "createdAt": { + "type": "integer" + }, + "updatedAt": { + "type": "integer" + } + }, + "type": "object" + } }, - "type": "object" - }, - "oneOnOne": { - "properties": { - "messagesSetting": { - "description": "1: Don't subscribe\n2: Subscribe to all messages\n3: Subscribe to messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "messagesOverride": { - "type": "boolean" - }, - "repliesSetting": { - "description": "1: Don't subscribe\n2: Subscribe to all replies\n3: Subscribe to replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "repliesOverride": { - "type": "boolean" - }, - "reactionsSetting": { - "description": "1: Don't subscribe\n2: Subscribe to reactions for own messages\n3: Subscribe to reactions for all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "reactionsOverride": { - "type": "boolean" - } + "parameters": { + "authToken": { + "name": "authToken", + "in": "path", + "description": "An auth token of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Auth Token", + "value": "" + } + } + }, + "conversationId": { + "name": "conversationId", + "in": "path", + "description": "(Required) conversation id", + "required": true, + "schema": { + "type": "string" + } + }, + "uid--conversation": { + "name": "uid", + "in": "path", + "description": "UID of the user whose conversation needs to be fetched.", + "required": true, + "schema": { + "type": "string" + } + }, + "guid--conversation": { + "name": "guid", + "in": "path", + "description": "GUID of the group whose conversation needs to be fetched.", + "required": true, + "schema": { + "type": "string" + } + }, + "uid": { + "name": "uid", + "in": "path", + "description": "An UID of a user.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "UID", + "value": "" + } + } + }, + "guid": { + "name": "guid", + "in": "path", + "description": "A GUID of a group.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "GUID", + "value": "" + } + } + }, + "requiredonBehalfOf": { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "required": true, + "schema": { + "type": "string" + } + }, + "requiredAppId": { + "name": "appId", + "in": "header", + "description": "(Required) App ID", + "required": true, + "schema": { + "type": "string" + } + }, + "onBehalfOf": { + "name": "onBehalfOf", + "in": "header", + "description": "UID of the user on whose behalf the action is performed.", + "schema": { + "type": "string" + } + }, + "messageId": { + "name": "messageId", + "in": "path", + "description": "messageId for the moderation service", + "required": true, + "schema": { + "type": "string" + } + }, + "ruleId": { + "name": "ruleId", + "in": "path", + "description": "Rule ID", + "required": true, + "schema": { + "type": "string" + } + }, + "keywordId": { + "name": "keywordId", + "in": "path", + "description": "Keyword ID", + "required": true, + "schema": { + "type": "string" + } + }, + "pushToken": { + "name": "pushToken", + "in": "path", + "description": "(Required) Push Token", + "required": true, + "schema": { + "type": "string" + } + }, + "providerId": { + "name": "providerId", + "in": "path", + "description": "Provider ID.", + "required": true, + "schema": { + "type": "string" + }, + "examples": { + "string": { + "summary": "Provider ID", + "value": "" + } + } + }, + "requiredUID": { + "name": "uid", + "in": "query", + "description": "(Required) UID", + "required": true, + "schema": { + "type": "string" + } + } }, - "type": "object" - }, - "pnSettingSchema": { - "description": "Response data", - "properties": { - "preferences": { - "$ref": "#/components/schemas/Preferences" - }, - "sound": { - "$ref": "#/components/schemas/Sound" - }, - "templates": { - "$ref": "#/components/schemas/Templates" - } + "examples": { + "text-message": { + "summary": "Text Message example", + "value": { + "receiver": "cometchat-uid-2", + "receiverType": "user", + "category": "message", + "type": "text", + "data": { + "text": "Hello" + } + } + }, + "custom-message": { + "summary": "Custom Message example", + "value": { + "receiverType": "user", + "data": { + "customData": { + "text": "Hello there!" + } + }, + "category": "custom", + "type": "text", + "receiver": "cometchat-uid-2", + "tags": [ + "tag1" + ] + } + }, + "media-message": { + "summary": "Media Message example", + "value": { + "receiverType": "user", + "data": { + "text": "Hello there!", + "attachments": [ + { + "name": "ironman.png", + "extension": "png", + "mimeType": "image/png", + "url": "https: //files-.cometchat.io//media/.png?fat=" + } + ] + }, + "category": "message", + "type": "image", + "receiver": "cometchat-uid-2" + } + } }, - "type": "object" - }, - "pnTokenSchema": { - "description": "Response data", - "oneOf": [ - { - "$ref": "#/components/schemas/PlatformFCM" - }, - { - "$ref": "#/components/schemas/PlatformAPNS" - }, - { - "$ref": "#/components/schemas/PlatformVOIP" - } - ] - }, - "pnUpdatePreferences": { - "description": "Response data", - "properties": { - "groupPreferences": { - "properties": { - "groupMessages": { - "description": "1: Don't subscribe\n2: Subscribe to all messages\n3: Subscribe to messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "groupReplies": { - "description": "1: Don't subscribe\n2: Subscribe to all replies\n3: Subscribe to replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "groupReactions": { - "description": "1: Don't subscribe\n2: Subscribe to reactions for own messages\n3: Subscribe to reactions for all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "groupMemberLeft": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberAdded": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberJoined": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberKicked": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberBanned": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberUnbanned": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "groupMemberScopeChanged": { - "description": "1: Don't subscribe\n2: Subscribe", - "type": "integer", - "enum": [ - 1, - 2 - ] - } - }, - "type": "object" - }, - "oneOnOnePreferences": { - "properties": { - "oneOnOneMessages": { - "description": "1: Don't subscribe\n2: Subscribe to all messages\n3: Subscribe to messages with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "oneOnOneReplies": { - "description": "1: Don't subscribe\n2: Subscribe to all replies\n3: Subscribe to replies with mentions", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - }, - "oneOnOneReactions": { - "description": "1: Don't subscribe\n2: Subscribe to reactions for own messages\n3: Subscribe to reactions for all messages", - "type": "integer", - "enum": [ - 1, - 2, - 3 - ] - } - }, - "type": "object" - }, - "mutePreferences": { - "$ref": "#/components/schemas/MutePreferences" - }, - "usePrivacyTemplate": { - "type": "boolean" - } + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "description": "API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).", + "name": "apikey", + "in": "header" + } + } + }, + "tags": [ + { + "name": "API Keys", + "description": "The API keys are used to authorise the APIs" }, - "type": "object" - }, - "pushNotificationSchema": { - "properties": { - "success": { - "type": "boolean" - } + { + "name": "Roles", + "description": "The roles are used to give user access rights" }, - "type": "object" - }, - "pushProviders": { - "description": "Response data", - "type": "array", - "items": {} - }, - "reactionSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "messageId": { - "type": "string" - }, - "reaction": { - "type": "string" - }, - "uid": { - "type": "string" - }, - "reactedAt": { - "type": "integer" - }, - "reactedBy": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - } + { + "name": "Users", + "description": "The REST collection for users." }, - "type": "object" - }, - "roleSchema": { - "description": "Response data", - "properties": { - "role": { - "type": "string" - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "metadata": { - "type": "object" - }, - "email": { - "type": "string" - }, - "settings": { - "properties": { - "listUsers": { - "type": "string" - }, - "sendMessagesTo": { - "type": "string" - } - }, - "type": "object" - }, - "createdAt": { - "type": "integer" - } + { + "name": "Auth Tokens", + "description": "The auth tokens are used to login end users using client SDKs." }, - "type": "object" - }, - "triggerSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "category": { - "type": "string" - }, - "description": { - "type": "string" - } + { + "name": "Blocked Users", + "description": "The REST collections for blocked users." }, - "type": "object" - }, - "unmuteConversation": { - "properties": { - "id": { - "description": "uid or guid", - "type": "string" - }, - "type": { - "description": "oneOnOne or group", - "type": "string", - "enum": [ - "oneOnOne", - "group" - ] - } + { + "name": "Friends", + "description": "List,add and remove friends by passing UID in path variables" }, - "type": "object" - }, - "unregisterpnToken": { - "required": [ - "authToken" - ], - "properties": { - "authToken": { - "type": "string" - } + { + "name": "Groups", + "description": "The REST collections for groups." }, - "type": "object" - }, - "updatemessageSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "action": { - "type": "string" - }, - "entities": { - "properties": { - "by": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - }, - "for": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - }, - "on": { - "properties": { - "entity": { - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "properties": { - "text": { - "type": "string" - }, - "entities": { - "properties": { - "sender": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - }, - "receiver": { - "properties": { - "entity": { - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "role": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "status": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "conversationId": { - "type": "string" - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "editedAt": { - "type": "integer" - }, - "editedBy": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "tags": { - "type": "array", - "items": {} - } - }, - "type": "object" - }, - "entityType": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } + { + "name": "Banned Users", + "description": "Ban and Unban user by passing other UID in path variables." }, - "type": "object" - }, - "usageMetricsSchema": { - "description": "Response data", - "properties": { - "metrics": { - "properties": { - "audio_minutes": { - "type": "integer" - }, - "video_minutes": { - "type": "integer" - }, - "recorded_minutes": { - "type": "integer" - }, - "active_users": { - "type": "integer" - }, - "concurrent_users": { - "type": "integer" - } - }, - "type": "object" - }, - "time_range": { - "properties": { - "fromDate": { - "type": "integer" - }, - "toDate": { - "type": "integer" - } - }, - "type": "object" - } + { + "name": "Group Members", + "description": "The REST collections for group members." }, - "type": "object" - }, - "userConversationSchema": { - "description": "Response data", - "properties": { - "conversationId": { - "type": "string" - }, - "conversationType": { - "type": "string" - }, - "unreadMessageCount": { - "type": "string" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - }, - "lastMessage": { - "properties": { - "id": { - "type": "string" - }, - "conversationId": { - "type": "string" - }, - "sender": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "category": { - "type": "string" - }, - "type": { - "type": "string" - }, - "data": { - "type": "object", - "allOf": [ - { - "properties": { - "action": { - "type": "string" - } - }, - "type": "object" - }, - { - "$ref": "#/components/schemas/objectEntitySchema" - } - ] - }, - "sentAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } - }, - "type": "object" - }, - "conversationWith": { - "type": "object" - } + { + "name": "Messages", + "description": "The REST collections for messages." }, - "type": "object" - }, - "userSchema": { - "description": "Response data", - "properties": { - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "avatar": { - "type": "string" - }, - "metadata": { - "properties": { - "email": { - "type": "string" - } - }, - "type": "object" - }, - "status": { - "type": "string" - }, - "role": { - "type": "string" - }, - "createdAt": { - "type": "integer" - } + { + "name": "Conversations", + "description": "The REST collections for conversations." }, - "type": "object" - }, - "webhookSchema": { - "description": "Response data", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "webhookURL": { - "type": "string" - }, - "useBasicAuth": { - "type": "boolean" - }, - "username": { - "type": "string" - }, - "password": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "createdAt": { - "type": "integer" - }, - "updatedAt": { - "type": "integer" - } + { + "name": "Restrict Features", + "description": "Allows Restricting Features" }, - "type": "object" - } - }, - "parameters": { - "authToken": { - "name": "authToken", - "in": "path", - "description": "An auth token of a user.", - "required": true, - "schema": { - "type": "string" + { + "name": "Metrics", + "description": "Allows accessing Data Metrics" }, - "examples": { - "string": { - "summary": "Auth Token", - "value": "cometchat-uid-1_1625206799abcdef" - } - } - }, - "conversationId": { - "name": "conversationId", - "in": "path", - "description": "(Required) conversation id", - "required": true, - "schema": { - "type": "string" - } - }, - "uid--conversation": { - "name": "uid", - "in": "path", - "description": "UID of the user whose conversation is being accessed.", - "required": true, - "schema": { - "type": "string" - } - }, - "guid--conversation": { - "name": "guid", - "in": "path", - "description": "GUID of the group whose conversation is being accessed.", - "required": true, - "schema": { - "type": "string" - } - }, - "uid": { - "name": "uid", - "in": "path", - "description": "An UID of a user.", - "required": true, - "schema": { - "type": "string" + { + "name": "Triggers", + "description": "Allows adding triggers to a webhook." }, - "examples": { - "string": { - "summary": "UID", - "value": "cometchat-uid-1" - } - } - }, - "guid": { - "name": "guid", - "in": "path", - "description": "A GUID of a group.", - "required": true, - "schema": { - "type": "string" + { + "name": "Webhooks", + "description": "Allows accessing Webhooks." }, - "examples": { - "string": { - "summary": "GUID", - "value": "cometchat-guid-1" - } - } - }, - "requiredonBehalfOf": { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "required": true, - "schema": { - "type": "string" - } - }, - "requiredAppId": { - "name": "appId", - "in": "header", - "description": "(Required) App ID", - "required": true, - "schema": { - "type": "string" - } - }, - "onBehalfOf": { - "name": "onBehalfOf", - "in": "header", - "description": "UID of the user on whose behalf the action is performed.", - "schema": { - "type": "string" - } - }, - "pushToken": { - "name": "pushToken", - "in": "path", - "description": "(Required) Push Token", - "required": true, - "schema": { - "type": "string" - } - }, - "providerId": { - "name": "providerId", - "in": "path", - "description": "Provider ID.", - "required": true, - "schema": { - "type": "string" + { + "name": "Notifications", + "description": "Allows configuring Notifications core." }, - "examples": { - "string": { - "summary": "Provider ID", - "value": "provider_12345" - } - } - }, - "requiredUID": { - "name": "uid", - "in": "query", - "description": "(Required) UID", - "required": true, - "schema": { - "type": "string" + { + "name": "Moderation", + "description": "The REST collections for Moderations." } - } - }, - "securitySchemes": { - "apiKey": { - "type": "apiKey", - "description": "API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).", - "name": "apikey", - "in": "header" - } - } - }, - "tags": [ - { - "name": "API Keys", - "description": "The API keys are used to authorise the APIs" - }, - { - "name": "Roles", - "description": "The roles are used to give user access rights" - }, - { - "name": "Users", - "description": "The REST collection for users." - }, - { - "name": "Auth Tokens", - "description": "The auth tokens are used to login end users using client SDKs." - }, - { - "name": "Blocked Users", - "description": "The REST collections for blocked users." - }, - { - "name": "Friends", - "description": "List,add and remove friends by passing UID in path variables" - }, - { - "name": "Groups", - "description": "The REST collections for groups." - }, - { - "name": "Banned Users", - "description": "Ban and Unban user by passing other UID in path variables." - }, - { - "name": "Group Members", - "description": "The REST collections for group members." - }, - { - "name": "Messages", - "description": "The REST collections for messages." - }, - { - "name": "Conversations", - "description": "The REST collections for conversations." - }, - { - "name": "Restrict Features", - "description": "Allows Restricting Features" - }, - { - "name": "Metrics", - "description": "Allows accessing Data Metrics" - }, - { - "name": "Triggers", - "description": "Allows adding triggers to a webhook." - }, - { - "name": "Webhooks", - "description": "Allows accessing Webhooks." - }, - { - "name": "Push Notifications", - "description": "Allows configuring Push Notifications." - } - ], - "x-readme": { - "explorer-enabled": true, - "proxy-enabled": true - } + ] } \ No newline at end of file diff --git a/docs.json b/docs.json index ad3c1f53d..295ba8277 100644 --- a/docs.json +++ b/docs.json @@ -5030,6 +5030,9 @@ "rest-api/messages/remove-reaction", "rest-api/messages/list-threaded-messages", "rest-api/messages/send-threaded-message", + "rest-api/messages/list-threads", + "rest-api/messages/subscribe-thread", + "rest-api/messages/unsubscribe-thread", "rest-api/messages/list-user-messages", "rest-api/messages/list-group-messages", "rest-api/messages/send-bot-message" diff --git a/rest-api/messages/list-threads.mdx b/rest-api/messages/list-threads.mdx new file mode 100644 index 000000000..8aced3b72 --- /dev/null +++ b/rest-api/messages/list-threads.mdx @@ -0,0 +1,6 @@ +--- +openapi: get /threads +description: "List CometChat message threads with REST API to fetch thread conversations across your app." +--- + +For the complete error reference, see [Error Guide](/articles/error-guide). diff --git a/rest-api/messages/subscribe-thread.mdx b/rest-api/messages/subscribe-thread.mdx new file mode 100644 index 000000000..75694761d --- /dev/null +++ b/rest-api/messages/subscribe-thread.mdx @@ -0,0 +1,6 @@ +--- +openapi: post /messages/{id}/thread/subscription +description: "Subscribe a CometChat user to a message thread with REST API to receive updates on threaded replies." +--- + +For the complete error reference, see [Error Guide](/articles/error-guide). diff --git a/rest-api/messages/unsubscribe-thread.mdx b/rest-api/messages/unsubscribe-thread.mdx new file mode 100644 index 000000000..d9d6a9bfc --- /dev/null +++ b/rest-api/messages/unsubscribe-thread.mdx @@ -0,0 +1,6 @@ +--- +openapi: delete /messages/{id}/thread/subscription +description: "Unsubscribe a CometChat user from a message thread with REST API to stop receiving threaded reply updates." +--- + +For the complete error reference, see [Error Guide](/articles/error-guide).