Skip to content

Create



POST /api/v1/notes_v2/create

Overview

Create a new version of the note.

Body Request Parameters

Parameter Name Type Required Description
title string Y Note title
Allow empty: False
content string Y Markdown body
Allow empty: False
tags array Tag list
Allow empty: False
tagKV json Key-value tags
Allow empty: False
isPublic int Whether it is public, 1 for public, 0 for private, default is 1
Allow empty: False
extend json Studio business extension fields
Allow empty: False
noteType string Note type, normal for regular notes, runbook for operations manual, default is normal
Allow empty: False
Optional values: ['normal', 'runbook']

Parameter Supplement

Use this API to create a new version of the note. The request body must contain at least title and content, and optionally tags, tagKV, isPublic, and extend.

  • Do not pass the note storage path or noteUUID; read noteUUID from the response after creation.
  • If isPublic is not passed, it defaults to a public note; pass 0 for a private note.
  • After creation, use the noteUUID from the response for subsequent retrieval, modification, and deletion.
  • The etag in the response can be used as ifMatch during the first edit or deletion.

Request Example

curl 'https://openapi.guance.com/api/v1/notes_v2/create' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"title":"A","content":"# A","tags":["ops"],"tagKV":{"host":"127.0.0.1"}}'

Response

{
    "code": 200,
    "content": {
        "noteUUID": "nbnote_xxx",
        "title": "A",
        "tags": [
            "ops"
        ],
        "tagKV": {
            "host": "127.0.0.1"
        },
        "isPublic": 1,
        "createdSource": "manual",
        "noteType": "normal",
        "etag": "etag_xxx",
        "version": 1
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-XXXX"
} 

Feedback

Is this page helpful? ×