Way to not answer the question. At all. (:
City ID for a city you own can be found by holding the mouse over the checkbox beside the city in your city inventory. If the city is your faction's, you need to consult them. If neither you nor the faction owns the city, you can't create an NPC in it.
NPC rules are located at: http://rules.swcombine.com/general/npcs/