{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customermates-com/json-schema/customermates-com-get-messaging-thread-result-schema-schema.json",
  "title": "GetMessagingThreadResultSchema",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customermates-openapi.json#/components/schemas/GetMessagingThreadResultSchema",
  "type": "object",
  "properties": {
    "thread": {
      "$ref": "#/$defs/MessagingThreadSchemaOutput"
    },
    "messages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "messagingThreadId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "connectedAccountId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "providerMessageId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider": {
            "type": "string",
            "enum": [
              "google",
              "outlook",
              "mail",
              "linkedin",
              "whatsapp",
              "instagram",
              "telegram"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "sender": {
            "type": "object",
            "properties": {
              "attendeeId": {
                "type": "string"
              },
              "displayName": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "identifier": {
                "type": "string"
              },
              "pictureUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "profileUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "headline": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occupation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "isSelf": {
                "type": "boolean"
              },
              "records": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "ref": {
                      "type": "object",
                      "properties": {
                        "typeId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "recordId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        }
                      },
                      "required": [
                        "typeId",
                        "recordId"
                      ],
                      "additionalProperties": false
                    },
                    "identityId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "typeLabel": {
                      "type": "string"
                    },
                    "typePluralLabel": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "avatarUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "canEdit": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ref",
                    "typeLabel",
                    "typePluralLabel",
                    "title",
                    "avatarUrl",
                    "canEdit"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "attendeeId",
              "displayName",
              "identifier",
              "records"
            ],
            "additionalProperties": false
          },
          "recipients": {
            "type": "object",
            "properties": {
              "to": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "attendeeId": {
                      "type": "string"
                    },
                    "displayName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "identifier": {
                      "type": "string"
                    },
                    "pictureUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "profileUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "headline": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "occupation": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isSelf": {
                      "type": "boolean"
                    },
                    "records": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ref": {
                            "type": "object",
                            "properties": {
                              "typeId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "recordId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              }
                            },
                            "required": [
                              "typeId",
                              "recordId"
                            ],
                            "additionalProperties": false
                          },
                          "identityId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "typeLabel": {
                            "type": "string"
                          },
                          "typePluralLabel": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "avatarUrl": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "canEdit": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "ref",
                          "typeLabel",
                          "typePluralLabel",
                          "title",
                          "avatarUrl",
                          "canEdit"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "attendeeId",
                    "displayName",
                    "identifier",
                    "records"
                  ],
                  "additionalProperties": false
                }
              },
              "cc": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "attendeeId": {
                      "type": "string"
                    },
                    "displayName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "identifier": {
                      "type": "string"
                    },
                    "pictureUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "profileUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "headline": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "occupation": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isSelf": {
                      "type": "boolean"
                    },
                    "records": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ref": {
                            "type": "object",
                            "properties": {
                              "typeId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "recordId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              }
                            },
                            "required": [
                              "typeId",
                              "recordId"
                            ],
                            "additionalProperties": false
                          },
                          "identityId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "typeLabel": {
                            "type": "string"
                          },
                          "typePluralLabel": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "avatarUrl": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "canEdit": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "ref",
                          "typeLabel",
                          "typePluralLabel",
                          "title",
                          "avatarUrl",
                          "canEdit"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "attendeeId",
                    "displayName",
                    "identifier",
                    "records"
                  ],
                  "additionalProperties": false
                }
              },
              "bcc": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "attendeeId": {
                      "type": "string"
                    },
                    "displayName": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "identifier": {
                      "type": "string"
                    },
                    "pictureUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "profileUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "headline": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "occupation": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "isSelf": {
                      "type": "boolean"
                    },
                    "records": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ref": {
                            "type": "object",
                            "properties": {
                              "typeId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "recordId": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              }
                            },
                            "required": [
                              "typeId",
                              "recordId"
                            ],
                            "additionalProperties": false
                          },
                          "identityId": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "typeLabel": {
                            "type": "string"
                          },
                          "typePluralLabel": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "avatarUrl": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "canEdit": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "ref",
                          "typeLabel",
                          "typePluralLabel",
                          "title",
                          "avatarUrl",
                          "canEdit"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "attendeeId",
                    "displayName",
                    "identifier",
                    "records"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "to",
              "cc",
              "bcc"
            ],
            "additionalProperties": false
          },
          "subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bodyText": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "bodyHtml": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "attachmentsMeta": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "fileName": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "mime": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "size": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sticker": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "voiceNote": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "gif": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "durationSeconds": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "unavailable": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "linkUrl": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            }
          },
          "isEvent": {
            "default": false,
            "type": "boolean"
          },
          "isDeleted": {
            "default": false,
            "type": "boolean"
          },
          "isHidden": {
            "default": false,
            "type": "boolean"
          },
          "isDraft": {
            "default": false,
            "type": "boolean"
          },
          "sentAt": {
            "type": "string"
          },
          "editedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "reactions": {
            "default": [],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "value"
              ],
              "additionalProperties": false
            }
          },
          "folderIds": {
            "default": [],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "draftRevision": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                "description": "Opaque revision returned with the saved draft; required whenever draftMessageId is provided"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "messagingThreadId",
          "connectedAccountId",
          "provider",
          "direction",
          "sender",
          "recipients",
          "subject",
          "bodyText",
          "bodyHtml",
          "attachmentsMeta",
          "isEvent",
          "isDeleted",
          "isHidden",
          "isDraft",
          "sentAt",
          "editedAt",
          "reactions",
          "draftRevision"
        ],
        "additionalProperties": false
      }
    },
    "total": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "accountOwners": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "properties": {
          "displayName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "accountLabel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "avatarUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "displayName",
          "accountLabel",
          "avatarUrl"
        ],
        "additionalProperties": false
      }
    },
    "folderContext": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "folders": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "role": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "totalCount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unreadCount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "role",
                  "totalCount",
                  "unreadCount"
                ],
                "additionalProperties": false
              }
            },
            "selectedFolderIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "currentFolderIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "canMove": {
              "type": "boolean"
            }
          },
          "required": [
            "folders",
            "selectedFolderIds",
            "currentFolderIds",
            "canMove"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "thread",
    "messages",
    "total",
    "accountOwners",
    "folderContext"
  ],
  "additionalProperties": false,
  "$defs": {
    "MessagingThreadSchemaOutput": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "connectedAccountId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "unipileThreadId": {
          "type": "string"
        },
        "provider": {
          "type": "string",
          "enum": [
            "google",
            "outlook",
            "mail",
            "linkedin",
            "whatsapp",
            "instagram",
            "telegram"
          ]
        },
        "type": {
          "default": "single",
          "type": "string",
          "enum": [
            "single",
            "group",
            "channel"
          ]
        },
        "name": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "subject": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "preview": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "previewKind": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "image",
                "gif",
                "video",
                "audio",
                "voice",
                "sticker",
                "unsupported",
                "post",
                "file",
                "deleted"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "lastMessageAt": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "participants": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "attendeeId": {
                "type": "string"
              },
              "displayName": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "identifier": {
                "type": "string"
              },
              "pictureUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "profileUrl": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "headline": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "occupation": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "isSelf": {
                "type": "boolean"
              },
              "records": {
                "default": [],
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "ref": {
                      "type": "object",
                      "properties": {
                        "typeId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "recordId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        }
                      },
                      "required": [
                        "typeId",
                        "recordId"
                      ],
                      "additionalProperties": false
                    },
                    "identityId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "typeLabel": {
                      "type": "string"
                    },
                    "typePluralLabel": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "avatarUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "canEdit": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "ref",
                    "typeLabel",
                    "typePluralLabel",
                    "title",
                    "avatarUrl",
                    "canEdit"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "attendeeId",
              "displayName",
              "identifier",
              "records"
            ],
            "additionalProperties": false
          }
        },
        "state": {
          "default": "unread",
          "type": "string",
          "enum": [
            "unread",
            "open",
            "closed",
            "spam"
          ]
        },
        "sharedToCrm": {
          "default": false,
          "type": "boolean"
        },
        "accountShared": {
          "default": false,
          "type": "boolean"
        },
        "isOwner": {
          "default": false,
          "type": "boolean"
        },
        "lastMessageFromSelf": {
          "default": false,
          "type": "boolean"
        },
        "lastSentMessageFromSelf": {
          "default": null,
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ]
        },
        "lastMessageSenderName": {
          "default": null,
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "createdAt": {
          "type": "string"
        },
        "updatedAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "connectedAccountId",
        "unipileThreadId",
        "provider",
        "type",
        "name",
        "subject",
        "preview",
        "previewKind",
        "lastMessageAt",
        "participants",
        "state",
        "sharedToCrm",
        "accountShared",
        "isOwner",
        "lastMessageFromSelf",
        "lastSentMessageFromSelf",
        "lastMessageSenderName",
        "createdAt",
        "updatedAt"
      ],
      "additionalProperties": false
    }
  }
}