Answer: Histamine is a neurotransmitter that is synthesized mainly by two populations: a small patch of cells in the hypothalamus of the brain called the tuberomammillary nucleus (TMN) and mast cells.
Histamine is an organic chemical signaling molecule that the body uses. A wide variety of behavioral responses are affected by histamine signaling, including itch, blood vessel dilation, immune signaling, and inflammation.
In the nervous system more specifically, histamine is used as a neurotransmitter. Histamine signals to neurons by activation of one of four classes of receptors, named H1 through H4. The major center of histamine producing neurons in the brain are located in a region of the hypothalamus called the tuberomammillary nucleus, or TMN for short.
In the brain, histamine is responsible for meditating behaviors related to sleep and wake. Activation of histaminergic neurons in the TMN promotes wakefulness, and inactivation of these neurons leads to sleepiness - which accounts for why some antihistamines cause drowsiness.
It's also worth noting that almost half of all brain histamine is derived from non-neuronal cells. Mast cells are pro-inflammatory immune cells that respond to allergic stimuli. In a genetic model of mast cell deficient mice, the mice were observed to have unusual REM and slow-wave sleep patterns in response to histamine antagonists and an increase in anxiety and depressive behaviors (Histamine from Brain Resident MAST Cells Promotes Wakefulness and Modulates Behavioral States).
One way to identify sites of histamine production is to immunostain against the enzyme histidine decarboxylase (HDC). HDC is the biosynthetic enzyme that converts the amino acid histidine into histamine. As far as we know, this pathway is the only route by which histamine can be synthesized. Antibodies against HDC are commercially available.