v1

latestOpenAPI 3.0.02026-07-14362240.2 KB
chats

Update a chat

Updates an existing chat's properties such as name, picture, members, or settings.

patch/messenger/v1/chats

Request body

idstring required

Chat id

ownerIdnumber

Owner id

namestring

Chat name

pictureUrlstring

Chat picture url

groupIdnumber

Group id

portalsstring[]
membersnumber[]

Members ids

activeboolean

Chat active

externalLinesstring[]

External lines

Example request

{
  "id": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
  "ownerId": 1,
  "name": "Chat name",
  "pictureUrl": "https://example.com/picture.jpg",
  "groupId": 1,
  "members": [
    1,
    2,
    3,
    4
  ],
  "active": true,
  "externalLines": [
    "659ff121fd62e43063340f2f"
  ],
  "meta": [
    {
      "type": "telegram",
      "value": "1234567890"
    }
  ]
}

Response

Updated chat

idstring required

Chat id

membersstring required

Members ids

timestampnumber required

Timestamp of last message in chat

ownerIdnumber required

Owner id

namestring required

Chat name

pictureUrlstring required

Chat picture url

type'PRIVATE' | 'PUBLIC' | 'GROUP' | 'DIRECT' | 'EXTERNAL' required

Chat type

groupIdnumber required

Group id

portalsstring[] required

Portals

activeboolean required

Chat active

unreadCountnumber required

Unread messages count

pinnedboolean required

Pinned chat

pinnedTimestampnumber required

Pinned timestamp

Example response

{
  "id": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
  "timestamp": 1709043064088,
  "ownerId": 1,
  "name": "Chat name",
  "pictureUrl": "https://example.com/picture.jpg",
  "type": "GROUP",
  "groupId": 1,
  "portals": [
    "portal1",
    "portal2"
  ],
  "externalLines": [
    {
      "id": "659ff121fd62e43063340f2f",
      "name": "Main line",
      "icon": "https://example.com/icon.png",
      "externalId": "externalId",
      "timestamp": 1620211200000,
      "portal": "portal",
      "phoneNumber": "+1234567890"
    }
  ],
  "lastMessage": {
    "id": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
    "timestamp": 1709043064088,
    "message": "Hello, world!",
    "type": "MESSAGE",
    "chatId": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
    "readBy": [
      1,
      2,
      3,
      4
    ],
    "externalLine": {
      "id": "659ff121fd62e43063340f2f",
      "name": "Main line",
      "icon": "https://example.com/icon.png",
      "externalId": "externalId",
      "timestamp": 1620211200000,
      "portal": "portal",
      "phoneNumber": "+1234567890"
    },
    "attachedFiles": [
      {
        "entityId": "659ff121fd62e43063340f2f",
        "entityType": "chat_message",
        "lastModified": 1613491200000,
        "originalFilename": "file.jpg",
        "size": "1024",
        "url": "https://example.com/file.jpg"
      }
    ],
    "relations": [
      {
        "action": "create",
        "service": "crm",
        "entity": "contact",
        "name": "659ff121fd62e43063340f2f",
        "pictureUrl": "https://example.com/picture.jpg",
        "entityId": "659ff121fd62e43063340f2f"
      }
    ],
    "externalAuthorId": "123456",
    "externalId": "123456",
    "ref": {
      "chatId": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
      "authorId": 1,
      "messageId": "76bfc2ff-207c-4b5a-8543-f7009b7f8872"
    },
    "meta": {
      "body": [
        {
          "text": "Hello, world!",
          "url": "https://www.instagram.com"
        }
      ]
    }
  },
  "meta": [
    {
      "type": "telegram",
      "value": "1234567890"
    }
  ],
  "active": true,
  "unreadCount": 1,
  "pinned": true,
  "pinnedTimestamp": 1709043064088
}