Skip to content

Correct how a chapter ended

PATCH
/v1/threads/{id}/chapters/{chapterId}
curl --request PATCH \
--url https://api.threadkite.app/v1/threads/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/chapters/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "outcome": "deal", "lostReasonId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "note": "example", "valueMinor": 1 }'

Its outcome, lost reason, note or sale value. Only a closed chapter: an open one is closed with the thread.

id
required
string format: uuid
chapterId
required
string format: uuid
Media typeapplication/json

Correct how a closed chapter ended

object
outcome
string
Allowed values: deal lost none no_reply
lostReasonId
string format: uuid
nullable
note
string
nullable <= 500 characters
valueMinor

Sale value for Won, in minor units of the organisation’s currency

integer
nullable <= 100000000000
Media typeapplication/json
object
id
required
string format: uuid
number
required

1, 2, 3 within the thread

integer
>= -9007199254740991 <= 9007199254740991
startedAt
required
string format: date-time
startedBy
required

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

string
Allowed values: first lead period staff api flow migration
closedAt
required

Null while open

string format: date-time
nullable
outcome
required
string
nullable
Allowed values: deal lost none no_reply
threadId
required
string format: uuid
stage
required

Derived from the chapter’s activity, never set by hand

string
Allowed values: new contacted booked attended won lost
outcomeNote
required

Lost reason or closing note

string
nullable
lostReasonId
required
string format: uuid
nullable
outcomeValueMinor
required

Sale value when closed as Won, in minor units

number
nullable
outcomeCurrency
required
string
nullable
owner
required
One of:
object
id
required
string
name
required
string
locationId
required

Where its first lead came in

string format: uuid
nullable
leadCount
required
integer
>= -9007199254740991 <= 9007199254740991
lastLeadAt
required
string format: date-time
nullable
summary
required

The AI summary of the chapter (three to five lines, newline separated); kept when it closes

string
nullable
items
required

What they were interested in: catalogue items and free-text lines, main items with their add-ons (parentId), in order

Array<object>
object
id
required
string format: uuid
item
required
One of:
One of: discriminator: type
object
id
required
string format: uuid
source
required

Where the item came from: manual, csv, api or an integration key

string
externalId
required

The item’s id in its source

string
locationId
required
string format: uuid
nullable
title
required

From the attributes

string
status
required

The availability: in_stock, out_of_stock, preorder or backorder for products; an industry pack’s item types have their own

string
price
required
One of:
object
amountMinor
required

Amount in minor units (pence, cents)

number
currency
required

ISO 4217

string
billing
required

How the price is charged: one_off (once), monthly (every month) or annual (every year)

string
Allowed values: one_off monthly annual
images
required

Image links, main image first

Array<string>
archivedAt
required

When it was removed from the catalogue (no longer in stock). Removed items stay on the leads and threads that mention them

string format: date-time
nullable
url
required

Advert or product page

string
nullable
addOn
required

Usually sold as an add-on to something else (a warranty, delivery, an onboarding package). Suggestions only

boolean
addOnFor
required

The item types it is usually added to; empty means anything

Array<string>
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
attributes
required
object
title
required

Google/Meta title

string
<= 150 characters
description

Google/Meta description

string
<= 5000 characters
link

Product page. Google/Meta link

string format: uri
imageLinks

Main image first. Google/Meta image_link and additional_image_link

Array<string>
<= 11 items
price
required

Google/Meta price

object
amountMinor
required

Amount in minor units (pence, cents)

number
currency
required

ISO 4217

string
salePrice

Google/Meta sale_price

object
amountMinor
required

Amount in minor units (pence, cents)

number
currency
required

ISO 4217

string
availability

Google/Meta availability

string
default: in_stock
Allowed values: in_stock out_of_stock preorder backorder
condition

Google/Meta condition

string
default: new
Allowed values: new refurbished used
brand

Google/Meta brand

string
<= 70 characters
gtin

GTIN-8, 12, 13 or 14. Google/Meta gtin

string
mpn

Google/Meta mpn

string
<= 70 characters
sku

Your own stock code

string
<= 100 characters
googleProductCategory

Google/Meta google_product_category

string
<= 750 characters
productType

Google/Meta product_type

string
<= 750 characters
itemGroupId

