---
title: "Update a chat"
method: PATCH
path: "/messenger/v1/chats"
tags: ["chats"]
---

# Update a chat

`PATCH /messenger/v1/chats`

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

## Request body

- UpdateChatDto
  - `id` string, required — Chat id
  - `ownerId` number — Owner id
  - `name` string — Chat name
  - `pictureUrl` string — Chat picture url
  - `groupId` number — Group id
  - `portals` string[]
  - `members` number[] — Members ids
  - `active` boolean — Chat active
  - `externalLines` string[] — External lines
  - `meta` ChatMeta[]
    - `type` 'phone' | 'widgetUser' | 'username' | 'facebook' | 'instagram' | 'telegram' | 'twitter' | 'viber' | 'whatsapp', required — Meta type
    - `value` string, required — Meta value

## Response `200`

Updated chat

- ChatResponseDto
  - `id` string, required — Chat id
  - `members` string, required — Members ids
  - `timestamp` number, required — Timestamp of last message in chat
  - `ownerId` number, required — Owner id
  - `name` string, required — Chat name
  - `pictureUrl` string, required — Chat picture url
  - `type` 'PRIVATE' | 'PUBLIC' | 'GROUP' | 'DIRECT' | 'EXTERNAL', required — Chat type
  - `groupId` number, required — Group id
  - `portals` string[], required — Portals
  - `externalLines` ExternalLineResponseDto[], required — External lines
    - `id` string, required — External line id
    - `name` string, required — External line name
    - `icon` string, required — External line icon
    - `externalId` string, required — External line external id
    - `timestamp` number, required — External line timestamp
    - `portal` string, required — External line portal
    - `phoneNumber` string, required — External line phone number
  - `lastMessage` MessageResponseDto, required
    - `id` string — Message id
    - `timestamp` number — Timestamp of message
    - `message` string, required — Message text
    - `type` 'MESSAGE' | 'AUDIO' | 'VIDEO' | 'GIF' | 'SYSTEM' — Message type
    - `chatId` string, required — Chat id
    - `readBy` number[] — Members ids
    - `externalLine` ExternalLineResponseDto, required
      - `id` string, required — External line id
      - `name` string, required — External line name
      - `icon` string, required — External line icon
      - `externalId` string, required — External line external id
      - `timestamp` number, required — External line timestamp
      - `portal` string, required — External line portal
      - `phoneNumber` string, required — External line phone number
    - `attachedFiles` AttachedFile[] — Attached files
      - `id` object, required — Attached file id
      - `entityId` string, required — Attached file entity id
      - `entityType` string, required — Attached file entity type
      - `lastModified` number, required — Attached file created date
      - `originalFilename` string, required — Attached file original filename
      - `size` string, required — Attached file size
      - `url` string, required — Attached file url
    - `relations` MessageRelation[] — Relations
      - `action` 'create' | 'update' | 'delete', required — Action
      - `service` 'crm', required — Service
      - `entity` 'lead' | 'contact' | 'deal', required — Entity
      - `name` string, required — Entity id
      - `pictureUrl` string, required — Entity picture url
      - `entityId` string, required — Entity id
    - `externalAuthorId` string — External author id
    - `externalId` string — External id
    - `ref` Reference
      - `chatId` string, required — Chat id
      - `authorId` number, required — Author id
      - `messageId` string, required — Message id
    - `meta` MessageMeta
      - `entity` string, required — Entity name
      - `type` string, required — Entity type
      - `accountName` string, required — Account name
      - `accountImage` string, required — Account image url
      - `body` MetaBody[], required — Body entity
        - `text` string, required — Text post or stories or whatever
        - `attachedFiles` string[], required — Attached files url
        - `url` string, required — Post or stories url
  - `meta` ChatMeta[], required
    - `type` 'phone' | 'widgetUser' | 'username' | 'facebook' | 'instagram' | 'telegram' | 'twitter' | 'viber' | 'whatsapp', required — Meta type
    - `value` string, required — Meta value
  - `active` boolean, required — Chat active
  - `unreadCount` number, required — Unread messages count
  - `pinned` boolean, required — Pinned chat
  - `pinnedTimestamp` number, required — Pinned timestamp
  - `setting` ChatSettingsDto, required
    - `muteUntil` number[], required — Mute until

---

[API](https://skmtc.net/uspacy/apis/messenger-service-2.md) · [All operations](https://skmtc.net/uspacy/apis/messenger-service-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/uspacy/messenger-service-2/versions/699626a9e425/schema)
