HackMD Trash API
Operations for listing and restoring trashed notes.
Operations for listing and restoring trashed notes.
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/hackmd:hackmd-trash-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. 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: HackMD Open Trash API
version: 1.0.0
description: HackMD OpenAPI
license:
name: UNLICENSED
contact:
name: HackMD Team
email: support@hackmd.io
servers:
- url: /v1
description: API Server
tags:
- name: Trash
description: Operations for listing and restoring trashed notes.
paths:
/trash:
get:
operationId: ListTrash
responses:
'200':
description: Ok
content:
application/json:
schema:
items:
$ref: '#/components/schemas/ApiTrashNote'
type: array
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRequestErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'429':
description: Rate limit or workspace quota exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRateLimitErrorResponse'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ApiServerErrorResponse'
description: List trashed notes in your personal workspace (same data as the internal trash API).
tags:
- Trash
security:
- token: []
parameters: []
summary: List trash
x-summary-source: derived
/trash/batch-restore:
put:
operationId: BatchRestore
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/TrashBatchOperationResponse'
'207':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/TrashBatchOperationResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRequestErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'404':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'429':
description: Rate limit or workspace quota exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRateLimitErrorResponse'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ApiServerErrorResponse'
description: Restore multiple notes from trash in one request.
tags:
- Trash
security:
- token: []
parameters: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BatchRestoreTrashBody'
summary: Batch restore
x-summary-source: derived
/trash/{noteId}/restore:
put:
operationId: RestoreNote
responses:
'204':
description: ''
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRequestErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'403':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'404':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'429':
description: Rate limit or workspace quota exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRateLimitErrorResponse'
'500':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ApiServerErrorResponse'
description: Restore a single note from trash.
tags:
- Trash
security:
- token: []
parameters:
- description: Encoded note id of the trashed note.
in: path
name: noteId
required: true
schema:
type: string
summary: Restore note
x-summary-source: derived
/teams/{teampath}/trash:
get:
operationId: ListTeamTrash
responses:
'200':
description: ''
content:
application/json:
schema:
items:
$ref: '#/components/schemas/ApiTrashNote'
type: array
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRequestErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'403':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'404':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'429':
description: Rate limit or workspace quota exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/ApiRateLimitErrorResponse'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/ApiServerErrorResponse'
description: List trashed notes in a team workspace (team admin only; same rules as the internal API).
tags:
- Trash
security:
- token: []
parameters:
- description: The path identifier for the team.
in: path
name: teampath
required: true
schema:
type: string
summary: List team trash
x-summary-source: derived
components:
schemas:
ApiErrorResponse:
properties:
error:
type: string
required:
- error
type: object
additionalProperties: false
ApiRequestErrorResponse:
properties:
message:
type: string
required:
- message
type: object
additionalProperties: false
ApiRateLimitErrorResponse:
anyOf:
- $ref: '#/components/schemas/ApiErrorResponse'
- $ref: '#/components/schemas/ApiQuotaErrorResponse'
BatchRestoreTrashBody:
properties:
noteIds:
items:
type: string
type: array
required:
- noteIds
type: object
additionalProperties: false
ApiTrashNote:
properties:
id:
type: string
title:
type: string
tags:
items:
type: string
type: array
deletedAt:
type: number
format: double
ownerId:
type: string
teamId:
type:
- string
- 'null'
shortId:
type: string
publishType:
type: string
permanentDeletedAt:
type:
- number
- 'null'
format: double
required:
- id
- title
- tags
- deletedAt
- ownerId
- teamId
- shortId
- publishType
- permanentDeletedAt
type: object
additionalProperties: false
ApiQuotaErrorResponse:
properties:
error:
properties:
upgradeUrl:
type: string
helpUrl:
type: string
message:
type: string
code:
type: string
enum:
- quota_exceeded
required:
- upgradeUrl
- helpUrl
- message
- code
type: object
required:
- error
type: object
additionalProperties: false
TrashBatchOperationResponse:
properties: {}
additionalProperties:
properties:
reason:
$ref: '#/components/schemas/BatchOperationError'
status:
type: string
enum:
- success
- failure
required:
- status
type: object
type: object
ApiServerErrorResponse:
anyOf:
- $ref: '#/components/schemas/ApiErrorResponse'
- $ref: '#/components/schemas/ApiRequestErrorResponse'
BatchOperationError:
enum:
- NOT_FOUND
- PERMISSION_DENIED
- INTERNAL_ERROR
type: string
securitySchemes:
token:
type: http
scheme: bearer
x-provenance:
method: harvested
publisher: HackMD
source: https://api.hackmd.io/v1/docs/swagger.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)