I'll try to answer your question, sorry if it doesn't satisfy you. I'm going to focus on the 19th century Ottomans here
In 1841, the Porte overhauled the already rooted mürur tezkeresi system with men-i mürur nizamnamesi law. Basically, the law required all all who traveled in the Ottoman Empire to be in possession of a mürur tezkeresi, outlined how Ottoman subjects could obtain them, and detailed the information that was to be included in each document. The mürur tezkiresi tended to be a small document, was generally printed on poor-quality paper, and contained only four lines of basic information on the traveler and his business (name, purpose of visit, intended route, and final destination). The law also made a strict distinction between domestic and international mobility, requiring Ottoman subjects seeking to travel abroad to obtain special permission and from the central government. This meant that by this time only a small, connected and trustworthy minority of Ottomans could hope to obtain the state permission to travel abroad. During the Hamidian Era, further revisions were made to the law and the pasaport nizamnamesi (passport regulation) law was enacted. To travel abroad, a person needed not only a mürur tezkeresi, but also a pasaport and had to prove their identities with a nüfus tezkeresi (identity pass) and ilmühaber (certificate). The Ottoman pasaport document functioned like international passports issued by other states in this era, a diplomatic request for safe passage. Because of the high cost and difficulty to obtain said documents, the Ottoman state was seeking to limit legal international travel to elites or groups trusted by the state. In practice however, there are many travel agents and forgers that could easily issued mürur tezkiresi to people that can pay. There are attempts by the government to stamp them out and further restrict access to the documents, but these never fully disappeared.
In 1910 after the Young Turk Revolution, the mürur tezkiresi system was abolished and a draft of a new passport law was submitted to the Ottoman parliament. Several members of parliament argued for the complete abolishment of the external passport because it restricted freedom of movement and that only Russia, Serbia and Bulgaria were still demanding passport. After a heated debate, the new law was passed on June 1911. The law stated that anyone who leaves the Ottoman Empire to go abroad may choose to obtain a passport. If someone wanted to go abroad without a passport, his or her identity was to be verified about by producing an identity card. If the person was proven to be Ottoman but had not obtained a passport before leaving the country he was to pay for a passport, or, if he had a passport but no visa, twice the fee for a visa. If the person in question was unable to prove identity he was to be put under police surveillance. So if you're an Ottoman and wanted to go abroad, you can't just freely do it, as you had to produce documents, one way or another.
Foreigners entering the Ottoman Empire also received more or less the same treatment. Though most European countries had abolished passports, the Ottoman Empire doesn't follow this trend. Men-i mürur nizamnamesi stated that every foreigner needed both a passport and mürur tezkeresi to travel to the Ottoman Empire. However in many cases mürur tezkeresi can be replaced with a ferman or buyruldu. The former is given by the government mostly to diplomats or foreign officials, while the latter can be obtained from a local governor or police. The passport not only required for foreigners travelling to the Ottoman Empire, but was also required by anybody intending to cross the border into Ottoman territory. During the Hamidian Era the rule was slightly changed that now a visa is required, and the rules stayed more or less the same up to the Young Turk Era.
Sources:
Travel Documents, Mobility Control, and the Ottoman State in an Age of Global Migration, 1880–1915 by David Gutman
Migration and the State: On Ottoman Regulations Concerning Migration Since the Age of Mahmud II by Christoph Herzog