Leads not assigning to signed in company when created through API

Leads not assigning to signed in company when created through API

Hi,

I have created an app on your system and am using the PHP sdk for CRM.
We are capturing leads from multiple clients who sign in through the OAuth process to the app.

Unfortunately all the leads captured through the app are going to the account that created the app rather than the user who is signed in.

Scenario:
Company A registered the app, Company B creates a lead through the app but the lead gets stored in the list of Company A.

Expectation:
The lead should be stored in Company B.

I cant find anything regarding this in the documentation. 
I can provide samples of my code if required.

Thanks,
Nick