{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/rulebase/main/json-schema/rulebase-linked-activity-thread-schema.json",
  "title": "LinkedActivityThread",
  "x-generated": "2026-10-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rulebase-openapi.json#/components/schemas/LinkedActivityThread",
  "type": [
    "object",
    "null"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "initial_contact_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_contact_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "contacts_count": {
      "type": [
        "integer",
        "null"
      ]
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "screening_search": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "provider": {
                "type": "string"
              },
              "external_id": {
                "type": "string"
              },
              "source_url": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "fetched_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "redacted_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "issues": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "data": {
                "type": "object",
                "additionalProperties": {
                  "nullable": true
                }
              }
            },
            "required": [
              "id",
              "provider",
              "external_id",
              "source_url",
              "status",
              "fetched_at",
              "redacted_at",
              "issues",
              "data"
            ]
          },
          "screening_search_origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "conversation_origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "jira_issue_origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "linear_issue_origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "slack_message_origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "work_item_origin": {
            "type": [
              "string",
              "null"
            ]
          },
          "entity_created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "conversation": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "external_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "subject": {
                "type": "string"
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "jira_issue_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ticket_status": {
                "type": "string",
                "enum": [
                  "open",
                  "resolved"
                ]
              },
              "external_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "external_created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "created_at": {
                "type": "string",
                "format": "date-time"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time"
              },
              "data_source": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "type": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "type"
                ]
              },
              "requester": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "type": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "id",
                  "name",
                  "email",
                  "phone",
                  "type"
                ]
              },
              "conversation_agents": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "employee": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "type": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "human",
                            "bot"
                          ]
                        },
                        "avatar_url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "email",
                        "type",
                        "avatar_url"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "employee"
                  ]
                }
              }
            },
            "required": [
              "id",
              "external_id",
              "subject",
              "summary",
              "jira_issue_key",
              "ticket_status",
              "external_url",
              "external_created_at",
              "created_at",
              "updated_at",
              "data_source",
              "requester",
              "conversation_agents"
            ]
          },
          "jira_issue": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "issue_key": {
                "type": "string"
              },
              "summary": {
                "type": "string"
              },
              "status_category": {
                "type": "string",
                "enum": [
                  "undefined",
                  "new",
                  "indeterminate",
                  "done"
                ]
              },
              "url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "service_desk_url": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "issue_key",
              "summary",
              "status_category",
              "url",
              "service_desk_url"
            ]
          },
          "linear_issue": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "identifier": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "state_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "state_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "url": {
                "type": "string"
              },
              "team_key": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "assignee_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "priority_label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "identifier",
              "title",
              "state_name",
              "state_type",
              "url",
              "team_key",
              "assignee_name",
              "priority_label",
              "created_at",
              "updated_at"
            ]
          },
          "slack_message": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "external_created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "url",
              "external_created_at"
            ]
          },
          "work_item": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "external_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "short_description": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "external_id",
              "type",
              "status",
              "short_description"
            ]
          },
          "customer_complaint": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "summary": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "priority": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ]
              },
              "created_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "title",
              "summary",
              "status",
              "priority",
              "created_at"
            ]
          }
        },
        "required": [
          "id",
          "type",
          "conversation_origin",
          "jira_issue_origin",
          "linear_issue_origin",
          "slack_message_origin",
          "work_item_origin",
          "entity_created_at",
          "created_at",
          "updated_at",
          "conversation",
          "jira_issue",
          "linear_issue",
          "slack_message",
          "work_item"
        ]
      }
    }
  },
  "required": [
    "id",
    "initial_contact_at",
    "last_contact_at",
    "contacts_count",
    "created_at",
    "updated_at",
    "items"
  ]
}