API Integration

I am experiencing an authentication issue with a newly created Live REST API key.

Application: DMAS Lead Generation
Environment: Live
Key type: REST API key
Restricted IPs: None
JavaScript domains: None

I am trying to access the Companies House Public Data API using the documented HTTP Basic Authentication method, with the API key as the username and a blank password.

Endpoint tested:

https://api.company-information.service.gov.uk/company/17145528

I have tested the key independently using Windows curl.exe, not just through my application.

The request follows the documented format:

curl -i -u "<API_KEY>:" -H "User-Agent: DMAS-Lead-Generation/1.0" https://api.company-information.service.gov.uk/company/17145528

The response is:

HTTP/1.1 400 Bad Request

{"error":"Invalid Authorization header","type":"ch:service"}

The response headers also include:

Ch-Authentication-Error: Invalid Authorization header

I have:

  1. Created a Live application.
  2. Created a new REST API key.
  3. Copied the key directly using the Developer Hub’s Copy function.
  4. Tested the key using the documented Basic Authentication method.
  5. Tested it independently using Windows curl.exe.
  6. Confirmed there are no IP restrictions or JavaScript domain restrictions.
  7. Generated a fresh key and received the same response.

Could you please check whether the Live REST API key for this application/account has been correctly activated/provisioned, and advise if there is any additional activation or account approval step required?

I would be grateful if you could also confirm whether there is currently an issue affecting newly generated Live REST API keys.

I have not included the API key itself for security reasons.

I’ve tested the same request with my own Live REST API key and it succeeds. I also used --config NUL to avoid any local curl configuration and --basic to make the authentication scheme explicit.

Could you try the following, replacing only the placeholder with your key?

curl.exe --config NUL --basic --user "your-LIVE-key-here:" --header "Accept: application/json" --header "User-Agent: DMAS-Lead-Generation/1.0" --verbose "https://api.company-information.service.gov.uk/company/17145528"

Please check that there is no leading or trailing whitespace in the key and that the colon remains immediately after the key inside the quotes. Output from my test is below. It might be worth creating another live app and using a new key just to be sure.

curl -i -u "my-REST-API-KEY-was-here:" -H "User-Agent: DMAS-Lead-Generation/1.0" https://api.company-information.service.gov.uk/company/17145528

HTTP/2 200
date: Thu, 24 Sep 2026 15:19:24 GMT
content-type: application/json
access-control-allow-credentials: true
access-control-allow-headers: X-RateLimit-Query, origin, content-type, content-length, user-agent, host, accept, authorization
access-control-expose-headers: X-RateLimit-Window, X-RateLimit-Limit, X-RateLimit-Remain, X-RateLimit-Reset, Location, www-authenticate, cache-control, pragma, content-type, expires
, last-modified
access-control-max-age: 3600
cache-control: no-cache, no-store, max-age=0, must-revalidate
expires: 0
pragma: no-cache
set-cookie: JSESSIONID=I_REMOVED_THIS_MANUALLY; Path=/; HttpOnly
x-content-type-options: nosniff
x-frame-options: DENY
x-ratelimit-limit: 600
x-ratelimit-remain: 598
x-ratelimit-reset: 1790263458
x-ratelimit-window: 5m
x-xss-protection: 0

{“accounts”:{“accounting_reference_date”:{“day”:“30”,“month”:“04”},“next_accounts”:{“due_on”:“2028-01-09”,“overdue”:false,“period_end_on”:“2027-04-30”,“period_start_on”:“2026-04-09”
},“next_due”:“2028-01-09”,“next_made_up_to”:“2027-04-30”,“overdue”:false},“can_file”:true,“company_name”:“\“BIGHOUSE DIRECT LTD\” LTD”,“company_number”:“17145528”,“company_status”:"
active",“confirmation_statement”:{“next_due”:“2027-04-22”,“next_made_up_to”:“2027-04-08”,“overdue”:false},“date_of_creation”:“2026-04-09”,“etag”:“c31c070c408c2d6896c9516d1bfe393c459
6a0b0”,“has_charges”:false,“has_insolvency_history”:false,“jurisdiction”:“england-wales”,“links”:{“persons_with_significant_control”:“/company/17145528/persons-with-significant-cont
rol”,“self”:“/company/17145528”,“filing_history”:“/company/17145528/filing-history”,“officers”:“/company/17145528/officers”},“registered_office_address”:{“address_line_1”:“1 Rossall
Avenue”,“country”:“United Kingdom”,“locality”:“Manchester”,“postal_code”:“M26 1JD”},“registered_office_is_in_dispute”:false,“sic_codes”:[“47910”],“type”:“ltd”,“undeliverable_regist
ered_office_address”:false,“has_super_secure_pscs”:false}`