Skip to main content

Create note

This endpoint creates a new note.

HTTP Request

POST https://api.lunatask.app/v1/notes

Body Parameters

ParameterDescription
notebook_idThe Notebook ID of the notebook where the note should be created (optional, can be found in our apps in the notebook settings)
nameThe name of the note (optional, but impractical if empty)
contentThe content of the note (optional, but impractical if empty, formatted in Markdown)
date_onA date assigned to the note (optional, ISO-8601 formatted)
sourceIdentification of external system where the note is coming from (optional, e.g. "evernote")
source_idThe ID of the record in the external system (optional, e.g. "352fd2d7-cdc0-4e91-a0a3-9d6cc9d440e7")

When creating a note, given there's already an existing note in the same notebook with the same source/source_id, the endpoint will return 204 No Content without creating a duplicate.

Example in Ruby

require 'rest-client'

access_token = 'xxx'

payload = {
name: 'My new note',
content: 'My important note content',
source: 'evernote',
source_id: '352fd2d7-cdc0-4e91-a0a3-9d6cc9d440e7',
notebook_id: '11b37775-5a34-41bb-b109-f0e5a6084799'
}

RestClient.post('https://api.lunatask.app/v1/notes', payload.to_json, { Authorization: "bearer #{access_token}", "Content-Type": 'application/json' })

Response

The above command returns JSON structured like this:

{
"note": {
"id": "5999b945-b2b1-48c6-aa72-b251b75b3c2e",
"notebook_id": "d1ff35f5-6b25-4199-ab6e-c19fe3fe27f1",
"date_on": null,
"sources": [
{
"source": "evernote",
"source_id": "352fd2d7-cdc0-4e91-a0a3-9d6cc9d440e7"
}
],
"created_at": "2021-01-10T10:39:25Z",
"updated_at": "2021-01-10T10:39:25Z",
"deleted_at": null
}
}