Who was the first African-American staff officer in the US armed forces?

Brigadier General Benjamin Oliver Davis, Sr. Entered the officer ranks in 1898 during the war with Spain. In November 1944 he became Special Assistant to the Commanding General, Communications Zone, European Theater of Operations, stationed in Paris, France, and in November 1945 was granted a period of detached service for the purposes of recuperation and rehabilitation. In January 1946 he again became Assistant, The Inspector General, Washington, D.C. He retired on 14 July 1948, after having served fifty years. General Davis died on November 26, 1970. His remains are interred in Arlington National Cemetery, Arlington, Virginia. His son, Lieutenant General Benjamin O. Davis, Jr., (U.S. Air Force, Retired), is the fourth African American graduate of the U.S. Military Academy and the nation's second African American general officer. You did say Staff Officer (also called Flag Officer)in your question, but here's some more info: First Black Officer promoted in the field was Stephen Swails of Cooperstown, Mass in 1864. First Black Officer to graduate from West Point Academy was Henry Flipper in 1877.