Skip to content

Create



POST /api/v1/notes/create

Overview

Creates a legacy note and returns the note UUID.

Before You Begin and Usage Steps

A minimal request only requires a name. Get the new note UUID from content.uuid in the response, and then call Import Note to rebuild charts. chartUUIDs stores ordered references. To actually import chart content into the note, use template import.

Request Headers

Parameter Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with the required permission from API Key Management in the target workspace.

Body Request Parameters

Parameter Type Required Description
name string Y Note name, maximum 128 characters.
Nullable: False
Max length: 128
Example: 生产巡检笔记
How to obtain or enter: Enter a name for the new note, or reuse the name of an existing note.
chartUUIDs array Ordered array of chart UUIDs, up to 32 items. If omitted, it is empty. This stores references and does not reassign ownership for existing charts.
Nullable: False
Max length: 32
Example: []
How to obtain or enter: For a new note, you can use an empty array. The UUIDs of existing charts can be verified through content.charts[].uuid in the corresponding legacy Note Details.
extend json Note extension configuration; if omitted, {}.
Nullable: False
Example: {}
How to obtain or enter: Prefer to copy existing configuration from content.extend in Note Details or extend in the template.

Additional Parameter Notes

By default, you can create an empty note with a name. If you need to import from a legacy note template, save the UUID of the new note first.

Request Example

curl --request POST 'https://openapi.truewatch.com/api/v1/notes/create' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"name":"生产巡检笔记"}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.id integer Note record ID.
content.uuid string Note UUID, used for querying, modifying, importing, and deleting.
content.name string Note name.
content.workspaceUUID string Workspace it belongs to.
content.isPublic integer Visibility, 1 for public, 0 for creating identity only.
content.extend object Note extension configuration.
content.status integer Current note status.
content.creator string Creator identity ID.
content.updator string ID of the last updater; can be empty if not updated.
content.createAt number Creation time, Unix seconds.
content.updateAt number Last update time, Unix seconds. Can be -1 if not updated.
content.deleteAt number Deletion time, Unix seconds. -1 if not deleted.
content.pos array<object> Ordered reference array of charts.
content.pos[].chartUUID string Chart UUID.
content.declaration object or null Public declaration for the workspace.
{
  "code": 200,
  "content": {
    "id": 11,
    "uuid": "note_example",
    "name": "生产巡检笔记",
    "workspaceUUID": "wksp_example",
    "isPublic": 1,
    "pos": [],
    "extend": {},
    "status": 0,
    "creator": "wsak_example",
    "updator": "",
    "createAt": 1785427200,
    "updateAt": -1,
    "deleteAt": -1,
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Resolution
406 ft.ParameterValidationFailed Request field is missing, or field value violates the declared validation conditions Parameter parsing failed Verify parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Request JSON syntax is invalid Request JSON format error Correct the JSON according to content.reason, line, and column.
400 ft.JsonFormatError JSON syntax is valid but the request top level is not an object Some json file format error Put parameters in a JSON object and retry.
403 ft.ForbiddenFreeEditionLimit The workspace has the corresponding quota enabled and the number of legacy notes reaches the limit Free Plan workspace {} has reached the limit ({}), so new notes cannot be created. Enable the Commercial Plan to unlock the limit Check the workspace plan and note count, then adjust the quota or resources.