Set up an organisation for a business, with the app installed
const url = 'https://api.threadkite.app/v1/partner/organisations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Smith Motors","country":"GB","locationName":"Smith Motors Leeds","ownerName":"Chris Moore","ownerEmail":"hello@example.com","industryPack":"automotive","plan":"trial","referralCode":"MOTORMS"}'};
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/partner/organisations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Smith Motors", "country": "GB", "locationName": "Smith Motors Leeds", "ownerName": "Chris Moore", "ownerEmail": "hello@example.com", "industryPack": "automotive", "plan": "trial", "referralCode": "MOTORMS" }'It starts a free trial from when its owner joins (plan: "trial", the default), or goes straight on the Free plan (plan: "free"); we bill the business directly if it upgrades. The owner is emailed that you set it up, then an owner invitation.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
Smith MotorsExample
Smith Motors LeedsExample
Chris MooreWe email them that you set Threadkite up for them, and an owner invitation
The industry pack the business uses (automotive), or null for none
trial: a 14-day trial of Pro, from when the owner joins. free: straight on the Free plan, with no trial
The referral partner who brought you this business, by their referral code: they get the referral (commission and any referral discount) instead of you. We must have agreed it with you first; any other code is refused (referral_not_allowed). Leave it out and the referral is yours
Example
MOTORMSResponses
Section titled “Responses”object
The referring partner’s code: yours, or the referralCode you gave
object
person: an owner or admin connected it; partner: you created the organisation
Its own address for your webhooks: /v1/inbound/installations/<inboundId> on the API
The customer’s id in your system, for the app-wide webhook address
object
The link has expired; resend it to send a fresh one
Example
{ "referralCode": "MOTORMS", "installation": { "organisationName": "Smith Motors", "grantedScopes": [ "organisation:read" ], "status": "active", "installedBy": "person", "inboundId": "in_8Kq2xW7mR4tZ9pL3vN6bH1cY", "accountId": "D-0042" }, "ownerInvite": { "email": "chris@smithmotors.co.uk" }}Missing or invalid app token (code invalid_app_token)
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}