import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/object-extractors/"
payload = {
"name": "Contract clauses",
"brief": "Extract obligations and effective dates from contracts.",
"llm_model": "gpt-4o",
"extractable_pydantic_class": "from pydantic import BaseModel
from typing import Optional
class ContractClause(BaseModel):
clause_type: str
text: str
effective_date: Optional[str] = None
",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"document_ids": [],
"add_anchoring_object": True,
"extract_single_object": False,
"compute_alerts": False,
"extraction_mode": "standard"
}
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: 'Contract clauses',
brief: 'Extract obligations and effective dates from contracts.',
llm_model: 'gpt-4o',
extractable_pydantic_class: 'from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n',
extraction_prompt: 'Extract every distinct contractual obligation as a separate ContractClause object.',
document_ids: [],
add_anchoring_object: true,
extract_single_object: false,
compute_alerts: false,
extraction_mode: 'standard'
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/object-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}/object-extractors/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Contract clauses",
"brief": "Extract obligations and effective dates from contracts.",
"llm_model": "gpt-4o",
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"document_ids": [],
"add_anchoring_object": true,
"extract_single_object": false,
"compute_alerts": false,
"extraction_mode": "standard"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Contract clauses",
"brief": "Extract obligations and effective dates from contracts.",
"llm_model": "gpt-4o",
"extractable_object": "ContractClause",
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"document_ids": [
"b3c1d2e4-5f6a-4b7c-8d9e-0a1b2c3d4e5f"
],
"document_ranges": {},
"compute_alerts": false,
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"pre_execution_filter": {},
"alerts_additional_instructions": "<string>",
"alerts_llm_model": "<string>",
"extraction_mode": "standard",
"agentic_config": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"prompt_generation_status": "<string>",
"deployed_extractable_pydantic_class": "<string>",
"deployed_extraction_prompt": "<string>",
"deployed_llm_model": "<string>",
"extracted_objects_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alerts_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object_name": "<string>",
"blocks_table_version_info": {},
"chunks_table_version_info": {},
"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,
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"llm_model": "gpt-4o",
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"alerts_additional_instructions": "<string>",
"extraction_mode": "standard",
"agentic_config": {}
}
],
"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,
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"llm_model": "gpt-4o",
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"alerts_additional_instructions": "<string>",
"extraction_mode": "standard",
"agentic_config": {}
},
"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,
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"llm_model": "gpt-4o",
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"alerts_additional_instructions": "<string>",
"extraction_mode": "standard",
"agentic_config": {}
}
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Create object extractor
Create an ObjectExtractor. A first ObjectExtractorVersion is
created automatically and marked as default. Pass import_mode: true
to skip auto-version creation (bulk imports only).
Required field: name.
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/object-extractors/"
payload = {
"name": "Contract clauses",
"brief": "Extract obligations and effective dates from contracts.",
"llm_model": "gpt-4o",
"extractable_pydantic_class": "from pydantic import BaseModel
from typing import Optional
class ContractClause(BaseModel):
clause_type: str
text: str
effective_date: Optional[str] = None
",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"document_ids": [],
"add_anchoring_object": True,
"extract_single_object": False,
"compute_alerts": False,
"extraction_mode": "standard"
}
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: 'Contract clauses',
brief: 'Extract obligations and effective dates from contracts.',
llm_model: 'gpt-4o',
extractable_pydantic_class: 'from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n',
extraction_prompt: 'Extract every distinct contractual obligation as a separate ContractClause object.',
document_ids: [],
add_anchoring_object: true,
extract_single_object: false,
compute_alerts: false,
extraction_mode: 'standard'
})
};
fetch('https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/object-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}/object-extractors/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Contract clauses",
"brief": "Extract obligations and effective dates from contracts.",
"llm_model": "gpt-4o",
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"document_ids": [],
"add_anchoring_object": true,
"extract_single_object": false,
"compute_alerts": false,
"extraction_mode": "standard"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Contract clauses",
"brief": "Extract obligations and effective dates from contracts.",
"llm_model": "gpt-4o",
"extractable_object": "ContractClause",
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"document_ids": [
"b3c1d2e4-5f6a-4b7c-8d9e-0a1b2c3d4e5f"
],
"document_ranges": {},
"compute_alerts": false,
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"pre_execution_filter": {},
"alerts_additional_instructions": "<string>",
"alerts_llm_model": "<string>",
"extraction_mode": "standard",
"agentic_config": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"prompt_generation_status": "<string>",
"deployed_extractable_pydantic_class": "<string>",
"deployed_extraction_prompt": "<string>",
"deployed_llm_model": "<string>",
"extracted_objects_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"alerts_table": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"object_name": "<string>",
"blocks_table_version_info": {},
"chunks_table_version_info": {},
"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,
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"llm_model": "gpt-4o",
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"alerts_additional_instructions": "<string>",
"extraction_mode": "standard",
"agentic_config": {}
}
],
"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,
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"llm_model": "gpt-4o",
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"alerts_additional_instructions": "<string>",
"extraction_mode": "standard",
"agentic_config": {}
},
"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,
"extractable_pydantic_class": "from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n",
"extraction_prompt": "Extract every distinct contractual obligation as a separate ContractClause object.",
"llm_model": "gpt-4o",
"add_anchoring_object": true,
"filtered_on_block_types": true,
"block_types": [
"text",
"table"
],
"extract_single_object": false,
"block_grouping_config": {},
"alerts_additional_instructions": "<string>",
"extraction_mode": "standard",
"agentic_config": {}
}
}{
"error": "User not found"
}{
"error": "Authentication credentials were not provided."
}{
"error": "You do not have permission to perform this action."
}Authorizations
Use Authorization: Bearer
Path Parameters
UUID of the project
Body
Extracts structured data (instances of a Pydantic model) from chunks or blocks of documents.
Human-readable name.
"Contract clauses"
Short description shown in the UI.
"Extract obligations and effective dates from contracts."
"gpt-4o"
Display name of the object class (auto-derived from extractable_pydantic_class if omitted).
"ContractClause"
Python source of the Pydantic model used as the extraction schema.
"from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n"
"Extract every distinct contractual obligation as a separate ContractClause object."
Documents to extract from. Empty array means "all documents in the project".
["b3c1d2e4-5f6a-4b7c-8d9e-0a1b2c3d4e5f"]
Optional per-document page-range filter ({document_id: [start_page, end_page]}).
false
true
["text", "table"]
Filter applied to the source chunks/blocks before extraction runs.
standard, agentic Configuration for agentic extraction mode.
Bulk-import flag. When true, the create endpoint skips auto-version creation.
Response
Created
Extracts structured data (instances of a Pydantic model) from chunks or blocks of documents.
Human-readable name.
"Contract clauses"
Short description shown in the UI.
"Extract obligations and effective dates from contracts."
"gpt-4o"
Display name of the object class (auto-derived from extractable_pydantic_class if omitted).
"ContractClause"
Python source of the Pydantic model used as the extraction schema.
"from pydantic import BaseModel\nfrom typing import Optional\n\nclass ContractClause(BaseModel):\n clause_type: str\n text: str\n effective_date: Optional[str] = None\n"
"Extract every distinct contractual obligation as a separate ContractClause object."
Documents to extract from. Empty array means "all documents in the project".
["b3c1d2e4-5f6a-4b7c-8d9e-0a1b2c3d4e5f"]
Optional per-document page-range filter ({document_id: [start_page, end_page]}).
false
true
["text", "table"]
Filter applied to the source chunks/blocks before extraction runs.
standard, agentic Configuration for agentic extraction mode.
ID of the warehouse Table where extracted objects are stored.
Show child attributes
Show child attributes
Immutable snapshot of an ObjectExtractor's version-bearing configuration.
New version rows are created automatically on PATCH when any of these
fields differs from the latest version.
Show child attributes
Show child attributes
Immutable snapshot of an ObjectExtractor's version-bearing configuration.
New version rows are created automatically on PATCH when any of these
fields differs from the latest version.
Show child attributes
Show child attributes