ObjectivesImmune regulation is a pivotal factor in the pathogenesis and repair of spinal cord injury (SCI). This study aims to explore potential immune center genes associated with spinal cord injury.MethodsThe public data set GSE151371 was obtained from the GEO database. The R software package "limma" was used to identify differentially expressed genes (DEGs) in SCI. GO, KEGG and GSEA pathway analyses were performed using the DEGs. The key module genes related to spinal cord injury were selected through WGCNA analysis. Overlapping genes were extracted from WGCNA, DEGs, and immune-related genes. LASSO analysis was employed to identify central genes associated with SCI immunity. Pearson correlation analysis assessed the correlation between hub genes and immune cells in SCI. In addition, we further investigated the hub genes' expression, diagnostic potential, function, and targeted drugs.ResultsWe have identified three immunity-related hub genes (ABHD5, EDNRB, EDN3). Immune infiltration analysis showed that the hub gene was significantly associated with resting NK cells, M2 macrophages, and monocytes in the immune microenvironment of SCI. ROC analysis demonstrated that these hub genes have favorable diagnostic performance for SCI. Functional analysis revealed that ABHD5 is primarily associated with lipid metabolism pathways, while EDN3 and EDNRB are mainly involved in endothelin, downstream GPCR signaling, and ERK signaling transduction. In addition, we identified six potential targeted drugs based on our findings.ConclusionsABHD5, EDNRB, and EDN3 are involved in processes such as SCI progression or repair through immunomodulation and deserve further study.