openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: Predictive Sales App API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: profile description: Client psychological profile derivation - name: archetypes description: Elemental archetype reference data - name: objections description: Learned objections database paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /profile: post: operationId: buildProfile tags: [profile] summary: Derive full client profile from date of birth description: > Calculates the zodiac element, numerology life path number, archetype, closing scripts, and full beginner training matrix from a prospect's date of birth. requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ProfileInput" responses: "200": description: Full client profile content: application/json: schema: $ref: "#/components/schemas/ClientProfile" "400": description: Invalid date content: application/json: schema: $ref: "#/components/schemas/ApiError" /archetypes: get: operationId: listArchetypes tags: [archetypes] summary: List all four elemental archetypes responses: "200": description: All archetypes content: application/json: schema: type: array items: $ref: "#/components/schemas/Archetype" /archetypes/{element}: get: operationId: getArchetype tags: [archetypes] summary: Get a single archetype by element parameters: - name: element in: path required: true schema: type: string responses: "200": description: Archetype data content: application/json: schema: $ref: "#/components/schemas/Archetype" "404": description: Element not found content: application/json: schema: $ref: "#/components/schemas/ApiError" /objections: get: operationId: listObjections tags: [objections] summary: List all learned objections parameters: - name: element in: query required: false schema: type: string description: Filter by element (FIRE, EARTH, AIR, WATER) responses: "200": description: All logged objections content: application/json: schema: type: array items: $ref: "#/components/schemas/LearnedObjection" post: operationId: createObjection tags: [objections] summary: Log a new learned objection requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ObjectionInput" responses: "201": description: Objection logged content: application/json: schema: $ref: "#/components/schemas/LearnedObjection" "400": description: Invalid input content: application/json: schema: $ref: "#/components/schemas/ApiError" /counter-questions: get: operationId: listCounterQuestions tags: [learning] summary: List all logged counter-questions, optionally filtered by element parameters: - name: element in: query required: false schema: type: string description: Filter by element (FIRE, EARTH, AIR, WATER) responses: "200": description: All logged counter-questions content: application/json: schema: type: array items: $ref: "#/components/schemas/CounterQuestionEntry" post: operationId: submitCounterQuestion tags: [learning] summary: Append a raw client counter-question to the JSON dataset under the active element requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CounterQuestionInput" responses: "201": description: Counter-question logged successfully content: application/json: schema: $ref: "#/components/schemas/CounterQuestionResult" "400": description: Invalid input content: application/json: schema: $ref: "#/components/schemas/ApiError" "404": description: Element archetype not found content: application/json: schema: $ref: "#/components/schemas/ApiError" /objections/{id}: delete: operationId: deleteObjection tags: [objections] summary: Delete a logged objection parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ApiError" components: schemas: HealthStatus: type: object required: [status] properties: status: type: string ApiError: type: object required: [error] properties: error: type: string # ── Profile ────────────────────────────────────────────────────────────── ProfileInput: type: object required: [dob] properties: dob: type: string format: date description: Prospect date of birth in YYYY-MM-DD format ClientProfile: type: object required: [element, lifePathNumber, archetypeName, psychologicalSummary, closingScripts, trainingMatrix] properties: element: type: string description: FIRE | EARTH | AIR | WATER lifePathNumber: type: integer description: Numerology life path number (1–9) archetypeName: type: string psychologicalSummary: type: string closingScripts: type: array items: $ref: "#/components/schemas/ClosingScript" trainingMatrix: $ref: "#/components/schemas/TrainingMatrix" # ── Archetypes ──────────────────────────────────────────────────────────── Archetype: type: object required: [element, archetypeName, psychologicalProfile, closingScripts] properties: element: type: string archetypeName: type: string psychologicalProfile: type: string closingScripts: type: array items: $ref: "#/components/schemas/ClosingScript" ClosingScript: type: object required: [scenario, script] properties: scenario: type: string script: type: string # ── Training Matrix ─────────────────────────────────────────────────────── TrainingMatrix: type: object required: - element - archetypeName - first60Seconds - bodyLanguageReads - verbalCues - dangerZones - greenLights - paceGuidance - trustBuildingRitual - neverSay - alwaysSay properties: element: type: string archetypeName: type: string first60Seconds: type: string bodyLanguageReads: type: array items: $ref: "#/components/schemas/BehavioralCue" verbalCues: type: array items: $ref: "#/components/schemas/BehavioralCue" dangerZones: type: array items: type: string greenLights: type: array items: type: string paceGuidance: type: string trustBuildingRitual: type: string neverSay: type: array items: type: string alwaysSay: type: array items: type: string BehavioralCue: type: object required: [signal, interpretation, response] properties: signal: type: string interpretation: type: string response: type: string # ── Objections ──────────────────────────────────────────────────────────── LearnedObjection: type: object required: [id, element, objection, createdAt] properties: id: type: integer element: type: string objection: type: string context: type: ["string", "null"] resolution: type: ["string", "null"] createdAt: type: string # ── Counter Questions ───────────────────────────────────────────────────── CounterQuestionInput: type: object required: [element, question] properties: element: type: string description: FIRE | EARTH | AIR | WATER question: type: string description: The raw verbatim counter-question the client asked CounterQuestionEntry: type: object required: [element, question, loggedAt] properties: element: type: string question: type: string loggedAt: type: string CounterQuestionResult: type: object required: [element, question, loggedAt, totalForElement, message] properties: element: type: string question: type: string loggedAt: type: string totalForElement: type: integer message: type: string ObjectionInput: type: object required: [element, objection] properties: element: type: string description: FIRE | EARTH | AIR | WATER objection: type: string description: The raw client question or pushback context: type: string description: Optional deal stage or property context resolution: type: string description: What worked to overcome this objection