# Requests to Officers API returning CORS Error & 403

**URL:** <http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011>\
**Category:** API Issues\
**Created:** [June 3, 2024, 2:28pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011 "2024-06-03T14:28:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharon\_robinson](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/s/7993a0/32.png) [@sharon\_robinson](http://forum.companieshouse.gov.uk/u/sharon_robinson)\
**Post date:** [June 3, 2024, 2:28pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/1 "2024-06-03T14:28:03Z")

</div>

When we are trying to get the details of officers for a company we get the following

`Access to XMLHttpRequest at 'https://api.company-information.service.gov.uk/company/.../officers' from origin '...' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.`

The ‘companies’ request is returning as expected, but the ‘officers’ call is continually returning the above.

Have there been any changes to the API recently that would affect this? From what we can see there doesn’t appear to be any Access-Control-Allow-Origin response header on the ‘officers’ request.

---

<div class="post-metadata">

**Author:** ![andrew2](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/a/58956e/32.png) [@andrew2](http://forum.companieshouse.gov.uk/u/andrew2)\
**Post date:** [June 7, 2024, 4:40am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/2 "2024-06-07T04:40:42Z")

</div>

I’ve had a similar problem for months - and just crickets from CH.  
[https://forum.aws.chdev.org/t/company-officers-api-401-cors-issue/7752/13?u=andrew2](https://forum.aws.chdev.org/t/company-officers-api-401-cors-issue/7752/13?u=andrew2)  
If you want to talk and try and work out what we have in common we might get some leads.

---

<div class="post-metadata">

**Author:** ![ed.reid](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/e/6a8cbe/32.png) [@ed.reid](http://forum.companieshouse.gov.uk/u/ed.reid)\
**Post date:** [June 10, 2024, 1:11pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/3 "2024-06-10T13:11:35Z")

</div>

We have also been having this issue from at least April 14th. Companies House have suggested that this may have been triggered by another Change they had implemented on the Officers API but we have not had any further update since.

@MArkWilliams is there any update on this issue as of yet please?

Thanks,  
Ed

---

<div class="post-metadata">

**Author:** ![MArkWilliams](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/markwilliams/32/194_2.png) [@MArkWilliams](http://forum.companieshouse.gov.uk/u/MArkWilliams)\
**Post date:** [June 24, 2024, 1:20pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/4 "2024-06-24T13:20:49Z")

</div>

We have now found the issue and are looking at a fix.

---

<div class="post-metadata">

**Author:** ![BristolJim](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@BristolJim](http://forum.companieshouse.gov.uk/u/BristolJim)\
**Post date:** [July 29, 2024, 11:13am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/5 "2024-07-29T11:13:38Z")

</div>

Hi,

I’m also getting the following from the /company endpoint:

`Access to XMLHttpRequest at 'https://api.companieshouse.gov.uk/company/07206291' from origin '...' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.`

I get this via javascript in-browser (Chrome and Firefox tested so far). The preflight request returns 403 Forbidden.

When I run the same via cURL however, it works as expected. e.g.

`curl https://api.companieshouse.gov.uk/company/07206291 -H 'Authorization: Basic [api_key]'`

It also works when I make the request via Postman.

Requests to the /search/companies endpoint work in-browser as I’d expect. e.g

`https://api.companieshouse.gov.uk/search/companies?q=test`

This only appears to have started happening for us over the weekend.

@MArkWilliams - Would the issue you have found account for the problems I’m experiencing?

---

<div class="post-metadata">

**Author:** ![developer4](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/developer4/32/1773_2.png) [@developer4](http://forum.companieshouse.gov.uk/u/developer4)\
**Post date:** [July 29, 2024, 12:34pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/6 "2024-07-29T12:34:52Z")

</div>

We are also experiencing the same issue as BristolJim today.

Trying the same request in Postman is fine, through javascript in-browser we get 403 / COR error.

Is there a current problem with the API endpoints at Companies House?

Update:  
@MArkWilliams are you aware of any issues on the “company” endpoint since the update last weekend (Saturday 27th July 2024)?

---

<div class="post-metadata">

**Author:** ![george.morriss](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@george.morriss](http://forum.companieshouse.gov.uk/u/george.morriss)\
**Post date:** [July 30, 2024, 10:56am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/7 "2024-07-30T10:56:53Z")

</div>

@MArkWilliams We are also experiencing the same issues, this is preventing us from using the API altogether as it cannot pull back any company information.

Is there any update on this?

---

<div class="post-metadata">

**Author:** ![it13](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/i/ee59a6/32.png) [@it13](http://forum.companieshouse.gov.uk/u/it13)\
**Post date:** [July 30, 2024, 3:20pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/8 "2024-07-30T15:20:51Z")

</div>

We are also getting a CORS error on the /company endpoint. Any update on when it will be fixed or any workarounds in the meantime?

---

<div class="post-metadata">

**Author:** ![developer4](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/developer4/32/1773_2.png) [@developer4](http://forum.companieshouse.gov.uk/u/developer4)\
**Post date:** [August 5, 2024, 9:32am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/9 "2024-08-05T09:32:37Z")

</div>

This is still erroring on the “company” endpoint. It’s been broken for over a week now.

Is there any update if this is being looked into or investigated even if it’s an acknowledgement of the issue?

---

<div class="post-metadata">

**Author:** ![callum\_watkins](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/c/f0a364/32.png) [@callum\_watkins](http://forum.companieshouse.gov.uk/u/callum_watkins)\
**Post date:** [August 11, 2024, 6:20pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/10 "2024-08-11T18:20:33Z")

</div>

@MArkWilliams This issue has now broken my service entirely, first the `/officers` endpoint starting 4 months ago (!) and now `/company`. Can you please confirm when you will be releasing a fix?

---

<div class="post-metadata">

**Author:** ![irvin.alzona](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/i/3d9bf3/32.png) [@irvin.alzona](http://forum.companieshouse.gov.uk/u/irvin.alzona)\
**Post date:** [August 12, 2024, 1:55pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/11 "2024-08-12T13:55:47Z")

</div>

Hi @MArkWilliams ,

I hope you are well. I would like to follow up on this item please. I can see that this is also related to this issue we are monitoring:

- [Company Officers API 401 CORS Issue - #25 by irvin.alzona](https://forum.aws.chdev.org/t/company-officers-api-401-cors-issue/7752/25)

Regards,  
Irvin

---

<div class="post-metadata">

**Author:** ![lee.johnson](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/l/7ab992/32.png) [@lee.johnson](http://forum.companieshouse.gov.uk/u/lee.johnson)\
**Post date:** [August 20, 2024, 9:39am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/12 "2024-08-20T09:39:16Z")

</div>

Hi,

Did you get this fixed, We are having exactly the same problem, work in Postman but not from website, and has been working for years up until 3 weeks ago.

I’m not seeing any help for Companies House team at all!

---

<div class="post-metadata">

**Author:** ![BristolJim](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/b/9dc877/32.png) [@BristolJim](http://forum.companieshouse.gov.uk/u/BristolJim)\
**Post date:** [August 20, 2024, 10:22am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/13 "2024-08-20T10:22:33Z")

</div>

Hi Lee,

I’ve just checked and it’s not fixed.

---

<div class="post-metadata">

**Author:** ![Jeffrey](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/jeffrey/32/1394_2.png) [@Jeffrey](http://forum.companieshouse.gov.uk/u/Jeffrey)\
**Post date:** [August 20, 2024, 11:53am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/14 "2024-08-20T11:53:30Z")

</div>

Confirming this is still an issue on our end as well, rendering our engineers incapable of using the API locally for months. @MArkWilliams can you share any ETA with us as to when we can expect this issue to be resolved?

---

<div class="post-metadata">

**Author:** ![lee.johnson](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/l/7ab992/32.png) [@lee.johnson](http://forum.companieshouse.gov.uk/u/lee.johnson)\
**Post date:** [August 20, 2024, 1:19pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/15 "2024-08-20T13:19:13Z")

</div>

I’m getting a 403 (Forbidden) on the preflight OPTIONS request made before the GET request.

I don’t think they have the OPTIONS method in their allowed methods??

---

<div class="post-metadata">

**Author:** ![callum\_watkins](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/c/f0a364/32.png) [@callum\_watkins](http://forum.companieshouse.gov.uk/u/callum_watkins)\
**Post date:** [August 27, 2024, 7:30pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/16 "2024-08-27T19:30:50Z")

</div>

@MArkWilliams Months go by and we hear nothing. Two months ago you said you had found the issue and were looking at a fix. Are you still working on implementing that fix? Please give us some information.

---

<div class="post-metadata">

**Author:** ![MArkWilliams](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/markwilliams/32/194_2.png) [@MArkWilliams](http://forum.companieshouse.gov.uk/u/MArkWilliams)\
**Post date:** [August 29, 2024, 11:40am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/17 "2024-08-29T11:40:19Z")

</div>

A fix has now gone in for this issue.  
If you are making CORS requests you will need to ensure the api key that you are using has your site in the js\_domains array.

---

<div class="post-metadata">

**Author:** ![callum\_watkins](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/c/f0a364/32.png) [@callum\_watkins](http://forum.companieshouse.gov.uk/u/callum_watkins)\
**Post date:** [August 30, 2024, 7:19pm UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/18 "2024-08-30T19:19:21Z")

</div>

I can confirm that the fix has resolved this issue.

It would be excellent if the team could look at fixing CORS for 429 responses too: [CORS headers missing from 429 response](https://forum.aws.chdev.org/t/cors-headers-missing-from-429-response/5209)

---

<div class="post-metadata">

**Author:** ![MArkWilliams](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/markwilliams/32/194_2.png) [@MArkWilliams](http://forum.companieshouse.gov.uk/u/MArkWilliams)\
**Post date:** [September 2, 2024, 11:46am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/19 "2024-09-02T11:46:47Z")

</div>

Thank you for that confirmation. I have also fed back your comment regarding 429 responses.

---

<div class="post-metadata">

**Author:** ![MArkWilliams](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/markwilliams/32/194_2.png) [@MArkWilliams](http://forum.companieshouse.gov.uk/u/MArkWilliams)\
**Post date:** [September 3, 2024, 10:30am UTC](http://forum.companieshouse.gov.uk/t/requests-to-officers-api-returning-cors-error-403/8011/20 "2024-09-03T10:30:36Z")

</div>

Some good news.  
The work to fix ‘CORS for 429 responses’ has been given the go ahead.  
I have posted an update on that thread.
