KasarKasar Docs
API Reference

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/schema

Returns every active object in your organization along with its fields.

Query Parameters

ParameterTypeDefaultDescription
include_hiddenbooleanfalseInclude 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

PropertyTypeDescription
namestringThe object's plural name, used as the path segment in record endpoints
labelstringHuman-readable plural display label
labelSingularstringHuman-readable singular display label
isSystembooleanWhether the object is built-in (vs. custom-created)
isHiddenbooleanWhether the object is system-internal and normally hidden
iconNamestring | nullIcon identifier for the object
colorstring | nullDisplay color for the object
fieldsarrayThe object's active fields (see below)

Field properties

PropertyTypeDescription
namestringColumn name in the database
labelstringHuman-readable display label
typestringField type (TEXT, NUMBER, EMAILS, SELECT, RELATION, PIPELINE, etc.)
isRequiredbooleanWhether the field must have a value when creating a record
isReadonlybooleanWhether the field is computed or system-managed
isSearchablebooleanWhether the field is included in full-text search
isHiddenbooleanWhether the field is hidden by default in the UI
defaultValuestring | nullDefault value applied on creation
isUniquebooleanWhether a unique constraint is enforced
optionsarray | nullInline choices for SELECT / MULTI_SELECT fields; null otherwise
relationConfigobjectRelation details, present only on relation fields (see below)

Option object

Present in the options array on SELECT and MULTI_SELECT fields.

PropertyTypeDescription
valuestringThe stored value
labelstringHuman-readable display label
colorstringOptional 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.

PropertyTypeDescription
relationTypestringOne of BELONGS_TO_ONE, HAS_MANY, MANY_TO_MANY, MORPH_RELATION
targetObjectNamestringThe 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

ParameterTypeDescription
objectstringThe 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

StatusCodeDescription
404INVALID_OBJECTThe object name does not exist in your schema

On this page