Interact with Paperless-ngx document management system via REST API. Use when users want to search, upload, download, organize documents, manage tags, correspondents, or document types in their Paperless-ngx instance.
通过HTTP请求使用REST API管理Paperless-ngx中的文档。
需要环境变量:
在所有请求中包含令牌:
Authorization: Token $PAPERLESS_TOKEN
bash
curl -s $PAPERLESS_URL/api/documents/?query=invoice \
-H Authorization: Token $PAPERLESS_TOKEN
筛选选项:correspondentid、document_typeid、tagsidin、createddategte、createddatelte、addeddategte。
bash
curl -s $PAPERLESS_URL/api/documents/{id}/ \
-H Authorization: Token $PAPERLESS_TOKEN
bash
bash
curl -s $PAPERLESSURL/api/documents/postdocument/ \
-H Authorization: Token $PAPERLESS_TOKEN \
-F document=@/path/to/file.pdf \
-F title=Document Title \
-F correspondent=1 \
-F document_type=2 \
-F tags=3 \
-F tags=4
可选字段:title、created、correspondent、documenttype、storagepath、tags(可重复)、archiveserialnumber、custom_fields。
bash
curl -s -X PATCH $PAPERLESS_URL/api/documents/{id}/ \
-H Authorization: Token $PAPERLESS_TOKEN \
-H Content-Type: application/json \
-d {title: New Title, correspondent: 1, tags: [1, 2]}
bash
curl -s -X DELETE $PAPERLESS_URL/api/documents/{id}/ \
-H Authorization: Token $PAPERLESS_TOKEN
bash
bash
bash
bash
curl -s -X POST $PAPERLESSURL/api/documents/bulkedit/ \
-H Authorization: Token $PAPERLESS_TOKEN \
-H Content-Type: application/json \
-d {
documents: [1, 2, 3],
method: add_tag,
parameters: {tag: 5}
}
方法:setcorrespondent、setdocumenttype、addtag、remove_tag、delete、reprocess。
上传后,检查任务状态:
bash
curl -s $PAPERLESSURL/api/tasks/?taskid={uuid} \
-H Authorization: Token $PAPERLESS_TOKEN
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 paperless-ngx-1776385633 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 paperless-ngx-1776385633 技能
skillhub install paperless-ngx-1776385633
文件大小: 1.84 KB | 发布时间: 2026-4-17 16:17