What is the evidence that the New Testament authors believed, or did not believe, that they were writing an inspired record? The term "canon" is used to describe the collection of books that are considered by Christians to be divinely inspired, and therefore to belong in the Bible. (See: How and when was the canon of the Bible put together?)

The Muratorian fragment, a 7th century Latin manuscript copy of a text dated as early as A.D. 170 or as late as the 4th century, is one of the oldest known listings of a New Testament canon.

What evidence is there in the New Testament itself, or based on other ancient texts, that the authors of the various New Testament books believed, or did not believe, that they were writing an inspired record?

What analyses and arguments have been made by scholars to demonstrate that the authors of the various New Testament books either believed, or did not believe, that they were writing an inspired record?
The question is:

Did the NT writers themselves know that they were writing an inspired record?

Though there is at least one major exception, which is mentioned below, for the most part the New Testament authors simply wrote their accounts without commenting on whether they were inspired. We can therefore glean only a few clues here and there about their state of mind, and in particular, about their sense of whether they were writing on their own or under inspiration from God.
Here are a few such clues contained within several of the books in the New Testament.
Luke and Acts
This is the often overlooked introduction to the Gospel of Luke:

Inasmuch as many have undertaken to compile a narrative of the things that have been accomplished among us, just as those who from the beginning were eyewitnesses and ministers of the word have delivered them to us, it seemed good to me also, having followed all things closely for some time past, to write an orderly account for you, most excellent Theophilus, that you may have certainty concerning the things you have been taught. (Luke 1:1-4)

And the parallel introduction to the book of Acts:

In the first book, O Theophilus, I have dealt with all that Jesus began to do and teach, until the day when he was taken up, after he had given commands through the Holy Spirit to the apostles whom he had chosen. He presented himself alive to them after his suffering by many proofs, appearing to them during forty days and speaking about the kingdom of God. (Acts 1:1-3)

Here we find the unidentified (in the text itself) author of these two books speaking confidently of &quot;having followed all things closely for some time past,&quot; (KJV: &quot;having had perfect understanding of all things from the very first&quot;), and citing this as his basis for writing &quot;an orderly account&quot; of these events.
Clearly the author of the Gospel of Luke felt that he was writing an account based on his own knowledge and investigation into the subjects and events he wrote about. This strongly suggests that the author of Luke and Acts did not think of himself as being divinely inspired in the writing process.
Paul
Much material could be pulled out of Paul's letters to attest to his state of mind in writing. However, here is one particularly clear passage about the author's sense of the source of his writing:

To the married I give this charge (not I, but the Lord): the wife should not separate from her husband. . . . To the rest I say (I, not the Lord) that if any brother has a wife who is an unbeliever, and she consents to live with him, he should not divorce her. (1 Corinthians 7:10, 12, italics added)

Here Paul, the author identified in 1 Corinthians 1:1, distinguishes between:

&quot;charges&quot; or commands, given not by himself, but by the Lord, and
instructions given not by the Lord, but by himself.

This is a clear indication that the author believed that at least some of what he wrote was on his own initiative and from his own belief and understanding rather than being inspired by the Lord.
Revelation
By contrast, the book of Revelation starts out with this prologue:

The revelation of Jesus Christ, which God gave him to show to his servants the things that must soon take place. He made it known by sending his angel to his servant John, who bore witness to the word of God and to the testimony of Jesus Christ, even to all that he saw. Blessed is the one who reads aloud the words of this prophecy, and blessed are those who hear, and who keep what is written in it, for the time is near. (Revelation 1:1-3)

The book then speaks in the voice of its human author:

John to the seven churches that are in Asia: (Revelation 1:4)

Here we find the human author clearly proclaiming this book as a &quot;revelation of Jesus Christ,&quot; which was made known &quot;by sending his angel to his servant John.&quot;
Clearly the author saw himself as writing under divine inspiration through the mediation of an angel. And indeed, a number of times he indicates that he was in an inspired, or spiritual state, had heaven opened to him, and heard voices from heaven. For example:

I was in the Spirit on the Lord's day, and I heard behind me a loud voice like a trumpet.  saying, &quot;Write what you see in a book and send it to the seven churches, to Ephesus and to Smyrna and to Pergamum and to Thyatira and to Sardis and to Philadelphia and to Laodicea.&quot; (Revelation 1:10-11)
After this I looked, and behold, a door standing open in heaven! And the first voice, which I had heard speaking to me like a trumpet, said, &quot;Come up here, and I will show you what must take place after this.&quot; At once I was in the Spirit, and behold, a throne stood in heaven, with one seated on the throne. (Revelation 4:1-2)
And when the seven thunders had sounded, I was about to write, but I heard a voice from heaven saying, &quot;Seal up what the seven thunders have said, and do not write it down.&quot; (Revelation 10:4)
Then the voice that I had heard from heaven spoke to me again, saying, &quot;Go, take the scroll that is open in the hand of the angel who is standing on the sea and on the land.&quot; (Revelation 10:8)
Then God's temple in heaven was opened, and the ark of his covenant was seen within his temple. There were flashes of lightning, rumblings, peals of thunder, an earthquake, and heavy hail. (Revelation 11:19)

These and other expressions in the book of Revelation indicate that its author felt a high level of spiritual and divine inspiration for the visions he recorded in the book.
Conclusion
This is by no means an exhaustive list of passages in the New Testament indicating something about the state of mind of the authors with regard to their sense of whether or not they were writing an inspired record.
However, even these few passages show that there was a wide variety of experiences on the part of the various New Testament authors, ranging from a sense of writing their books or letters based on their own ideas and efforts in some instances, all the way to a sense, in other instances, of receiving and recording words and visions given to them by God through the angels in heaven.