Schema
Retrieve object definitions, field metadata, options, and relation configurations from your CRM schema.
The Schema endpoints let you inspect your CRM's data model programmatically. Use them to discover available objects, their fields, types, constraints, options, and relations.
List all objects
GET /api/v1/schemaReturns every active object in your organization along with its fields.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
include_hidden | boolean | false | Include hidden (system-internal) objects in the response |
Example Request
curl -X GET "https://kasar.app/api/v1/schema" \
-H "Authorization: Bearer ksr_your_api_token"To include hidden objects:
curl -X GET "https://kasar.app/api/v1/schema?include_hidden=true" \
-H "Authorization: Bearer ksr_your_api_token"Response
{
"objects": [
{
"name": "contacts",
"label": "Contacts",
"labelSingular": "Contact",
"isSystem": true,
"isHidden": false,
"iconName": "Users",
"color": "#4F46E5",
"fields": [
{
"name": "first_name",
"label": "First Name",
"type": "TEXT",
"isRequired": true,
"isReadonly": false,
"isSearchable": true,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null
},
{
"name": "email",
"label": "Email",
"type": "EMAILS",
"isRequired": false,
"isReadonly": false,
"isSearchable": true,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null
},
{
"name": "status",
"label": "Status",
"type": "SELECT",
"isRequired": false,
"isReadonly": false,
"isSearchable": false,
"isHidden": false,
"defaultValue": "lead",
"isUnique": false,
"options": [
{ "value": "lead", "label": "Lead", "color": "#9CA3AF" },
{ "value": "qualified", "label": "Qualified", "color": "#3B82F6" },
{ "value": "customer", "label": "Customer", "color": "#10B981" }
]
},
{
"name": "company",
"label": "Company",
"type": "RELATION",
"isRequired": false,
"isReadonly": false,
"isSearchable": false,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null,
"relationConfig": {
"relationType": "BELONGS_TO_ONE",
"targetObjectName": "companies"
}
}
]
}
],
"enums": []
}The enums array is always empty. Options are no longer standalone entities — each SELECT / MULTI_SELECT field carries its own choices inline via the options property.
Object properties
| Property | Type | Description |
|---|---|---|
name | string | The object's plural name, used as the path segment in record endpoints |
label | string | Human-readable plural display label |
labelSingular | string | Human-readable singular display label |
isSystem | boolean | Whether the object is built-in (vs. custom-created) |
isHidden | boolean | Whether the object is system-internal and normally hidden |
iconName | string | null | Icon identifier for the object |
color | string | null | Display color for the object |
fields | array | The object's active fields (see below) |
Field properties
| Property | Type | Description |
|---|---|---|
name | string | Column name in the database |
label | string | Human-readable display label |
type | string | Field type (TEXT, NUMBER, EMAILS, SELECT, RELATION, PIPELINE, etc.) |
isRequired | boolean | Whether the field must have a value when creating a record |
isReadonly | boolean | Whether the field is computed or system-managed |
isSearchable | boolean | Whether the field is included in full-text search |
isHidden | boolean | Whether the field is hidden by default in the UI |
defaultValue | string | null | Default value applied on creation |
isUnique | boolean | Whether a unique constraint is enforced |
options | array | null | Inline choices for SELECT / MULTI_SELECT fields; null otherwise |
relationConfig | object | Relation details, present only on relation fields (see below) |
Option object
Present in the options array on SELECT and MULTI_SELECT fields.
| Property | Type | Description |
|---|---|---|
value | string | The stored value |
label | string | Human-readable display label |
color | string | Optional display color (may be absent) |
Relation config
Present only on relation fields (the relationConfig key is omitted entirely otherwise). Describes how two objects are linked.
| Property | Type | Description |
|---|---|---|
relationType | string | One of BELONGS_TO_ONE, HAS_MANY, MANY_TO_MANY, MORPH_RELATION |
targetObjectName | string | The related object's plural name |
Get a single object schema
GET /api/v1/schema/{object}Returns the schema for one object — the same shape as a single entry in the objects array of the list endpoint. The {object} path segment is matched against each object's plural name.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
object | string | The object's plural name (e.g., contacts, companies, opportunities) |
Example Request
curl -X GET "https://kasar.app/api/v1/schema/opportunities" \
-H "Authorization: Bearer ksr_your_api_token"Response
{
"name": "opportunities",
"label": "Opportunities",
"labelSingular": "Opportunity",
"isSystem": true,
"isHidden": false,
"iconName": "Target",
"color": "#F97316",
"fields": [
{
"name": "name",
"label": "Name",
"type": "TEXT",
"isRequired": true,
"isReadonly": false,
"isSearchable": true,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null
},
{
"name": "amount",
"label": "Amount",
"type": "CURRENCY",
"isRequired": false,
"isReadonly": false,
"isSearchable": false,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null
},
{
"name": "pipeline_step_id",
"label": "Pipeline Step",
"type": "PIPELINE",
"isRequired": false,
"isReadonly": false,
"isSearchable": false,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null
},
{
"name": "company",
"label": "Company",
"type": "RELATION",
"isRequired": false,
"isReadonly": false,
"isSearchable": false,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null,
"relationConfig": {
"relationType": "BELONGS_TO_ONE",
"targetObjectName": "companies"
}
},
{
"name": "close_date",
"label": "Close Date",
"type": "DATE",
"isRequired": false,
"isReadonly": false,
"isSearchable": false,
"isHidden": false,
"defaultValue": null,
"isUnique": false,
"options": null
}
]
}Error Responses
| Status | Code | Description |
|---|---|---|
| 404 | INVALID_OBJECT | The object name does not exist in your schema |