Hello Oleksandr,
You may use the
SharedCriterionService to add the keyword to the negative keyword list created at the account level. You will need to include the shared_set and the Keyword Id in the mutate request. The code sample available
here should be helpful to get started.
Please let me know if you face any issues.
Thanks,
Bharani, Google Ads API Team

ref:_00D1U1174p._5001UCaaqM:ref