North Yorkshire Police today sent out a text alert to residents after a "great deal of anxiety" was caused to the boy and his family after the incident last week.
The youth was traced after the younger boy made a "very accurate" description of him to police.
The alert reads: "On 10/10/2017 there was a report of an unknown male youth trying to coax a 7 year old boy into a van in Knaresborough with promises of free toys etc.
"The 7 year old ran home and NYP were alerted. The child was able to provide a description of the youth that subsequently proved to be very accurate, and the youth was traced.
"NYP have spoken with the youth and his family. The youth has fully admitted his involvement in what he believed was a joke.
"The entire incident, caused a great deal of anxiety to the victim and his family, as well as to members of the general public.
"Many NYP resources were also tied up as a result of this youth's folly. This was explained, and the youth is currently being dealt with for his misguided actions."
The force has been approached for a statement.