Home / GitHub Page

API: Updating tags


#1

When I create a note using the API (POST to /notes/) and supply one or more tag names, the note is created, the tags are created, and the tags are linked to the notes.

When I update a note using the API (PUT to /notes/:id) and supply one or more tag names, the note’s property tags is updated to the new contents, but no tags are created and linked. In other words, the note property tag no longer corresponds to the actual tags.

Is this a bug?


#2

Setting tags I think is only supported when POSTing, because that’s what was needed for the clipper. PUT probably ignores this property.

However, you might be able to do what you want using the /tags endpoint: https://joplin.cozic.net/api/#tags


#3

Okay, so updating tags is not possible via update note. Understandable.


#4

It seems that the note’s tag property reflects the initial tags used when the note was created, and does not reflect the actual tags.
Does it make sense? Otherwise it may be better to drop this property altogether.


#5

It should show the actual tags normally, do you have an example where it doesn’t?


#6

The attached script should reproduce it.

issue reproducing script


#7

I should have mentioned that the tags property is also not supported in GET calls. I guess this property shouldn’t have been documented since it’s mostly just to support the web clipper.


#8

In fact I’ve just removed it from the doc. For anything with tags, it’s better to use the /tags end point as it’s more flexible and better maps to the data model, and if something cannot be done we can fix it there.


#9

I agree removing the tags as a property is the best solution.

I do hope that specifying initial tags in a create note action will keep working.

Thanks.


#10

Yes that will most likely always be there.