ThoughtBox Connections API
The connections API from ThoughtBox — 27 operation(s) for connections.
The connections API from ThoughtBox — 27 operation(s) for connections.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/thoughtbox-ai:thoughtbox-ai-connections-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: ThoughtBox Connections API
description: Document proxy and AI chat platform with MCP support
version: 0.1.0
tags:
- name: Connections
paths:
/api/connections/:
get:
tags:
- Connections
summary: List Connections
description: 'List all connected providers for the current user.
Custom endpoints (provider key `custom:`) carry a user-chosen display
name inside their encrypted credential, not in the key itself — decrypt
just those rows to surface it. `name` is omitted for every other
provider type, which have no such display label.'
operationId: list_connections_api_connections__get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- HTTPBearer: []
/api/connections/files:
post:
tags:
- Connections
summary: List Files
description: 'List files from connected storage providers for the dashboard file browser.
A request naming a specific `provider` that fails always 502s — it''s
someone asking about one provider specifically (the cloud-file picker''s
tree browse, mpcentral#867 Stage 2; the assistant''s list_files tool
called with a single provider) with nothing to silently fall back to.
A caller doing its own best-effort fan-out across every connected
provider (DocServer.list_files, mcp/server.py:149, when called with no
provider filter) owns that degradation itself, at the point where it
actually knows it''s merging many sources — not here.'
operationId: list_files_api_connections_files_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FilesListRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/files/read:
get:
tags:
- Connections
summary: Read File
description: Read a file's contents for preview. Returns text content.
operationId: read_file_api_connections_files_read_get
security:
- HTTPBearer: []
parameters:
- name: provider
in: query
required: true
schema:
type: string
description: Storage provider
title: Provider
description: Storage provider
- name: file_id
in: query
required: true
schema:
type: string
description: File ID to read
title: File Id
description: File ID to read
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/files/copy-to-thoughtbox:
post:
tags:
- Connections
summary: Copy To Thoughtbox
description: 'Pull a file from a connected provider and hand its bytes back to the
caller (thoughtbox#152, revised: mpcentral#814 — this endpoint is a pure
fetch-and-relay, it does not persist anything in ThoughtBox-managed
storage). Used by the /connect?mode=pick picker: rather than a
cloud-picked file being read live at AI-extraction time (the dependency
thoughtbox#55''s fix removed), the caller pulls the bytes once here and is
responsible for storing them wherever they actually need to live — for
Marketplace Central, that''s the tenant''s own gateway backend
(POST /api/files/upload), not ThoughtBox Central. Central-plane only
(mounted under the same conditional as this whole router — see main.py).
thoughtbox#254 (PR #255 review, G5): a caller that sends
`Accept: application/octet-stream` gets the raw bytes back directly,
no base64/JSON envelope at all — used by the picker''s upload-target
path, which hashes and re-PUTs these same bytes and has no use for a
1.33x-larger text copy of them. Nothing else needs to move into that
response: `name`/`mime_type` are just body''s own request fields
echoed back, and `size` is the body''s own byte length, both already
known to a caller that just sent this same request.'
operationId: copy_to_thoughtbox_api_connections_files_copy_to_thoughtbox_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CopyToThoughtboxRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/CopyToThoughtboxResponse'
- type: 'null'
title: Response Copy To Thoughtbox Api Connections Files Copy To Thoughtbox Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/files/serve:
get:
tags:
- Connections
summary: Serve File
description: Serve a file with its correct Content-Type. Uses signed URL token (no JWT needed).
operationId: serve_file_api_connections_files_serve_get
parameters:
- name: provider
in: query
required: true
schema:
type: string
description: Storage provider
title: Provider
description: Storage provider
- name: file_id
in: query
required: true
schema:
type: string
description: File ID to serve
title: File Id
description: File ID to serve
- name: token
in: query
required: true
schema:
type: string
description: Signed access token
title: Token
description: Signed access token
- name: uid
in: query
required: true
schema:
type: string
description: User ID
title: Uid
description: User ID
- name: file_name
in: query
required: false
schema:
type: string
description: Original filename for Content-Type detection
title: File Name
description: Original filename for Content-Type detection
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/files/serve-auth:
get:
tags:
- Connections
summary: Serve File Auth
description: 'Serve a file using JWT auth — no expiring signed token needed.
The frontend uses this for images embedded in chat so that URLs
never go stale when the LLM reuses them across messages.'
operationId: serve_file_auth_api_connections_files_serve_auth_get
security:
- HTTPBearer: []
parameters:
- name: provider
in: query
required: true
schema:
type: string
description: Storage provider
title: Provider
description: Storage provider
- name: file_id
in: query
required: true
schema:
type: string
description: File ID to serve
title: File Id
description: File ID to serve
- name: file_name
in: query
required: false
schema:
type: string
description: Original filename for Content-Type detection
title: File Name
description: Original filename for Content-Type detection
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/files/preview-text:
get:
tags:
- Connections
summary: Preview Text
description: Return extracted text from a document file. Uses the same signed URL auth as /files/serve.
operationId: preview_text_api_connections_files_preview_text_get
parameters:
- name: provider
in: query
required: true
schema:
type: string
description: Storage provider
title: Provider
description: Storage provider
- name: file_id
in: query
required: true
schema:
type: string
description: File ID to preview
title: File Id
description: File ID to preview
- name: file_name
in: query
required: false
schema:
type: string
description: Original file name for format detection
default: ''
title: File Name
description: Original file name for format detection
- name: token
in: query
required: true
schema:
type: string
description: Signed access token
title: Token
description: Signed access token
- name: uid
in: query
required: true
schema:
type: string
description: User ID
title: Uid
description: User ID
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/files/search:
get:
tags:
- Connections
summary: Search Files
description: 'Search for files across connected storage providers.
Same named-vs-no-filter split as list_files above: a named `provider`
that fails 502s — nothing to fall back to. No filter (the
picker''s merged search) returns `{"files": [...], "failed_providers":
[...]}` instead, reporting a dropped-out provider alongside whatever
succeeded rather than silently losing it — the only caller that''s
actually doing a best-effort fan-out across many providers.'
operationId: search_files_api_connections_files_search_get
security:
- HTTPBearer: []
parameters:
- name: q
in: query
required: true
schema:
type: string
description: Search query
title: Q
description: Search query
- name: provider
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter to a specific storage provider
title: Provider
description: Filter to a specific storage provider
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/api-key:
post:
tags:
- Connections
summary: Add Api Key
description: Store a BYOK API key (OpenAI, Anthropic, Google AI).
operationId: add_api_key_api_connections_api_key_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ApiKeyInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/custom-endpoint/models:
get:
tags:
- Connections
summary: List Custom Endpoint Models
description: Probe a custom OpenAI-compatible endpoint and return its available models.
operationId: list_custom_endpoint_models_api_connections_custom_endpoint_models_get
security:
- HTTPBearer: []
parameters:
- name: base_url
in: query
required: true
schema:
type: string
title: Base Url
- name: api_key
in: query
required: false
schema:
type: string
default: ''
title: Api Key
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/custom-endpoint:
post:
tags:
- Connections
summary: Add Custom Endpoint
description: 'Store a custom / self-hosted OpenAI-compatible endpoint (BYO Endpoint).
thoughtbox#205: keyed by a hash of the name (custom:) rather than
the single hardcoded "custom" slot, so more than one can be connected at
once (e.g. Grok and DeepSeek, both OpenAI-compatible, previously fought
over the one slot). A name is required for every new connection; reusing
an existing name reconfigures that same endpoint (store_credential''s
delete-then-insert), matching the existing single-endpoint "Reconfigure"
behavior.'
operationId: add_custom_endpoint_api_connections_custom_endpoint_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CustomEndpointInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/{provider}:
delete:
tags:
- Connections
summary: Remove Connection
description: Remove a connected provider.
operationId: remove_connection_api_connections__provider__delete
security:
- HTTPBearer: []
parameters:
- name: provider
in: path
required: true
schema:
type: string
title: Provider
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/available:
get:
tags:
- Connections
summary: Available Providers
description: 'thoughtbox#231: which storage providers this *deployment* holds
OAuth app credentials for at all — independent of any user''s own
connections. The frontend uses this to hide a "Connect" button for a
provider this deployment can never offer, rather than showing it and
letting the user hit the authorize-time 4xx below. No auth required:
this is deployment configuration, not user data.'
operationId: available_providers_api_connections_available_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
/api/connections/google_drive/authorize:
get:
tags:
- Connections
summary: Google Authorize
description: Return the Google OAuth consent URL. The frontend redirects the browser there.
operationId: google_authorize_api_connections_google_drive_authorize_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- HTTPBearer: []
/api/connections/google_drive/callback:
post:
tags:
- Connections
summary: Google Callback
description: Exchange Google auth code for tokens and store them.
operationId: google_callback_api_connections_google_drive_callback_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthCallbackInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/google_drive/grant/authorize:
get:
tags:
- Connections
summary: Google Grant Authorize
description: Return the Google consent URL for one capability (services/scope_grants.py).
operationId: google_grant_authorize_api_connections_google_drive_grant_authorize_get
security:
- HTTPBearer: []
parameters:
- name: capability
in: query
required: true
schema:
type: string
title: Capability
- name: keep
in: query
required: false
schema:
type: boolean
default: false
title: Keep
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/grant/decision:
post:
tags:
- Connections
summary: Grant Decision
description: 'The Grant access card''s answer to a turn waiting on it
(services/grant_waits.py). waiting=false: no turn was waiting, so the
chat continues the request itself.'
operationId: grant_decision_api_connections_grant_decision_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GrantDecisionInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/google_drive/grant/callback:
post:
tags:
- Connections
summary: Google Grant Callback
description: 'Exchange the code for one capability. A kept one merges into the stored
connection; a once one is held for at most an hour and the connection is
left alone.'
operationId: google_grant_callback_api_connections_google_drive_grant_callback_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthCallbackInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/google_drive/kept/{capability}:
delete:
tags:
- Connections
summary: Google Stop Keeping
description: 'thoughtbox#372: Connections'' "Stop keeping it". Back to asking each
time, at once; nothing is revoked at Google (services/scope_grants.py).'
operationId: google_stop_keeping_api_connections_google_drive_kept__capability__delete
security:
- HTTPBearer: []
parameters:
- name: capability
in: path
required: true
schema:
type: string
title: Capability
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/connections/google_drive/grant/picked:
post:
tags:
- Connections
summary: Google Grant Picked
description: 'Remember what was picked in the Google Picker under a live drive.file
grant (thoughtbox#312): a folder becomes the place ThoughtBox saves new
files; files become ones it may change. Kept on the Google connection,
since Google keeps per-file drive.file access until the user revokes it.
Google enforces the real limit; this only spares asking again.'
operationId: google_grant_picked_api_connections_google_drive_grant_picked_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PickedFilesInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/dropbox/authorize:
get:
tags:
- Connections
summary: Dropbox Authorize
description: Return the Dropbox OAuth consent URL.
operationId: dropbox_authorize_api_connections_dropbox_authorize_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- HTTPBearer: []
/api/connections/dropbox/callback:
post:
tags:
- Connections
summary: Dropbox Callback
description: Exchange Dropbox auth code for tokens and store them.
operationId: dropbox_callback_api_connections_dropbox_callback_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthCallbackInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/onedrive/authorize:
get:
tags:
- Connections
summary: Onedrive Authorize
description: Return the Microsoft OAuth consent URL.
operationId: onedrive_authorize_api_connections_onedrive_authorize_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- HTTPBearer: []
/api/connections/onedrive/own-app/authorize:
post:
tags:
- Connections
summary: Onedrive Own App Authorize
description: 'The consent URL for the user''s own app (#773), in its cloud, with PKCE in place of a secret. The verifier goes
back to the browser, which returns it with the code on the callback, like the state.'
operationId: onedrive_own_app_authorize_api_connections_onedrive_own_app_authorize_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OwnMicrosoftAppInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/onedrive/callback:
post:
tags:
- Connections
summary: Onedrive Callback
description: Exchange Microsoft auth code for tokens and store them.
operationId: onedrive_callback_api_connections_onedrive_callback_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthCallbackInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
/api/connections/box/authorize:
get:
tags:
- Connections
summary: Box Authorize
description: Return the Box OAuth consent URL.
operationId: box_authorize_api_connections_box_authorize_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
security:
- HTTPBearer: []
/api/connections/box/callback:
post:
tags:
- Connections
summary: Box Callback
description: Exchange Box auth code for tokens and store them.
operationId: box_callback_api_connections_box_callback_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthCallbackInput'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- HTTPBearer: []
components:
schemas:
CustomEndpointInput:
properties:
name:
type: string
title: Name
base_url:
type: string
title: Base Url
model:
type: string
title: Model
api_key:
type: string
title: Api Key
default: ''
type: object
required:
- name
- base_url
- model
title: CustomEndpointInput
FilesListRequest:
properties:
provider:
anyOf:
- type: string
- type: 'null'
title: Provider
path:
type: string
title: Path
default: /
type: object
title: FilesListRequest
CopyToThoughtboxResponse:
properties:
name:
type: string
title: Name
mime_type:
type: string
title: Mime Type
size:
type: integer
title: Size
content_base64:
type: string
title: Content Base64
type: object
required:
- name
- mime_type
- size
- content_base64
title: CopyToThoughtboxResponse
GrantDecisionInput:
properties:
capability:
type: string
title: Capability
granted:
type: boolean
title: Granted
type: object
required:
- capability
- granted
title: GrantDecisionInput
CopyToThoughtboxRequest:
properties:
provider:
type: string
title: Provider
file_id:
type: string
title: File Id
name:
type: string
title: Name
mime_type:
type: string
title: Mime Type
default: application/octet-stream
type: object
required:
- provider
- file_id
- name
title: CopyToThoughtboxRequest
OwnMicrosoftAppInput:
properties:
email:
type: string
maxLength: 320
title: Email
client_id:
type: string
maxLength: 64
title: Client Id
type: object
required:
- email
- client_id
title: OwnMicrosoftAppInput
description: 'thoughtbox#773: the user''s own Microsoft app. Only the client id: the cloud and tenant come from the address.'
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
PickedFilesInput:
properties:
files:
items:
additionalProperties: true
type: object
type: array
maxItems: 20
title: Files
type: object
required:
- files
title: PickedFilesInput
OAuthCallbackInput:
properties:
code:
type: string
title: Code
state:
type: string
maxLength: 512
title: State
own_app:
anyOf:
- $ref: '#/components/schemas/OwnMicrosoftAppInput'
- type: 'null'
code_verifier:
anyOf:
- type: string
maxLength: 128
- type: 'null'
title: Code Verifier
type: object
required:
- code
- state
title: OAuthCallbackInput
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
ApiKeyInput:
properties:
provider:
type: string
title: Provider
api_key:
type: string
title: Api Key
type: object
required:
- provider
- api_key
title: ApiKeyInput
securitySchemes:
HTTPBearer:
type: http
scheme: bearer