MDflow Folders API
The Folders API from MDflow — 3 operation(s) for folders.
The Folders API from MDflow — 3 operation(s) for folders.
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-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 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: Folders
paths:
/api/v1/folders:
get:
operationId: listFolders
summary: List folders
description: Returns all folders owned by the authenticated user.
tags:
- Folders
responses:
'200':
description: Folder list.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Folder'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/WorkspaceNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
post:
operationId: createFolder
summary: Create a folder
description: Creates a folder owned by the authenticated user. Duplicate sibling names are automatically disambiguated.
tags:
- Folders
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateFolderInput'
responses:
'201':
description: Created folder.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Folder'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: The parent folder (parent_id) or the target workspace (workspace_id) was not found or is not owned by the authenticated user.
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/ServerError'
/api/v1/folders/{id}/documents:
get:
operationId: listFolderDocuments
summary: List documents in a folder
description: Returns documents owned by the authenticated user inside the specified folder. A folder owned by another user returns 404.
tags:
- Folders
parameters:
- $ref: '#/components/parameters/FolderId'
responses:
'200':
description: Document list.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/DocumentListItem'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/FolderNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
/api/v1/folders/{id}:
get:
operationId: getFolder
summary: Get a folder
description: 'Returns one folder owned by the authenticated user, including its full path (workspace → … → folder) and its compounded description: the labeled cascade of descriptions from the workspace down through each ancestor folder to this folder. A folder owned by another user returns 404.'
tags:
- Folders
parameters:
- $ref: '#/components/parameters/FolderId'
responses:
'200':
description: Folder details.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/FolderDetail'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/FolderNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
patch:
operationId: updateFolder
summary: Update a folder
description: Updates a folder owned by the authenticated user. Provide at least one of name, description, or parent_id. Renaming or moving disambiguates the name against the destination siblings. Setting parent_id reparents the folder (null moves it to the top level); moving a folder under itself, one of its own descendants, or into a different workspace is rejected with 400.
tags:
- Folders
parameters:
- $ref: '#/components/parameters/FolderId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PatchFolderInput'
responses:
'200':
description: Updated folder.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Folder'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/FolderNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
delete:
operationId: deleteFolder
summary: Delete a folder
description: Deletes a folder owned by the authenticated user. Documents inside the folder are deleted by database cascade.
tags:
- Folders
parameters:
- $ref: '#/components/parameters/FolderId'
responses:
'204':
$ref: '#/components/responses/Deleted'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/FolderNotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
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.
Folder:
type: object
additionalProperties: false
required:
- id
- name
- description
- parent_id
- workspace_id
- created_at
- updated_at
properties:
id:
type: string
format: uuid
name:
type: string
description:
type:
- string
- 'null'
parent_id:
type:
- string
- 'null'
format: uuid
workspace_id:
type: string
format: uuid
description: The workspace this folder belongs to.
path:
type: array
description: Full path from the workspace root down to this folder, workspace first. Returned by the list and get endpoints; omitted from create and update responses.
items:
$ref: '#/components/schemas/PathSegment'
path_string:
type: string
description: Path segment names joined by " / ". Returned by the list and get endpoints; omitted from create and update responses.
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
DocumentListItem:
type: object
additionalProperties: false
required:
- id
- title
- folder_id
- is_public
- created_at
- updated_at
properties:
id:
type: string
format: uuid
title:
type: string
folder_id:
type: string
format: uuid
is_public:
type: boolean
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
workspace_id:
type: string
format: uuid
description: The workspace this document belongs to (via its folder). Returned by list/get responses; omitted from create/rename/move/body responses.
path:
type: array
description: Full path from the workspace root down to this document. Returned by list/get responses; omitted from mutation responses.
items:
$ref: '#/components/schemas/PathSegment'
path_string:
type: string
description: Path segment names joined by " / ".
PathSegment:
type: object
additionalProperties: false
required:
- id
- name
- type
properties:
id:
type: string
format: uuid
name:
type: string
type:
type: string
enum:
- workspace
- folder
- document
CreateFolderInput:
type: object
additionalProperties: false
required:
- name
properties:
name:
type: string
minLength: 1
maxLength: 100
description:
type: string
maxLength: 5000
parent_id:
type:
- string
- 'null'
format: uuid
workspace_id:
type: string
format: uuid
description: Workspace for a top-level folder. Ignored when parent_id is set (the parent's workspace wins). Defaults to the owner's oldest workspace.
FolderDetail:
type: object
additionalProperties: false
required:
- id
- name
- description
- parent_id
- workspace_id
- path
- path_string
- compounded_description
- created_at
- updated_at
properties:
id:
type: string
format: uuid
name:
type: string
description:
type:
- string
- 'null'
parent_id:
type:
- string
- 'null'
format: uuid
workspace_id:
type: string
format: uuid
description: The workspace this folder belongs to.
path:
type: array
description: Full path from the workspace root down to this folder, workspace first.
items:
$ref: '#/components/schemas/PathSegment'
path_string:
type: string
description: Path segment names joined by " / ".
compounded_description:
type: string
description: Labeled cascade of descriptions from the workspace down through each ancestor folder to this folder. Empty string when nothing in the chain has a description.
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
PatchFolderInput:
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
maxLength: 5000
parent_id:
type:
- string
- 'null'
format: uuid
responses:
WorkspaceNotFound:
description: Workspace was not found or is not owned by the authenticated user.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
notFound:
value:
error: Workspace not found
Deleted:
description: Deleted successfully. No response body.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
Forbidden:
description: The bearer token is valid but its owner cannot use the API. Agent control (REST + MCP) requires an MDflow Pro plan, so a token owned by a non-Pro account returns 403 on every endpoint. POST /api/v1/documents additionally returns 403 when the account reaches its document limit. The body includes a `message` field with guidance.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
proRequired:
value:
error: Pro plan required
message: 'Authenticate with OAuth (in Claude or ChatGPT connectors, add https://mdflow.cz/api/mcp and complete the sign-in prompt) or with an MDflow Personal Access Token (send an ''Authorization: Bearer mdf_...'' header, created at https://mdflow.cz/settings). Requires an MDflow Pro account. Documentation: https://mdflow.cz/docs/api'
documentLimit:
value:
error: Upgrade to Pro to create more than 100 documents.
FolderNotFound:
description: Folder was not found or is not owned by the authenticated user.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
notFound:
value:
error: Folder not found
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
Unauthorized:
description: Missing, malformed, invalid, or revoked bearer token. The body includes a `message` field with guidance for authenticating, and the response carries a `WWW-Authenticate` challenge.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
WWW-Authenticate:
$ref: '#/components/headers/WwwAuthenticate'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
missingToken:
value:
error: Missing or malformed bearer token
message: 'Authenticate with OAuth (in Claude or ChatGPT connectors, add https://mdflow.cz/api/mcp and complete the sign-in prompt) or with an MDflow Personal Access Token (send an ''Authorization: Bearer mdf_...'' header, created at https://mdflow.cz/settings). Requires an MDflow Pro account. Documentation: https://mdflow.cz/docs/api'
invalidToken:
value:
error: Invalid bearer token
message: 'Authenticate with OAuth (in Claude or ChatGPT connectors, add https://mdflow.cz/api/mcp and complete the sign-in prompt) or with an MDflow Personal Access Token (send an ''Authorization: Bearer mdf_...'' header, created at https://mdflow.cz/settings). Requires an MDflow Pro account. Documentation: https://mdflow.cz/docs/api'
ServerError:
description: Unexpected server error.
headers:
Cache-Control:
$ref: '#/components/headers/NoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unexpected:
value:
error: Unexpected API error
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
WwwAuthenticate:
description: RFC 6750 Bearer challenge carrying a `resource_metadata` parameter (RFC 9728) that points to `/.well-known/oauth-protected-resource` for OAuth discovery. `Bearer realm="MDflow", resource_metadata="…"` when credentials are missing, or one that also includes `error="invalid_token"` with an `error_description` when a token was rejected.
schema:
type: string
parameters:
FolderId:
name: id
in: path
required: true
description: Folder UUID.
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.'