Joseph records a revelation where God commands him to keep a record.
Section 21:1-3, Doctrine and Covenants, The Church of Jesus Christ of Latter-Day Saints, accessed November 29, 2021
Behold, there shall be a record kept among you; and in it thou shalt be called a seer, a translator, a prophet, an apostle of Jesus Christ, an elder of the church through the will of God the Father, and the grace of your Lord Jesus Christ,
Being inspired of the Holy Ghost to lay the foundation thereof, and to build it up unto the most holy faith.
Which church was organized and established in the year of your Lord eighteen hundred and thirty, in the fourth month, and on the sixth day of the month which is called April.