POST/datasets/{dataset_id}/metadata/built-in/{action}

Update Built-in Metadata Field

Enable or disable built-in metadata fields for the knowledge base.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 parameters
dataset_idstringrequired
Knowledge base ID, from [List Knowledge Bases](/en/api-reference/knowledge-bases/list-knowledge-bases). For a scoped key, [copy the ID from the Dify URL](/en/api-reference/guides/knowledge#knowledge-base-id).
actionstringrequired
`enable` to activate built-in metadata fields, `disable` to deactivate them.
Allowed:enabledisable

3 status codes
200Built-in metadata field toggled successfully.
resultstringoptional
Operation result.
403- `forbidden` : Dataset api access is not enabled. - `forbidden` : Sorry, you have reached the knowledge base request rate limit of your subscription. - `forbidden` : The API key is scoped to specific knowledge bases, and this knowledge base is not one of them.

One documented failure

  • forbidden

    Dataset api access is not enabled.

    forbidden (api access)

404`not_found` : Dataset not found.

One documented failure

  • not_found

    Dataset not found.

    not_found

Error handling

A 403 is returned: - forbidden : Dataset api access is not enabled.

  • forbidden : Sorry, you have reached the knowledge base request rate limit of your subscription.
  • forbidden : The API key is scoped to specific knowledge bases, and this knowledge base is not one of them. A 404 is returned: not_found : Dataset not found.