{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ringover/json-schema/ringover-conversation-light-schema.json",
  "title": "conversation_light",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ringover-openapi.yml#/components/schemas/conversation_light",
  "type": "object",
  "properties": {
    "conversation_id": {
      "type": "integer",
      "format": "int64"
    },
    "is_sms_write": {
      "type": "boolean",
      "description": "True if the user can send an SMS in the conversation"
    },
    "is_mms_write": {
      "type": "boolean",
      "description": "True if the user can send an MMS in the conversation"
    },
    "type": {
      "type": "string",
      "enum": [
        "INTERNAL",
        "EXTERNAL",
        "COLLABORATIVE"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "star": {
      "description": "Used to filter stars ID",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "enum": [
          "STAR1",
          "STAR2",
          "STAR3",
          "CHECK",
          "WARNING"
        ]
      }
    },
    "favorite": {
      "type": "boolean",
      "description": "True if the user bookmarked the conversation"
    },
    "name": {
      "type": "string"
    },
    "purpose": {
      "type": "string"
    },
    "user_list": {
      "$ref": "#/$defs/conv_user_light"
    },
    "internal": {
      "type": [
        "array",
        "null"
      ],
      "description": "Store internal conversation members",
      "items": {
        "$ref": "#/$defs/member"
      }
    },
    "external": {
      "type": [
        "array",
        "null"
      ],
      "description": "Store external conversation members (is not displayed in case of internal conversation)",
      "items": {
        "$ref": "#/$defs/member"
      }
    },
    "unread_messages_count": {
      "type": "integer",
      "format": "int64"
    },
    "last_message": {
      "$ref": "#/$defs/message"
    },
    "total_messages_count": {
      "type": "integer",
      "format": "int64"
    },
    "is_archived": {
      "type": "boolean",
      "description": "Archived (true) or not (false)"
    },
    "adminrules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/adminrulesitems"
      },
      "description": "Permissions of the conversation's administrators (Chat only)"
    },
    "can_thread_in": {
      "type": "integer",
      "description": "ID of the SMS conversation commented by the conversation"
    },
    "is_commented_by": {
      "type": "integer",
      "description": "ID of the associated comment conversation"
    },
    "unread_comment": {
      "type": "integer",
      "description": "Latest unread message of the conversation"
    },
    "creation_date": {
      "type": "string",
      "format": "date-time"
    },
    "update_date": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "adminrulesitems": {
      "type": "object",
      "properties": {
        "can_invite": {
          "type": "boolean"
        },
        "can_leave": {
          "type": "boolean"
        },
        "can_kick": {
          "type": "boolean"
        },
        "can_join": {
          "type": "boolean"
        },
        "can_view_history": {
          "type": "boolean"
        }
      }
    },
    "contact": {
      "type": "object",
      "properties": {
        "contact_id": {
          "type": "integer",
          "format": "int64"
        },
        "is_shared": {
          "type": "boolean"
        },
        "im_owner": {
          "type": "string"
        },
        "social_service": {
          "type": [
            "string",
            "null"
          ]
        },
        "social_service_id": {
          "type": "string"
        },
        "social_profile_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "social_data": {
          "type": [
            "string",
            "null"
          ]
        },
        "firstname": {
          "type": "string"
        },
        "lastname": {
          "type": "string"
        },
        "company": {
          "type": "string"
        },
        "concat_name": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "initial": {
          "type": "string"
        },
        "profile_picture": {
          "type": [
            "string",
            "null"
          ]
        },
        "creation_date": {
          "type": "string",
          "format": "date-time"
        },
        "numbers": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "integer",
            "format": "uint64"
          }
        }
      }
    },
    "conv_user_light": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "integer",
          "format": "int64",
          "description": "The user identifier"
        },
        "initial": {
          "type": "string",
          "description": "The initials of the user"
        },
        "color": {
          "type": "string"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the user"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the user"
        },
        "company": {
          "type": "string",
          "description": "The company of the user"
        },
        "concat_name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "description": "The email of the user"
        },
        "picture": {
          "type": "string",
          "description": "The picture of the user"
        },
        "is_sms_write": {
          "type": "boolean",
          "description": "True if the user can send an SMS in the conversation"
        },
        "is_administrator": {
          "type": "boolean"
        }
      }
    },
    "format_number": {
      "type": "object",
      "properties": {
        "raw": {
          "type": "integer",
          "format": "int64"
        },
        "country_code": {
          "type": "string"
        },
        "country": {
          "type": "string"
        },
        "e164": {
          "type": "string"
        },
        "international": {
          "type": "string"
        },
        "international_alt": {
          "type": "string"
        },
        "national": {
          "type": "string"
        },
        "national_alt": {
          "type": "string"
        },
        "rfc3966": {
          "type": "string"
        },
        "is_short_code": {
          "type": "boolean"
        }
      }
    },
    "member": {
      "type": "object",
      "properties": {
        "conversation_user_id": {
          "type": "integer",
          "format": "int64"
        },
        "user": {
          "description": "Can be `null` (mutually exclusive with ivr and group)",
          "$ref": "#/$defs/member_ringover"
        },
        "ivr": {
          "description": "Can be `null` (mutually exclusive with ivr and group). Always `null` if the conversation is not collaborative.",
          "$ref": "#/$defs/member_ivr"
        },
        "group": {
          "description": "Can be `null` (mutually exclusive with ivr and group)",
          "type": "object",
          "properties": {
            "id": {
              "type": "integer",
              "format": "int64",
              "description": "The identifier of the group"
            },
            "name": {
              "type": "string",
              "description": "The name of the group"
            },
            "color": {
              "type": "string"
            }
          }
        },
        "alphanumeric": {
          "type": [
            "string",
            "null"
          ],
          "description": "Can be `null` if the `number` is filled"
        },
        "number": {
          "$ref": "#/$defs/format_number"
        },
        "contact": {
          "$ref": "#/$defs/contact"
        },
        "picture": {
          "type": [
            "string",
            "null"
          ]
        },
        "is_administrator": {
          "type": "boolean"
        }
      }
    },
    "member_ivr": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "scenario_id": {
          "type": "integer",
          "format": "int64"
        },
        "color": {
          "type": "string"
        }
      }
    },
    "member_ringover": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "integer",
          "format": "int64"
        },
        "initial": {
          "type": "string"
        },
        "color": {
          "type": "string"
        },
        "firstname": {
          "type": "string"
        },
        "lastname": {
          "type": "string"
        },
        "company": {
          "type": "string"
        },
        "concat_name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "picture": {
          "type": "string"
        },
        "is_sms_write": {
          "description": "is not displayed if the user does not have the `is_sms_write` right",
          "type": "boolean"
        },
        "is_administrator": {
          "description": "is not displayed if the user is not an administrator",
          "type": "boolean"
        }
      }
    },
    "message": {
      "type": "object",
      "properties": {
        "message_id": {
          "type": "integer",
          "format": "int64"
        },
        "mdr_uuid": {
          "type": "string",
          "description": "is displayed for external conversations"
        },
        "thread": {
          "type": "object",
          "properties": {
            "thread_uuid": {
              "type": "string"
            },
            "conversation_id_linked": {
              "type": "integer"
            },
            "conversation_sms_id_linked": {
              "type": "integer"
            },
            "nb_response": {
              "type": "integer"
            },
            "buffer_section": {
              "type": "integer"
            }
          }
        },
        "conversation_id": {
          "type": "integer"
        },
        "conversation_user_id": {
          "type": "integer"
        },
        "user": {
          "$ref": "#/$defs/user_light"
        },
        "contact": {
          "$ref": "#/$defs/contact"
        },
        "number": {
          "$ref": "#/$defs/format_number"
        },
        "buffer": {
          "type": "string",
          "description": "Content of the message"
        },
        "total_price": {
          "type": "integer",
          "description": "Is `null` if the conversation is internal"
        },
        "total_plan": {
          "type": "integer",
          "description": "Is `null` if the conversation is internal"
        },
        "is_failed": {
          "type": "boolean"
        },
        "nb_fragments": {
          "type": "integer",
          "description": "Depends on the number of characters sent"
        },
        "direction": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "IN",
            "OUT"
          ]
        },
        "is_archived": {
          "type": "boolean"
        },
        "archive_date": {
          "type": "string",
          "format": "date-time"
        },
        "creation_date": {
          "type": "string",
          "format": "date-time"
        },
        "update_date": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "user_light": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "integer",
          "format": "int64",
          "description": "The user identifier"
        },
        "team_id": {
          "type": "integer",
          "format": "int64",
          "description": "The team identifier of the user"
        },
        "initial": {
          "type": "string",
          "description": "The initials of the user"
        },
        "color": {
          "type": "string"
        },
        "firstname": {
          "type": "string",
          "description": "The firstname of the user"
        },
        "lastname": {
          "type": "string",
          "description": "The lastname of the user"
        },
        "company": {
          "type": "string",
          "description": "The company of the user"
        },
        "email": {
          "type": "string",
          "description": "The email of the user"
        },
        "picture": {
          "type": "string",
          "description": "The picture of the user"
        },
        "concat_name": {
          "type": "string"
        }
      }
    }
  }
}