v1

latestOpenAPI 3.0.02026-07-14362240.2 KB
messages

Edit a message

Updates the content of an existing message. Only the message author can edit their messages.

patch/messenger/v1/messages

Request body

idstring

Message id

timestampnumber

Timestamp of message

messagestring required

Message text

type'MESSAGE' | 'AUDIO' | 'VIDEO' | 'GIF' | 'SYSTEM'

Message type

chatIdstring required

Chat id

parentMessagestring

Parent message id

readBynumber[]

Members ids

externalLinestring

External line

externalAuthorIdstring

External author id

externalIdstring

External id

mentionedstring[]

Mentioned users

status'sent' | 'delivered' | 'read' | 'error'
statusTextstring

Example request

{
  "id": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
  "timestamp": 1709043064088,
  "message": "Hello, world!",
  "type": "MESSAGE",
  "chatId": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
  "parentMessage": "76bfc2ff-207c-4b5a-8543-f7009b7f8872",
  "readBy": [
    1,
    2,
    3,
    4
  ],
  "externalLine": "123123123123123123",
  "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"
  },
  "mentioned": [
    1
  ],
  "meta": {
    "body": [
      {
        "text": "Hello, world!",
        "url": "https://www.instagram.com"
      }
    ]
  }
}

Response

The updated message

idstring

Message id

timestampnumber

Timestamp of message

messagestring required

Message text

type'MESSAGE' | 'AUDIO' | 'VIDEO' | 'GIF' | 'SYSTEM'

Message type

chatIdstring required

Chat id

readBynumber[]

Members ids

externalAuthorIdstring

External author id

externalIdstring

External id

Example response

{
  "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"
      }
    ]
  }
}