Skip to content

A one-hour token for one installation

POST
/v1/app/installations/{id}/access_tokens
curl --request POST \
--url https://api.threadkite.app/v1/app/installations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/access_tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "scopes": [ "organisation:read" ] }'

Send it as Authorization: Bearer tkin_… to the rest of the API: it acts in that organisation with the installation’s scopes (or the fewer you ask for).

id
required
string format: uuid
Media typeapplication/json
object
scopes

Fewer scopes than the installation was granted, for a token that can do less. Left out: all of the installation’s.

Array<string>
<= 36 items
Allowed values: organisation:read locations:read locations:write members:read members:write items:read items:write leads:write contacts:read contacts:write contacts:delete companies:read companies:write companies:delete threads:read threads:write messages:read messages:write tasks:read tasks:write appointments:read appointments:write events:read events:write records:read records:write flows:read flows:write segments:read reports:read reports:write sales:read sales:write imports:read imports:write webhooks:manage
Media typeapplication/json
object
token
required

Send as Authorization: Bearer <token>. Works for one hour.

string
expiresAt
required
string format: date-time
installationId
required
string format: uuid
organisationId
required
string format: uuid
scopes
required
Array<string>
Allowed values: organisation:read locations:read locations:write members:read members:write items:read items:write leads:write contacts:read contacts:write contacts:delete companies:read companies:write companies:delete threads:read threads:write messages:read messages:write tasks:read tasks:write appointments:read appointments:write events:read events:write records:read records:write flows:read flows:write segments:read reports:read reports:write sales:read sales:write imports:read imports:write webhooks:manage

Example

{
"token": "tkin_…",
"scopes": [
"organisation:read"
]
}

Missing or invalid app token (code invalid_app_token)

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
}