The Union Army had not accepted African Americans as volunteers, but by the summer of 1862 they were beginning to consider some of the benefits of changing that stand. The 37th United States Congress supported the idea of black volunteers for use as laborers and as soldiers. They passed the Militia Act of 1862 which allowed both of these on July 17th 1862. President Abraham Lincoln didn’t start using the Act until after the Emancipation Proclamation was issued in January 1863.
If you would like to read more, check out The Militia Act of 1862