[Github App] inviting user to organization, error: "Inviter must be an organization admin"

I am trying to invite members to my org through an installed github app.

I am using @octokit/rest:

org: ORG_NAME',
headers: { accept: 'application/vnd.github.dazzler-preview+json' },

this method corresponds to PUT /orgs/:org/memberships/:username which is marked as “Enabled for Github Apps”

I am receiving this error:

[ { resource: 'OrganizationInvitation',
code: 'unprocessable',
field: 'data',
message: 'Inviter must be an organization admin' } ]

My app has the following permission:
Organization Members: [Read/Write]

How can I resolve this?

Hi @the-vampiire,

Thank you for being here, and our apologies for the delay! If you are still having this issue could you please send us the full output of a curl -v request that demonstrates the problem?

That should help us investigate the issue. Also, please make sure you mask any sensitive information like OAuth tokens and Authorization headers in the output of the curl command. Please send the output to https://github.com/contact. And include a link to this thread to give support some background on the ticket.

I hope this helps!