In reality the CIA operative spent a day and a half in Iran, according to the Canadian ambassador.
The real story is that a couple named Sheardown (they didn't even appear in the movie) sheltered four of the Americans in their home for months. The wife did not have diplomatic immunity and would have been executed if they were found out. Canada's parliament had a secret session to grant citizenship to the Americans so they could be legally issued Canadian passports. The CIA provided fake exit visas with wrong dates that, if used, would have gotten everybody killed.
It's virtually a fictional account.
As a “former proud canadian” (from Sask), what they taught us at school (from the viewpoint of our anti-American teachers) is that “we saved Americans in Iran”. It depends on which idiotic province one came from.
From what I've read, this movie is about as historically accurate as The Wind and the Lion; essentially, fiction wrapped around a real occurrence. I'm kinda surprised that Cloony and Affleck didn't jump at the chance to make a movie that would deservedly glorify someone other than Americans. I guess they just can't handle the truth?