Not at all sure which pyramids you're talking about but if Egyptian then it's not sure if they were slaves:
https://www.theguardian.com/world/2010/jan/11/great-pyramid-tombs-slaves-egypt Great Pyramid tombs unearth 'proof' workers were not slaves
Not at all sure which pyramids you're talking about but if Egyptian then it's not sure if they were slaves:https://www.theguardian.com/world/2010/jan/11/great-pyramid-tombs-slaves-egyptGreat Pyramid tombs unearth 'proof' workers were not slaves