Starfleet codes

Code 1 signals either a total or imminent disaster, a possible invasion, or indicates that the Federation is either currently or about to be engaged in open warfare with a hostile power. The code requires all Starfleet personnel within the affected area to  immediately assume a 'war' footing or posture. It is also colloquially known as "Defense Alert", or a "Priority One Alert". In 2267, the Enterprise received a Code 1 message from Starfleet Command stating they were at war with the Klingon Empire (TOS: "Errand of  Mercy", "The Trouble with Tribbles", "The Alternative Factor")