Hi Dhruv,
Thank you for reaching out. That value comes from
this line where the link IDs are queried. If you don't know the ID beforehand, just remove the filter on that query and all of the pending invitations for the account will be returned. Assuming you only have 1 pending invitation at the time, you can just select that linkID to perform the operation on.
Regards,
Mitchell
Google Ads API Team

ref:_00D1U1174p._5004Q1zLUuC:ref