Starfleet oath
The Starfleet oath was the oath taken by every commissioned and non-commissioned officer serving in Starfleet.

The oath
The oath included:
A vow to obey the laws of the United Federation of Planets, to defend its security and to abide to the principles it stood for. (; ; )
A vow to obey Starfleet orders and responsibilities. (; )
A vow to obey the principle of non-interference and to uphold it with ones life if necessary. (; )
A vow "to seek out life", the principle Starfleet was founded on. (; )

History
In 2268, Commander Spock explained to his mother, that it was because of the oath had taken when he was commissioned, why at the time he could not relinquish command of the  to another officer. When the ship was under attack, the oath demanded him to carry out his responsibilities as the acting captain. ()

Later in the same year, Spock stated that the oath he swore as a Starfleet officer meant that as long as he wore the uniform, his duty was to protect the security of the Federation. ()

In 2367, Captain Jean-Luc Picard accepted the resignation of Lieutenant Worf from Starfleet. His sworn oath as a Starfleet officer, would have prohibited Worf from supporting Gowron in the Klingon Civil War, as it would have been interfering in an internal affair of the Klingon Empire. As a Starfleet officer, Worf was prohibited from violating the principle of non-interference, even if he had taken an extended leave of absence. ()
 
In 2370, when Lieutenant Jadzia Dax was preparing to depart Deep Space 9 with three Klingons, in order to help them avenge their sons' murders and thereby fulfill the terms of a blood oath taken by Curzon Dax, Captain Benjamin Sisko reminded her that she had also taken an oath when she joined Starfleet. By that oath she was subject to orders, and to obey the laws of the Federation. ()

Later in the same year, when the Cardassians accused the non-commissioned Chief Petty Officer Miles O'Brien of secretly providing Starfleet weapons to the Maquis, O'Brien assured Odo that he took an oath to defend the Federation and what it stands for. ()

In 2371, prior to the Klingon Empire's attack on Deep Space Nine, Klingon Chancellor Gowron attempted to sway Lt. Cmdr. Worf into joining the Klingons' invasion of Cardassia. Worf refused, since he had sworn an oath of allegiance to the Federation, and couldn't break his word due to his internal sense of Klingon honor. In response, Gowron stripped Worf's Great House (the House of Mogh) of its titles and made Worf and his family pariahs and personas non grata in the Empire. () 

In 2372, Captain Benjamin Sisko stated that, as a Starfleet officer, he was bound by oath not to interfere with Bajoran affairs. ()

In 2376, Captain Kathryn Janeway reminded Captain Rudolph Ransom of the oath he had taken as a Starfleet officer, "to seek out life, not destroy it," when it was discovered he was responsible for murdering several nucleogenic lifeforms. ()

See also 
Captain's Oath
Hippocratic Oath

Starfleet
Vows