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; readnoteUUIDfrom the response after creation. - If
isPublicis not passed, it defaults to a public note; pass0for a private note. - After creation, use the
noteUUIDfrom the response for subsequent retrieval, modification, and deletion. - The
etagin the response can be used asifMatchduring 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"}}'