Skip to content

core-apis.md: add_tag_property requires UUID strings for both arguments, not display names #2

@ChipNowacek

Description

@ChipNowacek

Bug: add_tag_property argument type documented incorrectly

File: references/core-apis.md — Tag Property Management section

What the docs currently say

await parentLogseq.api.add_tag_property(tagUuid, 'propertyName')

The second argument is shown as a display name string ('propertyName').

What it actually requires

Both arguments require a BlockIdentity (UUID string), not display names. Passing a property name string silently fails — the property-to-class association is not made, and no error is thrown.

Confirmed behavior (production use)

We verified this while building a manifest-driven installer for a Logseq plugin. The working call is:

await parentLogseq.api.add_tag_property(tagUuid, propertyUuid)

Where:

  • tagUuid — UUID from createTag() return value or getTag().uuid
  • propertyUuid — must be resolved via DataScript after upsertProperty(), since upsertProperty does not return a UUID:
const results = await logseq.DB.datascriptQuery(`
  [:find ?uuid
   :where
   [?e :block/title "myPropertyName"]
   [?e :block/tags ?t]
   [?t :db/ident :logseq.class/Property]
   [?e :block/uuid ?uuid]]
`) as [string][] | null
const propertyUuid = results?.[0]?.[0]

The same UUID requirement applies to the tag argument — a display name string does not work there either.

Suggested correction

Update the example in core-apis.md to use propertyUuid instead of 'propertyName', and add a note explaining the DataScript resolution step.

Thanks for the skill — it was genuinely useful. This was the one place where the gap between the docs and the actual API bit us.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions