Start a new chapter
const url = 'https://api.threadkite.app/v1/threads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/chapters';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"close":{"outcome":"deal","lostReasonId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","note":"example","valueMinor":1899500},"carryItems":false}'};
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/threads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/chapters \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "close": { "outcome": "deal", "lostReasonId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "note": "example", "valueMinor": 1899500 }, "carryItems": false }'Starts a new chapter in the thread and opens it. On a thread that is still open, give close to say how the current chapter ended first. carryItems starts it with what the current chapter was about.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Start a new chapter in the thread
object
How the current chapter ended, when the thread is still open (it is closed first). Not needed when the thread is Done
object
deal (Won), lost (needs a lost reason), none or no_reply
Required when the outcome is lost, unless your organisation has no lost reasons: then give a note saying why instead
Sale value for Won, in minor units of the organisation’s currency
Example
1899500Start the new chapter with what the current one was about (“still looking, just later”); otherwise it starts empty
Responses
Section titled “Responses”object
The inbox it is in
object
object
Their picture, uploaded by your team; null when none
object
The company’s picture (uploaded, or its website’s icon); null when none
As the register gives it (active, dissolved, liquidation…); null when not known
The current chapter’s, derived from its activity, never set by hand
The current chapter (the latest)
object
1, 2, 3 within the thread
What started it: first (the thread began), lead (a new lead on a Done thread), period (they wrote long after it closed), staff, api, flow, or migration
Null while open
object
1, 2, 3 within the thread
What started it: first (the thread began), lead (a new lead on a Done thread), period (they wrote long after it closed), staff, api, flow, or migration
Null while open
object
The appointment type id
The time zone it is written in
Who the thread is waiting on
object
Hot, Warm or Cold
Why, up to three, the strongest first
When someone said the contact’s latest messages need no reply (POST /v1/threads/{id}/no-reply-needed); null once they write again or the team replies
When the first reply is due
object
Their picture; null to show their initials
object
object
Archived since it was added: it stays on the thread until taken off, but cannot be added again
Unread for the signed-in person (null for API keys)
Pinned by the signed-in person (POST /v1/threads/{id}/pin): pinned threads come first in the list. Each person pins their own; always false for API keys
Leads in every chapter
Started by “Send a test lead”: kept out of Unassigned, rules, lead counts and webhooks, and can be deleted
What the current chapter is about: catalogue items and free-text lines, main items with their add-ons (parentId), in order
object
object
Where the item came from: manual, csv, api or an integration key
The item’s id in its source
From the attributes
The availability: in_stock, out_of_stock, preorder or backorder for products; an industry pack’s item types have their own
object
Amount in minor units (pence, cents)
ISO 4217
How the price is charged: one_off (once), monthly (every month) or annual (every year)
Image links, main image first
When it was removed from the catalogue (no longer in stock). Removed items stay on the leads and threads that mention them
Advert or product page
Usually sold as an add-on to something else (a warranty, delivery, an onboarding package). Suggestions only
The item types it is usually added to; empty means anything
object
Google/Meta title
Google/Meta description
Product page. Google/Meta link
Main image first. Google/Meta image_link and additional_image_link
Google/Meta price
object
Amount in minor units (pence, cents)
ISO 4217
Google/Meta sale_price
object
Amount in minor units (pence, cents)
ISO 4217
Google/Meta availability
Google/Meta condition
Google/Meta brand
GTIN-8, 12, 13 or 14. Google/Meta gtin
Google/Meta mpn
Your own stock code
Google/Meta google_product_category
Google/Meta product_type
Shared by variants. Google/Meta item_group_id
Google/Meta size
Google/Meta color
Google/Meta material
Google/Meta pattern
Google/Meta custom_label_0
Google/Meta custom_label_1
Google/Meta custom_label_2
Google/Meta custom_label_3
Google/Meta custom_label_4
object
Where the item came from: manual, csv, api or an integration key
The item’s id in its source
From the attributes
The availability: in_stock, out_of_stock, preorder or backorder for products; an industry pack’s item types have their own
object
Amount in minor units (pence, cents)
ISO 4217
How the price is charged: one_off (once), monthly (every month) or annual (every year)
Image links, main image first
When it was removed from the catalogue (no longer in stock). Removed items stay on the leads and threads that mention them
Advert or product page
Usually sold as an add-on to something else (a warranty, delivery, an onboarding package). Suggestions only
The item types it is usually added to; empty means anything
object
Advert title; made from make, model and derivative when left out. Google/Meta title
Google/Meta description
Number plate. Meta vehicle_registration_plate
Google/Meta vin
Google brand, Meta make
Google/Meta model
Full version name
Google/Meta trim
Google/Meta year
First registration date, YYYY-MM-DD
Google mileage, Meta mileage.value and .unit
object
Google condition and certified_pre_owned, Meta state_of_vehicle
Google engine, Meta fuel_type
Meta transmission
Meta drivetrain
Exterior colour. Google color, Meta exterior_color
Meta interior_color
Google/Meta body_style
Google/Meta price
object
Amount in minor units (pence, cents)
ISO 4217
Google/Meta sale_price
object
Amount in minor units (pence, cents)
ISO 4217
object
object
Amount in minor units (pence, cents)
ISO 4217
object
Amount in minor units (pence, cents)
ISO 4217
Main image first. Google image_link/additional_image_link, Meta image[n].url
Advert page. Google link, Meta url
Google/Meta availability
A free-text line’s words
object
Amount in minor units (pence, cents)
ISO 4217
How the price is charged: a free-text line’s own, or a catalogue item’s (as on item). one_off, monthly or annual
The main item this is an add-on to; null for a main item
Order among its siblings
How it got there: named by a lead, added by staff, the API or the assistant
The message that first named it
object
object
Null shows an initial badge
What its row in the inbox list shows, from its inbox’s list layout
object
The item line: the first main item the thread is about. Null when the inbox hides it or the thread is about nothing
object
The item’s reference (an identifier its industry pack names, such as a plate), drawn the way its industry pack draws it; null when the layout leaves it out or the item has none
The item type the reference belongs to; null with no reference
The layout’s other item fields, formatted and joined with ’ · ’
Other main items the thread is about
The item is no longer in the catalogue
The thread details to show under it, in order (read each from the thread’s own fields)
Changes when the thread or its summary changes; poll it to know when to reload
object
As given
E.164
Their picture, uploaded by your team; null when none
The companies they work for now, their primary company first (see /v1/contacts/{id}/companies for past ones)
object
object
The company’s picture (uploaded, or its website’s icon); null when none
As the register gives it (active, dissolved, liquidation…); null when not known
What they do for the company, in your words: Director, Accounts…
Their main company (at most one); shown first and with their name
How the link was made: manual (your team), domain (their email address is at one of the company’s domains), form, lead, import, api, integration or assistant
When they left the company; kept for history, not current
Email bounced or is not valid
The number failed or is not valid
Set when this contact was merged into another
When the contact and their data were deleted (an erasure): what’s left is only kept so counts and reports add up
object
The other system, e.g. my-dms
The contact’s id there
The installed partner app this id belongs to (its integration is the app slug)
The contact in that app (from the app’s contact address), for Open in …
object
Where the latest decision came from, in short: form, api, staff, stop_reply, unsubscribe, import, complaint, assistant, connection, merge or system. The full story (who, how, the wording shown) is in the consent history.
A contact form asked to opt them back in after they opted out. Not applied: anyone can type an address into a form.
Channels on which this person asked not to receive marketing: their email address or number is on the marketing suppression list (someone with it opted out and their data was deleted). Marketing opt-ins there are kept as pending and marketing sends are refused; replies and service messages are unaffected
The contact’s most recent live thread you can see, if any (a contact has one thread per inbox)
The contact’s live threads you can see, one per inbox, most recent first
object
object
Their picture, uploaded by your team; null when none
object
The company’s picture (uploaded, or its website’s icon); null when none
As the register gives it (active, dissolved, liquidation…); null when not known
The current chapter’s links
object
The chapter it belongs to (a deal is its chapter’s)
The current chapter in full: its outcome, value, owner at close and summary
object
1, 2, 3 within the thread
What started it: first (the thread began), lead (a new lead on a Done thread), period (they wrote long after it closed), staff, api, flow, or migration
Null while open
Derived from the chapter’s activity, never set by hand
Lost reason or closing note
Sale value when closed as Won, in minor units
object
Where its first lead came in
The AI summary of the chapter (three to five lines, newline separated); kept when it closes
What they were interested in: catalogue items and free-text lines, main items with their add-ons (parentId), in order
object
object
Where the item came from: manual, csv, api or an integration key
The item’s id in its source
From the attributes
The availability: in_stock, out_of_stock, preorder or backorder for products; an industry pack’s item types have their own
object
Amount in minor units (pence, cents)
ISO 4217
How the price is charged: one_off (once), monthly (every month) or annual (every year)
Image links, main image first
When it was removed from the catalogue (no longer in stock). Removed items stay on the leads and threads that mention them
Advert or product page
Usually sold as an add-on to something else (a warranty, delivery, an onboarding package). Suggestions only
The item types it is usually added to; empty means anything
object
Google/Meta title
Google/Meta description
Product page. Google/Meta link
Main image first. Google/Meta image_link and additional_image_link
Google/Meta price
object
Amount in minor units (pence, cents)
ISO 4217
Google/Meta sale_price
object
Amount in minor units (pence, cents)
ISO 4217
Google/Meta availability
Google/Meta condition
Google/Meta brand
GTIN-8, 12, 13 or 14. Google/Meta gtin
Google/Meta mpn
Your own stock code
Google/Meta google_product_category
Google/Meta product_type
Shared by variants. Google/Meta item_group_id
Google/Meta size
Google/Meta color
Google/Meta material
Google/Meta pattern
Google/Meta custom_label_0
Google/Meta custom_label_1
Google/Meta custom_label_2
Google/Meta custom_label_3
Google/Meta custom_label_4
object
Where the item came from: manual, csv, api or an integration key
The item’s id in its source
From the attributes
The availability: in_stock, out_of_stock, preorder or backorder for products; an industry pack’s item types have their own
object
Amount in minor units (pence, cents)
ISO 4217
How the price is charged: one_off (once), monthly (every month) or annual (every year)
Image links, main image first
When it was removed from the catalogue (no longer in stock). Removed items stay on the leads and threads that mention them
Advert or product page
Usually sold as an add-on to something else (a warranty, delivery, an onboarding package). Suggestions only
The item types it is usually added to; empty means anything
object
Advert title; made from make, model and derivative when left out. Google/Meta title
Google/Meta description
Number plate. Meta vehicle_registration_plate
Google/Meta vin
Google brand, Meta make
Google/Meta model
Full version name
Google/Meta trim
Google/Meta year
First registration date, YYYY-MM-DD
Google mileage, Meta mileage.value and .unit
object
Google condition and certified_pre_owned, Meta state_of_vehicle
Google engine, Meta fuel_type
Meta transmission
Meta drivetrain
Exterior colour. Google color, Meta exterior_color
Meta interior_color
Google/Meta body_style
Google/Meta price
object
Amount in minor units (pence, cents)
ISO 4217
Google/Meta sale_price
object
Amount in minor units (pence, cents)
ISO 4217
object
object
Amount in minor units (pence, cents)
ISO 4217
object
Amount in minor units (pence, cents)
ISO 4217
Main image first. Google image_link/additional_image_link, Meta image[n].url
Advert page. Google link, Meta url
Google/Meta availability
A free-text line’s words
object
Amount in minor units (pence, cents)
ISO 4217
How the price is charged: a free-text line’s own, or a catalogue item’s (as on item). one_off, monthly or annual
The main item this is an add-on to; null for a main item
Order among its siblings
How it got there: named by a lead, added by staff, the API or the assistant
The message that first named it
object
Notes pinned to the top of the thread for everyone who opens it, the latest pinned first (up to 3 can be pinned; a thread merged in keeps its pins, so a merged thread can show more)
object
The note (a message of kind note)
object
When it was pinned
object
Whether you can reply and act on this thread (Basic seats read and add notes)
Example
{ "inbox": { "name": "Leeds Sales", "type": "sales" }, "contact": { "name": "Sarah Turner", "email": "sarah.turner@example.co.uk", "phoneE164": "+447911123456", "avatarUrl": "https://api.threadkite.com/avatars/9b0d….jpg", "company": { "name": "Acme Fleet Services Ltd", "avatarUrl": "https://api.threadkite.com/avatars/6c1f….png", "status": "active" } }, "state": "open", "stage": "new", "chapter": { "number": 2, "startedBy": "first", "outcome": "deal" }, "previousChapter": { "number": 2, "startedBy": "first", "outcome": "deal" }, "nextAppointment": { "type": "consultation", "typeLabel": "Consultation", "timeZone": "Europe/London" }, "waiting": "us", "score": { "band": "hot", "reasons": [ "Asked about finance", "Replies within 5 minutes" ] }, "owner": { "id": "usr_8f2c", "name": "James Patel", "avatarUrl": "https://api.threadkite.app/avatars/0b7c3a52-5d9e-4f3a-9a51-2f1e8c6d4b10.jpg" }, "lastMessage": { "preview": "Is this still available? Could I come in on Saturday?", "kind": "message", "channel": "email" }, "tags": [ { "name": "Finance", "colour": "blue" } ], "leadCount": 2, "items": [ { "item": { "source": "my-dms", "externalId": "SKU-1042", "title": "Oak dining table", "status": "in_stock", "price": { "amountMinor": 1299500, "currency": "GBP" }, "billing": "one_off", "addOnFor": [ "product" ], "attributes": { "title": "Merino jumper", "price": { "amountMinor": 1299500, "currency": "GBP" }, "salePrice": { "amountMinor": 1299500, "currency": "GBP" }, "availability": "in_stock", "condition": "new" }, "type": "product" }, "label": "Custom paint", "price": { "amountMinor": 1299500, "currency": "GBP" }, "billing": "one_off", "quantity": 1, "source": "lead", "addedBy": { "id": "usr_8f2c", "name": "James Patel" } } ], "leadSource": { "name": "Google Ads" }, "display": { "item": { "reference": "FL-1042", "referenceType": "flat", "text": "2 bed flat, Roundhay · £1,150 a month", "more": 1 }, "details": [ "stage", "source", "next_appointment" ] }, "contactDetails": { "name": "Sarah Turner", "email": "sarah.turner@example.co.uk", "phone": "07911 123456", "phoneE164": "+447911123456", "avatarUrl": "https://api.threadkite.com/avatars/9b0d….jpg", "companies": [ { "company": { "name": "Acme Fleet Services Ltd", "avatarUrl": "https://api.threadkite.com/avatars/6c1f….png", "status": "active" }, "role": "Fleet manager", "jobTitle": "Head of Transport", "source": "manual" } ], "externalIds": [ { "integration": "my-dms", "externalId": "CUST-10442", "appName": "Northern DMS", "url": "https://dms.example/customers/CUST-10442" } ], "consents": [ { "channel": "email", "status": "opted_in", "source": "stop_reply" } ], "attributes": { "finance_end_date": "2027-01-03", "budget": 15000 }, "marketingSuppressed": [ "email" ] }, "participants": [ { "contact": { "name": "Sarah Turner", "email": "sarah.turner@example.co.uk", "phoneE164": "+447911123456", "avatarUrl": "https://api.threadkite.com/avatars/9b0d….jpg", "company": { "name": "Acme Fleet Services Ltd", "avatarUrl": "https://api.threadkite.com/avatars/6c1f….png", "status": "active" } }, "role": "primary" } ], "links": [ { "recordType": "deal", "integration": "my-dms", "externalId": "DEAL-2231", "label": "Deal #2231", "url": "https://dms.example.com/deals/2231", "status": "won" } ], "currentChapter": { "number": 2, "startedBy": "first", "outcome": "deal", "stage": "new", "outcomeCurrency": "GBP", "owner": { "id": "usr_8f2c", "name": "James Patel" }, "leadCount": 1, "items": [ { "item": { "source": "my-dms", "externalId": "SKU-1042", "title": "Oak dining table", "status": "in_stock", "price": { "amountMinor": 1299500, "currency": "GBP" }, "billing": "one_off", "addOnFor": [ "product" ], "attributes": { "title": "Merino jumper", "price": { "amountMinor": 1299500, "currency": "GBP" }, "salePrice": { "amountMinor": 1299500, "currency": "GBP" }, "availability": "in_stock", "condition": "new" }, "type": "product" }, "label": "Custom paint", "price": { "amountMinor": 1299500, "currency": "GBP" }, "billing": "one_off", "quantity": 1, "source": "lead", "addedBy": { "id": "usr_8f2c", "name": "James Patel" } } ] }, "chapterCount": 2, "pinnedNotes": [ { "text": "Prefers a text to a call. Ask for Sam at the front desk.", "authorName": "James Patel", "pin": { "by": { "id": "usr_8f2c", "name": "James Patel" } } } ]}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" } ]}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}