import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tag-extractors/"
payload = {
"name": "Department classifier",
"brief": "Classify each chunk into a department.",
"llm_model": "gpt-4o",
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
},
{
"id": "engineering",
"label": "Engineering",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"tag_level": "chunk",
"enforce_single_tag": True,
"compute_alerts": False,
"document_ids": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Department classifier',
brief: 'Classify each chunk into a department.',
llm_model: 'gpt-4o',
tagging_tree: {
id: 'department',
label: 'Department',
children: [
{id: 'legal', label: 'Legal', children: []},
{id: 'finance', label: 'Finance', children: []},
{id: 'engineering', label: 'Engineering', children: []}
]
},
extraction_prompt: 'Choose the department this chunk most likely belongs to.',
tag_level: 'chunk',
enforce_single_tag: true,
compute_alerts: false,
document_ids: []
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tag-extractors/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tag-extractors/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Department classifier",
"brief": "Classify each chunk into a department.",
"llm_model": "gpt-4o",
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
},
{
"id": "engineering",
"label": "Engineering",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"tag_level": "chunk",
"enforce_single_tag": true,
"compute_alerts": false,
"document_ids": []
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Department classifier",
"brief": "Classify each chunk into a department.",
"llm_model": "gpt-4o",
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"tag_level": "chunk",
"document_ids": [],
"compute_alerts": false,
"enforce_single_tag": false,
"pre_execution_filter": {},
"alerts_additional_instructions": "<string>",
"alerts_llm_model": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"prompt_generation_status": "<string>",
"deployed_tagging_tree": {},
"deployed_extraction_prompt": "<string>",
"deployed_llm_model": "<string>",
"extracted_tags_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alerts_tags_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chunks_table_version_info": {},
"filtering_options": [
{}
],
"table_version_updates": {},
"versions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_default": true,
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"llm_model": "gpt-4o",
"enforce_single_tag": false,
"alerts_additional_instructions": "<string>"
}
],
"default_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_default": true,
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"llm_model": "gpt-4o",
"enforce_single_tag": false,
"alerts_additional_instructions": "<string>"
},
"latest_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_default": true,
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"llm_model": "gpt-4o",
"enforce_single_tag": false,
"alerts_additional_instructions": "<string>"
}
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Create tag extractor
Create a TagExtractor. A first TagExtractorVersion is created
automatically and marked as default.
Required field: name. The tagging_tree body is validated against
a schema by the backend — id, label, and children keys must be
present at every node (children may be empty).
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tag-extractors/"
payload = {
"name": "Department classifier",
"brief": "Classify each chunk into a department.",
"llm_model": "gpt-4o",
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
},
{
"id": "engineering",
"label": "Engineering",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"tag_level": "chunk",
"enforce_single_tag": True,
"compute_alerts": False,
"document_ids": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Department classifier',
brief: 'Classify each chunk into a department.',
llm_model: 'gpt-4o',
tagging_tree: {
id: 'department',
label: 'Department',
children: [
{id: 'legal', label: 'Legal', children: []},
{id: 'finance', label: 'Finance', children: []},
{id: 'engineering', label: 'Engineering', children: []}
]
},
extraction_prompt: 'Choose the department this chunk most likely belongs to.',
tag_level: 'chunk',
enforce_single_tag: true,
compute_alerts: false,
document_ids: []
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tag-extractors/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/tag-extractors/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Department classifier",
"brief": "Classify each chunk into a department.",
"llm_model": "gpt-4o",
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
},
{
"id": "engineering",
"label": "Engineering",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"tag_level": "chunk",
"enforce_single_tag": true,
"compute_alerts": false,
"document_ids": []
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Department classifier",
"brief": "Classify each chunk into a department.",
"llm_model": "gpt-4o",
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"tag_level": "chunk",
"document_ids": [],
"compute_alerts": false,
"enforce_single_tag": false,
"pre_execution_filter": {},
"alerts_additional_instructions": "<string>",
"alerts_llm_model": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"prompt_generation_status": "<string>",
"deployed_tagging_tree": {},
"deployed_extraction_prompt": "<string>",
"deployed_llm_model": "<string>",
"extracted_tags_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alerts_tags_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chunks_table_version_info": {},
"filtering_options": [
{}
],
"table_version_updates": {},
"versions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_default": true,
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"llm_model": "gpt-4o",
"enforce_single_tag": false,
"alerts_additional_instructions": "<string>"
}
],
"default_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_default": true,
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"llm_model": "gpt-4o",
"enforce_single_tag": false,
"alerts_additional_instructions": "<string>"
},
"latest_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"is_default": true,
"tagging_tree": {
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
},
"extraction_prompt": "Choose the department this chunk most likely belongs to.",
"llm_model": "gpt-4o",
"enforce_single_tag": false,
"alerts_additional_instructions": "<string>"
}
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Authorizations
Use Authorization: Bearer <token>. The token is either a user token / OAuth access
token, or a service-account API key (cfk_...). A key is valid on every endpoint and
acts as its service account, an organization member with per-store permissions.
Refused keys answer 403 with Invalid API key., API key revoked.,
API key expired. or API key disabled..
Path Parameters
UUID of the project
Body
Applies hierarchical metadata tags to chunks (or documents) using an LLM.
"Department classifier"
"Classify each chunk into a department."
"gpt-4o"
Nested tree describing the tag taxonomy. Each node has shape
{id: string, label: string, children: [...]}.
{
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
}
"Choose the department this chunk most likely belongs to."
Granularity at which tags are applied.
chunk, document "chunk"
[]
When true, only one leaf tag per chunk is allowed.
false
Response
Created
Applies hierarchical metadata tags to chunks (or documents) using an LLM.
"Department classifier"
"Classify each chunk into a department."
"gpt-4o"
Nested tree describing the tag taxonomy. Each node has shape
{id: string, label: string, children: [...]}.
{
"id": "department",
"label": "Department",
"children": [
{
"id": "legal",
"label": "Legal",
"children": []
},
{
"id": "finance",
"label": "Finance",
"children": []
}
]
}
"Choose the department this chunk most likely belongs to."
Granularity at which tags are applied.
chunk, document "chunk"
[]
When true, only one leaf tag per chunk is allowed.
false
Show child attributes
Show child attributes
Immutable snapshot of a TagExtractor's version-bearing configuration.
Show child attributes
Show child attributes
Immutable snapshot of a TagExtractor's version-bearing configuration.
Show child attributes
Show child attributes