MDflow Team documents API
Team API (/api/team/v1) — authenticated with a Team access token.
Team API (/api/team/v1) — authenticated with a Team access token.
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/mdflow-cz:mdflow-cz-team-documents-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: MDflow Public Team documents API
version: 1.0.0
description: 'HTTP API for reading and writing workspaces, folders, and markdown documents in MDflow. The personal API under /api/v1 authenticates with a Personal Access Token (mdf_…) or an OAuth access token and requires MDflow Pro. The Team API under /api/team/v1 is the content surface of an MDflow Team account: it authenticates with a Team access token (mdt_…) that is bound to one Team account, granted only the workspaces picked at creation, capped at read-only or read-and-write, and re-checked against the creator''s live membership, role, workspace permission, and the account''s access state on every request. Personal tokens are rejected on Team routes and Team tokens on personal routes.'
servers:
- url: https://mdflow.cz
description: Production
- url: http://localhost:3000
description: Local development
security:
- personalAccessToken: []
tags:
- name: Team documents
description: Team API (/api/team/v1) — authenticated with a Team access token.
paths:
/api/team/v1/folders/{id}/documents:
get:
operationId: listTeamFolderDocuments
summary: List documents in a Team folder
description: Lists the documents directly inside one Team folder, sorted by title, without bodies. An optional `?workspace_id=` must match the folder's workspace; a mismatch is a 400 rather than another workspace's documents.
tags:
- Team documents
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/FolderId'
- name: workspace_id
in: query
required: false
description: Optional. Must be the folder's own workspace; any other value is a 400.
schema:
type: string
format: uuid
responses:
'200':
description: Team document list.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TeamDocumentListItem'
'400':
description: The folder or workspace id is not a UUID, or workspace_id is not the folder's workspace.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalidFolderId:
value:
error: Invalid folder id
workspaceConflict:
value:
error: workspace_id conflicts with folder
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
$ref: '#/components/responses/TeamFolderNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
/api/team/v1/documents:
get:
operationId: listTeamDocuments
summary: List Team documents
description: Lists documents across every Team workspace the token can read, most recently updated first, without bodies. Pass `?workspace_id=` to stay inside one workspace. Pass `?ids=` with up to 10 comma-separated document UUIDs to fetch exactly those documents with their bodies in one request — the batch read the Team MCP server uses for topic retrieval. Ids the token cannot read are silently left out.
tags:
- Team documents
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/TeamWorkspaceFilter'
- name: ids
in: query
required: false
description: Up to 10 comma-separated document UUIDs. When present, each returned document includes its `body`.
schema:
type: string
example: 4e5f6a7b-8c9d-4e0f-a1b2-3c4d5e6f7a8b,5f6a7b8c-9d0e-4f1a-b2c3-4d5e6f7a8b9c
responses:
'200':
description: Team document list. Items carry `body` only when `ids` was passed.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
type: array
items:
oneOf:
- $ref: '#/components/schemas/TeamDocumentListItem'
- $ref: '#/components/schemas/TeamDocument'
'400':
description: workspace_id is not a UUID, or ids is empty, longer than 10 entries, or contains a non-UUID.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalidWorkspaceId:
value:
error: Invalid workspace id
invalidIds:
value:
error: Invalid ids
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
$ref: '#/components/responses/TeamWorkspaceNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
post:
operationId: createTeamDocument
summary: Create a Team document
description: Creates a markdown document in a Team workspace where the token has write access. Pass `folder_id` to file it into a folder (the folder's workspace wins; a conflicting `workspace_id` is a 400), or `workspace_id` alone to create it at the workspace root. Duplicate sibling titles are automatically disambiguated. Answers 400 once the Team account reaches its 10,000-document cap.
tags:
- Team documents
security:
- teamAccessToken: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTeamDocumentInput'
responses:
'201':
description: Created Team document (without body).
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamDocumentListItem'
'400':
description: Request body was malformed or failed validation, no workspace could be determined, workspace_id contradicts the folder, or the Team account is at its document cap.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalidRequestBody:
value:
error: Invalid request body
workspaceRequired:
value:
error: workspace_id is required
workspaceConflict:
value:
error: workspace_id conflicts with folder
documentLimit:
value:
error: Team document limit reached
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
description: The folder is not in a workspace the token can read, or the target workspace is outside the token's grant.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
folderNotFound:
value:
error: Folder not found
workspaceNotFound:
value:
error: Workspace not found
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
/api/team/v1/documents/{id}:
get:
operationId: getTeamDocument
summary: Get a Team document
description: Returns one Team document including its markdown body. A document in a workspace the token cannot read returns 404.
tags:
- Team documents
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/DocumentId'
responses:
'200':
description: Team document with body.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamDocument'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
$ref: '#/components/responses/TeamDocumentNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
patch:
operationId: renameTeamDocument
summary: Rename a Team document
description: Retitles one Team document. The new title is disambiguated against the other documents in the same folder (or at the same workspace root). Requires write access to the document's workspace.
tags:
- Team documents
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/DocumentId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchDocumentInput'
responses:
'200':
description: Renamed Team document (without body).
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamDocumentListItem'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
$ref: '#/components/responses/TeamDocumentNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
delete:
operationId: deleteTeamDocument
summary: Delete a Team document
description: Permanently deletes one Team document with its images and attached files. Requires write access to the document's workspace. Recorded in the Team audit feed under the token's creator.
tags:
- Team documents
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/DocumentId'
responses:
'204':
$ref: '#/components/responses/Deleted'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
$ref: '#/components/responses/TeamDocumentNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
/api/team/v1/documents/{id}/body:
put:
operationId: updateTeamDocumentBody
summary: Overwrite a Team document body
description: 'Replaces the entire markdown body of one Team document; title and folder are preserved. An empty body is refused with 400 unless the request also sends `confirmEmpty: true`. The edit is attributed to the token''s creator in version history and the audit feed. Returns the document without its body.'
tags:
- Team documents
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/DocumentId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateTeamDocumentBodyInput'
responses:
'200':
description: Updated Team document (without body).
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamDocumentListItem'
'400':
description: Request body was malformed or failed validation, or an empty body was sent without confirmEmpty.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalidRequestBody:
value:
error: Invalid request body
emptyBody:
value:
error: 'Empty body requires confirmEmpty: true'
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
$ref: '#/components/responses/TeamDocumentNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
/api/team/v1/documents/{id}/folder:
put:
operationId: moveTeamDocument
summary: Move a Team document
description: Moves one Team document into another folder of the same workspace, or to the workspace root with `folder_id` null. A destination folder in another workspace returns 404 — documents never change workspace. Duplicate titles at the destination are disambiguated. Requires write access to the document's workspace.
tags:
- Team documents
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/DocumentId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MoveTeamDocumentInput'
responses:
'200':
description: Moved Team document (without body).
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamDocumentListItem'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
description: The document, or the destination folder within its workspace, is not in a workspace the token can read.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
documentNotFound:
value:
error: Document not found
folderNotFound:
value:
error: Folder not found
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
components:
schemas:
Error:
type: object
additionalProperties: false
required:
- error
properties:
error:
type: string
message:
type: string
description: Optional human-readable guidance for resolving the error, included on authentication (401) and authorization (403) failures.
TeamDocumentListItem:
type: object
additionalProperties: false
required:
- id
- workspace_id
- folder_id
- title
- created_at
- updated_at
properties:
id:
type: string
format: uuid
workspace_id:
type: string
format: uuid
description: The Team workspace this document belongs to. Never changes.
folder_id:
type:
- string
- 'null'
format: uuid
description: Containing folder, or null for a document at the workspace root.
title:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
PatchDocumentInput:
type: object
additionalProperties: false
required:
- title
properties:
title:
type: string
minLength: 1
maxLength: 100
CreateTeamDocumentInput:
type: object
additionalProperties: false
required:
- title
- body
properties:
title:
type: string
minLength: 1
maxLength: 100
body:
type: string
maxLength: 512000
description: Markdown document body. UTF-8 encoded content must not exceed 512000 bytes.
folder_id:
type:
- string
- 'null'
format: uuid
description: Folder to create the document in; its workspace is used. Omit or null for the workspace root.
workspace_id:
type: string
format: uuid
description: Team workspace for a root document. Required when folder_id is not set (MDflow never guesses a workspace); must match the folder's workspace when it is.
TeamDocument:
type: object
additionalProperties: false
required:
- id
- workspace_id
- folder_id
- title
- body
- created_at
- updated_at
properties:
id:
type: string
format: uuid
workspace_id:
type: string
format: uuid
description: The Team workspace this document belongs to. Never changes.
folder_id:
type:
- string
- 'null'
format: uuid
description: Containing folder, or null for a document at the workspace root.
title:
type: string
body:
type: string
description: Markdown document body.
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
MoveTeamDocumentInput:
type: object
additionalProperties: false
required:
- folder_id
properties:
folder_id:
type:
- string
- 'null'
format: uuid
description: Destination folder in the document's own workspace, or null for the workspace root.
UpdateTeamDocumentBodyInput:
type: object
additionalProperties: false
required:
- body
properties:
body:
type: string
maxLength: 512000
description: Replacement markdown body. UTF-8 encoded content must not exceed 512000 bytes.
confirmEmpty:
type: boolean
description: Must be true when body is an empty string. An empty body is otherwise refused with 400.
responses:
TeamFolderNotFound:
description: The folder does not exist in a workspace the token can read.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
notFound:
value:
error: Folder not found
Deleted:
description: Deleted successfully. No response body.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
BadRequest:
description: Request body was malformed or failed validation.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalidRequestBody:
value:
error: Invalid request body
TeamServerError:
description: Unexpected server error, or the live membership lookup failed. Retry rather than discarding the token — this is never a revocation signal.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unexpected:
value:
error: Unexpected API error
accessLookupFailed:
value:
error: Could not verify team access
TeamUnauthorized:
description: Missing, malformed, invalid, or revoked Team access token — including a personal `mdf_` token sent to a Team route, and a token whose creator has left the team. The body includes a `message` with Team token guidance, and the response carries a `WWW-Authenticate` challenge.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
WWW-Authenticate:
$ref: '#/components/headers/TeamWwwAuthenticate'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
missingToken:
value:
error: Missing or malformed bearer token
message: 'Authenticate with an MDflow Team access token (send an ''Authorization: Bearer mdt_...'' header). Team tokens are created by team members on the Team API Access page at https://mdflow.cz/teams and follow the creator''s current team membership and workspace permissions.'
invalidToken:
value:
error: Invalid bearer token
message: 'Authenticate with an MDflow Team access token (send an ''Authorization: Bearer mdt_...'' header). Team tokens are created by team members on the Team API Access page at https://mdflow.cz/teams and follow the creator''s current team membership and workspace permissions.'
TeamForbidden:
description: 'The Team access token is valid but the operation exceeds its effective access: a write from a read-only token or from a creator whose current workspace permission is read-only, a write while the Team account is not active (setup, grace, or read_only), or any request while the account is being deleted. No plan check is involved — eligibility comes from the Team seat. The body includes a `message` with guidance.'
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
writeAccessRequired:
value:
error: Write access required
message: 'Authenticate with an MDflow Team access token (send an ''Authorization: Bearer mdt_...'' header). Team tokens are created by team members on the Team API Access page at https://mdflow.cz/teams and follow the creator''s current team membership and workspace permissions.'
accountReadOnly:
value:
error: Team account is read-only
message: 'Authenticate with an MDflow Team access token (send an ''Authorization: Bearer mdt_...'' header). Team tokens are created by team members on the Team API Access page at https://mdflow.cz/teams and follow the creator''s current team membership and workspace permissions.'
accountUnavailable:
value:
error: Team account is unavailable
message: 'Authenticate with an MDflow Team access token (send an ''Authorization: Bearer mdt_...'' header). Team tokens are created by team members on the Team API Access page at https://mdflow.cz/teams and follow the creator''s current team membership and workspace permissions.'
TeamDocumentNotFound:
description: The document does not exist in a workspace the token can read.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
notFound:
value:
error: Document not found
TeamWorkspaceNotFound:
description: The workspace is outside the token's grant or the creator's current access. MDflow does not reveal whether it exists.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
notFound:
value:
error: Workspace not found
RateLimited:
description: The token or authenticated user exceeded a 60 requests per minute rate limit.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
rateLimited:
value:
error: Rate limit exceeded
headers:
NoStore:
description: API responses are not cacheable.
schema:
type: string
const: no-store
RetryAfter:
description: Seconds to wait before retrying after a rate-limit response.
schema:
type: integer
minimum: 1
TeamWwwAuthenticate:
description: 'RFC 6750 Bearer challenge for the Team API. `Bearer realm="MDflow Team"` when credentials are missing, or `Bearer realm="MDflow Team", error="invalid_token", error_description="…"` when a token was rejected. Carries no `resource_metadata` parameter: the Team API accepts only Team access tokens today, and OAuth is a planned later phase.'
schema:
type: string
parameters:
FolderId:
name: id
in: path
required: true
description: Folder UUID.
schema:
type: string
format: uuid
DocumentId:
name: id
in: path
required: true
description: Document UUID.
schema:
type: string
format: uuid
TeamWorkspaceFilter:
name: workspace_id
in: query
required: false
description: Only return rows in this Team workspace. A workspace outside the token's grant returns 404.
schema:
type: string
format: uuid
securitySchemes:
personalAccessToken:
type: http
scheme: bearer
bearerFormat: PAT
description: 'Use an MDflow Personal Access Token in the form `Authorization: Bearer mdf_...`.'
teamAccessToken:
type: http
scheme: bearer
bearerFormat: Team access token
description: 'Use an MDflow Team access token in the form `Authorization: Bearer mdt_...`. Created by any member on the Team''s API Access page (`/teams/{accountId}/api-access`); bound to one Team account, limited to the workspaces selected at creation, capped at read-only or read-and-write, and re-checked against the creator''s live membership and permissions on every request. Only accepted by the `/api/team/v1` routes.'