HiOne of the first purpose built ground attack aircraft, was the Junkers J.I, which went into service in 1917.
The Junkers J.I was not a ground attack aircraft, it undertook 'contact patrols' to locate friendly troops and to report on location of enemy troops (called 'counter attack patrol' by the British but could be a combined role by an individual aircraft). It was mainly equipped with a single machine gun in the observer's position for defence, although there were experiments with two downward firing MGs (considered unsuccessful by the Germans) and a Becker 20mm (again considered unsuccessful for this type). The aircraft was heavy and extra equipment being fitted was problematic, it also lacked the manoeuvrability that was useful for ground attack aircraft. It carried mainly a wireless and hand held camera (the Germans photographed ground troops' cloth signals) plus message streamers. This was an important role, the J.I was issued in ones and twos to units.
There were other German armoured aircraft and Jack Herris has covered them in his 'German Armoured Warplanes of WWI', Aeronaut Books 2012, and some of these were used for ground attack. However, most ground attack aircraft used by the Germans in the Schlachtflieger units appear to be only lightly armoured or non-armoured (see 'Schlachtflieger!' by Rick Duiven & Dan-San Abbott) to keep up their performance and weapons carrying ability.
Mike