{
  "info": {
    "_postman_id": "aedee668-20c2-590f-a986-a87d6f504712",
    "name": "Qlara API - Inbox",
    "description": "The Inbox section of API Reference in the Qlara documentation.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "id": "3488b5fc-9be4-5e76-a761-fc7e00590651",
      "name": "List inbox conversations",
      "request": {
        "name": "List inbox conversations",
        "description": {
          "content": "Returns the two-way conversations of one inbox section: `ACTIVE` (the main inbox, the default), `ARCHIVED` or `TRASHED`.\n\n- **What a conversation is**: every message exchanged with one contact on one channel (WhatsApp, RCS and so on), grouped in one thread. It is created automatically when a contact sends an inbound message.\n- **Sections**: without `section` only the `ACTIVE` conversations are returned. List the archived ones with `section=ARCHIVED` and the trashed ones with `section=TRASHED`.\n- **Filters**: `dateFrom` keeps the conversations whose last message is at or after an instant, `channelIds` restricts to one or more channels, and `unreadOnly=true` returns only the conversations with unread messages.\n- **Sorting**: `orderBy` takes a field name with a `-` prefix for descending or `+` for ascending, such as `-lastMessageDate` for newest first.\n- **Unread counter**: each conversation carries one. It is cleared by `PATCH /inbox/conversations/{chatId}/read`, and also by `GET /inbox/conversations/{chatId}/messages` called without `idFrom` and `idTo`.\n- **Tidying up**: move a conversation out of the default list with `PATCH /inbox/conversations/{chatId}/archive` and bring it back with `PATCH /inbox/conversations/{chatId}/unarchive`.\n\n<details>\n<summary>How conversations change on their own</summary>\n\n- **After 7 days with no new message** the conversation is closed: its `status` becomes `CLOSED` and it stays in `ACTIVE`.\n- **After 30 days closed** it is moved to `ARCHIVED`. An untouched conversation therefore leaves the default list about 37 days after its last message.\n- **A new inbound message** brings an archived or trashed conversation back to `ACTIVE`, with `status` `OPEN`.\n\n</details>",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "inbox",
            "conversations"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [
            {
              "disabled": false,
              "key": "channelIds",
              "value": "INSTAGRAM-1308,WHATSAPP-42",
              "description": "Comma-separated channel filter. Each value is `CHANNEL-channelId`, where `CHANNEL` is the `socialMedia` of the conversation (`WHATSAPP`, `RCS`, `INSTAGRAM`, `FACEBOOK` or `CHATBOT`, case-insensitive) and `channelId` is its `channelId` field."
            },
            {
              "disabled": false,
              "key": "dateFrom",
              "value": "2025-01-15T00:00:00Z",
              "description": "Only the conversations whose last message is at or after this instant (inclusive). Accepted formats: `yyyy-MM-dd` (a whole day, UTC), `yyyy-MM-ddTHH:mm:ss` (UTC) or ISO-8601 with an offset, such as `2025-01-15T00:00:00+01:00` or `2025-01-15T00:00:00Z`. A date alone means `00:00:00Z` of that day."
            },
            {
              "disabled": false,
              "key": "orderBy",
              "value": "string",
              "description": "Sort field with an optional `+` or `-` prefix, such as `-lastMessageDate` or `+contactName`."
            },
            {
              "disabled": false,
              "key": "section",
              "value": "ACTIVE",
              "description": "Inbox section to list: `ACTIVE` (the main inbox, used when the parameter is omitted), `ARCHIVED` or `TRASHED`. Case-insensitive. Any other value is refused with `400`."
            },
            {
              "disabled": false,
              "key": "unreadOnly",
              "value": "false",
              "description": "If `true`, returns only the conversations with unread messages."
            }
          ],
          "variable": []
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "GET",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "ba780a17-d999-50fb-adb3-624d6f8e006f",
          "name": "The conversations of the section.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "channelIds",
                  "value": "INSTAGRAM-1308,WHATSAPP-42"
                },
                {
                  "key": "dateFrom",
                  "value": "2025-01-15T00:00:00Z"
                },
                {
                  "key": "orderBy",
                  "value": "string"
                },
                {
                  "key": "section",
                  "value": "ACTIVE"
                },
                {
                  "key": "unreadOnly",
                  "value": "true"
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "[\n  {\n    \"id\": 500,\n    \"companyId\": 7362,\n    \"hasUnreadMessages\": true,\n    \"lastCheckedAt\": \"2025-03-10 14:30:00.000+0100\",\n    \"userName\": \"string\",\n    \"phoneNumber\": \"+39333123456\",\n    \"externalUserId\": \"1309399970616060\",\n    \"profilePicture\": \"string\",\n    \"unreadCount\": 4546,\n    \"lastMessageText\": \"Thanks for your help!\",\n    \"lastMessageDate\": \"2025-03-10 14:30:00.000+0100\",\n    \"socialMedia\": \"whatsapp\",\n    \"channelId\": 1308,\n    \"companyProfileName\": \"string\",\n    \"companyProfilePicture\": \"string\",\n    \"companyProfileId\": \"string\",\n    \"companyPhoneNumber\": \"string\",\n    \"companyPhoneNumberType\": \"string\",\n    \"whatsappWindowExpire\": \"2025-03-10 14:30:00.000+0100\",\n    \"assignedUserId\": 378,\n    \"status\": \"OPEN\",\n    \"visibility\": \"ACTIVE\"\n  },\n  {\n    \"id\": 500,\n    \"companyId\": 5875,\n    \"hasUnreadMessages\": true,\n    \"lastCheckedAt\": \"2025-03-10 14:30:00.000+0100\",\n    \"userName\": \"string\",\n    \"phoneNumber\": \"+39333123456\",\n    \"externalUserId\": \"1309399970616060\",\n    \"profilePicture\": \"string\",\n    \"unreadCount\": 6910,\n    \"lastMessageText\": \"Thanks for your help!\",\n    \"lastMessageDate\": \"2025-03-10 14:30:00.000+0100\",\n    \"socialMedia\": \"whatsapp\",\n    \"channelId\": 1308,\n    \"companyProfileName\": \"string\",\n    \"companyProfilePicture\": \"string\",\n    \"companyProfileId\": \"string\",\n    \"companyPhoneNumber\": \"string\",\n    \"companyPhoneNumberType\": \"string\",\n    \"whatsappWindowExpire\": \"2025-03-10 14:30:00.000+0100\",\n    \"assignedUserId\": 7277,\n    \"status\": \"OPEN\",\n    \"visibility\": \"ACTIVE\"\n  }\n]",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "c7a85b78-dc61-5120-ad81-c6a38f0e3a74",
          "name": "`section` is not `ACTIVE`, `ARCHIVED` or `TRASHED`, or `dateFrom` is in none of the accepted formats. The response body names the parameter and the accepted values.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "channelIds",
                  "value": "INSTAGRAM-1308,WHATSAPP-42"
                },
                {
                  "key": "dateFrom",
                  "value": "2025-01-15T00:00:00Z"
                },
                {
                  "key": "orderBy",
                  "value": "string"
                },
                {
                  "key": "section",
                  "value": "ACTIVE"
                },
                {
                  "key": "unreadOnly",
                  "value": "true"
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "2c06d039-57b1-5999-afd1-edac8ed50aac",
          "name": "The API key is missing, invalid, or lacks the `INBOX` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "channelIds",
                  "value": "INSTAGRAM-1308,WHATSAPP-42"
                },
                {
                  "key": "dateFrom",
                  "value": "2025-01-15T00:00:00Z"
                },
                {
                  "key": "orderBy",
                  "value": "string"
                },
                {
                  "key": "section",
                  "value": "ACTIVE"
                },
                {
                  "key": "unreadOnly",
                  "value": "true"
                }
              ],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "db788d78-02ff-5c11-a432-b9a63cce9290",
      "name": "Get messages of a conversation",
      "request": {
        "name": "Get messages of a conversation",
        "description": {
          "content": "Returns one page of the messages of a conversation: the most recent ones in the requested ID range, at most 20 per call, ordered oldest first.\n\n- **Each message** carries its direction (inbound or outbound), timestamp, content and delivery status.\n- **Range**: `idFrom` and `idTo` bound the range by message ID, both inclusive. The newest messages of the range are returned, selected by creation time, so take the smallest ID of a page from all its messages, not from the first one.\n- **Older messages**: call again with `idTo` set to the smallest ID received minus 1, until a page comes back with fewer than 20 messages.\n- **Catching up**: call with `idFrom` set to the ID of the last message you hold plus 1. When 20 messages come back there may be more in between: keep `idFrom` and page backwards with `idTo` until a page has fewer than 20 messages.\n\n> **A call without `idFrom` and `idTo` also marks the conversation as read.** Its unread counter goes to 0 and the channel is told that every unread inbound message was read, so the contact can see a read receipt. The messages of that same response can still show `isRead` false. To read the latest page without that effect, pass `idFrom=1`: it returns the same page and leaves the unread counter alone.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "inbox",
            "conversations",
            ":chatId",
            "messages"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [
            {
              "disabled": false,
              "key": "idFrom",
              "value": "5145",
              "description": "Lower bound of the message ID range, inclusive. The newest messages of the range are returned, at most 20. A call with `idFrom` or `idTo` does not mark the conversation as read."
            },
            {
              "disabled": false,
              "key": "idTo",
              "value": "5145",
              "description": "Upper bound of the message ID range, inclusive. Set it to the smallest ID received minus 1 to load older messages."
            }
          ],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "chatId",
              "description": "(Required) ID of the conversation."
            }
          ]
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "GET",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "c12276ef-f1cf-5fc4-aaa7-d23d47bbdc90",
          "name": "One page of messages, oldest first.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "messages"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "idFrom",
                  "value": "5145"
                },
                {
                  "key": "idTo",
                  "value": "5145"
                }
              ],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "OK",
          "code": 200,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "{\n  \"profile\": {\n    \"userName\": \"string\",\n    \"profilePicture\": \"string\",\n    \"additionalInfo\": \"string\",\n    \"contactId\": 18273,\n    \"externalUserId\": \"1309399970616060\"\n  },\n  \"messages\": [\n    {\n      \"id\": 6413,\n      \"text\": \"Hello, how can I help?\",\n      \"template\": {},\n      \"isUnsupported\": true,\n      \"isRead\": true,\n      \"replyMessage\": {\n        \"id\": 2656,\n        \"text\": \"string\",\n        \"template\": {},\n        \"isInbound\": true,\n        \"username\": \"string\",\n        \"url\": \"string\"\n      },\n      \"reaction\": \"string\",\n      \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n      \"attachments\": [\n        {\n          \"id\": 8693,\n          \"type\": \"string\",\n          \"mediaKey\": \"string\",\n          \"url\": \"string\",\n          \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n          \"instagram\": {\n            \"thumbnailUrl\": \"string\",\n            \"permalink\": \"string\",\n            \"igPostMediaId\": \"string\",\n            \"reelVideoId\": \"string\",\n            \"storyId\": \"string\",\n            \"title\": \"string\"\n          }\n        },\n        {\n          \"id\": 9293,\n          \"type\": \"string\",\n          \"mediaKey\": \"string\",\n          \"url\": \"string\",\n          \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n          \"instagram\": {\n            \"thumbnailUrl\": \"string\",\n            \"permalink\": \"string\",\n            \"igPostMediaId\": \"string\",\n            \"reelVideoId\": \"string\",\n            \"storyId\": \"string\",\n            \"title\": \"string\"\n          }\n        }\n      ],\n      \"isUserReply\": false,\n      \"status\": \"DELIVERED\",\n      \"isEdited\": true,\n      \"chatbotId\": 3718,\n      \"chatbotInfo\": {\n        \"name\": \"string\",\n        \"avatarUrl\": \"string\",\n        \"status\": \"ACTIVE\"\n      }\n    },\n    {\n      \"id\": 8062,\n      \"text\": \"Hello, how can I help?\",\n      \"template\": {},\n      \"isUnsupported\": true,\n      \"isRead\": true,\n      \"replyMessage\": {\n        \"id\": 8893,\n        \"text\": \"string\",\n        \"template\": {},\n        \"isInbound\": false,\n        \"username\": \"string\",\n        \"url\": \"string\"\n      },\n      \"reaction\": \"string\",\n      \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n      \"attachments\": [\n        {\n          \"id\": 5608,\n          \"type\": \"string\",\n          \"mediaKey\": \"string\",\n          \"url\": \"string\",\n          \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n          \"instagram\": {\n            \"thumbnailUrl\": \"string\",\n            \"permalink\": \"string\",\n            \"igPostMediaId\": \"string\",\n            \"reelVideoId\": \"string\",\n            \"storyId\": \"string\",\n            \"title\": \"string\"\n          }\n        },\n        {\n          \"id\": 3234,\n          \"type\": \"string\",\n          \"mediaKey\": \"string\",\n          \"url\": \"string\",\n          \"createdAt\": \"2022-03-10T12:15:50-04:00\",\n          \"instagram\": {\n            \"thumbnailUrl\": \"string\",\n            \"permalink\": \"string\",\n            \"igPostMediaId\": \"string\",\n            \"reelVideoId\": \"string\",\n            \"storyId\": \"string\",\n            \"title\": \"string\"\n          }\n        }\n      ],\n      \"isUserReply\": false,\n      \"status\": \"DELIVERED\",\n      \"isEdited\": false,\n      \"chatbotId\": 1233,\n      \"chatbotInfo\": {\n        \"name\": \"string\",\n        \"avatarUrl\": \"string\",\n        \"status\": \"ACTIVE\"\n      }\n    }\n  ]\n}",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "62122395-2de6-5f5e-a872-0c0d8f2b8a02",
          "name": "The API key is missing, invalid, or lacks the `INBOX` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "messages"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "idFrom",
                  "value": "5145"
                },
                {
                  "key": "idTo",
                  "value": "5145"
                }
              ],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "1203bbe0-aa30-514a-ae23-3624b47f276d",
          "name": "No conversation with this ID in your account.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "messages"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [
                {
                  "key": "idFrom",
                  "value": "5145"
                },
                {
                  "key": "idTo",
                  "value": "5145"
                }
              ],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "GET",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "5e160eb8-8870-5159-a133-79cb2a003789",
      "name": "Send a reply to a conversation",
      "request": {
        "name": "Send a reply to a conversation",
        "description": {
          "content": "Sends a reply in an existing conversation, on the channel the conversation runs on: you do not choose the channel.\n\n- **Body**: `chatId` and a non-blank `message`, at least one attachment, or both.\n- **Attachments**: every `attachments[].mediaId` must be a media item of your own library (see the Media endpoints).\n- **`202` means accepted and queued for delivery.** The reply is handed on for delivery before the response is sent, so a refusal at that point comes back at once as `400` or `502`. Track the delivery with the delivery-status webhook, if you have configured one.\n- **Reply window**: some channels accept replies only within a time window, such as the 24 hours of WhatsApp. A reply sent outside it may fail to be delivered.\n- **`replyTo`** is the message of the conversation you reply to. On a WhatsApp reply that carries text it must be a message of this conversation; a reply with attachments only ignores it.\n\n> **On WhatsApp a `502` can arrive after part of the reply was sent.** The text and each attachment go out as separate messages, text first, so a retry sends that part again. On Instagram, Facebook Messenger and chatbot conversations a `502` means nothing was sent, and the request can be retried.\n\n<details>\n<summary>Maximum text length on each channel</summary>\n\n| Channel | Characters |\n|---|---|\n| WhatsApp | 4096 |\n| RCS | 3072 |\n| Facebook Messenger | 2000 |\n| Instagram | 1000 |\n\n</details>",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "inbox",
            "conversations",
            "reply"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": []
        },
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "POST",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"chatId\": 500,\n  \"message\": \"Thank you for contacting us!\",\n  \"replyTo\": 1412,\n  \"attachments\": [\n    {\n      \"mediaId\": 100\n    },\n    {\n      \"mediaId\": 100\n    }\n  ]\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      },
      "response": [
        {
          "id": "2f939904-5e82-5868-a263-ed1165756773",
          "name": "Reply accepted and queued for delivery. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                "reply"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"chatId\": 500,\n  \"message\": \"Thank you for contacting us!\",\n  \"replyTo\": 7861,\n  \"attachments\": [\n    {\n      \"mediaId\": 100\n    },\n    {\n      \"mediaId\": 100\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Accepted",
          "code": 202,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "6e32fc8c-3f25-5854-ab1f-ffe47e69f5c8",
          "name": "The body is malformed or misses a required field, the reply is empty, the text is longer than the channel accepts, an attachment has a type or size the channel does not accept, or RCS refuses the message. Apart from the checks on the body itself, the response does not say which cause applies.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                "reply"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"chatId\": 500,\n  \"message\": \"Thank you for contacting us!\",\n  \"replyTo\": 7861,\n  \"attachments\": [\n    {\n      \"mediaId\": 100\n    },\n    {\n      \"mediaId\": 100\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Bad Request",
          "code": 400,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "386aba00-50e4-5fed-a38d-6b95ec9dc3fb",
          "name": "The API key is missing, invalid, or lacks the `INBOX` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                "reply"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"chatId\": 500,\n  \"message\": \"Thank you for contacting us!\",\n  \"replyTo\": 7861,\n  \"attachments\": [\n    {\n      \"mediaId\": 100\n    },\n    {\n      \"mediaId\": 100\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "ffb526c4-c1e5-5ad6-ad03-65b59acc033c",
          "name": "The conversation does not exist in your account, an attachment is not a media item of your library, or, on a WhatsApp reply that carries text, `replyTo` is not a message of this conversation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                "reply"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"chatId\": 500,\n  \"message\": \"Thank you for contacting us!\",\n  \"replyTo\": 7861,\n  \"attachments\": [\n    {\n      \"mediaId\": 100\n    },\n    {\n      \"mediaId\": 100\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "827ffa6b-8490-5cb1-a8b8-9571bb50108c",
          "name": "An attachment could not be read from the media library, or the channel did not accept the reply. On WhatsApp part of the reply may already have been sent.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                "reply"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": []
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"chatId\": 500,\n  \"message\": \"Thank you for contacting us!\",\n  \"replyTo\": 7861,\n  \"attachments\": [\n    {\n      \"mediaId\": 100\n    },\n    {\n      \"mediaId\": 100\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "status": "Bad Gateway",
          "code": 502,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "e9a2603b-78c8-5c7a-a246-19616c41d37b",
      "name": "Mark a conversation as read",
      "request": {
        "name": "Mark a conversation as read",
        "description": {
          "content": "Marks every message of a conversation as read: the unread counter goes to 0 and the channel is told that every unread inbound message was read, so the contact can see a read receipt.\n\n- **Often not needed**: `GET /inbox/conversations/{chatId}/messages` called without `idFrom` and `idTo` already does the same. Call this after reading the messages with `idFrom` or `idTo`, or to mark a conversation as read without fetching it.\n- **Idempotent**: on a conversation that is already fully read it changes nothing and still answers `204`.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "inbox",
            "conversations",
            ":chatId",
            "read"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "chatId",
              "description": "(Required) ID of the conversation."
            }
          ]
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "PATCH",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "063208c1-9383-5e28-a328-3883c1709c3f",
          "name": "Conversation marked as read. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "read"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "No Content",
          "code": 204,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "3dd2b016-ed00-59d0-aaa5-e22045037c0a",
          "name": "The API key is missing, invalid, or lacks the `INBOX` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "read"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "a18aa17e-c628-5975-ae1c-f959f2eca357",
          "name": "No conversation with this ID in your account.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "read"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "b7aa709a-0482-5f6d-aa5d-605fa6b5c00f",
      "name": "Archive a conversation",
      "request": {
        "name": "Archive a conversation",
        "description": {
          "content": "Archives a conversation: it leaves the default list of `GET /inbox/conversations` and is listed with `section=ARCHIVED`.\n\n- **Nothing is deleted**: the messages and the whole history are kept.\n- **It comes back on its own**: a new inbound message from the contact moves the conversation back to the active inbox. To restore it yourself, call `PATCH /inbox/conversations/{chatId}/unarchive`.\n- **The current state is not checked**: archiving an already archived conversation answers `204`, and a trashed conversation is moved to the archive.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "inbox",
            "conversations",
            ":chatId",
            "archive"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "chatId",
              "description": "(Required) ID of the conversation."
            }
          ]
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "PATCH",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "8f4ff358-a247-5438-aa7c-57109894d5b4",
          "name": "Conversation archived. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "archive"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "No Content",
          "code": 204,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "15270860-73f0-529b-a001-57d7b6a6f3d6",
          "name": "The API key is missing, invalid, or lacks the `INBOX` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "archive"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "206f20ce-e78b-546d-a166-077e37d7ad40",
          "name": "No conversation with this ID in your account.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "archive"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    },
    {
      "id": "9e7edab6-92cb-58de-acf5-88cceb3c3ced",
      "name": "Unarchive a conversation",
      "request": {
        "name": "Unarchive a conversation",
        "description": {
          "content": "Restores an archived conversation to the default list of `GET /inbox/conversations`, undoing `PATCH /inbox/conversations/{chatId}/archive`.\n\n- **Messages are untouched**: only the section of the conversation is set back to `ACTIVE`.\n- **The current state is not checked**: on a conversation that is already active it answers `204` and changes nothing, and it also brings back a conversation that was moved to the trash.",
          "type": "text/plain"
        },
        "url": {
          "path": [
            "api",
            "partner-gateway",
            "inbox",
            "conversations",
            ":chatId",
            "unarchive"
          ],
          "host": [
            "{{baseUrl}}"
          ],
          "query": [],
          "variable": [
            {
              "disabled": false,
              "type": "any",
              "value": "5145",
              "key": "chatId",
              "description": "(Required) ID of the conversation."
            }
          ]
        },
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "method": "PATCH",
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "key",
              "value": "X-API-Key"
            },
            {
              "key": "value",
              "value": "{{apiKey}}"
            },
            {
              "key": "in",
              "value": "header"
            }
          ]
        }
      },
      "response": [
        {
          "id": "c5599112-fc00-53f3-a43a-5e8635fa1b1a",
          "name": "Conversation restored to the active inbox. No response body.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "unarchive"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "No Content",
          "code": 204,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "4d4e96aa-87f9-5292-a284-269acd47c8a7",
          "name": "The API key is missing, invalid, or lacks the `INBOX` operation.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "unarchive"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "Unauthorized",
          "code": 401,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        },
        {
          "id": "a8eb2870-e098-54e5-a6fa-80724e1032f4",
          "name": "No conversation with this ID in your account.",
          "originalRequest": {
            "url": {
              "path": [
                "api",
                "partner-gateway",
                "inbox",
                "conversations",
                ":chatId",
                "unarchive"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "5145",
                  "key": "chatId",
                  "description": "(Required) ID of the conversation."
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "body": {}
          },
          "status": "Not Found",
          "code": 404,
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "body": "\"\"",
          "cookie": [],
          "_postman_previewlanguage": "json"
        }
      ],
      "event": [],
      "protocolProfileBehavior": {
        "disableBodyPruning": true
      }
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-Api-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{apiKey}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.qlara.ai",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "YOUR_API_KEY",
      "type": "string"
    }
  ]
}
