{
  "openapi": "3.0.4",
  "info": {
    "title": "My API",
    "version": "v1"
  },
  "paths": {
    "/GetAuditLogs": {
      "get": {
        "tags": [
          "TrackingEndpoints"
        ],
        "summary": "Get Audit Logs for Client",
        "description": "Get Audit Logs for Client",
        "operationId": "Tracking.GetAuditLogs",
        "parameters": [
          {
            "name": "pageNo",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "orderby",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dir",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/GetAuditLogsReponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAuditLogsReponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAuditLogsReponse"
                }
              }
            }
          }
        }
      }
    },
    "/Identify": {
      "post": {
        "tags": [
          "TrackingEndpoints"
        ],
        "summary": "Send Identify & Group for Client",
        "description": "Send Identify & Group for Client",
        "operationId": "Tracking.Identify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentifyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentifyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IdentifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IdentifyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentifyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentifyResponse"
                }
              }
            }
          }
        }
      }
    },
    "/info": {
      "get": {
        "tags": [
          "Meta"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/posthog/sync": {
      "post": {
        "tags": [
          "PostHogEndpoints"
        ],
        "summary": "Re-send PostHog person and account traits for a client id range",
        "description": "PostHog only. Requires the X-Sync-Secret header.",
        "operationId": "Tracking.PostHogSyncPersons",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostHogSyncPersonsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostHogSyncPersonsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostHogSyncPersonsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostHogSyncPersonsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostHogSyncPersonsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostHogSyncPersonsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/PostHog/Track": {
      "post": {
        "tags": [
          "PostHogEndpoints"
        ],
        "summary": "Track a PostHog event by name",
        "description": "Native PostHog path for catalog events that have no ESegmentEvent member. Runs beside /Track and never touches the Segment path.",
        "operationId": "Tracking.PostHogTrack",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostHogTrackRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/PostHogTrackRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/PostHogTrackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PostHogTrackResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostHogTrackResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostHogTrackResponse"
                }
              }
            }
          }
        }
      }
    },
    "/SyncSegment": {
      "post": {
        "tags": [
          "TrackingEndpoints"
        ],
        "summary": "Sync between Database and Segment (Identify & Group for Clients)",
        "description": "Sync between Database and Segment (Identify & Group for Clients)",
        "operationId": "Tracking.SyncSegment",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncSegmentRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncSegmentRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SyncSegmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/Track": {
      "post": {
        "tags": [
          "TrackingEndpoints"
        ],
        "summary": "Track Segment Events",
        "description": "Track Segment Events",
        "operationId": "Tracking.Track",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TrackResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackResponse"
                }
              }
            }
          }
        }
      }
    },
    "/UnsetGroupProperty": {
      "post": {
        "tags": [
          "TrackingEndpoints"
        ],
        "summary": "Unset Group Property",
        "description": "Unset Group Property",
        "operationId": "Tracking.UnsetGroupProperty",
        "parameters": [
          {
            "name": "request",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/UnsetUserProperty": {
      "post": {
        "tags": [
          "TrackingEndpoints"
        ],
        "summary": "Unset User Property",
        "description": "Unset User Property",
        "operationId": "Tracking.UnsetUserProperty",
        "parameters": [
          {
            "name": "request",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuditAction": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6
        ],
        "type": "integer",
        "format": "int32"
      },
      "AuditEntityType": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28
        ],
        "type": "integer",
        "format": "int32"
      },
      "AuditLogViewModel": {
        "type": "object",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/AuditAction"
          },
          "entityType": {
            "$ref": "#/components/schemas/AuditEntityType"
          },
          "entityId": {
            "type": "string",
            "nullable": true
          },
          "userId": {
            "type": "string",
            "nullable": true
          },
          "clientId": {
            "type": "integer",
            "format": "int32"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "newValues": {
            "type": "object",
            "additionalProperties": { },
            "nullable": true
          },
          "oldValues": {
            "type": "object",
            "additionalProperties": { },
            "nullable": true
          },
          "entityName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ESegmentEvent": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          29,
          30,
          31,
          32,
          33,
          34,
          35,
          36,
          37,
          38,
          39,
          40,
          41,
          42,
          43,
          44,
          45,
          46,
          47,
          48,
          49,
          50,
          51,
          52,
          53,
          54,
          55,
          56,
          57,
          58,
          59,
          60,
          61,
          62,
          63,
          64,
          65,
          66,
          67,
          68,
          69,
          70,
          71,
          72,
          73,
          74,
          75,
          76,
          77,
          78,
          79,
          80,
          81,
          82,
          83,
          84,
          85,
          86,
          87,
          88,
          89,
          90,
          91,
          92,
          93,
          94,
          95,
          96,
          97,
          98,
          99,
          100,
          101,
          102,
          103,
          104,
          105
        ],
        "type": "integer",
        "format": "int32"
      },
      "GetAuditLogsReponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditLogViewModel"
            },
            "nullable": true
          },
          "succeeded": {
            "type": "boolean"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          },
          "totalRecords": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "IdentifyRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "integer",
            "format": "int32"
          },
          "userId": {
            "type": "string",
            "nullable": true
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "IdentifyResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PostHogSyncPersonsRequest": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "format": "int32"
          },
          "to": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PostHogSyncPersonsResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "integer",
            "format": "int32"
          },
          "to": {
            "type": "integer",
            "format": "int32"
          },
          "clients": {
            "type": "integer",
            "format": "int32"
          },
          "users": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PostHogTrackRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "integer",
            "format": "int32"
          },
          "userId": {
            "type": "string",
            "nullable": true
          },
          "event": {
            "type": "string",
            "nullable": true
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "nullable": true
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PostHogTrackResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SyncSegmentRequest": {
        "type": "object",
        "properties": {
          "start": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "end": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TrackRequest": {
        "type": "object",
        "properties": {
          "clientId": {
            "type": "integer",
            "format": "int32"
          },
          "userId": {
            "type": "string",
            "nullable": true
          },
          "event": {
            "$ref": "#/components/schemas/ESegmentEvent"
          },
          "properties": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "nullable": true
            },
            "nullable": true
          },
          "isG1Enabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TrackResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}