A self-written account of one's own life is known as Autobiography. The word was first used in 1797 by William Taylor. Autobiography is considered a literary genre. Basically, the work is a combination of fantasy and autobiography. The main purpose of such books is to portray the life experiences and achievements of the author's life.
For example; The Story of My Experiments with Truth is an autobiographical work about the life of Mahatma Gandhi.