{"openapi":"3.1.0","info":{"title":"Credum / Comparazona public AI-agent intake","version":"0.1.0","description":"Public, unauthenticated AI-agent endpoints. They validate and prepare a one-hour short review link only; Redis stores an encrypted envelope, but no Application row is created and no lender is pinged until the user confirms on Credum/Comparazona.","termsOfService":"https://comparazona.es/terminos-condiciones/"},"externalDocs":{"description":"Human-readable integration and safety guide","url":"https://app.comparazona.es/for-ai-agents"},"servers":[{"url":"https://app.comparazona.es"}],"paths":{"/api/agent/fields":{"get":{"operationId":"getAgentFields","summary":"Get country-specific fields, automatic amount limits, and higher-amount alternatives.","parameters":[{"name":"country","in":"query","required":true,"schema":{"type":"string","enum":["MX","ES"]}}],"responses":{"200":{"description":"Field catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentFieldCatalog"}}}}}}},"/api/agent/validate":{"post":{"operationId":"validateAgentApplication","summary":"Validate without storing PII; above-limit errors link to the country's alternative-offers wall.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentApplicationRequest"}}}},"responses":{"200":{"description":"Complete or validation result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentValidationResult"}}}},"400":{"description":"Bad request"},"429":{"description":"Rate limited"}}}},"/api/agent/review-link":{"post":{"operationId":"createAgentReviewLink","summary":"Create a one-hour short review URL backed by an encrypted Redis envelope. No DB Application is created yet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentApplicationRequest"}}}},"responses":{"200":{"description":"Review URL created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentReviewLinkResponse"}}}},"422":{"description":"Application incomplete or invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentValidationResult"}}}},"429":{"description":"Rate limited"}}}}},"components":{"schemas":{"AgentFieldCatalog":{"type":"object","required":["country","currency","locale","amountRange","higherAmountAlternatives","fields","agentInstructions"],"additionalProperties":true,"properties":{"country":{"type":"string","enum":["MX","ES"]},"currency":{"type":"string","enum":["MXN","EUR"]},"locale":{"type":"string"},"amountRange":{"type":"object","required":["min","max"],"properties":{"min":{"type":"number"},"max":{"type":"number"}}},"higherAmountAlternatives":{"type":"object","required":["message","url","linkLabel"],"properties":{"message":{"type":"string"},"url":{"type":"string","format":"uri"},"linkLabel":{"type":"string"}}},"fields":{"type":"array","items":{"type":"object","additionalProperties":true}},"agentInstructions":{"type":"object","additionalProperties":true}}},"AgentValidationResult":{"type":"object","required":["status","canCreateReviewLink","country"],"additionalProperties":true,"properties":{"status":{"type":"string","enum":["complete","incomplete","validation_error"]},"canCreateReviewLink":{"type":"boolean"},"country":{"type":"string","enum":["MX","ES"]},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}},"missingConditionalFields":{"type":"array","items":{"type":"object","additionalProperties":true}},"eligibleOfferCount":{"type":"integer","minimum":0}}},"AgentReviewLinkResponse":{"type":"object","required":["status","reviewUrl","expiresInSeconds","country","eligibleOfferCount"],"additionalProperties":false,"properties":{"status":{"type":"string","const":"review_link_created"},"reviewUrl":{"type":"string","format":"uri"},"expiresInSeconds":{"type":"integer","const":3600},"country":{"type":"string","enum":["MX","ES"]},"eligibleOfferCount":{"type":"integer","minimum":0}}},"AgentApplicationRequest":{"type":"object","required":["country","applicant"],"additionalProperties":false,"properties":{"country":{"type":"string","enum":["MX","ES"]},"applicant":{"type":"object","description":"Canonical country field values from /api/agent/fields. Use amount, email, phone, birthDate, etc. The server returns field-level errors for missing/invalid values.","additionalProperties":true},"agentSource":{"type":"object","additionalProperties":false,"properties":{"declaredName":{"type":"string","maxLength":80},"declaredUrl":{"type":"string","format":"uri","maxLength":500}}}}}}},"x-agent-rules":{"finalConsentOnCredum":true,"noLenderPingBeforeConfirmation":true,"mustNotImplyApprovalRateOrAmount":true,"noOutboundDeliveryFromUnconfirmedDraft":true}}