{
 "openapi": "3.1.0",
 "info": {
  "title": "Prospects (CRM)",
  "version": "20261030b",
  "description": "Students and businesses being recruited. Scoring explains itself; converting hands over to SLCM or opens an account."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "prospects": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Campus / office"
     },
     "prospect_no": {
      "type": "string",
      "description": "Prospect no",
      "readOnly": true
     },
     "prospect_type": {
      "type": "string",
      "description": "Type"
     },
     "first_name": {
      "type": "string",
      "description": "First name"
     },
     "last_name": {
      "type": "string",
      "description": "Last name"
     },
     "preferred_name": {
      "type": "string",
      "description": "Preferred name"
     },
     "email": {
      "type": "string",
      "description": "Email"
     },
     "phone": {
      "type": "string",
      "description": "Phone"
     },
     "date_of_birth": {
      "type": "string",
      "format": "date",
      "description": "Date of birth"
     },
     "country": {
      "type": "string",
      "description": "Country"
     },
     "city": {
      "type": "string",
      "description": "City"
     },
     "organization_name": {
      "type": "string",
      "description": "Organization"
     },
     "industry": {
      "type": "string",
      "description": "Industry"
     },
     "employee_count": {
      "type": "integer",
      "description": "Employees"
     },
     "annual_revenue": {
      "type": "string",
      "format": "decimal",
      "description": "Annual revenue"
     },
     "source": {
      "type": "string",
      "description": "Source"
     },
     "source_detail": {
      "type": "string",
      "description": "Source detail"
     },
     "campaign_id": {
      "type": "string",
      "format": "uuid",
      "description": "Campaign"
     },
     "referral_id": {
      "type": "string",
      "format": "uuid",
      "description": "Referral id",
      "readOnly": true
     },
     "owner_id": {
      "type": "string",
      "format": "uuid",
      "description": "Owner"
     },
     "stage": {
      "type": "string",
      "description": "Stage"
     },
     "score": {
      "type": "string",
      "format": "decimal",
      "description": "Score"
     },
     "score_basis": {
      "type": "string",
      "description": "Score basis"
     },
     "rating": {
      "type": "string",
      "description": "Rating"
     },
     "interest_program_id": {
      "type": "string",
      "format": "uuid",
      "description": "Program of interest"
     },
     "interest_term_id": {
      "type": "string",
      "format": "uuid",
      "description": "Entry term"
     },
     "estimated_value": {
      "type": "string",
      "format": "decimal",
      "description": "Estimated value"
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Account id",
      "readOnly": true
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact id",
      "readOnly": true
     },
     "applicant_id": {
      "type": "string",
      "format": "uuid",
      "description": "Applicant id",
      "readOnly": true
     },
     "opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Opportunity id",
      "readOnly": true
     },
     "converted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Converted at",
      "readOnly": true
     },
     "disqualify_reason": {
      "type": "string",
      "description": "Disqualify reason",
      "readOnly": true
     },
     "next_action": {
      "type": "string",
      "description": "Next action"
     },
     "next_action_at": {
      "type": "string",
      "format": "date",
      "description": "Next action due"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "linkedin_url": {
      "type": "string",
      "description": "LinkedIn profile"
     },
     "personal_email": {
      "type": "string",
      "description": "Personal email"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/crm/prospects": {
   "get": {
    "summary": "list prospects",
    "operationId": "list_prospects_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create prospects",
    "operationId": "create_prospects_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/prospects/{id}": {
   "get": {
    "summary": "get prospects",
    "operationId": "get_prospects_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change prospects",
    "operationId": "change_prospects_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete prospects",
    "operationId": "delete_prospects_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/prospects/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_prospects_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/prospects/{parentId}/interests": {
   "get": {
    "summary": "Interests",
    "operationId": "action_prospects_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Interests",
    "operationId": "action_prospects_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/prospects/{parentId}/interests/{lineId}": {
   "put": {
    "summary": "Interests",
    "operationId": "action_prospects_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Interests",
    "operationId": "action_prospects_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/prospects/{id}/score": {
   "post": {
    "summary": "Score",
    "operationId": "action_prospects_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/prospects/{id}/convert": {
   "post": {
    "summary": "Convert",
    "operationId": "action_prospects_0_6",
    "description": "Body keys: programId, termId, sendPaymentSetup",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/prospects/{id}/disqualify": {
   "post": {
    "summary": "Disqualify",
    "operationId": "action_prospects_0_6",
    "description": "Body keys: reason*",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}