We study the hidden-charm pentaquark states $udsc\bar{c}$ with spins 1/2, 3/2, and 5/2 within the QCD sum-rule approach. First, we construct the currents for the particular configuration of pentaquark states that consist of the flavor singlet three-quark cluster $uds$ of spins 1/2 and 3/2 and the two-quark cluster $\bar cc$ of spin 1, where both clusters are in a color-octet state. From the QCD sum rules obtained by the operator product expansion up to dimension-10 condensates, the extracted masses for the pentaquark states $uds$-$\bar{c}c$ are about 4.6 GeV (5.6 GeV) for spin 1/2$^\pm$, about 5.1 GeV (6.0 GeV) for spin 3/2$^\pm$, about 6.1 GeV (5.9 GeV) for spin 5/2$^\pm$, where the masses of the positive parity states are given in parentheses. Additionally, based on the flavor singlet pentaquark states, it is also shown that other pentaquark states of clusters like $udc$-$\bar{c}s$ and $usc$-$\bar cd$ lead to masses similar to the $uds$-$\bar cc$ case within error bars. Furthermore, in order to see whether any of the states, observed by the LHCb Collaboration, could be understood as the pentaquark of two clusters in the color-octet state, we study the pentaquark formed by the two clusters $udc$-$\bar cu$, where the three-quark cluster is assumed to have the same flavor structure as the above $uds$ cluster. We come to the conclusion that if the observed pentaquark will be found to have spin 1/2 and negative parity, then it could be described as a state of two color-octet clusters.