Skip to main content

Schema Management

A metadata group must have a schema defined before metadata can be attached to documents in that group. The schema declares which keys are allowed, what type each key is, and whether the value participates in full-text search.

Endpoints

MethodPathPurpose
PUT/custom-metadata/schema/{groupName}Create or update a schema
GET/custom-metadata/schema/{groupName}Retrieve the current schema
DELETE/custom-metadata/schema/{groupName}Delete a schema

Create or update a schema

PUT /custom-metadata/schema/{groupName}

Defines or updates the schema for a metadata group.

Request body

{
"metadataKeys": [
{
"name": "string",
"propertyType": "TEXT" | "PICKLIST" | "TEXTLIST" | "MULTIPICKLIST",
"skipIndexing": false
}
]
}
FieldTypeRequiredDescription
namestringYesKey name. Alphanumeric, case-insensitive, max 50 characters.
propertyTypeenumYesOne of TEXT, PICKLIST, TEXTLIST, MULTIPICKLIST. See Property types.
skipIndexingbooleanNoDefault false. When true, the key is stored on the document but not used for full-text search matching.

Example

curl -X PUT https://customer-be.glean.com/rest/api/index/custom-metadata/schema/compliance \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"metadataKeys": [
{ "name": "status", "propertyType": "PICKLIST" },
{ "name": "tags", "propertyType": "MULTIPICKLIST" },
{ "name": "reviewDate", "propertyType": "TEXT" },
{ "name": "internalNotes", "propertyType": "TEXT", "skipIndexing": true }
]
}'

Retrieve a schema

GET /custom-metadata/schema/{groupName}

Returns the current schema for the group, in the same shape as the PUT request body.

Delete a schema

DELETE /custom-metadata/schema/{groupName}

Deletes the schema for a metadata group. Existing metadata values previously attached to documents using this schema are retained until they are removed by a separate cleanup pass.

Property types

TypeDescriptionSearch behavior
TEXTSingle-line free-form text.Substring match on punctuation/whitespace boundaries.
PICKLISTSingle value chosen from a small set of distinct values.Exact-string match; suitable as a facet.
TEXTLISTArray of free-form text values.Substring match per entry.
MULTIPICKLISTArray of picklist values.Exact-string match per entry; suitable as a multi-select facet.
note

DATE, INT, and USERID property types are not supported by the Custom Metadata API.

Schema limits

LimitValue
Maximum metadata groups50
Maximum keys per group20
Maximum group name length50 characters
Maximum key name length50 characters