Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 1
Message 1 of 1

[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:

octo_kit.orgs.createInvitation({
username,
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:

errors:
[ { 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?