PATCH/datasets/{dataset_id}/metadata/{metadata_id}

Rename a custom metadata field

Updates the name of a custom metadata field in a knowledge base. Supply the new name, which must be unique among the knowledge base's fields and no longer than 255 characters. Use this operation to rename a field without changing its identifier or type.

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

2 parameters · 1 body field
dataset_idstringrequired
The knowledge base identifier in UUID format.
metadata_idstringrequired
The UUID of the metadata field to rename.

The new name for the custom metadata field.

namestringrequired
New name for the field. Must be unique among the knowledge base's fields and at most 255 characters.

4 status codes
200Returns the updated metadata field, including its identifier, name, and type.
idstringoptional
Metadata field identifier.
namestringoptional
Metadata field name.
typestringoptional
Metadata field type.
400Returned when the name already exists, exceeds 255 characters, or conflicts with a built-in field.

One documented failure

  • invalid_param

    Metadata name already exists.

    invalid_param

403Returned when dataset API access is disabled, a subscription rate limit applies, or the API key is not scoped to the knowledge base.

One documented failure

  • forbidden

    Dataset api access is not enabled.

    forbidden (api access)

404Returned when the knowledge base or the specified metadata field is not found in that knowledge base.

One documented failure

  • not_found

    Dataset not found.

    not_found (knowledge base)

Error handling

A 400 is returned when name already exists, exceeds 255 characters, or conflicts with a built-in field; a 403 indicates disabled dataset API access, a subscription rate limit, or an API-key scope mismatch; a 404 indicates the knowledge base or metadata field was not found. The dataset_id path parameter must identify an existing knowledge base, and the metadata_id path parameter must identify a field in it. The new name must be unique among the knowledge base's fields and no longer than 255 characters.