Postgresql Update Table row values by Grouped Column
Simple answer - as the dummy value in api_id doesn't matter: use the call_id:

update the_table 
    set api_id = call_id::text 
where api_id is null;




Complicated answer: 

Assuming you have some way of generating a random string, you could do something like this (untested):

update the_table
   set api_id = t.random_string
from (
  select distinct on (call_id) call_id, random_string() as random_string
  from the_table
  where api_id is null
  order by call_id
) t 
where t.call_id = the_table.call_id
 and the_table.api_id is null;


This generates one row with per call_id in the inner query and generates a random value for each of that. This result is then used to update the target table.

The above assumes that if there is already value for a specific call_id there is one for all rows. It won't "fill" in missing api_id for other rows (e.g. if there was a row with call_id = 123 but no api_id)