401 not authorised

Hi all,

I’m currently trying to access data on directors via your API, aiming to input a list of companies and return the related directors (or vice versa).

However, i’m falling at the first hurdle, as i can’t seem to get access with my key. Recieve a 401 unauthorised error. Any ideas?


can you post the code you are using?

I am getting the same error using the basic example which can be found in the documentation and in many topics on this forum. I registered my application and try to use my API key, but keep getting the
“error”: “Invalid Authorization”,
“type”: “ch:service”
error when trying to invoke
curl -u API_key: https://api.company-information.service.gov.uk/company/00002065
Could you please tell what could be the issue? Is it required for my application to be approved or something?


You need to pass an accept header and authorisation. In the following example I am using C# as the programming language. MAke sure that the API key that you use is for the live environment and that it is base 64 encoded as this example

Thank you, it worked!

Great to hear you have solved this.

I have left a C# code example on github in case anyone reads this ticket in the future https://github.com/lukhezo/CompaniesHouse