The API key was created on the elastic server
Was this API key created in elasticsearch itself (a service API key), as opposed to through kibana (a kibana API key)? You can receive such an error in this case, as kibana doesn't know anything about the elasticsearch service key. This issue is another example of that.
If that's not the case, I would reiterate trying other permutations to narrow down the issue:
- Can you exercise the Cases API with another authentication method?
- Can you exercise another kibana API (e.g. reading cases)?
FYI there is also a page for Cases prerequisites. It wasn't clear whether you were trying to automate some existing cases workflows, or starting to use cases for the first time, but that page might prove helpful either way.