The Second Apocalypse of James is a Gnostic writing. It is the fourth tractate in Codex V in the Nag Hammadi library, immediately following the First Apocalypse of James. The order is a deliberate scribal choice, since the first text prepares James the Just for his death as a martyr, and the second text describes his death in detail. The existing Coptic version was likely translated in c. 300 AD from a Greek original written in c. 150 AD (possibly earlier than the First Apocalypse). In the text, James serves as a Gnostic redeemer who tries unsuccessfully to persuade the people to understand God before his martyrdom.
 Because of the fragmentary state of the tractate, the speakers are not always clear. The beginning of the text is introduced as a discourse spoken by James the Just in Jerusalem, right before his death, and written down by the priest Mareim and shared with Theuda, father of James. James says to come with his wife Mary and relatives. James claims to have received revelation from the Pleroma of Imperishability and says that he obeyed Jesus. James calls himself the brother in secret who prayed to the Father. He recounts a visit from his step-brother Jesus, whom he did not recognize at first, but who called him "brother."
 James goes on to talk about the virgin and how understanding the Father can be profitable. James warns about the false ruler, far from the aeons, who uses evil schemes, commits violence, and exercises unjust dominion. James says that the Father has compassion, is not limited by time or possessions, and is superior to those who are below. James saw things from a height and explains how they happened. He wishes to reveal things to those who seek to enter and walk in the way that is before the door. James is an illuminator and redeemer who will bring good among all. Those who are instructed in these things will come to rest and reign.
 James states that Jesus kissed his mouth and called him beloved. Jesus claims to reveal hidden knowledge that neither the heavens nor their archons know. He also claims to reveal information that a being who boasts of being the only one and having power over everything did not know. Jesus told James to understand and know these revelations. James advises the crowd to renounce the difficult and variable way and walk in accordance with Jesus. Those who are ignorant are doomed to destruction and derision.
 The people are not persuaded by the James's speech and decide to stone him to death. They throw him down and drag him upon the ground before stoning him. James stretches out his hands and prays to God to save him from this place of sojourn and sinful flesh. He asks for forgiveness of his debts of the days of his life and renounces everyone except for God. The text ends with the James' falling silent after his prayer.
 The father of James is named as Theuda instead of Joseph. Some Christians consider James the Just to be the same person as James, son of Alphaeus, and so Theuda would be an alternate form of Alphaeus, since both names mean "flow" or "change."
 James says that Jesus kissed his mouth, but this kiss is meant as a showing of equal status between them or of familial relation rather than being romantic.
 In the text, Jesus calls James "my beloved" twice. Biblical scholar James Tabor believes that James is the disciple whom Jesus loved in the Gospel of John.