Amb. Macharia is the Principal Secretary – Ministry of Foreign Affairs and International Trade. He previously served as Kenya's representative to the United Nations and as the former President of the UNICEF Executives Board. 

He had a long career in the service of the United Nations, including with UNICEF and the United Nations Development Programme (UNDP) in Africa, the Caribbean and New York. He previously served as the Permanent Representative of Kenya to the United Nations from 2010 up to 26th Jan 2018, and previously in Nairobi (2009-2010). He has also served on UN special assignments, and was President of the United Nations Children’s Fund (UNICEF) Executive Board (2014); President of UN Forests Forum (2011-2012), Co-Chair of the Ad hoc Working Group on Forest Financing (2010-2011), Vice President of the 67th Session of the UN General Assembly, Co-Chair of the General Assembly Working Group on the Sustainable Development Goals (SDGs) (2012-2014) and as co-facilitator of the post 2015 Development Agenda (2014-2015). He was also Chairperson of the United Nations Peacebuilding Commission. 

He graduated from the College of Wooster in Ohio, United States, with a B.A. in History, Economics, and Religion. In 1983, he obtained a Master of Education in Administration and Social Policy from Harvard University, in Cambridge, Massachusetts, United States. He lists specializations in "macro-economic policy management and in social policy and planning.”