The function of TMEM165 (transmembrane protein 165, Ensembl gene identifier ENSG00000134851) is as follows. Putative divalent cation:proton antiporter that exchanges calcium or manganese ions for protons across the Golgi membrane. Mediates the reversible transport of calcium or manganese to the Golgi lumen driven by the proton gradient and possibly the membrane potential generated by V-ATPase. Provides calcium or manganese cofactors to resident Golgi enzymes and contributes to the maintenance of an acidic luminal Golgi pH required for proper functioning of the secretory pathway (By similarity) (PubMed:22683087, PubMed:23569283, PubMed:27008884, PubMed:32047108). Promotes Ca(2+) storage within the Golgi lumen of the mammary epithelial cells to be then secreted into milk (By similarity). The transport mechanism and stoichiometry remains to be elucidated. {ECO:0000250|UniProtKB:P38301, ECO:0000250|UniProtKB:P52875, ECO:0000269|PubMed:22683087, ECO:0000269|PubMed:23569283, ECO:0000269|PubMed:27008884, ECO:0000269|PubMed:32047108}.