{"openapi":"3.1.0","info":{"title":"Otto LMS admissions API proof","version":"0.36.0","description":"Local proof contract generated from Zod schemas for Phase 4 Ticket 036. Write endpoints validate payloads but do not persist records."},"paths":{"/api/v1/leads":{"get":{"summary":"List local admissions leads","operationId":"listAdmissionsLeads","parameters":[{"name":"stageId","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ListAdmissionsLeadsQuery"}}],"responses":{"200":{"description":"Local admissions lead list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionsApiLeadListResponse"}}}},"400":{"description":"Validation error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionsApiErrorEnvelope"}}}}}},"post":{"summary":"Validate a create-lead request without writing","operationId":"previewCreateAdmissionsLead","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAdmissionsLeadRequest"}}}},"responses":{"200":{"description":"Validated dry-run response; no write accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionsApiCreateLeadPreviewResponse"}}}},"400":{"description":"Validation error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionsApiErrorEnvelope"}}}}}}},"/api/v1/leads/{id}/stage":{"patch":{"summary":"Preview a lead stage movement without writing","operationId":"previewAdmissionsLeadStageChange","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAdmissionsLeadStageRequest"}}}},"responses":{"200":{"description":"Stage movement preview with guardrails; no write accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionsApiStagePreviewResponse"}}}},"404":{"description":"Lead not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdmissionsApiErrorEnvelope"}}}}}}},"/api/v1/openapi":{"get":{"summary":"Return the local OpenAPI proof document","operationId":"getAdmissionsOpenApiProof","responses":{"200":{"description":"OpenAPI 3.1 proof generated from Zod schemas."}}}}},"components":{"schemas":{"AdmissionsApiLead":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"legalName":{"type":"string"},"preferredName":{"type":["string","null"]},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string"},"stageId":{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},"source":{"type":"string"},"campaign":{"type":"string"},"program":{"type":"string"},"campus":{"type":"string"},"startDateLabel":{"type":"string"},"assignedRep":{"type":"string"},"consentChannels":{"type":"array","items":{"type":"string","enum":["email","sms","phone"]}},"duplicateRisk":{"type":"string","enum":["none","review","high"]},"applicationStatus":{"type":"string","enum":["not-started","in-progress","submitted","under-review","accepted","agreement-sent","enrolled","started","lost"]},"nextStep":{"type":"string"},"openTaskCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"localOnly":{"type":"boolean","const":true},"databaseBacked":{"type":"boolean","const":false}},"required":["id","displayName","legalName","preferredName","email","phone","stageId","source","campaign","program","campus","startDateLabel","assignedRep","consentChannels","duplicateRisk","applicationStatus","nextStep","openTaskCount","localOnly","databaseBacked"],"additionalProperties":false},"AdmissionsApiStage":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},"label":{"type":"string"},"sequence":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"requiredFields":{"type":"array","items":{"type":"string","enum":["legalName","email","phone","consent","appointmentAt","tourOutcome","applicationSubmittedAt","acceptanceDecisionAt","agreementSentAt","enrollmentConfirmedAt","startDate","lostReason"]}},"terminal":{"type":"boolean"},"lostStage":{"type":"boolean"}},"required":["id","label","sequence","requiredFields","terminal","lostStage"],"additionalProperties":false},"ListAdmissionsLeadsQuery":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stageId":{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},"limit":{"default":50,"type":"integer","minimum":1,"maximum":50},"cursor":{"type":"string","minLength":1}},"required":["limit"],"additionalProperties":false},"CreateAdmissionsLeadRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"legalName":{"type":"string","minLength":2,"maxLength":120},"preferredName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"email":{"type":"string","maxLength":160,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":7,"maxLength":40},"source":{"type":"string","minLength":2,"maxLength":80},"campaign":{"type":"string","minLength":2,"maxLength":120},"program":{"type":"string","minLength":2,"maxLength":120},"campus":{"type":"string","minLength":2,"maxLength":120},"startDateLabel":{"type":"string","minLength":2,"maxLength":80},"assignedRep":{"type":"string","minLength":2,"maxLength":120},"consentChannels":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["email","sms","phone"]}},"consentWording":{"type":"string","minLength":20,"maxLength":500},"idempotencyKey":{"type":"string","minLength":8,"maxLength":120},"dryRun":{"default":true,"type":"boolean","const":true}},"required":["legalName","email","phone","source","program","campus","consentChannels","consentWording","dryRun"],"additionalProperties":false},"UpdateAdmissionsLeadStageRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"targetStageId":{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},"expectedVersion":{"type":"string","minLength":4,"maxLength":80},"reason":{"type":"string","minLength":4,"maxLength":240},"idempotencyKey":{"type":"string","minLength":8,"maxLength":120}},"required":["targetStageId"],"additionalProperties":false},"AdmissionsApiLeadListResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"apiVersion":{"type":"string","const":"v1"},"requestId":{"type":"string"},"localOnly":{"type":"boolean","const":true},"databaseBacked":{"type":"boolean","const":false},"productionWrites":{"type":"boolean","const":false},"data":{"type":"object","properties":{"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"displayName":{"type":"string"},"legalName":{"type":"string"},"preferredName":{"type":["string","null"]},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string"},"stageId":{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},"source":{"type":"string"},"campaign":{"type":"string"},"program":{"type":"string"},"campus":{"type":"string"},"startDateLabel":{"type":"string"},"assignedRep":{"type":"string"},"consentChannels":{"type":"array","items":{"type":"string","enum":["email","sms","phone"]}},"duplicateRisk":{"type":"string","enum":["none","review","high"]},"applicationStatus":{"type":"string","enum":["not-started","in-progress","submitted","under-review","accepted","agreement-sent","enrolled","started","lost"]},"nextStep":{"type":"string"},"openTaskCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"localOnly":{"type":"boolean","const":true},"databaseBacked":{"type":"boolean","const":false}},"required":["id","displayName","legalName","preferredName","email","phone","stageId","source","campaign","program","campus","startDateLabel","assignedRep","consentChannels","duplicateRisk","applicationStatus","nextStep","openTaskCount","localOnly","databaseBacked"],"additionalProperties":false}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},"label":{"type":"string"},"sequence":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"requiredFields":{"type":"array","items":{"type":"string","enum":["legalName","email","phone","consent","appointmentAt","tourOutcome","applicationSubmittedAt","acceptanceDecisionAt","agreementSentAt","enrollmentConfirmedAt","startDate","lostReason"]}},"terminal":{"type":"boolean"},"lostStage":{"type":"boolean"}},"required":["id","label","sequence","requiredFields","terminal","lostStage"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":50},"nextCursor":{"type":["string","null"]},"returned":{"type":"integer","minimum":0,"maximum":9007199254740991},"totalAvailable":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["limit","nextCursor","returned","totalAvailable"],"additionalProperties":false},"filters":{"type":"object","properties":{"stageId":{"anyOf":[{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},{"type":"null"}]}},"required":["stageId"],"additionalProperties":false}},"required":["leads","stages","pagination","filters"],"additionalProperties":false},"links":{"type":"object","properties":{"self":{"type":"string"},"openapi":{"type":"string","const":"/api/v1/openapi"}},"required":["self","openapi"],"additionalProperties":false}},"required":["apiVersion","requestId","localOnly","databaseBacked","productionWrites","data","links"],"additionalProperties":false},"AdmissionsApiCreateLeadPreviewResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"apiVersion":{"type":"string","const":"v1"},"requestId":{"type":"string"},"localOnly":{"type":"boolean","const":true},"databaseBacked":{"type":"boolean","const":false},"productionWrites":{"type":"boolean","const":false},"data":{"type":"object","properties":{"accepted":{"type":"boolean","const":false},"dryRun":{"type":"boolean","const":true},"wouldCreateLead":{"type":"boolean","const":false},"writeAccepted":{"type":"boolean","const":false},"normalizedLead":{"type":"object","properties":{"legalName":{"type":"string","minLength":2,"maxLength":120},"preferredName":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"null"}]},"email":{"type":"string","maxLength":160,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":7,"maxLength":40},"source":{"type":"string","minLength":2,"maxLength":80},"campaign":{"type":"string","minLength":2,"maxLength":120},"program":{"type":"string","minLength":2,"maxLength":120},"campus":{"type":"string","minLength":2,"maxLength":120},"startDateLabel":{"type":"string","minLength":2,"maxLength":80},"assignedRep":{"type":"string","minLength":2,"maxLength":120},"consentChannels":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"string","enum":["email","sms","phone"]}},"consentWording":{"type":"string","minLength":20,"maxLength":500},"idempotencyKey":{"type":"string","minLength":8,"maxLength":120},"dryRun":{"default":true,"type":"boolean","const":true},"displayName":{"type":"string"},"stageId":{"type":"string","const":"new"},"duplicateRisk":{"type":"string","enum":["none","review","high"]}},"required":["legalName","email","phone","source","program","campus","consentChannels","consentWording","dryRun","displayName","stageId","duplicateRisk"],"additionalProperties":false},"proofBoundary":{"type":"string"}},"required":["accepted","dryRun","wouldCreateLead","writeAccepted","normalizedLead","proofBoundary"],"additionalProperties":false},"links":{"type":"object","properties":{"self":{"type":"string"},"openapi":{"type":"string","const":"/api/v1/openapi"}},"required":["self","openapi"],"additionalProperties":false}},"required":["apiVersion","requestId","localOnly","databaseBacked","productionWrites","data","links"],"additionalProperties":false},"AdmissionsApiStagePreviewResponse":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"apiVersion":{"type":"string","const":"v1"},"requestId":{"type":"string"},"localOnly":{"type":"boolean","const":true},"databaseBacked":{"type":"boolean","const":false},"productionWrites":{"type":"boolean","const":false},"data":{"type":"object","properties":{"leadId":{"type":"string"},"targetStageId":{"type":"string","enum":["new","contacted","appointment-set","toured","applied","accepted","agreement-sent","enrolled","started","lost"]},"allowed":{"type":"boolean"},"missingRequiredFields":{"type":"array","items":{"type":"string","enum":["legalName","email","phone","consent","appointmentAt","tourOutcome","applicationSubmittedAt","acceptanceDecisionAt","agreementSentAt","enrollmentConfirmedAt","startDate","lostReason"]}},"proofOnly":{"type":"boolean","const":true},"mutationHandler":{"type":"null"},"writeAccepted":{"type":"boolean","const":false},"databaseBacked":{"type":"boolean","const":false},"proofBoundary":{"type":"string"}},"required":["leadId","targetStageId","allowed","missingRequiredFields","proofOnly","mutationHandler","writeAccepted","databaseBacked","proofBoundary"],"additionalProperties":false},"links":{"type":"object","properties":{"self":{"type":"string"},"openapi":{"type":"string","const":"/api/v1/openapi"}},"required":["self","openapi"],"additionalProperties":false}},"required":["apiVersion","requestId","localOnly","databaseBacked","productionWrites","data","links"],"additionalProperties":false},"AdmissionsApiErrorEnvelope":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["ADMISSIONS_API_PROOF_ONLY","ADMISSIONS_LEAD_NOT_FOUND","ADMISSIONS_STAGE_BLOCKED","ADMISSIONS_VALIDATION_FAILED"]},"message":{"type":"string"},"request_id":{"type":"string"},"details":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message","request_id","details"],"additionalProperties":false},"localOnly":{"type":"boolean","const":true},"databaseBacked":{"type":"boolean","const":false},"productionWrites":{"type":"boolean","const":false}},"required":["error","localOnly","databaseBacked","productionWrites"],"additionalProperties":false}}},"x-local-proof":true,"x-production-writes":false}