MDflow Team folders 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-folders-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 folders 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 folders
description: Team API (/api/team/v1) — authenticated with a Team access token.
paths:
/api/team/v1/folders:
get:
operationId: listTeamFolders
summary: List Team folders
description: Lists folders across every Team workspace the token can read, oldest first. Pass `?workspace_id=` to list only one workspace; a workspace outside the token's grant returns 404.
tags:
- Team folders
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/TeamWorkspaceFilter'
responses:
'200':
description: Team folder list.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/TeamFolder'
'400':
$ref: '#/components/responses/BadRequest'
'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: createTeamFolder
summary: Create a Team folder
description: Creates a folder in a Team workspace where the token has write access. A top-level folder needs `workspace_id` — a Team token can span several workspaces, so MDflow never guesses one and answers 400 without it. A subfolder inherits its parent's workspace; a conflicting `workspace_id` is a 400. Duplicate sibling names are automatically disambiguated.
tags:
- Team folders
security:
- teamAccessToken: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTeamFolderInput'
responses:
'201':
description: Created Team folder.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamFolder'
'400':
description: Request body was malformed or failed validation, no workspace could be determined, or workspace_id contradicts the parent folder.
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 parent folder
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
description: The parent 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:
parentFolderNotFound:
value:
error: Parent folder not found
workspaceNotFound:
value:
error: Workspace not found
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
/api/team/v1/folders/{id}:
get:
operationId: getTeamFolder
summary: Get a Team folder
description: Returns one Team folder with its description, parent, and workspace. A folder in a workspace the token cannot read returns 404 without revealing whether it exists.
tags:
- Team folders
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/FolderId'
responses:
'200':
description: Team folder.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamFolder'
'400':
$ref: '#/components/responses/BadRequest'
'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'
patch:
operationId: updateTeamFolder
summary: Update a Team folder
description: Renames, re-describes, or moves a Team folder. Provide at least one of name, description, or parent_id. Renaming or moving disambiguates the name against the destination siblings. `parent_id` null moves the folder to the workspace top level; a parent in another workspace returns 404, and making a folder its own parent or a descendant's child is rejected with 400. Folders never move across workspaces. Requires write access to the folder's workspace.
tags:
- Team folders
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/FolderId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchTeamFolderInput'
responses:
'200':
description: Updated Team folder.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/TeamFolder'
'400':
description: Request body was malformed, empty, or failed validation, or the move would create a cycle.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
invalidRequestBody:
value:
error: Invalid request body
ownParent:
value:
error: Folder cannot be its own parent
cycle:
value:
error: Could not update folder
'401':
$ref: '#/components/responses/TeamUnauthorized'
'403':
$ref: '#/components/responses/TeamForbidden'
'404':
description: The folder, or the destination parent folder, 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:
folderNotFound:
value:
error: Folder not found
parentFolderNotFound:
value:
error: Parent folder not found
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
delete:
operationId: deleteTeamFolder
summary: Delete a Team folder
description: Permanently deletes a Team folder together with every subfolder and document inside it, including their images and attached files. Requires write access to the folder's workspace. Recorded in the Team audit feed under the token's creator.
tags:
- Team folders
security:
- teamAccessToken: []
parameters:
- $ref: '#/components/parameters/FolderId'
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/TeamFolderNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/TeamServerError'
/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 folders
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'
components:
headers:
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
NoStore:
description: API responses are not cacheable.
schema:
type: string
const: no-store
parameters:
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
FolderId:
name: id
in: path
required: true
description: Folder UUID.
schema:
type: string
format: uuid
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
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
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
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
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.'
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.
CreateTeamFolderInput:
type: object
additionalProperties: false
required:
- name
properties:
name:
type: string
minLength: 1
maxLength: 100
description:
type:
- string
- 'null'
maxLength: 5000
description: Empty text is stored as null.
parent_id:
type:
- string
- 'null'
format: uuid
description: Parent folder for a subfolder; its workspace is used.
workspace_id:
type: string
format: uuid
description: Team workspace for a top-level folder. Required when parent_id is not set (MDflow never guesses a workspace); must match the parent's workspace when it is.
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
TeamFolder:
type: object
additionalProperties: false
required:
- id
- workspace_id
- parent_id
- name
- description
- created_at
- updated_at
properties:
id:
type: string
format: uuid
workspace_id:
type: string
format: uuid
description: The Team workspace this folder belongs to. Never changes.
parent_id:
type:
- string
- 'null'
format: uuid
description: Parent folder, or null for a top-level folder.
name:
type: string
description:
type:
- string
- 'null'
description: The primary retrieval signal for the documents inside.
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
PatchTeamFolderInput:
type: object
additionalProperties: false
minProperties: 1
description: At least one of name, description, or parent_id must be provided.
properties:
name:
type: string
minLength: 1
maxLength: 100
description:
type:
- string
- 'null'
maxLength: 5000
description: Empty text or null clears the description; an absent key leaves it untouched.
parent_id:
type:
- string
- 'null'
format: uuid
description: Destination parent in the same workspace, or null for the workspace top level.
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.'