Companies house Api Error

How to fix This error?
{“error”:“Empty Authorization header”,“type”:“ch:service”}

Welcome to the forum. A good place to start is to read the into / authorisation docs:
https://developer-specs.company-information.service.gov.uk/guides/authorisation

Many people seem to struggle with authorization - it might be helpful to understand:

…and have a basic understanding of what http headers are and what is being sent (even if a tool is supposed to do this part for you). In this case it looks like that’s where the issue is.

It’s always a good idea to clearly explain what you want to achieve and what you’re doing when you want help with an error / problem. This should help avoid communication problems - especially between people with different languages / cultures and saves time. See notes on the SSECE - Short, Self Contained, Correct (Compilable), Example and being aware of avoiding x-y problems). Here it would be appropriate to report after your problem:

  • What script / library / tool you use to connect to the API

  • What parameters / setup / code you’re using with that (e.g. screenshot of Postman set-up, minimum lines of code you were using - and what language!)

  • Which API endpoint you were calling.

In this forum you shouldn’t list any passwords / your API key however.

Hope this helps.

By the way, if this occurred in Postman there’s a visual guide on exactly how to set that up in the following thread:

I struggled with this for hours last week. What worked for me was that I changed the Authentic type to “Private key in header” and then set the key name to “Authorization” and the value to my api key.