{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Event Stitching Server","description":"Identity resolution and event logging"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{},"parameters":{}},"paths":{"/":{"get":{"responses":{"200":{"description":"Stitcher server information","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"version":{"type":"string"},"docs":{"type":"string"}},"required":["message","version","docs"]}}}}}}},"/health":{"get":{"responses":{"200":{"description":"Health check","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}}}}},"/api/v1/events/":{"post":{"description":"Log a single analytics event","operationId":"create_event","security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"server_timestamp":{"type":"string","format":"date-time"},"session_id":{"type":"string","nullable":true},"action":{"type":"string"},"experiment_id":{"type":"string"},"variant_key_name":{"type":"string"},"page_id":{"type":"string"},"page_version_id":{"type":"string"},"experiment_features":{"type":"object","additionalProperties":{"nullable":true}},"email":{"type":"string"},"user_id":{"type":"string"},"client_id":{"type":"string"},"ip_address":{"type":"string"},"lead_id":{"type":"string"},"tracking_status":{"type":"string"},"identifiers":{"type":"object","additionalProperties":{"nullable":true}},"cookies":{"type":"object","additionalProperties":{"nullable":true}},"user_agent":{"type":"string"},"url":{"type":"string"},"referrer_url":{"type":"string"},"request_headers":{"type":"object","additionalProperties":{"nullable":true}},"page_height_pixels":{"type":"string"},"page_width_pixels":{"type":"string"},"page_scroll_depth":{"type":"string"},"browser_locale":{"type":"string"},"tracking_transport":{"type":"string"},"client_submission_unique_id":{"type":"string"},"event_source":{"type":"string"},"event_category":{"type":"string"},"properties":{"type":"object","additionalProperties":{"nullable":true}},"meta":{"type":"object","additionalProperties":{"nullable":true}},"client_library_version":{"type":"string"},"events_server_version":{"type":"string"},"timezone":{"type":"string"},"timezone_offset_hours":{"type":"number","nullable":true},"is_test":{"type":"boolean","nullable":true},"cohort_id":{"type":"string"},"client_side_decision_id":{"type":"string"},"decision_id":{"type":"string"},"feature_flags":{"type":"object","additionalProperties":{"nullable":true}},"router_config_id":{"type":"string"},"case_config_id":{"type":"string"},"target_config_id":{"type":"string"},"ad_id":{"type":"string"},"ad_group_id":{"type":"string"},"ad_campaign_id":{"type":"string"}},"required":["organization_id","timestamp","action"]}}}},"responses":{"200":{"description":"Event logged successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"event_id":{"type":"string"},"message":{"type":"string"}},"required":["success"]}}}},"400":{"description":"Invalid request body"},"500":{"description":"Server error"}}}},"/api/v1/events/batch/":{"post":{"description":"Log multiple analytics events in a batch","operationId":"create_events_batch","security":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"server_timestamp":{"type":"string","format":"date-time"},"session_id":{"type":"string","nullable":true},"action":{"type":"string"},"experiment_id":{"type":"string"},"variant_key_name":{"type":"string"},"page_id":{"type":"string"},"page_version_id":{"type":"string"},"experiment_features":{"type":"object","additionalProperties":{"nullable":true}},"email":{"type":"string"},"user_id":{"type":"string"},"client_id":{"type":"string"},"ip_address":{"type":"string"},"lead_id":{"type":"string"},"tracking_status":{"type":"string"},"identifiers":{"type":"object","additionalProperties":{"nullable":true}},"cookies":{"type":"object","additionalProperties":{"nullable":true}},"user_agent":{"type":"string"},"url":{"type":"string"},"referrer_url":{"type":"string"},"request_headers":{"type":"object","additionalProperties":{"nullable":true}},"page_height_pixels":{"type":"string"},"page_width_pixels":{"type":"string"},"page_scroll_depth":{"type":"string"},"browser_locale":{"type":"string"},"tracking_transport":{"type":"string"},"client_submission_unique_id":{"type":"string"},"event_source":{"type":"string"},"event_category":{"type":"string"},"properties":{"type":"object","additionalProperties":{"nullable":true}},"meta":{"type":"object","additionalProperties":{"nullable":true}},"client_library_version":{"type":"string"},"events_server_version":{"type":"string"},"timezone":{"type":"string"},"timezone_offset_hours":{"type":"number","nullable":true},"is_test":{"type":"boolean","nullable":true},"cohort_id":{"type":"string"},"client_side_decision_id":{"type":"string"},"decision_id":{"type":"string"},"feature_flags":{"type":"object","additionalProperties":{"nullable":true}},"router_config_id":{"type":"string"},"case_config_id":{"type":"string"},"target_config_id":{"type":"string"},"ad_id":{"type":"string"},"ad_group_id":{"type":"string"},"ad_campaign_id":{"type":"string"}},"required":["organization_id","timestamp","action"]}},"skip_server_event_integrations":{"type":"boolean","default":true}},"required":["data"]}}}},"responses":{"200":{"description":"Events logged successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"events_processed":{"type":"number"},"message":{"type":"string"}},"required":["success","events_processed"]}}}},"400":{"description":"Invalid request body"},"500":{"description":"Server error"}}}},"/api/v1/organizations":{"post":{"description":"Create a new organization","operationId":"create_organization","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"example":"org_123"},"name":{"type":"string","minLength":1,"example":"Acme Corporation"},"abbreviation":{"type":"string","minLength":1,"example":"acme"}},"required":["id","name","abbreviation"]}}}},"responses":{"201":{"description":"Organization created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"org_123"},"name":{"type":"string","example":"Acme Corporation"},"abbreviation":{"type":"string","example":"acme"}},"required":["id","name","abbreviation"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}},"401":{"description":"Unauthorized"}}}},"/api/v1/organizations/{id}":{"get":{"description":"Get organization by ID","operationId":"get_organization","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Organization found","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"org_123"},"name":{"type":"string","example":"Acme Corporation"},"abbreviation":{"type":"string","example":"acme"}},"required":["id","name","abbreviation"]}}}},"401":{"description":"Unauthorized"},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}}}},"put":{"description":"Update organization","operationId":"update_organization","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Acme Corporation"},"abbreviation":{"type":"string","minLength":1,"example":"acme"}}}}}},"responses":{"200":{"description":"Organization updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"org_123"},"name":{"type":"string","example":"Acme Corporation"},"abbreviation":{"type":"string","example":"acme"}},"required":["id","name","abbreviation"]}}}},"401":{"description":"Unauthorized"},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}}}},"delete":{"description":"Delete organization","operationId":"delete_organization","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Organization deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success"]}}}},"401":{"description":"Unauthorized"},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"error":{"type":"string"}},"required":["success","error"]}}}}}}}}}