{"openapi":"3.1.0","info":{"title":"LPDATOS API","version":"1.0.0","description":"API pública versionada para solicitudes ARCOP, consentimientos, supresiones y registro de proveedores de LPDATOS.CL."},"servers":[{"url":"/","description":"Aplicación LPDATOS.CL"}],"tags":[{"name":"Solicitudes ARCOP","description":"Recepción y seguimiento de solicitudes de titulares."},{"name":"Consentimientos","description":"Registro y retiro de consentimientos de contacto."},{"name":"Supresiones","description":"Estado vigente de las supresiones de contacto."},{"name":"Proveedores","description":"Registro de proveedores y alertas de cumplimiento."}],"paths":{"/api/v1/openapi.json":{"get":{"operationId":"getOpenApiDocument","summary":"Obtener el documento OpenAPI","description":"Documento público de contrato de la API v1.","responses":{"200":{"description":"Documento OpenAPI 3.1.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/v1/organizations/{organization}/requests":{"get":{"operationId":"listDataSubjectRequests","tags":["Solicitudes ARCOP"],"summary":"Listar solicitudes ARCOP","x-required-scope":"requests:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}},{"name":"requestType","in":"query","schema":{"type":"string","enum":["access","rectification","erasure","objection","portability"]}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","in_progress","completed","rejected"]}},{"name":"slaState","in":"query","schema":{"type":"string","enum":["overdue","due_soon","on_time","completed_on_time","completed_late"]}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"perPage","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Solicitudes de la organización.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSubjectRequestCollection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"operationId":"createDataSubjectRequest","tags":["Solicitudes ARCOP"],"summary":"Crear una solicitud ARCOP","x-required-scope":"requests:create","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDataSubjectRequest"}}}},"responses":{"201":{"description":"Solicitud creada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSubjectRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/api/v1/organizations/{organization}/requests/{request}":{"get":{"operationId":"getDataSubjectRequest","tags":["Solicitudes ARCOP"],"summary":"Consultar el estado de una solicitud ARCOP","x-required-scope":"requests:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}},{"name":"request","in":"path","required":true,"description":"UUID de la solicitud.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Estado y reloj SLA de la solicitud.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSubjectRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/organizations/{organization}/consents":{"get":{"operationId":"listOutreachConsents","tags":["Consentimientos"],"summary":"Listar consentimientos de contacto","x-required-scope":"consents:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}},{"name":"channel","in":"query","schema":{"type":"string","enum":["whatsapp","email"]}},{"name":"given","in":"query","schema":{"type":"boolean"}},{"name":"search","in":"query","schema":{"type":"string","maxLength":512}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"perPage","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Consentimientos de la organización.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachConsentCollection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"operationId":"createOutreachConsent","tags":["Consentimientos"],"summary":"Registrar un consentimiento de contacto","x-required-scope":"consents:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOutreachConsent"}}}},"responses":{"201":{"description":"Consentimiento y recibo inmutable registrados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRegistration"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/ValidationError"}}}},"/api/v1/organizations/{organization}/consents/{consent}":{"delete":{"operationId":"revokeOutreachConsent","tags":["Consentimientos"],"summary":"Retirar un consentimiento","x-required-scope":"consents:write","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}},{"name":"consent","in":"path","required":true,"description":"ID numérico del consentimiento vigente.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Consentimiento retirado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachConsent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/api/v1/organizations/{organization}/suppressions":{"get":{"operationId":"listSuppressions","tags":["Supresiones"],"summary":"Listar supresiones vigentes","x-required-scope":"suppressions:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}},{"name":"channel","in":"query","schema":{"type":"string","enum":["whatsapp","email"]}},{"name":"search","in":"query","schema":{"type":"string","maxLength":512}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"perPage","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":100}}],"responses":{"200":{"description":"Última supresión por titular, canal y finalidad.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionCollection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/organizations/{organization}/vendors":{"get":{"operationId":"listVendors","tags":["Proveedores"],"summary":"Listar proveedores y encargados","x-required-scope":"inventory:read","security":[{"bearerAuth":[]}],"parameters":[{"name":"organization","in":"path","required":true,"description":"Identificador Hub (tenant) o UUID de la organización.","schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["active","terminated"]}},{"name":"role","in":"query","schema":{"type":"string","enum":["processor","subprocessor","recipient"]}},{"name":"search","in":"query","schema":{"type":"string","maxLength":255}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"perPage","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Proveedores de la organización con alertas de cumplimiento.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorCollection"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"lpd_ opaque token","description":"Credencial de cliente API emitida para una organización, con prefijo lpd_, permisos y expiración opcional."}},"responses":{"Unauthorized":{"description":"Falta la credencial, no es válida, expiró, fue revocada o la organización está inactiva.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"La credencial no tiene el permiso requerido para la operación.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"NotFound":{"description":"El recurso no existe en la organización indicada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"ValidationError":{"description":"La solicitud no cumple las reglas de validación.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"schemas":{"ErrorResponse":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}}}}},"PaginationMetadata":{"type":"object","required":["total","perPage","currentPage","lastPage","firstPage","firstPageUrl","lastPageUrl","nextPageUrl","previousPageUrl"],"properties":{"total":{"type":"integer","minimum":0},"perPage":{"type":"integer","minimum":1},"currentPage":{"type":"integer","minimum":1},"lastPage":{"type":"integer","minimum":1},"firstPage":{"type":"integer","minimum":1},"firstPageUrl":{"type":"string"},"lastPageUrl":{"type":"string"},"nextPageUrl":{"type":["string","null"]},"previousPageUrl":{"type":["string","null"]}}},"DataSubjectRequest":{"type":"object","required":["id","uuid","requestType","status","source","subjectType","subjectValueHash","affectedCount","notes","dueAt","slaState","escalated","extensionRequestedAt","extensionReason","identityPending","identityVerifiedAt","identityVerificationMethod","resolvedAt","createdAt","updatedAt"],"properties":{"id":{"type":"integer"},"uuid":{"type":"string","format":"uuid"},"requestType":{"type":"string","enum":["access","rectification","erasure","objection","portability"]},"status":{"type":"string","enum":["pending","in_progress","completed","rejected"]},"source":{"type":"string","enum":["admin","public","api"]},"subjectType":{"type":"string","enum":["email","rut","phone","custom"]},"subjectValueHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"affectedCount":{"type":"integer","minimum":0},"notes":{"type":["string","null"]},"dueAt":{"type":["string","null"],"format":"date-time"},"slaState":{"type":"string","enum":["overdue","due_soon","on_time","completed_on_time","completed_late"]},"escalated":{"type":"boolean"},"extensionRequestedAt":{"type":["string","null"],"format":"date-time"},"extensionReason":{"type":["string","null"]},"identityPending":{"type":"boolean"},"identityVerifiedAt":{"type":["string","null"],"format":"date-time"},"identityVerificationMethod":{"type":["string","null"],"enum":["otp","manual","channel",null]},"resolvedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreateDataSubjectRequest":{"type":"object","required":["requestType","subjectType","subjectValue"],"properties":{"requestType":{"type":"string","enum":["access","rectification","erasure","objection","portability"]},"subjectType":{"type":"string","enum":["email","rut","phone","custom"]},"subjectValue":{"type":"string","minLength":1,"maxLength":512},"notes":{"type":["string","null"],"maxLength":2000}}},"DataSubjectRequestCollection":{"type":"object","required":["data","metadata"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DataSubjectRequest"}},"metadata":{"$ref":"#/components/schemas/PaginationMetadata"}}},"OutreachConsent":{"type":"object","required":["id","subjectType","subjectValue","channel","given","source","consentedAt","revokedAt","updatedAt"],"properties":{"id":{"type":"integer"},"subjectType":{"type":"string","enum":["email","rut","phone","custom"]},"subjectValue":{"type":"string"},"channel":{"type":"string","enum":["whatsapp","email"]},"given":{"type":"boolean"},"source":{"type":["string","null"],"enum":["form","manual","import","api",null]},"consentedAt":{"type":["string","null"],"format":"date-time"},"revokedAt":{"type":["string","null"],"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreateOutreachConsent":{"type":"object","required":["subjectType","subjectValue","channel","given"],"properties":{"subjectType":{"type":"string","enum":["email","rut","phone","custom"]},"subjectValue":{"type":"string","minLength":1,"maxLength":512},"channel":{"type":"string","enum":["whatsapp","email"]},"given":{"type":"boolean"},"purposeId":{"type":"integer","minimum":1}}},"OutreachConsentCollection":{"type":"object","required":["data","metadata"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OutreachConsent"}},"metadata":{"$ref":"#/components/schemas/PaginationMetadata"}}},"ConsentReceiptBase":{"type":"object","required":["id","subjectDisplay","purposeId","channel","given","noticeVersion","parentReceiptId","createdAt"],"properties":{"id":{"type":"integer"},"subjectDisplay":{"type":"string"},"purposeId":{"type":["integer","null"]},"channel":{"type":"string","enum":["whatsapp","email"]},"given":{"type":"boolean"},"noticeVersion":{"type":"string"},"parentReceiptId":{"type":["integer","null"]},"createdAt":{"type":"string","format":"date-time"}}},"ConsentReceiptEvidence":{"allOf":[{"$ref":"#/components/schemas/ConsentReceiptBase"},{"type":"object","required":["consentTextSnapshot","context"],"properties":{"consentTextSnapshot":{"type":"string"},"context":{"type":["object","null"],"properties":{"ip":{"type":"string"},"userAgent":{"type":"string"}}}}}]},"ConsentRegistration":{"allOf":[{"$ref":"#/components/schemas/OutreachConsent"},{"type":"object","required":["receipt","preferenceUrl"],"properties":{"receipt":{"$ref":"#/components/schemas/ConsentReceiptEvidence"},"preferenceUrl":{"type":["string","null"],"format":"uri"}}}]},"ProcessingPurpose":{"type":"object","required":["id","name","description","legalBasisId","active","updatedAt"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"legalBasisId":{"type":"integer"},"active":{"type":"boolean"},"updatedAt":{"type":"string","format":"date-time"}}},"SuppressionEntry":{"allOf":[{"$ref":"#/components/schemas/ConsentReceiptBase"},{"type":"object","required":["subjectIdentifierHash","purpose"],"properties":{"subjectIdentifierHash":{"type":"string","pattern":"^[0-9a-f]{64}$"},"purpose":{"oneOf":[{"$ref":"#/components/schemas/ProcessingPurpose"},{"type":"null"}]}}}]},"SuppressionCollection":{"type":"object","required":["data","metadata"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SuppressionEntry"}},"metadata":{"$ref":"#/components/schemas/PaginationMetadata"}}},"ProcessingActivityReference":{"type":"object","required":["id","name","ownerName","status"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"ownerName":{"type":["string","null"]},"status":{"type":"string"}}},"VendorAlerts":{"type":"object","required":["dpaUnsigned","contractExpired","contractExpiringSoon","internationalTransferWithoutMechanism","hasAlerts"],"properties":{"dpaUnsigned":{"type":"boolean"},"contractExpired":{"type":"boolean"},"contractExpiringSoon":{"type":"boolean"},"internationalTransferWithoutMechanism":{"type":"boolean"},"hasAlerts":{"type":"boolean"}}},"Vendor":{"type":"object","required":["id","organizationId","name","rut","role","contactEmail","country","processingDescription","dpaSigned","dpaDocumentPath","subprocessorList","securityMeasures","transferMechanism","transferDetails","riskLevel","status","dataCategories","processingActivityCount","dpaDate","contractExpiryDate","internationalTransfer","alerts","createdAt","updatedAt","processingActivities"],"properties":{"id":{"type":"integer"},"organizationId":{"type":"integer"},"name":{"type":"string"},"rut":{"type":["string","null"]},"role":{"type":"string","enum":["processor","subprocessor","recipient"]},"contactEmail":{"type":["string","null"],"format":"email"},"country":{"type":"string"},"processingDescription":{"type":"string"},"dpaSigned":{"type":"boolean"},"dpaDocumentPath":{"type":["string","null"]},"subprocessorList":{"type":["string","null"]},"securityMeasures":{"type":["string","null"]},"transferMechanism":{"type":["string","null"],"enum":["adequacy","sccs","bcrs","other",null]},"transferDetails":{"type":["string","null"]},"riskLevel":{"type":"string","enum":["low","medium","high"]},"status":{"type":"string","enum":["active","terminated"]},"dataCategories":{"type":"array","items":{"type":"string"}},"processingActivityCount":{"type":"integer","minimum":0},"dpaDate":{"type":["string","null"],"format":"date"},"contractExpiryDate":{"type":["string","null"],"format":"date"},"internationalTransfer":{"type":"boolean"},"alerts":{"$ref":"#/components/schemas/VendorAlerts"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"processingActivities":{"type":"array","items":{"$ref":"#/components/schemas/ProcessingActivityReference"}}}},"VendorCollection":{"type":"object","required":["data","metadata"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Vendor"}},"metadata":{"$ref":"#/components/schemas/PaginationMetadata"}}}}}}