Add a company
const url = 'https://api.threadkite.app/v1/companies';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Acme Fleet Services","legalName":"Acme Fleet Services Ltd","website":"acme.co.uk","phone":"0113 496 0000","email":"office@acme.co.uk","address":{"lines":["Unit 4, Riverside Park","Canal Road"],"town":"Leeds","county":"West Yorkshire","postcode":"LS12 2DX","country":"United Kingdom"},"companyNumber":"01234567","vatNumber":"GB123456789","status":"active","sicCodes":["example"],"ownerId":"usr_8f2c","parentCompanyId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","isPersonal":true,"attributes":{"account_tier":"Gold"},"domains":["acme.co.uk"],"externalIds":[{"integration":"my-dms","externalId":"CUST-10442"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.threadkite.app/v1/companies \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Acme Fleet Services", "legalName": "Acme Fleet Services Ltd", "website": "acme.co.uk", "phone": "0113 496 0000", "email": "office@acme.co.uk", "address": { "lines": [ "Unit 4, Riverside Park", "Canal Road" ], "town": "Leeds", "county": "West Yorkshire", "postcode": "LS12 2DX", "country": "United Kingdom" }, "companyNumber": "01234567", "vatNumber": "GB123456789", "status": "active", "sicCodes": [ "example" ], "ownerId": "usr_8f2c", "parentCompanyId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "isPersonal": true, "attributes": { "account_tier": "Gold" }, "domains": [ "acme.co.uk" ], "externalIds": [ { "integration": "my-dms", "externalId": "CUST-10442" } ] }'A name is enough; everything else can be filled in later.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
Acme Fleet ServicesExample
Acme Fleet Services LtdExample
acme.co.ukExample
0113 496 0000Example
office@acme.co.ukobject
Example
[ "Unit 4, Riverside Park", "Canal Road"]Example
LeedsExample
West YorkshireExample
LS12 2DXExample
United KingdomExample
01234567Example
GB123456789Example
activeThe team member (user id) who looks after it
Example
usr_8f2cA sole trader or partnership: its details are personal data, deleted with its people
Its web domains (acme.co.uk, or a website address). Free mail domains such as gmail.com are refused. Left out: the website’s domain, if it has one
Example
[ "acme.co.uk"]object
The other system, e.g. my-dms
Example
my-dmsThe contact’s id there
Example
CUST-10442Responses
Section titled “Responses”object
object
Its registered number (Companies House in the UK), normalised
object
The number checked
HMRC has it registered
Who HMRC has it registered to; null when it is not registered
object
HMRC’s consultation number, proof of the check (verified checks only)
As the register gives it: active, dissolved…
object
Its parent company (one level: a parent has no parent of its own)
Its web domains. People whose email address is at one are linked to it (unless you turned that off)
object
The other system, e.g. my-dms
The contact’s id there
Its picture; null when none
upload (your team) or website (its website icon, fetched for you)
A sole trader or partnership: its details are personal data, deleted and exported with its people’s
People who work there now
Set when this company was merged into another
Example
{ "name": "Acme Fleet Services", "legalName": "Acme Fleet Services Ltd", "website": "https://acme.co.uk", "phone": "0113 496 0000", "email": "office@acme.co.uk", "address": { "lines": [ "Unit 4, Riverside Park", "Canal Road" ], "town": "Leeds", "county": "West Yorkshire", "postcode": "LS12 2DX", "country": "United Kingdom" }, "companyNumber": "01234567", "vatNumber": "GB123456789", "vatCheck": { "vatNumber": "GB553557881", "name": "Acme Fleet Services Ltd", "address": { "lines": [ "Unit 4, Riverside Park", "Canal Road" ], "town": "Leeds", "county": "West Yorkshire", "postcode": "LS12 2DX", "country": "United Kingdom" } }, "status": "active", "sicCodes": [ "49410" ], "owner": { "id": "usr_8f2c", "name": "James Patel" }, "domains": [ "acme.co.uk" ], "externalIds": [ { "integration": "my-dms", "externalId": "CUST-10442" } ], "attributes": { "account_tier": "Gold" }, "avatarUrl": "https://api.threadkite.com/avatars/6c1f….png", "avatarSource": "upload", "contactCount": 3}object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Missing or invalid API key
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}The organisation is on the Free plan (code upgrade_required)
object
Stable machine-readable reason
The feature that needs Pro
Where to upgrade or pay, in the web app
Example
{ "statusCode": 402, "code": "upgrade_required", "message": "Connections are part of Pro. Upgrade to connect texts, calls and more.", "feature": "extraSeats", "upgradePath": "/settings/billing"}The key does not have the scope (or the person the permission)
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Another company has that domain, company number or external id
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Rate limit reached
object
Stable machine-readable reason
Seconds until another request will be accepted
Example
{ "statusCode": 429, "code": "rate_limited", "message": "Too many requests. Each key can make 120 requests a minute; try again in 12 seconds.", "retryAfter": 12}