Date: 201708
Local time of day: 1201-1800
Location: SFO.Airport, CA
Light: Daylight
Aircraft: B737 Next Generation Undifferentiated
Operator: Air Carrier
Operating under: Part 121
Flight plan: IFR
Mission: Passenger
Flight phase: Climb
Airspace: Class B SFO
ATC / advisory: TRACON NCT
Reporter organization: Air Carrier
Reporter function: Pilot Not Flying; Captain
Reporter qualification: Flight Crew Air Transport Pilot (ATP)
Human factors: Time Pressure; Communication Breakdown; Confusion
Second reporter function: Pilot Flying; First Officer
Anomaly: ATC Issue All Types; Conflict Ground Conflict; Less Severe; Deviation / Discrepancy - Procedural Published Material / Policy; Deviation / Discrepancy - Procedural Clearance
Detector: Person Air Traffic Control
When detected: In-flight
Result: Air Traffic Control Issued New Clearance; Air Traffic Control Provided Assistance; Flight Crew Requested ATC Assistance / Clarification
Contributing factors: Human Factors
Primary problem: Human Factors

Narrative: Taxiing out to Runway 1L; we received a taxi clearance from a busy Ramp Control. The area around our gates at SFO is undergoing construction and taxi room is very limited. Multiple aircraft were approaching 1L and there was an A380 that had pushed back and was creating space/taxi issues for Ramp and Ground Control. We received multiple taxi instructions/changes during our taxi with Ramp and were told to contact Ground as we passed the A380. My focus at this time was primarily outside ensuring clearance on the A380. As we passed the A380 and checked in with Ground Control; we were given another taxi clearance change and it was at this time that Ground also included an altitude cap of 5000 on departure. I heard the taxi clearances but did not hear the new altitude clearance limit of 5000.We were switched to Departure Control passing approximately 1000 AGL. I was the Pilot Monitoring and told Departure we were on the SSTIK1 climbing via the SID. We were in a left hand turn and Departure Control told us to roll out on a heading of 220 and climb to 10;000. I acknowledged and shortly after Departure asked me what altitude Tower had given us on departure. Tower had not given us an altitude on our takeoff clearance so I replied 'to climb via the SID' per our PDC. Departure didn't ask anything else and continued to provide vectors as they often do on this SID out of SFO. Shortly after; the FO stated he thinks we may have been given an altitude limit by Ground Control during one of our taxi instructions. I told him I didn't hear one and that it's unusual (from Ground) but definitely possible. He looked at his notes on his Release and realized during one of his readbacks to Ground; he had 5000 written down. I believe Departure Control realized there was a miscommunication at some point on the ground. He didn't seem upset or stressed. We received a new clearance limit and vector from Departure before even reaching 5000 and I'm guessing he gave this to us based on me checking in passing around 1000 with 'climbing via the SID'.


Second narrative: [Report narrative contained no additional information.]


Synopsis: B737 flight crew reported misinterpreting an altitude clearance on departure due to a communication error with ATC. The cleared altitude was confirmed with ATC and the flight proceeded uneventfully.