# 403 Forbidden - I get 403

**URL:** <http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006>\
**Category:** Uncategorized\
**Created:** [September 17, 2026, 2:18am UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006 "2026-09-17T02:18:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mxb500](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mxb500](http://forum.companieshouse.gov.uk/u/mxb500)\
**Post date:** [September 17, 2026, 2:18am UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/1 "2026-09-17T02:18:57Z")

</div>

I am an experienced RESTful developer, years of experience developing MTD products but new to CH platform. Everything looks straightforward until you start getting 403 for no apparent reason.

I have recently signed up, created an app, generated keys, configured redirect urls localhost and ports. Any calls coming back with 403. Cannot create a test company so nothing testing.

Any wise words?

---

<div class="post-metadata">

**Author:** ![companieshousedata](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/companieshousedata/32/2190_2.png) [@companieshousedata](http://forum.companieshouse.gov.uk/u/companieshousedata)\
**Post date:** [September 18, 2026, 12:38pm UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/2 "2026-09-18T12:38:46Z")

</div>

Can you try this:

```auto
curl -v -u 'YOUR_API_KEY:' \
  https://api.company-information.service.gov.uk/company/00000006

```

And if it fails, can you post the 403 body with the key redacted and maybe that might reveal more.

Additionally:  
Have a gander at this and see if it’s relevant to you: [Issues with creating test company in sandbox API](https://forum.companieshouse.gov.uk/t/issues-with-creating-test-company-in-sandbox-api/12444)  
And this: [Reports of invalid auth when using key in test.](https://forum.companieshouse.gov.uk/t/invalid-authorization-when-using-api-key/12696)

---

<div class="post-metadata">

**Author:** ![mxb500](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mxb500](http://forum.companieshouse.gov.uk/u/mxb500)\
**Post date:** [September 22, 2026, 8:17am UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/3 "2026-09-22T08:17:27Z")

</div>

- Host api-sandbox.company-informati on.service. gov 443 was resolved.
- IPv6: (none)
- IPv4: 35.178.252.20, 13.135.146.127, 13.135.229.221
- Trying 35.178.252.20:443…
- schannel: disabled automatic use of client certificate
- ALPN: curl offers http/1.1
- ALPN: server accepted http/1.1
- Established connection to …gov.uk (35.178.252.20 port 443) from 192.168.50.3 port 56085
- using HTTP/1.x

> GET /company/00000006 HTTP/1.1  
> Host: api-sandbox.c…gov.uk  
> User-Agent: curl/8.21.0  
> Accept: _/_  
> Authorization: Basic tMWIzYi00NTAxLWE5YjktNGY

- Request completely sent off
- schannel: remote party requests renegotiation
- schannel: renegotiating SSL/TLS connection
- schannel: SSL/TLS connection renegotiated
- schannel: remote party requests renegotiation
- schannel: renegotiating SSL/TLS connection
- schannel: SSL/TLS connection renegotiated  
\< HTTP/1.1 403 Forbidden  
\< Date: Tue, 22 Sep 2026 00:18:32 GMT  
\< Content-Length: 0  
\< Connection: keep-alive

Help appreciated

---

<div class="post-metadata">

**Author:** ![companieshousedata](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/companieshousedata/32/2190_2.png) [@companieshousedata](http://forum.companieshouse.gov.uk/u/companieshousedata)\
**Post date:** [September 22, 2026, 10:12am UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/4 "2026-09-22T10:12:15Z")

</div>

You originally mentioned you wanted to create a new test company, the header/response you posted mentions `http://api-sandbox.company-information.service.gov` but the CH docs [[Different URI for create](https://developer-specs.company-information.service.gov.uk/sandbox-test-data-generator-api/reference/company-test-data/create)] state `POST https://test-data-sandbox.company-information.service.gov.uk/test-data/company` should be used, have you tried this URI yet?

---

<div class="post-metadata">

**Author:** ![mxb500](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mxb500](http://forum.companieshouse.gov.uk/u/mxb500)\
**Post date:** [September 22, 2026, 10:45pm UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/5 "2026-09-22T22:45:07Z")

</div>

Yes I have. Still getting ‘Forbidden’. Is it just the 2 APIkeys : test and live or there are some other keys one requires?

---

<div class="post-metadata">

**Author:** ![companieshousedata](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/companieshousedata/32/2190_2.png) [@companieshousedata](http://forum.companieshouse.gov.uk/u/companieshousedata)\
**Post date:** [September 23, 2026, 7:16am UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/6 "2026-09-23T07:16:05Z")

</div>

There are **three client credential types** , not just “test and live keys”:

- **API key** - Basic Auth, used for public-data GETs and also the Test Data Generator.
- **Stream key** - for Streaming API connections.
- **OAuth web client** - client ID/secret plus OAuth flow, used for filing/change APIs requiring user/company authorisation. [Company Information Developer Hub](https://developer.company-information.service.gov.uk/how-to-create-an-application)

However, you only need a **TEST REST API KEY** to create a test company in the sandbox.

I’ve just tested this myself today using a Test application API key and the endpoint is working.

This exact request returned `HTTP/2 201 Created`:

```auto
curl -v \
  -u 'MY-TEST-APPLICATION-API-KEY-HERE-FOLLOWED-BY-A-COLON:' \
  -H 'Content-Type: application/json' \
  -d '{}' \
  'https://test-data-sandbox.company-information.service.gov.uk/test-data/company'

```

So I think we can rule out the Test Data Generator endpoint itself.

I’d now concentrate on the credential. In Developer Hub, make sure you have:

```auto
Application: Test
Client type: API key

```

rather than a Live API key, Stream key, OAuth client ID or OAuth client secret. This is a screenshot of the test application page where I got my API key from to perform this test:

 ![ch-test-rest-api-key](http://discourselive.s3.dualstack.eu-west-1.amazonaws.com/original/2X/0/01816c7a909a3886f830b90fad1dca8d831cc595.png)

Also check whether the API key has an IP restriction configured. For diagnosis I’d create a **new Test API key with no IP restriction** and try exactly the command above.

You don’t need OAuth or your localhost redirect URLs for this particular request, the Test Data Generator authenticates using the Test API key.

If a newly-created unrestricted Test API key (give it 5 minutes to propagate) still produces a bare `403`, I’d send Companies House support the timestamp and request details because the identical request is currently returning `201` for another Test application.

This is the output from the CURL statement above, it shows a HTTP/2 201 response, identifies x-ratelimit-remain: 599 because this was my first test against the API during the last 5 minutes.

 ![ch-test-create-company-example](http://discourselive.s3.dualstack.eu-west-1.amazonaws.com/original/2X/c/c4512e09b16f98211e746351e28fe1cbf903a5df.png)

---

<div class="post-metadata">

**Author:** ![mxb500](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@mxb500](http://forum.companieshouse.gov.uk/u/mxb500)\
**Post date:** [September 24, 2026, 1:02am UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/7 "2026-09-24T01:02:52Z")

</div>

Thank you for being patient 🙂 It was the restriction on the ip address. I have removed it for now as my focus is to write code that works in the first place.

---

<div class="post-metadata">

**Author:** ![companieshousedata](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/companieshousedata/32/2190_2.png) [@companieshousedata](http://forum.companieshouse.gov.uk/u/companieshousedata)\
**Post date:** [September 24, 2026, 6:49am UTC](http://forum.companieshouse.gov.uk/t/403-forbidden-i-get-403/13006/8 "2026-09-24T06:49:37Z")

</div>

I’m glad you made progress with it 👍