Shared by variants. Google/Meta item_group_id

string
<= 50 characters
size

Google/Meta size

string
<= 100 characters
colour

Google/Meta color

string
<= 100 characters
material

Google/Meta material

string
<= 200 characters
pattern

Google/Meta pattern

string
<= 100 characters
customLabel0

Google/Meta custom_label_0

string
<= 100 characters
customLabel1

Google/Meta custom_label_1

string
<= 100 characters
customLabel2

Google/Meta custom_label_2

string
<= 100 characters
customLabel3

Google/Meta custom_label_3

string
<= 100 characters
customLabel4

Google/Meta custom_label_4

string
<= 100 characters
type
required
string
Allowed values: product
label
required

A free-text line’s words

string
nullable
price
required
One of:
object
amountMinor
required

Amount in minor units (pence, cents)

number
currency
required

ISO 4217

string
billing
required

How the price is charged: a free-text line’s own, or a catalogue item’s (as on item). one_off, monthly or annual

string
Allowed values: one_off monthly annual
quantity
required
integer
>= -9007199254740991 <= 9007199254740991
parentId
required

The main item this is an add-on to; null for a main item

string format: uuid
nullable
position
required

Order among its siblings

integer
>= -9007199254740991 <= 9007199254740991
source
required

How it got there: named by a lead, added by staff, the API or the assistant

string
Allowed values: lead staff api assistant
messageId
required

The message that first named it

string format: uuid
nullable
addedBy
required
One of:
object
id
required
string
name
required
string
createdAt
required
string format: date-time

Example

{
"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"
}
}
]
}
Media typeapplication/json
object
statusCode
required
number
code
required

Stable machine-readable reason

string
message
required
string
errors

With code invalid: every problem with the request, by field (message is the first)

Array<object>
object
path
required

Dotted path inside the item, e.g. attributes.price.amountMinor

string
message
required
string

Example

{
"statusCode": 403,
"code": "forbidden",
"message": "You do not have permission to do that.",
"errors": [
{
"message": "Enter the make"
}
]
}

Missing or invalid API key

Media typeapplication/json
object
statusCode
required
number
code
required

Stable machine-readable reason

string
message
required
string
errors

With code invalid: every problem with the request, by field (message is the first)

Array<object>
object
path
required

Dotted path inside the item, e.g. attributes.price.amountMinor

string
message
required
string

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)

Media typeapplication/json
object
statusCode
required
number
code
required

Stable machine-readable reason

string
message
required
string
feature
required

The feature that needs Pro

string
nullable
Allowed values: extraSeats connections aiAssistant aiReplies rules fullReports api inboxes bulkMessages videoMessages
upgradePath
required

Where to upgrade or pay, in the web app

string

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)

Media typeapplication/json
object
statusCode
required
number
code
required

Stable machine-readable reason

string
message
required
string
errors

With code invalid: every problem with the request, by field (message is the first)

Array<object>
object
path
required

Dotted path inside the item, e.g. attributes.price.amountMinor

string
message
required
string

Example

{
"statusCode": 403,
"code": "forbidden",
"message": "You do not have permission to do that.",
"errors": [
{
"message": "Enter the make"
}
]
}
Media typeapplication/json
object
statusCode
required
number
code
required

Stable machine-readable reason

string
message
required
string
errors

With code invalid: every problem with the request, by field (message is the first)

Array<object>
object
path
required

Dotted path inside the item, e.g. attributes.price.amountMinor

string
message
required
string

Example

{
"statusCode": 403,
"code": "forbidden",
"message": "You do not have permission to do that.",
"errors": [
{
"message": "Enter the make"
}
]
}
Media typeapplication/json
object
statusCode
required
number
code
required

Stable machine-readable reason

string
message
required
string
errors

With code invalid: every problem with the request, by field (message is the first)

Array<object>
object
path
required

Dotted path inside the item, e.g. attributes.price.amountMinor

string
message
required
string

Example

{
"statusCode": 403,
"code": "forbidden",
"message": "You do not have permission to do that.",
"errors": [
{
"message": "Enter the make"
}
]
}

Rate limit reached

Media typeapplication/json
object
statusCode
required
number
code
required

Stable machine-readable reason

string
message
required
string
retryAfter
required

Seconds until another request will be accepted

number

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
}