Add files to a Log entry
POST
/api/v1/notes/journal/entries/{block_id}/attachments
const url = 'https://example.com/api/v1/notes/journal/entries/example/attachments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"attachments":[{"target":"example","text":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/notes/journal/entries/example/attachments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "attachments": [ { "target": "example", "text": "example" } ] }'Requires a signed-in User with the data scope and file access in the Home. It adds file links under the Log entry. It returns 400 for invalid input or 404 when the entry or a file is missing. Route: /api/v1/notes/journal/entries/{block_id}/attachments. Inputs: block_id. Do not automatically replay this operation after an uncertain result.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”block_id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Existing Home files to append to one Journal entry (#421). Keeping the batch explicit lets the server validate every target before one checked Daily note write.
object
attachments
required
Array<object>
One composer attachment: a Home-relative file path and its link text (#421).
object
target
required
string
text
required
string
Examplegenerated
{ "attachments": [ { "target": "example", "text": "example" } ]}Responses
Section titled “Responses”Media typeapplication/json
object
attachments
required
Array<object>
object
embed
required
boolean
target
required
string
text
required
string
date
required
string
end
string | null
etag
required
string
id
required
string
start
required
string
tags
required
Array<string>
title
required
string
zone
string | null
Examplegenerated
{ "attachments": [ { "embed": true, "target": "example", "text": "example" } ], "date": "example", "end": "example", "etag": "example", "id": "example", "start": "example", "tags": [ "example" ], "title": "example", "zone": "example"}Invalid attachment
No Log entry has this block ID