The short answer
From 1498 to 1512 he was a civil servant of the Florentine republic: head of the second chancery, and secretary to the Ten, the committee that ran its wars and diplomacy. He was never a minister, never a member of the government, and never made a decision of state that was his to make.
The office
Florence's chief magistrates changed every two months, by design, so that nobody could build a following. The chancery was the government's memory: its clerks wrote the letters, kept the files and received the dispatches. He was elected in June 1498 at a salary of a hundred and ninety-two florins a year. His colleagues' letters show an office anyone would recognise: a clerk reprimanded for leaving early, a magistrate storming in shouting write!
The missions
He was sent, not as an ambassador but as a mandatario, to listen and report: to the King of France in 1500, to Cesare Borgia in 1502, to Rome for the conclave of 1503, to the Emperor in 1507 and 1508. He also raised and defended a militia of Florentine subjects from the countryside, and argued for it in public.
The end
In 1512 the militia ran at Prato, the republic fell, and on 7 November he was dismissed and barred from the building where he had worked for fourteen years. Everything he wrote afterwards, The Prince included, was written by a man who wanted the job back.