Skip to main content

Endpoint

GET /core/org-fields

Authentication

This endpoint requires authentication via API key. Include your API key in the X-API-Key header:
X-API-Key: ca_your_api_key_here

Query Parameters

ParameterTypeRequiredDescription
include_attributesbooleanNoWhen true, the response also includes the attributes array of mapped fields available for uploads. Defaults to false

Request Example

curl -X GET "https://platform.chamelio.ai/core/org-fields?include_attributes=true" \
  -H "X-API-Key: ca_your_api_key_here"
import requests

url = "https://platform.chamelio.ai/core/org-fields"
headers = {
    "X-API-Key": "ca_your_api_key_here"
}
params = {
    "include_attributes": True
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
const response = await fetch('https://platform.chamelio.ai/core/org-fields?include_attributes=true', {
  method: 'GET',
  headers: {
    'X-API-Key': 'ca_your_api_key_here'
  }
});

const data = await response.json();
console.log(data);

Response

Success Response

Status Code: 200 OK
{
  "org_fields": [
    {
      "org_field_id": 301,
      "name": "Governing Law",
      "field_value_type": "enum",
      "field_scope": "global",
      "description": "The jurisdiction whose laws govern the agreement",
      "enum_values": ["Delaware", "New York", "California"],
      "document_types": ["Master Services Agreement", "Non-Disclosure Agreement"]
    },
    {
      "org_field_id": 302,
      "name": "Effective Date",
      "field_value_type": "date",
      "field_scope": "global",
      "description": null,
      "enum_values": null,
      "document_types": null
    }
  ],
  "attributes": [
    {
      "name": "contract_type",
      "field_type": "text"
    },
    {
      "name": "renewal_date",
      "field_type": "date"
    }
  ]
}

Response Fields

FieldTypeDescription
org_fieldsarrayList of org fields configured for your organization. Each entry is an Org Field Object
attributesarray or nullList of mapped attributes available for uploads. Present only when include_attributes=true; otherwise null. Each entry is an Attribute Object

Org Field Object

Each object in the org_fields array contains:
FieldTypeDescription
org_field_idintegerUnique identifier of the org field
namestringHuman-readable name of the field
field_value_typestringType of the field value. One of text, enum, number, boolean, date, clause
field_scopestringScope the field applies to within your organization
descriptionstring or nullOptional description of the field
enum_valuesarray or nullAllowed values when field_value_type is enum; otherwise null
document_typesarray or nullNames of the document types this field applies to, if restricted; otherwise null

Attribute Object

Each object in the attributes array contains:
FieldTypeDescription
namestringName of the mapped attribute
field_typestringType of the attribute. One of text, number, boolean, date, link

Error Responses

401 Unauthorized

Returned when authentication fails. See the authentication errors section for details.
{
  "detail": "Invalid API key"
}

500 Internal Server Error

Returned when the org fields could not be retrieved due to a server error.
{
  "detail": "Failed to fetch org fields: Internal processing error"
}

Notes

Use the org_field_id and field_value_type values returned here to populate field_overrides when uploading a document via POST /core/upload.

Use Cases

This endpoint is useful for:
  • Field discovery - Look up the org fields configured for your organization and their value types
  • Override mapping - Retrieve valid org_field_id values before setting field_overrides on an upload
  • Attribute mapping - Discover the mapped attributes available to attach to documents