Evidence of slavery predates written records, and has existed in many cultures. However, slavery is rare among hunter-gatherer populations. Mass slavery requires economic surpluses and a high population density to be viable. Due to these factors, the practice of slavery would have only proliferated after the invention of agriculture during the Neolithic Revolution, about 11,000 years ago. Slavery was known in the very first civilizations such as Sumer in Mesopotamia which dates back as far as 3500 BC.
If we go for the written records then I think it should be Mesopotamian Code of Hammurabi (c. 1860 BC), which refers to it as an established institution and it was common among ancient people.