Skip to Content
DocumentationFeatureAPI Management

Third-Party API

This document describes all public API endpoints. All requests start with /tp.

All endpoints on this page must include the following request header

HeaderValue
API-KEYyour api key

API keys can be added via Avatar (bottom-left) -> Account -> APIKey Management in Revornix.


/tp/file/upload

Upload a file

Parameters

ParameterTypeRequiredDescription
fileFileYesFile
file_pathstringNoFile path
content_typestringNoContent type

Example

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } files = { "file": ("example.md", open("example.md", "rb"), "text/markdown") } data = { "file_path": "/files/example.md", "content_type": "text/markdown" } response = client.post( url="http://localhost:8001/tp/section/create", headers=headers, files=files, data=data )

/tp/section/create

Create a section

Parameters

ParameterTypeRequiredDescription
titlestringYesSection title
descriptionstringYesSection description
coverstringNoCover image
labelsint[]YesLabel list
auto_publishboolNoAuto publish
auto_podcastboolNoAuto-generate audio podcast
auto_illustrationboolNoAuto-generate illustrations
process_task_trigger_typeintYesTrigger reason (0: time trigger / 1: update event)
process_task_trigger_schedulerboolNoSchedule for time trigger (cron expression)

Example

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/section/create", headers=headers, json={ "title": "test title", "description": "test description", "cover": "test/test.png", "labels": [1, 2], "auto_publish": true, "process_task_trigger_type": 1 } )

/tp/section/label/create

Create a section label

Parameters

ParameterTypeRequiredDescription
namestringYesLabel name

Example

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/section/label/create", headers=headers, json={ "name": "test" } )

/tp/section/mine/all

Get all my sections


/tp/document/label/list

Get all document labels


/tp/document/label/create

Create a document label

Parameters

ParameterTypeRequiredDescription
namestringYesLabel name

Example

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/document/label/create", headers=headers, json={ "name": "test" } )

/tp/document/create

Create a document

Parameters

ParameterTypeRequiredDescription
categoryintYesDocument type, 0: file document, 1: link document, 2: quick note document
sectionsint[]YesSections to push to
labelsint[]YesLabel list
titlestringNoTitle
descriptionstringNoDescription
coverstringNoCover
contentstringYes/NoContent, required for quick notes and only valid for quick note documents
urlstringYes/NoURL, required for link documents and only valid for link documents
file_namestringYes/NoFile path (same as file_path from upload). Required for file documents and only valid for file documents; upload the file first
auto_summarybooleanNoAuto-generate summary
auto_podcastbooleanNoAuto-generate podcast
auto_tagbooleanNoAuto-tag
from_platstringYesSource platform, recommended api

Example

This example is for link documents only. Modify it for other types.

import httpx client = httpx.Client() headers = { "API-KEY": "your api key" } response = client.post( url="http://localhost:8001/tp/document/create", headers=headers, json={ "category": 1, "url": "https://baidu.com" "sections": [], "auto_summary": True, "labels": [], "from_plat": "api", } )
Last updated on