# Company Officers API 401 CORS Issue

**URL:** <http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752>\
**Category:** API Issues\
**Created:** [April 12, 2024, 5:21pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752 "2024-04-12T17:21:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamie](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@jamie](http://forum.companieshouse.gov.uk/u/jamie)\
**Post date:** [April 12, 2024, 5:21pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/1 "2024-04-12T17:21:37Z")

</div>

Hi,

Calling the company officers API we are getting a 401 CORS error returned. Last week this was working but we are now seeing the following (where 123456 would be a valid company id):

```
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.companieshouse.gov.uk/company/123456/officers?items_per_page=100. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 401.

```

Here is how we are calling the API:

```
$.ajax({
  url: "https://api.companieshouse.gov.uk/company/" + companyNumber + "/officers?items_per_page=100",
  dataType: "json",
  async: false,
  headers: {
    "Authorization": "Basic XXXXXXXXX" ,
    "Content-Type": "application/json"
  },
  success: function (data) {}
});

```

Calling other APIs are working as expected - for example the companies API:

```
var encoded = encodeURIComponent(search); 
$.ajax({
  url: "https://api.companieshouse.gov.uk/search/companies?q=" + encoded + "+&items_per_page=100",
  dataType: "json",
  async: false,
  headers: {
    "Authorization": "Basic XXXXXXXXX" ,
    "Content-Type": "application/json"
  },
  success: function (data) {}
});

```

We have checked the allowed IP/domains which are correct (and haven’t changed) and they are correct. With other API calls going through successfully just the one for company officers not working.

Have there been any changes recently or known issues we should be aware of?

Thank you.

---

<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:** [April 14, 2024, 6:13pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/2 "2024-04-14T18:13:30Z")

</div>

Ahh it’s not just me! This was driving me crazy and then your post suggested it was just the officer filings - confirmed true. Can get everything else. Def CH side then as I’ve not changed anything either.

---

<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:** [April 14, 2024, 7:06pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/3 "2024-04-14T19:06:22Z")

</div>

@MArkWilliams tagging you in as I’ve seen you reply on other matters to do with companies house issues, are you able to help with this at all?

---

<div class="post-metadata">

**Author:** ![development.uk](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@development.uk](http://forum.companieshouse.gov.uk/u/development.uk)\
**Post date:** [April 16, 2024, 3:15pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/4 "2024-04-16T15:15:07Z")

</div>

Hi, when calling the officers API we have also been getting a 401 CORS error, starting from last week Tuesday 9th April. All other API calls (such as for filing history) are working fine, it’s specifically officers with the issue.

Error returned (where 123456 would be a valid company id):  
`Access to fetch at 'https://api.companieshouse.gov.uk/company/123456/officers?items_per_page=100&start_index=0' from origin (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.`

API call:  
`fetch( 'https://api.companieshouse.gov.uk/company/${companyNumber}/officers?items_per_page=100start_index=0', { headers: { Authorization: 'Basic ' + 'XXXXXXXXXXXXX' } } )`

There’s been no changes on our side, and all other API calls (constructed in the same way, with same auth) work aside from company officers.  
We would also like to know if there’s been changes to the officers API, or any currently known issues with the officers API. Thank you

---

<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:** [April 17, 2024, 11:45am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/5 "2024-04-17T11:45:52Z")

</div>

Hi @MArkWilliams, are you able to help with this? we are also receiving the same error

---

<div class="post-metadata">

**Author:** ![jamie](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@jamie](http://forum.companieshouse.gov.uk/u/jamie)\
**Post date:** [April 22, 2024, 9:59am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/6 "2024-04-22T09:59:57Z")

</div>

Hi,

Are we able to get an update if this is expected behaviour now or if this is a confirmed issue?

Thanks!

---

<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:** [April 24, 2024, 9:39am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/7 "2024-04-24T09:39:46Z")

</div>

We are not able to reproduce this, but we are investigating.  
For clarity, are you only having issues with one of our API’s, officers? All others are ok?  
If anyone has any other details that may help, please feel free to add here.  
If there is anyone who does not have issues, also please shout…

---

<div class="post-metadata">

**Author:** ![jamie](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@jamie](http://forum.companieshouse.gov.uk/u/jamie)\
**Post date:** [April 24, 2024, 10:08am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/8 "2024-04-24T10:08:00Z")

</div>

Hi @MArkWilliams,

Thanks for the response. Yes we are only having issues with the officers API - which is giving the CORS error. As far as i’m aware the others are working fine (we also use the company search/company profile and they work fine). We use the same API key calling both with one working and one not so domains are correct.

Thanks!

---

<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:** [April 24, 2024, 3:44pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/9 "2024-04-24T15:44:24Z")

</div>

Hi @MArkWilliams ,

We are experiencing this same problem. As others have mentioned, all other request areas that we use are working okay with the same API Key, it is just the requests to the Officers API that are returning a 401 code where it wasn’t previously. This is causing significant issues for us so we appreciate you taking the time to look into this!

Thank you,  
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:** [April 24, 2024, 4:38pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/10 "2024-04-24T16:38:24Z")

</div>

We are still unable to reproduce this, but are still investigating. We are now looking at all deployments and changes. We have 2 dates from this forum post here of 9th April and 12th April. Does anyone have a more accurate date or time when they first experienced this?

---

<div class="post-metadata">

**Author:** ![srshankirth](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/s/ecccb3/32.png) [@srshankirth](http://forum.companieshouse.gov.uk/u/srshankirth)\
**Post date:** [April 25, 2024, 9:23am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/11 "2024-04-25T09:23:32Z")

</div>

@MArkWilliams ,

We see the same problem specifically with officers API and the issue is consistently occurring.  
The successfull request, response from my end on 27-March-2024.  
Please note we have not received request after 27th March until 12th Apr on my app end.

Hence, I would suggest you to check the deployments or any change which was done from company house between 28th Mar “To” 12th Apr.

---

<div class="post-metadata">

**Author:** ![srshankirth](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/s/ecccb3/32.png) [@srshankirth](http://forum.companieshouse.gov.uk/u/srshankirth)\
**Post date:** [April 29, 2024, 7:32am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/12 "2024-04-29T07:32:39Z")

</div>

Hi @MArkWilliams ,  
could you please let us know if the problem is identified and for fix.

---

<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:** [April 30, 2024, 10:12am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/13 "2024-04-30T10:12:55Z")

</div>

@MarkWilliams If you want a demo of the problem, use the refresh icon on this page with the F12 del tools window open:  
[https://www.myeventflo.com/crisp/compare.aspx](https://www.myeventflo.com/crisp/compare.aspx)  
(green circle arrow buttons)  
If I remove the fetch\_officer\_data() function I get company and PSC data just fine. All three fetch functions use the same requester function sendRequest() which has  
var headers = new Headers({  
‘Authorization’: 'Basic ’ + apikey64,  
‘Content-Type’: ‘text/json’,  
‘Origin’: ‘[https://www.myeventflo.com/](https://www.myeventflo.com/)’  
});  
const options = {  
method: method,  
headers: headers,  
mode: ‘cors’  
};

---

<div class="post-metadata">

**Author:** ![srshankirth](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/s/ecccb3/32.png) [@srshankirth](http://forum.companieshouse.gov.uk/u/srshankirth)\
**Post date:** [April 30, 2024, 1:44pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/14 "2024-04-30T13:44:25Z")

</div>

Hi @MArkWilliams ,

Could you please check if the change implemented as per below link causing an problem on this current ongoing issue.

[https://forum.aws.chdev.org/t/company-officers-list-ordering-of-results-changes/7711/2](https://forum.aws.chdev.org/t/company-officers-list-ordering-of-results-changes/7711/2)

---

<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:** [May 8, 2024, 10:21am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/15 "2024-05-08T10:21:39Z")

</div>

Hi @MArkWilliams,

Could we please request an update on this? Has there been any progression with the investigation?

This issue is causing significant issues with our business, so any update would be much appreciated.

We appreciate you taking the time to look into this.

Thanks again,  
Ed

---

<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:** [May 15, 2024, 3:20pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/16 "2024-05-15T15:20:17Z")

</div>

Hi @MArkWilliams is there any update on this issue yet?

Thank you,  
Ed

---

<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:04pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/17 "2024-06-10T13:04:38Z")

</div>

Hi @MArkWilliams

Has there been any update on this? This issue is having a large impact on our operations so any update would be much appreciated.

Thank you,  
Ed

---

<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:** [June 11, 2024, 9:05am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/18 "2024-06-11T09:05:23Z")

</div>

@MArkWilliams do we have any update on this? we have had to turn the API off to get around this issue which has been like this since April

---

<div class="post-metadata">

**Author:** ![development.uk](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/d6d6ee/32.png) [@development.uk](http://forum.companieshouse.gov.uk/u/development.uk)\
**Post date:** [June 11, 2024, 12:35pm UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/19 "2024-06-11T12:35:57Z")

</div>

Hi @MArkWilliams. We to are waiting for an update. This has been an issue for a while now.  
To confirm, this was first noticed by us 9th April

Thanks.

---

<div class="post-metadata">

**Author:** ![jamie](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/j/aca169/32.png) [@jamie](http://forum.companieshouse.gov.uk/u/jamie)\
**Post date:** [June 13, 2024, 9:20am UTC](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752/20 "2024-06-13T09:20:45Z")

</div>

Hi @MArkWilliams,

Just following up. Has it been confirmed that the behaviour for calling this API has changed?

Thank you

[Next page](http://forum.companieshouse.gov.uk/t/company-officers-api-401-cors-issue/7752.md?page=2)
