from unstructured import UnstructuredClient
client = UnstructuredClient(
username="My Username",
password="My Password",
)
response = client.tags.upsert(
tag_data={
"name": "name",
"output_type": "output_type",
},
)
print(response.available_values_added){
"tag_name": "<string>",
"tag": {
"tag_id": "<string>",
"username": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"output_type": "string",
"available_values": [],
"examples": [],
"updated_at": "2025-10-31T16:15:55.923700",
"tuned": 0,
"maxValues": 123,
"date_format": "MM-dd-YYYY",
"enhance_file_metadata": true,
"group": "<string>",
"min_confidence": 123,
"strategy": "LLM",
"patterns": [],
"visual_rules": [],
"scope": "ALL_PAGES"
},
"available_values_added": [
"<string>"
]
}Insert or update a tag definition.
| Field | Type | Description |
|---|---|---|
tag_data | DeasyInputTag | Tag data structure containing tag definition. |
{ "tag_name": str, "tag": DeasyTag, "available_values_added": List[str] }{
"tag_data": {
"name": "category",
"description": "Document category classification",
"type": "select",
"available_values": ["invoice", "receipt", "contract"]
}
}
from unstructured import UnstructuredClient
client = UnstructuredClient(
username="My Username",
password="My Password",
)
response = client.tags.upsert(
tag_data={
"name": "name",
"output_type": "output_type",
},
)
print(response.available_values_added){
"tag_name": "<string>",
"tag": {
"tag_id": "<string>",
"username": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"output_type": "string",
"available_values": [],
"examples": [],
"updated_at": "2025-10-31T16:15:55.923700",
"tuned": 0,
"maxValues": 123,
"date_format": "MM-dd-YYYY",
"enhance_file_metadata": true,
"group": "<string>",
"min_confidence": 123,
"strategy": "LLM",
"patterns": [],
"visual_rules": [],
"scope": "ALL_PAGES"
},
"available_values_added": [
"<string>"
]
}Show child attributes
Show child attributes
Show child attributes
AND, OR Successful Response
Show child attributes
string, binary, number, date Show child attributes
Show child attributes
AND, OR