Set the organization's own Companies House API key (OWNER only)
PUT
/organizations/current/companies-house-key
const url = 'https://api.invogi.com/v1/organizations/current/companies-house-key';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"api_key":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.invogi.com/v1/organizations/current/companies-house-key \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "api_key": "example" }'Enables the UK register check for supplier company numbers using the organization’s own free Companies House REST API key. The key is verified against Companies House, stored encrypted, and never returned. There is no deployment-wide key: without one the check is off for the organization.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
api_key
required
string
Example generated
{ "api_key": "example"}Responses
Section titled “Responses”Key verified and stored
Media typeapplication/json
object
companiesHouseKeyConfigured
required
boolean
Example generated
{ "companiesHouseKeyConfigured": true}Companies House rejected the key
API key lacks required scope/role
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "NOT_FOUND" }}