import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/object-extractors/{extractor_id}/"
payload = { "name": "Contract clauses (renamed)" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"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."
}{
"error": "Not found."
}Update object extractor (auto-creates new version)
Partial update of an ObjectExtractor. If any version-bearing field
differs from the latest version, a new ObjectExtractorVersion row is
created automatically. Version-bearing fields:
extractable_pydantic_class, extraction_prompt, llm_model,
add_anchoring_object, filtered_on_block_types, block_types,
extract_single_object, block_grouping_config,
alerts_additional_instructions.
Pass set_latest_as_default: true to promote the newly created
version to the default in the same call.
import requests
url = "https://eu.app.clarifeye.ai/api/v1/projects/{project_id}/object-extractors/{extractor_id}/"
payload = { "name": "Contract clauses (renamed)" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"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."
}{
"error": "Not found."
}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
Body
Extracts structured data (instances of a Pydantic model) from chunks or blocks of documents.
Response
Updated. A new version may have been created — inspect versions[] to confirm.
Extracts structured data (instances of a Pydantic model) from chunks or blocks of documents.