It's not an "api" exactly, but you can use:
$caseParams = [
'activity_id' => 1234,
'case_id' => 12,
Are you saying the api call used to work before and now is failing? I'm not sure if it ever worked before with an existing activity?
It looks also like ...
I can't help on the csvimporter part as I am not using it but the CustomField entity is used for defining custom fields. It could be used if you want to create new custom fields from a csv file so it's not what you are looking for.
Instead, you should use the Contact entity which should have the custom fields you need.
If csvimporter doesn't work, you might ...