{"openapi":"3.1.0","info":{"title":"Delta Central API","version":"0.1.0","description":"Uma autenticação e um contrato para integrações autorizadas."},"servers":[{"url":"https://api.reliancecrm.com.br"}],"paths":{"/v1/comissoes/bevi/consultas":{"post":{"operationId":"comissoes_bevi_consultar_comissoes","tags":["comissoes"],"summary":"Consultar comissões","description":"Consulta somente leitura com recuperação automática da sessão autorizada.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["banco","convenio","prazo"],"properties":{"banco":{"type":"string","maxLength":100},"convenio":{"type":"string","maxLength":100},"prazo":{"type":"integer","minimum":1,"maximum":144}}},"example":{"banco":"BMG","convenio":"SPPREV","prazo":96}}}},"x-integration-id":"comissoes_bevi","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Resultado da operação autenticada","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"comissoes_bevi"},"operation":{"const":"consultar_comissoes"},"data":{"type":"object","additionalProperties":true,"description":"Payload de domínio; a Central acrescenta o envelope público."},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Sem autorização","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"422":{"description":"Entrada ou retorno do portal não validado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Acesso ainda indisponível após recuperação","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/comissoes/bevi/status":{"get":{"operationId":"comissoes_bevi_consultar_status","tags":["comissoes"],"summary":"Consultar acesso da Bevi","description":"Consulta somente leitura com recuperação automática da sessão autorizada.","x-integration-id":"comissoes_bevi","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Resultado da operação autenticada","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"comissoes_bevi"},"operation":{"const":"consultar_status"},"data":{"type":"object","additionalProperties":true,"description":"Payload de domínio; a Central acrescenta o envelope público."},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Sem autorização","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"422":{"description":"Entrada ou retorno do portal não validado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Acesso ainda indisponível após recuperação","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigx/convenios":{"get":{"operationId":"consigx_listar_convenios","tags":["margem"],"summary":"Lista de convênios ConsigX","description":"Lista os perfis de convênio conhecidos e seus status sem consultar o portal.","parameters":[{"$ref":"#/components/parameters/TenantId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"}],"x-integration-id":"consigx","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Perfis","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consigx"},"operation":{"const":"listar_convenios"},"data":{"type":"object","required":["convenios"],"properties":{"convenios":{"type":"array","items":{"type":"object"}}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigx/consultas":{"post":{"operationId":"consigx_consultar_margem","tags":["margem"],"summary":"Consulta de margem por convênio","description":"Consulta CPF no convênio explicitamente selecionado.","parameters":[{"$ref":"#/components/parameters/TenantId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/consigx_QueryRequest"}}}},"x-integration-id":"consigx","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Payload de domínio sem envelope público","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consigx"},"operation":{"const":"consultar_margem"},"data":{"$ref":"#/components/schemas/consigx_MarginResult"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"502":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigx/lotes":{"post":{"operationId":"consigx_criar_lote_margem","tags":["margem"],"summary":"Criação de lote de margens","description":"Cria um lote tenant-scoped para consultar CPFs no convênio selecionado.","parameters":[{"$ref":"#/components/parameters/TenantId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/consigx_BatchRequest"}}}},"x-integration-id":"consigx","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito; id no primeiro nível para troca pela Central","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consigx"},"operation":{"const":"criar_lote_margem"},"data":{"$ref":"#/components/schemas/consigx_BatchAccepted"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigx/lotes/{id}":{"get":{"operationId":"consigx_obter_lote_margem","tags":["margem"],"summary":"Consulta de lote de margens","description":"Obtém progresso e resultados do lote usando identificador opaco da Central.","parameters":[{"$ref":"#/components/parameters/TenantId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32}}],"x-integration-id":"consigx","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Estado do lote","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consigx"},"operation":{"const":"obter_lote_margem"},"data":{"$ref":"#/components/schemas/consigx_BatchState"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/monitor-diario/sync":{"post":{"operationId":"monitor_diario_crm_monitor_daily_sync","tags":["crm"],"summary":"Sincronizar alterações diárias","description":"Inclui no CRM os servidores ativos alterados no Diário Oficial da data informada.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/monitor_diario_crm_DailySyncRequest"}}}},"x-integration-id":"monitor_diario_crm","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Replay idempotente","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"monitor_diario_crm"},"operation":{"const":"monitor_daily_sync"},"data":{"$ref":"#/components/schemas/monitor_diario_crm_DailySyncResponse"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"201":{"description":"Execução criada e concluída","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"monitor_diario_crm"},"operation":{"const":"monitor_daily_sync"},"data":{"$ref":"#/components/schemas/monitor_diario_crm_DailySyncResponse"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Conflito de idempotência","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/monitor-diario/sync/{runId}":{"get":{"operationId":"monitor_diario_crm_monitor_daily_sync_status","tags":["crm"],"summary":"Consultar execução diária","description":"Retorna o resultado sanitizado de uma execução diária para o mesmo tenant.","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string","maxLength":128}}],"x-integration-id":"monitor_diario_crm","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Resultado sanitizado da execução","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"monitor_diario_crm"},"operation":{"const":"monitor_daily_sync_status"},"data":{"$ref":"#/components/schemas/monitor_diario_crm_DailySyncResponse"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Execução não encontrada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/municipal/consultas":{"post":{"operationId":"margem_ipm_ribeirao_preto_consultar_margem","tags":["margem"],"summary":"Consultar margem","description":"Consulta margem por CPF ou matricula com sessao reutilizada.","parameters":[{"$ref":"#/components/parameters/DeltaTenantId"},{"$ref":"#/components/parameters/DeltaRequestId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","const":"consultar_margem"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_Query"}}}},"x-integration-id":"margem_ipm_ribeirao_preto","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Resultado normalizado","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"margem_ipm_ribeirao_preto"},"operation":{"const":"consultar_margem"},"data":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_MarginResult"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/municipal/lotes":{"post":{"operationId":"margem_ipm_ribeirao_preto_criar_lote_margem","tags":["margem"],"summary":"Criar lote de margem","description":"Cria lote assincrono, deduplicado, retomavel e idempotente.","parameters":[{"$ref":"#/components/parameters/DeltaTenantId"},{"$ref":"#/components/parameters/DeltaRequestId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","const":"criar_lote_margem"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["consultas"],"properties":{"consultas":{"type":"array","minItems":1,"maxItems":10000,"items":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_Query"}}}}}}},"x-integration-id":"margem_ipm_ribeirao_preto","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote persistido e aceito","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"margem_ipm_ribeirao_preto"},"operation":{"const":"criar_lote_margem"},"data":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_Job"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/municipal/lotes/{id}":{"get":{"operationId":"margem_ipm_ribeirao_preto_consultar_lote_margem","tags":["margem"],"summary":"Consultar lote","description":"Consulta progresso e contadores de um lote do mesmo tenant.","parameters":[{"$ref":"#/components/parameters/JobId"},{"$ref":"#/components/parameters/DeltaTenantId"},{"$ref":"#/components/parameters/DeltaRequestId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","const":"consultar_lote_margem"}}],"x-integration-id":"margem_ipm_ribeirao_preto","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Estado atual do lote","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"margem_ipm_ribeirao_preto"},"operation":{"const":"consultar_lote_margem"},"data":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_Job"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/municipal/lotes/resultados/{id}":{"get":{"operationId":"margem_ipm_ribeirao_preto_obter_resultados_lote","tags":["margem"],"summary":"Obter resultados do lote","description":"Retorna resultados paginados exclusivamente para o tenant do lote.","parameters":[{"$ref":"#/components/parameters/JobId"},{"$ref":"#/components/parameters/DeltaTenantId"},{"$ref":"#/components/parameters/DeltaRequestId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","const":"obter_resultados_lote"}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"x-integration-id":"margem_ipm_ribeirao_preto","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Pagina de resultados do tenant","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"margem_ipm_ribeirao_preto"},"operation":{"const":"obter_resultados_lote"},"data":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_ResultsPage"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/apconsig-amapa/consultas":{"post":{"operationId":"apconsig_amapa_consultar_margem","tags":["margem"],"summary":"Consultar margem","description":"Consulta os três baldes de margem por CPF.","parameters":[{"$ref":"#/components/parameters/TenantId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/apconsig_amapa_Query"}}}},"x-integration-id":"apconsig_amapa","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Margem normalizada"},"400":{"description":"CPF inválido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Não autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite da fonte","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Fonte indisponível","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/apconsig-amapa/lotes":{"post":{"operationId":"apconsig_amapa_criar_lote_margem","tags":["margem"],"summary":"Criar lote de margens","description":"Cria lote tenant-scoped de consultas por CPF.","parameters":[{"$ref":"#/components/parameters/TenantId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/apconsig_amapa_Batch"}}}},"x-integration-id":"apconsig_amapa","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito"},"400":{"description":"Entrada inválida","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Não autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/apconsig-amapa/lotes/{id}":{"get":{"operationId":"apconsig_amapa_obter_lote_margem","tags":["margem"],"summary":"Obter lote de margens","description":"Obtém progresso e resultados de lote tenant-scoped.","parameters":[{"$ref":"#/components/parameters/TenantId"},{"$ref":"#/components/parameters/ProviderCredential"},{"$ref":"#/components/parameters/ProviderCredentialEncoding"},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32}}],"x-integration-id":"apconsig_amapa","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Estado do lote"},"401":{"description":"Não autorizado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/pessoas/consulta-pessoas/buscas-nominais":{"post":{"operationId":"consulta_pessoas_buscar_candidatos_por_nome","tags":["pessoas"],"summary":"Buscar candidatos por nome","description":"Retorna todos os candidatos associados ao nome completo.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/consulta_pessoas_NominalRequest"},"examples":{"pessoa":{"value":{"nome":"PESSOA DE EXEMPLO"}}}}}},"x-integration-id":"consulta_pessoas","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Busca concluída; a lista pode estar vazia ou conter vários candidatos","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consulta_pessoas"},"operation":{"const":"buscar_candidatos_por_nome"},"data":{"$ref":"#/components/schemas/consulta_pessoas_NominalResponse"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"502":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/pessoas/consulta-pessoas/lotes-nominais":{"post":{"operationId":"consulta_pessoas_criar_lote_nominal","tags":["pessoas"],"summary":"Criar lote nominal","description":"Cria lote assíncrono deduplicado com checkpoint cifrado.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["nomes"],"properties":{"nomes":{"type":"array","minItems":1,"maxItems":5000,"items":{"type":"string","minLength":5,"maxLength":180}}}},"examples":{"lote":{"value":{"nomes":["PESSOA DE EXEMPLO","OUTRA PESSOA DE EXEMPLO"]}}}}}},"x-integration-id":"consulta_pessoas","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consulta_pessoas"},"operation":{"const":"criar_lote_nominal"},"data":{"$ref":"#/components/schemas/consulta_pessoas_BatchAccepted"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/pessoas/consulta-pessoas/cadastros":{"post":{"operationId":"consulta_pessoas_consultar_cadastro_por_cpf","tags":["pessoas"],"summary":"Consultar cadastro por CPF","description":"Consulta cadastro e telefones do CPF autorizado; consome somente credito do portal, sem debito adicional da Central.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/consulta_pessoas_FullRequest"},"examples":{"confirmada":{"value":{"cpf":"000.000.000-00","confirmarConsumo":true}}}}}},"x-integration-id":"consulta_pessoas","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Cadastro encontrado ou resposta reutilizada do cache","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consulta_pessoas"},"operation":{"const":"consultar_cadastro_por_cpf"},"data":{"$ref":"#/components/schemas/consulta_pessoas_FullResponse"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"502":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/pessoas/consulta-pessoas/lotes-cadastrais":{"post":{"operationId":"consulta_pessoas_criar_lote_cadastral","tags":["pessoas"],"summary":"Criar lote cadastral","description":"Cria lote de consultas com consumo confirmado.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["cpfs","confirmarConsumo"],"properties":{"cpfs":{"type":"array","minItems":1,"maxItems":5000,"items":{"type":"string","pattern":"^[0-9.\\/-]{11,14}$"}},"confirmarConsumo":{"type":"boolean","const":true}}},"examples":{"loteConfirmado":{"value":{"cpfs":["000.000.000-00"],"confirmarConsumo":true}}}}}},"x-integration-id":"consulta_pessoas","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consulta_pessoas"},"operation":{"const":"criar_lote_cadastral"},"data":{"$ref":"#/components/schemas/consulta_pessoas_BatchAccepted"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/pessoas/consulta-pessoas/lotes/{id}":{"get":{"operationId":"consulta_pessoas_consultar_lote","tags":["pessoas"],"summary":"Consultar lote","description":"Retorna progresso e resultados do lote solicitado.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"consulta_pessoas","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Estado atual do lote","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"consulta_pessoas"},"operation":{"const":"consultar_lote"},"data":{"$ref":"#/components/schemas/consulta_pessoas_BatchStatus"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Falha.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/rolandia/margem/consulta":{"post":{"operationId":"rolandia_margem_consultar_matricula","tags":["margem"],"summary":"Consultar CPF e margem por matrícula","description":"Consulta uma matrícula de Rolândia e devolve CPF, cadastro e margem de empréstimo por competência.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matricula"],"properties":{"matricula":{"type":"string","pattern":"^\\d{1,20}$"}}}}}},"x-integration-id":"rolandia_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Dados de cadastro e margem","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"rolandia_margem"},"operation":{"const":"consultar_matricula"},"data":{"type":"object","required":["matricula","cpf","competencia","margem_emprestimo_disponivel"],"properties":{"matricula":{"type":"string"},"cpf":{"type":"string","description":"CPF completo; dado sensível"},"competencia":{"type":"integer"},"margem_emprestimo_total":{"type":"number"},"margem_emprestimo_disponivel":{"type":"number"},"margens":{"type":"array","items":{"type":"object"}}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Matrícula não encontrada","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Portal ou autenticação indisponível","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/rolandia/margem/lotes":{"post":{"operationId":"rolandia_margem_criar_lote","tags":["margem"],"summary":"Criar lote de matrículas","description":"Cria fila serializada de até 500 matrículas com checkpoint privado e sem repetição cega.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matriculas"],"properties":{"matriculas":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","pattern":"^\\d{1,20}$"}}}}}}},"x-integration-id":"rolandia_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote criado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/rolandia/margem/lotes/{id}":{"get":{"operationId":"rolandia_margem_obter_lote","tags":["margem"],"summary":"Obter resultado de lote","description":"Mostra progresso e resultados da fila pertencente ao tenant autenticado.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"rolandia_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Lote do tenant autenticado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado para o tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/sorriso/margem/consulta":{"post":{"operationId":"sorriso_margem_consultar_matricula","tags":["margem"],"summary":"Consulta de Margem Sorriso","description":"Consulta CPF e margens de empréstimo e cartão consignado por matrícula, sem margem de saque.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matricula"],"properties":{"matricula":{"type":"string","pattern":"^\\d{1,10}$"}}}}}},"x-integration-id":"sorriso_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"CPF e margens da matrícula, sem margem de saque","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"sorriso_margem"},"operation":{"const":"consultar_matricula"},"data":{"type":"object","required":["matricula","cpf","margem_bruta","margem_liquida","margem_bruta_emprestimo","margem_liquida_emprestimo","margem_bruta_cartao_consignado","margem_liquida_cartao_consignado"],"properties":{"matricula":{"type":"string"},"cpf":{"type":"string","description":"CPF completo; dado sensível"},"nome":{"type":"string"},"convenio":{"type":"string"},"margem_bruta":{"type":"number","nullable":true,"description":"Alias da margem bruta de empréstimo"},"margem_liquida":{"type":"number","nullable":true,"description":"Alias da margem disponível de empréstimo"},"margem_disponivel":{"type":"number","nullable":true},"margem_bruta_emprestimo":{"type":"number","nullable":true},"margem_liquida_emprestimo":{"type":"number","nullable":true},"margem_bruta_cartao_consignado":{"type":"number","nullable":true},"margem_liquida_cartao_consignado":{"type":"number","nullable":true},"margens":{"type":"array","items":{"type":"object"},"description":"Apenas empréstimo e cartão consignado"}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Matrícula sem resultado no portal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Fonte ou autenticação indisponível","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/sorriso/margem/lotes":{"post":{"operationId":"sorriso_margem_criar_lote","tags":["margem"],"summary":"Criar lote de Sorriso","description":"Cria fila privada de até 500 matrículas únicas, com checkpoint e consulta serializada.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matriculas"],"properties":{"matriculas":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","pattern":"^\\d{1,10}$"}}}}}}},"x-integration-id":"sorriso_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote criado; o id será opaco na Central"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/sorriso/margem/lotes/{id}":{"get":{"operationId":"sorriso_margem_obter_lote","tags":["margem"],"summary":"Obter lote de Sorriso","description":"Lê progresso e resultados do lote do tenant autenticado.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"sorriso_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Lote do tenant autenticado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado para o tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/sorriso/margem/lotes/{id}/retomar":{"post":{"operationId":"sorriso_margem_retomar_lote","tags":["margem"],"summary":"Retomar lote pausado de Sorriso","description":"Retoma somente matrículas pendentes; consultas incertas permanecem sem repetição.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"sorriso_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote retomado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Lote não está pausado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/morrinhos/margem/consulta":{"post":{"operationId":"morrinhos_margem_consultar_matricula","tags":["margem"],"summary":"Consulta de Margem Morrinhos","description":"Consulta CPF, margem bruta e margem disponível de empréstimo por matrícula.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matricula"],"properties":{"matricula":{"type":"string","pattern":"^\\d{1,10}$"}}}}}},"x-integration-id":"morrinhos_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"CPF e margens da matrícula","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"morrinhos_margem"},"operation":{"const":"consultar_matricula"},"data":{"type":"object","required":["matricula","cpf","margem_bruta","margem_liquida","margem_disponivel"],"properties":{"matricula":{"type":"string"},"cpf":{"type":"string","description":"CPF completo; dado sensível"},"nome":{"type":"string"},"convenio":{"type":"string"},"margem_bruta":{"type":"number"},"margem_liquida":{"type":"number","description":"Mesmo valor da margem disponível no portal"},"margem_disponivel":{"type":"number"},"margens":{"type":"array","items":{"type":"object"}}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Matrícula sem resultado no portal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Fonte ou autenticação indisponível","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/morrinhos/margem/lotes":{"post":{"operationId":"morrinhos_margem_criar_lote","tags":["margem"],"summary":"Criar lote de Morrinhos","description":"Cria fila privada de até 500 matrículas únicas, com checkpoint e consulta serializada.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matriculas"],"properties":{"matriculas":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","pattern":"^\\d{1,10}$"}}}}}}},"x-integration-id":"morrinhos_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote criado; o id será opaco na Central"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/morrinhos/margem/lotes/{id}":{"get":{"operationId":"morrinhos_margem_obter_lote","tags":["margem"],"summary":"Obter lote de Morrinhos","description":"Lê progresso e resultados do lote do tenant autenticado.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"morrinhos_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Lote do tenant autenticado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado para o tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/morrinhos/margem/lotes/{id}/retomar":{"post":{"operationId":"morrinhos_margem_retomar_lote","tags":["margem"],"summary":"Retomar lote pausado de Morrinhos","description":"Retoma somente matrículas pendentes; consultas incertas permanecem sem repetição.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"morrinhos_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote retomado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Lote não está pausado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/rondon-do-para/margem/consulta":{"post":{"operationId":"rondon_para_margem_consultar_matricula","tags":["margem"],"summary":"Consulta de Margem Rondon do Pará","description":"Consulta CPF, margem bruta e margem disponível por matrícula na primeira tabela do portal.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matricula"],"properties":{"matricula":{"type":"string","pattern":"^(?:\\d{1,10}|\\d{1,9}-\\d)$"}}}}}},"x-integration-id":"rondon_para_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"CPF e margens da matrícula, sem margem de saque","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"rondon_para_margem"},"operation":{"const":"consultar_matricula"},"data":{"type":"object","required":["matricula","cpf","margem_bruta","margem_liquida","margem_bruta_emprestimo","margem_liquida_emprestimo","margem_bruta_cartao_consignado","margem_liquida_cartao_consignado"],"properties":{"matricula":{"type":"string"},"cpf":{"type":"string","description":"CPF completo; dado sensível"},"nome":{"type":"string"},"convenio":{"type":"string"},"margem_bruta":{"type":"number","nullable":true,"description":"Alias da margem bruta de empréstimo"},"margem_liquida":{"type":"number","nullable":true,"description":"Alias da margem disponível de empréstimo"},"margem_disponivel":{"type":"number","nullable":true},"margem_bruta_emprestimo":{"type":"number","nullable":true},"margem_liquida_emprestimo":{"type":"number","nullable":true},"margem_bruta_cartao_consignado":{"type":"number","nullable":true},"margem_liquida_cartao_consignado":{"type":"number","nullable":true},"margens":{"type":"array","items":{"type":"object"},"description":"Apenas empréstimo e cartão consignado"}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Matrícula sem resultado no portal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Fonte ou autenticação indisponível","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/rondon-do-para/margem/lotes":{"post":{"operationId":"rondon_para_margem_criar_lote","tags":["margem"],"summary":"Criar lote de Rondon do Pará","description":"Cria fila privada de até 500 matrículas únicas, com checkpoint e consulta serializada.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matriculas"],"properties":{"matriculas":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","pattern":"^(?:\\d{1,10}|\\d{1,9}-\\d)$"}}}}}}},"x-integration-id":"rondon_para_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote criado; o id será opaco na Central"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/rondon-do-para/margem/lotes/{id}":{"get":{"operationId":"rondon_para_margem_obter_lote","tags":["margem"],"summary":"Obter lote de Rondon do Pará","description":"Lê progresso e resultados do lote do tenant autenticado.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"rondon_para_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Lote do tenant autenticado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado para o tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/rondon-do-para/margem/lotes/{id}/retomar":{"post":{"operationId":"rondon_para_margem_retomar_lote","tags":["margem"],"summary":"Retomar lote pausado de Rondon do Pará","description":"Retoma somente matrículas pendentes; consultas incertas permanecem sem repetição.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"rondon_para_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote retomado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Lote não está pausado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/usp/margem/lotes":{"post":{"operationId":"usp_margem_criar_lote","tags":["margem"],"summary":"Criar lote de consultas USP","description":"Recebe até 500 números USP e processa um por vez com checkpoint privado.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["matriculas"],"properties":{"matriculas":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","pattern":"^[0-9]{1,20}$","description":"Valores com menos de 5 dígitos recebem zeros à esquerda até 5 dígitos."}}}}}}},"x-integration-id":"usp_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"usp_margem"},"operation":{"const":"criar_lote"},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string"},"total":{"type":"integer"}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/usp/margem/lotes/{id}":{"get":{"operationId":"usp_margem_obter_lote","tags":["margem"],"summary":"Obter resultados de lote USP","description":"Retorna progresso, resultados e estados de pausa do lote do tenant autenticado.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"usp_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Estado do lote","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"usp_margem"},"operation":{"const":"obter_lote"},"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"total":{"type":"integer"},"concluido":{"type":"integer"},"pendente":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/usp_margem_Margem"}},"errors":{"type":"array","items":{"type":"object"}}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/santana/margem/consulta":{"post":{"operationId":"santana_margem_consultar_margem","tags":["margem"],"summary":"Consultar margem Santana individual","description":"Consulta uma unica matricula com idempotencia, isolamento por tenant e bloqueio de repeticao ambigua.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["matricula"],"properties":{"matricula":{"type":"string","pattern":"^\\d{1,20}$"}}}}}},"x-integration-id":"santana_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Margem confirmada ou ausencia confirmada.","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"santana_margem"},"operation":{"const":"consultar_margem"},"data":{"oneOf":[{"$ref":"#/components/schemas/santana_margem_Resultado"},{"type":"object","required":["status","matricula"],"properties":{"status":{"type":"string","enum":["not_found"]},"matricula":{"type":"string"}}}]},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Entrada ou credencial invalida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Autenticacao interna negada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Conta da fonte vinculada a outro tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Resultado incerto que nao pode ser repetido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Sessao ou conclusao pendente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/santana/margem/lotes":{"post":{"operationId":"santana_margem_criar_lote","tags":["margem"],"summary":"Consultar CPF ou matrícula em lote","description":"Cria uma fila de consulta por um único tipo de identificador, CPF ou matrícula; requer idempotência e credencial própria do tenant.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"matriculas":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","pattern":"^\\d{1,20}$"}},"cpfs":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"string","pattern":"^[0-9.\\-\\s]{11,14}$"}}},"oneOf":[{"required":["matriculas"]},{"required":["cpfs"]}]}}}},"x-integration-id":"santana_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito para processamento.","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"santana_margem"},"operation":{"const":"criar_lote"},"data":{"$ref":"#/components/schemas/santana_margem_Lote"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Entrada ou credencial inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Autenticação interna negada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Conta da fonte vinculada a outro tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Conflito na identidade da requisição.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/santana/margem/lotes/{id}":{"get":{"operationId":"santana_margem_obter_lote","tags":["margem"],"summary":"Consultar andamento e resultados","description":"Obtém o lote autorizado e seus resultados completos; o identificador é isolado por tenant.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"santana_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Andamento e resultados autorizados.","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"santana_margem"},"operation":{"const":"obter_lote"},"data":{"$ref":"#/components/schemas/santana_margem_Lote"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Autenticação interna negada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote ausente para este tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/presidente-venceslau/margem/consulta":{"post":{"operationId":"presidente_venceslau_margem_consultar_matricula","tags":["margem"],"summary":"Consultar margem estatutária","description":"Resolve a matrícula Consignet pelo nome e prefixo da matrícula pública, valida vínculo estatutário e devolve CPF e margens.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/presidente_venceslau_margem_ConsultaInput"}}}},"x-integration-id":"presidente_venceslau_margem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Cadastro e margens confirmados","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"presidente_venceslau_margem"},"operation":{"const":"consultar_matricula"},"data":{"$ref":"#/components/schemas/presidente_venceslau_margem_ConsultaOutput"},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Vínculo estatutário não encontrado","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Mais de um vínculo estatutário compatível","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite do portal atingido","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Portal ou autenticação indisponível","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/presidente-venceslau/margem/lotes":{"post":{"operationId":"presidente_venceslau_margem_criar_lote","tags":["margem"],"summary":"Criar lote estatutário","description":"Cria lote de até 1000 vínculos com checkpoint privado, deduplicação e interrupção segura.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["itens"],"properties":{"itens":{"type":"array","minItems":1,"maxItems":1000,"items":{"$ref":"#/components/schemas/presidente_venceslau_margem_ConsultaInput"}}}}}}},"x-integration-id":"presidente_venceslau_margem","x-billing":"none","x-operational-status":"not_verified","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote criado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/presidente-venceslau/margem/lotes/{id}":{"get":{"operationId":"presidente_venceslau_margem_obter_lote","tags":["margem"],"summary":"Obter lote estatutário","description":"Retorna progresso e resultados somente para o tenant autenticado.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"presidente_venceslau_margem","x-billing":"none","x-operational-status":"not_verified","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Lote do tenant autenticado"},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado para o tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/crm/campaigns/read-clients":{"post":{"operationId":"crm_campaign_reader_crm_campaign_read_clients","tags":["crm"],"summary":"Ler clientes de campanha e filtro","description":"Leitura gratuita de clientes do filtro exato de uma campanha CRM com paginação consistente. Não consulta fornecedores nem envia mensagens.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["campaign","filter"],"properties":{"campaign":{"type":"string","minLength":1,"maxLength":180},"filter":{"type":"string","minLength":1,"maxLength":180},"limit":{"type":"integer","minimum":1,"maximum":200,"default":100},"offset":{"type":"integer","minimum":0,"maximum":10000,"default":0},"snapshot":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"Obrigatório a partir da segunda página; reiniciar leitura se os dados mudarem."},"marginProduct":{"type":"string","enum":["consignacao","cartao","cartao_beneficio"],"default":"consignacao","description":"Família exata de margem. Cartão e cartão benefício são produtos distintos; não há fallback."}}}}}},"x-integration-id":"crm_campaign_reader","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Página consistente de clientes.","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"crm_campaign_reader"},"operation":{"const":"crm_campaign_read_clients"},"data":{"type":"object","required":["campaign","base","total","limit","offset","snapshot","complete","clients"],"properties":{"campaign":{"type":"object","required":["id","uuid","name","status"],"properties":{"id":{"type":"integer"},"uuid":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}}},"base":{"type":"object","required":["id","name","convenio"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"convenio":{"type":"string"}}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"snapshot":{"type":"string","pattern":"^[a-f0-9]{64}$"},"complete":{"type":"boolean"},"clients":{"type":"array","items":{"type":"object","required":["id","name","cpf","margin","marginField","marginProduct","convenio","phones","optOut","blocked","status"],"properties":{"id":{"type":"integer"},"customerId":{"type":["string","null"]},"name":{"type":"string"},"cpf":{"type":"string"},"margin":{"type":["number","null"],"description":"Margem líquida em reais da família exata solicitada; null quando ausente. Nunca herda outra família."},"marginField":{"enum":["margem_liquida_consignacao","margem_liquida_cartao","margem_liquida_cartao_beneficio"]},"marginProduct":{"enum":["consignacao","cartao","cartao_beneficio"]},"marginDate":{"type":["string","null"]},"marginSource":{"type":["string","null"]},"convenio":{"type":"string"},"phones":{"type":"array","items":{"type":"object","required":["number","providerPosition","sourceOrder","primary","source"],"properties":{"number":{"type":"string"},"providerPosition":{"type":["integer","null"]},"sourceOrder":{"type":["integer","null"]},"primary":{"type":"boolean"},"source":{"type":"string"},"updatedAt":{"type":["string","null"]}}}},"optOut":{"type":"boolean"},"blocked":{"type":"boolean"},"status":{"type":"string"},"updatedAt":{"type":["string","null"]},"birthDate":{"type":["string","null"],"description":"Nascimento retornado pelo último enriquecimento real do CRM."},"sex":{"type":["string","null"],"enum":["M","F",null],"description":"Sexo cadastral. Não inferido pelo nome ou foto."},"ageYears":{"type":["integer","null"],"minimum":0,"maximum":120},"ageMonths":{"type":["integer","null"],"minimum":0,"maximum":1451,"description":"Meses completos calculados pelo nascimento. null se houver somente idade em anos."}}}},"marginProduct":{"enum":["consignacao","cartao","cartao_beneficio"]}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"400":{"description":"Entrada inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"Autenticação interna inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Conta ou operação não permitida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Campanha ou filtro não encontrado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Ambiguidade, base arquivada ou leitura alterada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"500":{"description":"Falha de leitura sem envio.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração interna não configurada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/crm/campaigns/save-enrichment":{"post":{"operationId":"crm_campaign_reader_crm_campaign_save_enrichment","tags":["crm"],"summary":"Salvar consulta cadastral da campanha","description":"Grava todos os dados confirmados do lote Nova Vida no cliente exato do CRM, por CPF e campanha, de modo idempotente.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["campaignId","batchId","results"],"properties":{"campaignId":{"type":"integer","minimum":1},"batchId":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,150}$"},"results":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object"}}}}}}},"x-integration-id":"crm_campaign_reader","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Dados confirmados da consulta gravados no CRM.","content":{"application/json":{"schema":{"type":"object","required":["success","provider","operation","data","meta"],"properties":{"success":{"const":true},"provider":{"const":"crm_campaign_reader"},"operation":{"const":"crm_campaign_save_enrichment"},"data":{"type":"object","required":["campaignId","batchId","saved","alreadySaved","phonesSaved","skipped"],"properties":{"saved":{"type":"integer","minimum":0},"alreadySaved":{"type":"integer","minimum":0},"phonesSaved":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"campaignId":{"type":"integer"},"batchId":{"type":"string"}}},"meta":{"$ref":"#/components/schemas/GatewayMeta"}}}}}},"401":{"description":"Chave ausente ou inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Scope, entitlement ou status negou a operação.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Integração indisponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigo_contagem/consultar":{"post":{"operationId":"consigo_contagem_consultar_margem","tags":["margem"],"summary":"Consultar margem atual","description":"Consultar margem atual na carteira acessível desta conta, respeitando tenant e permissões.","parameters":[{"name":"X-Delta-Tenant-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","enum":["consultar_margem"]}},{"name":"X-Delta-Provider-Credential","in":"header","required":false,"schema":{"type":"string"},"description":"Contexto tenant base64url entregue pela Central autenticada; nunca em URL."},{"name":"X-Delta-Provider-Credential-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["base64url"]}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"Chave explícita; se ausente usa X-Delta-Request-Id interno após S2S. Central mantém a idempotência pública."},{"name":"X-Delta-Request-Id","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"Fallback interno obrigatório quando Idempotency-Key está ausente."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["cpf"],"properties":{"cpf":{"type":"string","description":"CPF do titular autorizado; dígitos validados."}}}}}},"x-integration-id":"consigo_contagem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Dados de domínio ou estado autorizado. Ausência é diferente de zero."},"400":{"description":"Entrada inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"S2S ou sessão não autenticada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Contexto ou permissão insuficiente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado neste tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Idempotência conflitante ou lote pausado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha do serviço ou resposta upstream perdida; reconciliar idempotência antes de nova execução.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigo_contagem/lotes":{"post":{"operationId":"consigo_contagem_criar_lote","tags":["margem"],"summary":"Criar lote","description":"Criar lote na carteira acessível desta conta, respeitando tenant e permissões.","parameters":[{"name":"X-Delta-Tenant-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","enum":["criar_lote"]}},{"name":"X-Delta-Provider-Credential","in":"header","required":false,"schema":{"type":"string"},"description":"Contexto tenant base64url entregue pela Central autenticada; nunca em URL."},{"name":"X-Delta-Provider-Credential-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["base64url"]}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"Chave explícita; se ausente usa X-Delta-Request-Id interno após S2S. Central mantém a idempotência pública."},{"name":"X-Delta-Request-Id","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128},"description":"Fallback interno obrigatório quando Idempotency-Key está ausente."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":10000,"items":{"oneOf":[{"type":"string"},{"type":"object","required":["cpf"],"properties":{"cpf":{"type":"string"},"source_rows":{"type":"array","items":{"type":"object","properties":{"sheet":{"type":"string"},"row":{"type":"integer","minimum":1}}}}}}]}}}}}}},"x-integration-id":"consigo_contagem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito com id no primeiro nível."},"400":{"description":"Entrada inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"S2S ou sessão não autenticada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Contexto ou permissão insuficiente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado neste tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Idempotência conflitante ou lote pausado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha do serviço ou resposta upstream perdida; reconciliar idempotência antes de nova execução.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigo_contagem/lotes/{id}":{"get":{"operationId":"consigo_contagem_consultar_lote","tags":["margem"],"summary":"Consultar progresso","description":"Consultar progresso na carteira acessível desta conta, respeitando tenant e permissões.","parameters":[{"name":"X-Delta-Tenant-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","enum":["consultar_lote"]}},{"name":"X-Delta-Provider-Credential","in":"header","required":false,"schema":{"type":"string"},"description":"Contexto tenant base64url entregue pela Central autenticada; nunca em URL."},{"name":"X-Delta-Provider-Credential-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["base64url"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-integration-id":"consigo_contagem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Dados de domínio ou estado autorizado. Ausência é diferente de zero."},"400":{"description":"Entrada inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"S2S ou sessão não autenticada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Contexto ou permissão insuficiente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado neste tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Idempotência conflitante ou lote pausado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha do serviço ou resposta upstream perdida; reconciliar idempotência antes de nova execução.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigo_contagem/lotes/resultados/{id}":{"get":{"operationId":"consigo_contagem_resultado_lote","tags":["margem"],"summary":"Ler resultados","description":"Ler resultados na carteira acessível desta conta, respeitando tenant e permissões.","parameters":[{"name":"X-Delta-Tenant-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","enum":["resultado_lote"]}},{"name":"X-Delta-Provider-Credential","in":"header","required":false,"schema":{"type":"string"},"description":"Contexto tenant base64url entregue pela Central autenticada; nunca em URL."},{"name":"X-Delta-Provider-Credential-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["base64url"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"x-integration-id":"consigo_contagem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Dados de domínio ou estado autorizado. Ausência é diferente de zero."},"400":{"description":"Entrada inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"S2S ou sessão não autenticada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Contexto ou permissão insuficiente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado neste tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Idempotência conflitante ou lote pausado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha do serviço ou resposta upstream perdida; reconciliar idempotência antes de nova execução.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigo_contagem/lotes/retomar/{id}":{"post":{"operationId":"consigo_contagem_retomar_lote","tags":["margem"],"summary":"Retomar lote pausado","description":"Retomar lote pausado na carteira acessível desta conta, respeitando tenant e permissões.","parameters":[{"name":"X-Delta-Tenant-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","enum":["retomar_lote"]}},{"name":"X-Delta-Provider-Credential","in":"header","required":false,"schema":{"type":"string"},"description":"Contexto tenant base64url entregue pela Central autenticada; nunca em URL."},{"name":"X-Delta-Provider-Credential-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["base64url"]}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"x-integration-id":"consigo_contagem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"202":{"description":"Lote aceito com id no primeiro nível."},"400":{"description":"Entrada inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"S2S ou sessão não autenticada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Contexto ou permissão insuficiente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado neste tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Idempotência conflitante ou lote pausado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha do serviço ou resposta upstream perdida; reconciliar idempotência antes de nova execução.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}},"/v1/margem/consigo_contagem/sessao/validar":{"post":{"operationId":"consigo_contagem_validar_sessao","tags":["margem"],"summary":"Carregar sessão tenant","description":"Carregar sessão tenant na carteira acessível desta conta, respeitando tenant e permissões.","parameters":[{"name":"X-Delta-Tenant-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Delta-Operation-Id","in":"header","required":true,"schema":{"type":"string","enum":["validar_sessao"]}},{"name":"X-Delta-Provider-Credential","in":"header","required":false,"schema":{"type":"string"},"description":"Contexto tenant base64url entregue pela Central autenticada; nunca em URL."},{"name":"X-Delta-Provider-Credential-Encoding","in":"header","required":false,"schema":{"type":"string","enum":["base64url"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false}}}},"x-integration-id":"consigo_contagem","x-billing":"none","x-operational-status":"active","security":[{"DeltaApiKey":[]}],"responses":{"200":{"description":"Dados de domínio ou estado autorizado. Ausência é diferente de zero."},"400":{"description":"Entrada inválida.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"401":{"description":"S2S ou sessão não autenticada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"403":{"description":"Contexto ou permissão insuficiente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"404":{"description":"Lote não encontrado neste tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"409":{"description":"Idempotência conflitante ou lote pausado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"429":{"description":"Limite excedido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}},"503":{"description":"Falha do serviço ou resposta upstream perdida; reconciliar idempotência antes de nova execução.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GatewayError"}}}}}}}},"components":{"securitySchemes":{"DeltaApiKey":{"type":"http","scheme":"bearer","bearerFormat":"delta_*"}},"schemas":{"GatewayError":{"type":"object","required":["success","code","message"],"properties":{"success":{"const":false},"code":{"type":"string"},"message":{"type":"string"}}},"GatewayMeta":{"type":"object","required":["request_id","duration_ms"],"properties":{"request_id":{"type":"string","format":"uuid"},"duration_ms":{"type":"number"}}},"consigx_Health":{"type":"object","additionalProperties":false,"required":["status","service","version"],"properties":{"status":{"const":"ok"},"service":{"const":"consigx"},"version":{"const":"1.1.6"}}},"consigx_Readiness":{"type":"object","additionalProperties":false,"required":["status","service","version","checks"],"properties":{"status":{"enum":["ready","not_ready"]},"service":{"const":"consigx"},"version":{"const":"1.1.6"},"checks":{"type":"object","additionalProperties":false,"required":["runtime_config","profiles","data_dir","sqlite"],"properties":{"runtime_config":{"enum":["ok","failed"]},"profiles":{"enum":["ok","failed"]},"data_dir":{"enum":["ok","failed"]},"sqlite":{"enum":["ok","failed"]}}}}},"consigx_OperationalStatus":{"type":"object","additionalProperties":false,"required":["status","service","version","workers","queries","recoveries","errors","last_error"],"properties":{"status":{"const":"ok"},"service":{"const":"consigx"},"version":{"const":"1.1.6"},"workers":{"type":"object"},"queries":{"type":"object"},"recoveries":{"type":"object"},"errors":{"type":"object"},"last_error":{"type":["object","null"]}}},"consigx_QueryRequest":{"type":"object","additionalProperties":false,"required":["convenio_id","cpf"],"properties":{"convenio_id":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"cpf":{"type":"string","minLength":11,"maxLength":18}}},"consigx_BatchRequest":{"type":"object","additionalProperties":false,"required":["convenio_id","cpfs"],"properties":{"convenio_id":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,62}$"},"cpfs":{"type":"array","minItems":1,"maxItems":1000,"uniqueItems":true,"items":{"type":"string","minLength":11,"maxLength":18}}}},"consigx_Margin":{"type":"object","additionalProperties":false,"required":["convenio","balde","total_centavos","disponivel_centavos"],"properties":{"convenio":{"type":"string"},"balde":{"enum":["consignavel","cartao","beneficio"]},"total_centavos":{"type":["integer","null"]},"disponivel_centavos":{"type":["integer","null"]}}},"consigx_MarginResult":{"type":"object","additionalProperties":false,"required":["cliente","beneficio","margens","status"],"properties":{"cliente":{"type":"object"},"beneficio":{"type":"object"},"margens":{"type":"array","items":{"$ref":"#/components/schemas/consigx_Margin"}},"status":{"type":"string"}}},"consigx_BatchAccepted":{"type":"object","additionalProperties":false,"required":["id","status","total"],"properties":{"id":{"type":"string"},"status":{"const":"queued"},"total":{"type":"integer","minimum":1}}},"consigx_BatchState":{"type":"object","required":["id","status","total","processed","items"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"total":{"type":"integer"},"processed":{"type":"integer"},"items":{"type":"array","items":{"type":"object"}}}},"consigx_Error":{"type":"object","additionalProperties":false,"required":["erro"],"properties":{"erro":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"monitor_diario_crm_DailySyncRequest":{"type":"object","additionalProperties":false,"required":["contract_version","run_id","source_date","agreement_id","items"],"properties":{"contract_version":{"const":"1.1.0"},"run_id":{"type":"string","maxLength":128},"source_date":{"type":"string","format":"date"},"agreement_id":{"type":"string","enum":["PREF_RIBEIRAO_PRETO","IPM_RIBEIRAO","PMESP"]},"items":{"type":"array","maxItems":500,"items":{"$ref":"#/components/schemas/monitor_diario_crm_DailySyncItem"}}}},"monitor_diario_crm_DailySyncItem":{"type":"object","additionalProperties":false,"required":["event_id","person","employment_status","employment_type","margin_status","event","margins"],"properties":{"event_id":{"type":"string","maxLength":192},"person":{"type":"object","additionalProperties":false,"required":["name","cpf"],"properties":{"name":{"type":"string","maxLength":200},"cpf":{"type":"string","pattern":"^[0-9]{11}$"}}},"employment_status":{"type":"string","enum":["ACTIVE"]},"employment_type":{"type":"string","enum":["STATUTORY","CONTRACTED","COMMISSIONED","OTHER","UNKNOWN"]},"margin_status":{"type":"string","enum":["POSITIVE","NO_MARGIN","NOT_QUERIED","BLOCKED_BY_SERVER"]},"event":{"type":"object","additionalProperties":false,"required":["type","date","observation"],"properties":{"type":{"type":"string","maxLength":80},"date":{"type":"string","format":"date"},"effective_date":{"type":"string","format":"date"},"observation":{"type":"string","maxLength":500},"source_url":{"type":"string","format":"uri","maxLength":1000},"act_number":{"type":"string","maxLength":100}}},"margins":{"type":"object","additionalProperties":false,"required":["consignado_cents","cartao_cents","cartao_beneficio_cents"],"properties":{"consignado_cents":{"type":"integer","minimum":0},"cartao_cents":{"type":"integer","minimum":0},"cartao_beneficio_cents":{"type":"integer","minimum":0}}}}},"monitor_diario_crm_DailySyncResponse":{"type":"object","required":["contract_version","run_id","source_date","agreement_id","campaign","summary","completed_at","replayed"],"properties":{"contract_version":{"type":"string"},"run_id":{"type":"string"},"source_date":{"type":"string","format":"date"},"agreement_id":{"type":"string"},"campaign":{"type":"object"},"summary":{"type":"object"},"completed_at":{"type":"string","format":"date-time"},"replayed":{"type":"boolean"}}},"margem_ipm_ribeirao_preto_Health":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","const":"ok"}}},"margem_ipm_ribeirao_preto_Readiness":{"type":"object","additionalProperties":false,"required":["status","checks","credential_mode","version","commit"],"properties":{"status":{"type":"string","enum":["ok","unavailable"]},"checks":{"type":"object","additionalProperties":false,"required":["runtime_config","data_dir_exists","data_dir_writable","persistence"],"properties":{"runtime_config":{"type":"boolean"},"data_dir_exists":{"type":"boolean"},"data_dir_writable":{"type":"boolean"},"persistence":{"type":"boolean"}}},"credential_mode":{"type":"string","const":"tenant_broker"},"version":{"type":"string"},"commit":{"type":"string"}}},"margem_ipm_ribeirao_preto_InternalError":{"type":"object","additionalProperties":false,"required":["erro"],"properties":{"erro":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"margem_ipm_ribeirao_preto_Query":{"oneOf":[{"type":"object","additionalProperties":false,"required":["cpf"],"properties":{"cpf":{"type":"string","description":"CPF com ou sem pontuacao."}}},{"type":"object","additionalProperties":false,"required":["matricula"],"properties":{"matricula":{"type":"string","minLength":1,"maxLength":40}}}]},"margem_ipm_ribeirao_preto_Person":{"type":["object","null"],"properties":{"name":{"type":["string","null"]},"cpf":{"type":["string","null"]},"birthDate":{"type":["string","null"]},"age":{"type":["integer","null"]},"identity":{"type":["string","null"]},"entity":{"type":["string","null"]}}},"margem_ipm_ribeirao_preto_MarginHistory":{"type":"object","required":["month","gross","net","used"],"properties":{"month":{"type":"string"},"gross":{"type":["number","null"]},"net":{"type":["number","null"]},"used":{"type":["number","null"]}}},"margem_ipm_ribeirao_preto_EnrollmentMargin":{"type":"object","required":["enrollment","agency","employmentType","admissionDate","contractEndDate","employeeStatus","role","currentGross","currentNet","history"],"properties":{"enrollment":{"type":["string","null"]},"agency":{"type":["string","null"]},"employmentType":{"type":["string","null"]},"admissionDate":{"type":["string","null"]},"contractEndDate":{"type":["string","null"]},"employeeStatus":{"type":["string","null"]},"role":{"type":["string","null"]},"currentGross":{"type":["number","null"]},"currentNet":{"type":["number","null"]},"history":{"type":"array","items":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_MarginHistory"}}}},"margem_ipm_ribeirao_preto_MarginResult":{"type":"object","additionalProperties":false,"required":["status","queriedAt","source","person","margins"],"properties":{"status":{"type":"string","enum":["found","not_found"]},"queriedAt":{"type":"string","format":"date-time"},"source":{"type":"string","const":"municipal_margin_source"},"person":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_Person"},"margins":{"type":"array","items":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_EnrollmentMargin"}}}},"margem_ipm_ribeirao_preto_AccountStatus":{"type":"object","required":["accountId","authenticated","pending"],"properties":{"accountId":{"type":"string"},"authenticated":{"type":"boolean"},"lastValidatedAt":{"type":["string","null"],"format":"date-time"},"pending":{"type":"integer"}}},"margem_ipm_ribeirao_preto_Job":{"type":"object","required":["id","status","total","deduplicated","processed","succeeded","failed","createdAt","startedAt","finishedAt","error"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","paused","completed","failed"]},"total":{"type":"integer"},"deduplicated":{"type":"integer","minimum":0},"processed":{"type":"integer"},"succeeded":{"type":"integer"},"failed":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":["string","null"],"format":"date-time"},"finishedAt":{"type":["string","null"],"format":"date-time"},"error":{"type":["string","null"]}}},"margem_ipm_ribeirao_preto_JobResult":{"type":"object","required":["index","request","ok"],"properties":{"index":{"type":"integer"},"request":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_Query"},"ok":{"type":"boolean"},"result":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_MarginResult"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"margem_ipm_ribeirao_preto_StatusPayload":{"type":"object","additionalProperties":false,"required":["tenantId","accounts","telemetry"],"properties":{"tenantId":{"type":"string"},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_AccountStatus"}},"telemetry":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_Telemetry"}}},"margem_ipm_ribeirao_preto_Telemetry":{"type":"object","additionalProperties":false,"required":["sessions","captcha","login_rejection_class","queries","recoveries","query_page","errors","last_error"],"properties":{"sessions":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_SessionCounters"},"captcha":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_CaptchaCounters"},"login_rejection_class":{"type":["string","null"],"pattern":"^[A-Z][A-Z0-9_]{1,63}$"},"queries":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_QueryCounters"},"recoveries":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_RecoveryCounters"},"query_page":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_QueryPageTelemetry"},"errors":{"type":"object","additionalProperties":{"type":"integer","minimum":0}},"last_error":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_SafeErrorEvent"}]}}},"margem_ipm_ribeirao_preto_SafeErrorEvent":{"type":"object","additionalProperties":false,"required":["error_code","recorded_at","upstream_status","response_class","final_url_class","content_type","content_length","redirect_count","session_authenticated","query_seed_present","error_class","axios_code","response_received","duration_ms","structure_fingerprint"],"properties":{"error_code":{"type":"string","pattern":"^[A-Z][A-Z0-9_]{1,63}$"},"recorded_at":{"type":"string","format":"date-time"},"upstream_status":{"type":["integer","null"],"minimum":100,"maximum":599},"response_class":{"type":"string"},"final_url_class":{"type":"string"},"content_type":{"type":["string","null"]},"content_length":{"type":["integer","null"],"minimum":0},"redirect_count":{"type":["integer","null"],"minimum":0},"session_authenticated":{"type":"boolean"},"query_seed_present":{"type":"boolean"},"error_class":{"type":"string"},"axios_code":{"type":["string","null"]},"response_received":{"type":"boolean"},"duration_ms":{"type":"integer","minimum":0},"structure_fingerprint":{"type":["string","null"],"pattern":"^[a-f0-9]{64}$"}}},"margem_ipm_ribeirao_preto_SessionCounters":{"type":"object","additionalProperties":false,"required":["validation_attempts","reused","logins","relogins","session_invalidated","login_cycle_started","login_attempt","login_attempt_number","login_success","login_cycle_exhausted","provider_session_in_use"],"properties":{"validation_attempts":{"type":"integer","minimum":0},"reused":{"type":"integer","minimum":0},"logins":{"type":"integer","minimum":0},"relogins":{"type":"integer","minimum":0},"session_invalidated":{"type":"integer","minimum":0},"login_cycle_started":{"type":"integer","minimum":0},"login_attempt":{"type":"integer","minimum":0},"login_attempt_number":{"type":"integer","minimum":0,"maximum":3},"login_success":{"type":"integer","minimum":0},"login_cycle_exhausted":{"type":"integer","minimum":0},"provider_session_in_use":{"type":"integer","minimum":0}}},"margem_ipm_ribeirao_preto_CaptchaCounters":{"type":"object","additionalProperties":false,"required":["required","solve_attempts","rejected","failures"],"properties":{"required":{"type":"integer","minimum":0},"solve_attempts":{"type":"integer","minimum":0},"rejected":{"type":"integer","minimum":0},"failures":{"type":"integer","minimum":0}}},"margem_ipm_ribeirao_preto_QueryCounters":{"type":"object","additionalProperties":false,"required":["logical_requests","physical_posts","completed"],"properties":{"logical_requests":{"type":"integer","minimum":0},"physical_posts":{"type":"integer","minimum":0},"completed":{"type":"integer","minimum":0}}},"margem_ipm_ribeirao_preto_RecoveryCounters":{"type":"object","additionalProperties":false,"required":["session_expired","webforms_refresh"],"properties":{"session_expired":{"type":"integer","minimum":0},"webforms_refresh":{"type":"integer","minimum":0}}},"margem_ipm_ribeirao_preto_QueryPageTelemetry":{"type":"object","additionalProperties":false,"required":["checks","http_status","page_class"],"properties":{"checks":{"type":"integer","minimum":0},"http_status":{"type":["integer","null"],"minimum":100,"maximum":599},"page_class":{"type":["string","null"]}}},"margem_ipm_ribeirao_preto_WarmupPayload":{"type":"object","additionalProperties":false,"required":["accounts"],"properties":{"accounts":{"type":"array","items":{"type":"object","required":["accountId","ok"],"properties":{"accountId":{"type":"string"},"ok":{"type":"boolean"},"error":{"type":"string"}}}}}},"margem_ipm_ribeirao_preto_ResultsPage":{"type":"object","additionalProperties":false,"required":["total","offset","limit","items"],"properties":{"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/margem_ipm_ribeirao_preto_JobResult"}}}},"apconsig_amapa_Query":{"type":"object","additionalProperties":false,"required":["cpf"],"properties":{"cpf":{"type":"string","maxLength":32}}},"apconsig_amapa_Batch":{"type":"object","additionalProperties":false,"required":["cpfs"],"properties":{"cpfs":{"type":"array","minItems":1,"maxItems":1000,"uniqueItems":true,"items":{"type":"string","maxLength":32}}}},"consulta_pessoas_Health":{"type":"object","required":["status","service","version"],"properties":{"status":{"type":"string","const":"ok"},"service":{"type":"string"},"version":{"type":"string"}}},"consulta_pessoas_NominalRequest":{"type":"object","additionalProperties":false,"required":["nome"],"properties":{"nome":{"type":"string","minLength":5,"maxLength":180,"description":"Nome completo com pelo menos duas palavras"}}},"consulta_pessoas_Candidate":{"type":"object","required":["nome","cpf"],"properties":{"nome":{"type":"string"},"cpf":{"type":"string","pattern":"^[0-9]{11}$"},"cpfMascarado":{"type":"string"},"tipoPessoa":{"type":"string"},"idade":{"type":["integer","null"],"minimum":0},"cidade":{"type":"string"},"uf":{"type":"string"}}},"consulta_pessoas_CounterSnapshot":{"type":["object","null"],"properties":{"usado":{"type":"integer","minimum":0},"limite":{"type":"integer","minimum":0}}},"consulta_pessoas_ObservedCounter":{"type":"object","required":["antes","depois","variacaoObservada"],"properties":{"antes":{"$ref":"#/components/schemas/consulta_pessoas_CounterSnapshot"},"depois":{"$ref":"#/components/schemas/consulta_pessoas_CounterSnapshot"},"variacaoObservada":{"type":["integer","null"]}}},"consulta_pessoas_NominalResponse":{"type":"object","required":["status","total","candidatos","contador"],"properties":{"status":{"enum":["nao_encontrado","sucesso_unico","multiplos_candidatos"]},"total":{"type":"integer","minimum":0},"candidatos":{"type":"array","items":{"$ref":"#/components/schemas/consulta_pessoas_Candidate"}},"duracaoMs":{"type":"number","minimum":0},"contador":{"$ref":"#/components/schemas/consulta_pessoas_ObservedCounter"}}},"consulta_pessoas_FullRequest":{"type":"object","additionalProperties":false,"required":["cpf","confirmarConsumo"],"properties":{"cpf":{"type":"string","pattern":"^[0-9.\\/-]{11,14}$"},"confirmarConsumo":{"type":"boolean","const":true}}},"consulta_pessoas_Phone":{"type":"object","properties":{"ddd":{"type":"string"},"numero":{"type":"string"},"telefone":{"type":"string"},"tipo":{"type":["string","null"]},"operadora":{"type":["string","null"]},"mobilidadeCadastral":{"type":["string","null"]}}},"consulta_pessoas_Address":{"type":"object","additionalProperties":true},"consulta_pessoas_FullResponse":{"type":"object","required":["status","cpf","contador","nome"],"properties":{"status":{"type":"string"},"cpf":{"type":"string","pattern":"^[0-9]{11}$"},"cpfMascarado":{"type":"string"},"cadastro":{"type":"object","additionalProperties":{"type":"string"}},"telefones":{"type":"array","items":{"$ref":"#/components/schemas/consulta_pessoas_Phone"}},"emails":{"type":"array","items":{"type":"string"}},"enderecos":{"type":"array","items":{"type":"string"}},"cache":{"type":"boolean"},"contador":{"$ref":"#/components/schemas/consulta_pessoas_ObservedCounter"},"nome":{"type":"string","minLength":1}}},"consulta_pessoas_BatchAccepted":{"type":"object","required":["id","status","total","consultaPaga"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pendente","executando"]},"total":{"type":"integer","minimum":1},"consultaPaga":{"type":"boolean"}}},"consulta_pessoas_BatchStatus":{"type":"object","required":["id","status","total"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pendente","executando","interrompido","concluido"]},"total":{"type":"integer","minimum":1},"completed":{"type":"integer","minimum":0},"results":{"type":"array","items":{"type":"object"}},"contadorAntes":{"$ref":"#/components/schemas/consulta_pessoas_CounterSnapshot"},"contadorDepois":{"$ref":"#/components/schemas/consulta_pessoas_CounterSnapshot"}}},"consulta_pessoas_ErrorEnvelope":{"type":"object","required":["erro"],"properties":{"erro":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":["object","null"]}}}}},"usp_margem_Margem":{"type":"object","required":["numero_usp","nome","nascimento","idade","cpf","margem_consignado","margem_cartao","consultado_em"],"properties":{"numero_usp":{"type":"string","description":"Número USP canônico usado na consulta, sem os três dígitos internos do eConsig."},"matricula_econsig":{"type":"string","description":"Identificador exibido pelo eConsig, com três dígitos internos adicionais."},"nome":{"type":"string"},"nascimento":{"type":"string","example":"04/05/1959"},"idade":{"type":"integer"},"cpf":{"type":"string","pattern":"^[0-9]{11}$"},"margem_consignado":{"type":"number"},"margem_cartao":{"type":"number"},"consultado_em":{"type":"string","format":"date-time"}}},"santana_margem_Resultado":{"type":"object","required":["nome","cpf","matricula","data_nascimento","idade","margem_consignado","margem_cartao","margem_cartao_beneficio"],"properties":{"nome":{"type":"string"},"cpf":{"type":"string","pattern":"^\\d{11}$"},"matricula":{"type":"string"},"data_nascimento":{"type":"string","description":"DD/MM/AAAA"},"idade":{"type":"integer","minimum":0,"maximum":125},"margem_consignado":{"type":"number"},"margem_cartao":{"type":"number"},"margem_cartao_beneficio":{"type":"number"},"data_referencia_idade":{"type":"string","format":"date"},"consultado_em":{"type":"string","format":"date-time"}}},"santana_margem_Lote":{"type":"object","required":["id","status","total","completed"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["QUEUED","RUNNING","COMPLETED","PAUSED","AUTH_REQUIRED","FAILED"]},"error_code":{"type":"string","nullable":true},"total":{"type":"integer"},"completed":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/santana_margem_Resultado"}},"errors":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer"},"code":{"type":"string"}}}}}},"presidente_venceslau_margem_ConsultaInput":{"type":"object","required":["matricula","nome"],"properties":{"matricula":{"type":"string","pattern":"^\\d{1,20}$","description":"Matrícula pública sem o sufixo interno do Consignet"},"nome":{"type":"string","minLength":3,"maxLength":180},"cargo":{"type":"string","maxLength":180}}},"presidente_venceslau_margem_ConsultaOutput":{"type":"object","required":["nome","cpf","matricula","matricula_portal","cargo","tipo_vinculo","competencia","margem_bruta","margem_liquida"],"properties":{"nome":{"type":"string"},"cpf":{"type":"string","pattern":"^\\d{11}$","description":"CPF completo; dado sensível"},"matricula":{"type":"string"},"matricula_portal":{"type":"string"},"cargo":{"type":"string"},"tipo_vinculo":{"type":"string","enum":["ESTATUTARIO"]},"convenio":{"type":"string"},"situacao_funcional":{"type":"string","nullable":true},"competencia":{"type":"integer"},"margem_bruta":{"type":"number"},"margem_liquida":{"type":"number"},"margem_liquida_original":{"type":"number","nullable":true},"atualizado_em":{"type":"string","nullable":true},"margens":{"type":"array","items":{"type":"object"}}}}}}}