The diagnosis of primary headache disorders is clinical and based on the diagnostic criteria of the International Headache Society (ICHD-3-beta). However several brain conditions may mimic primary headache disorders and laboratory investigation may be needed. This necessity occurs when the treating physician doubts for the primary origin of headache. Features that represent a warning for a possible underlying disorder causing the headache are new onset headache, change in previously stable headache pattern, headache that abruptly reaches the peak level, headache that changes with posture, headache awakening the patient, or precipitated by physical activity or Valsalva manoeuvre, first onset of headache >= 50 years of age, neurological symptoms or signs, trauma, fever, seizures, history of malignancy, history of HIV or active infections, and prior history of stroke or intracranial bleeding. All national headache societies and the European Headache Alliance invited to review and comment the consensus before the final draft. The consensus recommends brain MRI for the case of migraine with aura that persists on one side or in brainstem aura. Persistent aura without infarction and migrainous infarction require brain MRI, MRA and MRV. Brain MRI with detailed study of the pituitary area and cavernous sinus, is recommended for all TACs. For primary cough headache, exercise headache, headache associated with sexual activity, thunderclap headache and hypnic headache apart from brain MRI additional tests may be required. Because there is little and no good evidence the committee constructed a consensus based on the opinion of experts, and should be treated as imperfect.