Board Thread:Support Requests - Getting Technical/@comment-43962992-20191030052121/@comment-9605025-20191030062703

I don't know anywhere near enough to answer your question, but have you read Help:Bots? If not, perhaps something there will help. While you can certainly wait for help here. You could also try the dev wiki. That is where most of the users who know this stuff hang out. Although some of them come here as well. - Edit:

Actually, now that I have read your entire post, perhaps the answer is rather simple? When creating/editing a page via a browser, you can add categories by placing a category link on the page. For information on that, see this page. I am guessing that you can do the same when creating your pages via bot. Just place the category link as part of the page content.