Schema API

Discover your org's full data model at runtime -- built-in objects, custom object types, and their field definitions.

Endpoints

MethodPathDescription
GET/schemaGet the full org schema

Get the full org schema

GET /schema

Returns every object type available in your org, including both built-in CRM objects (contacts, companies, deals, etc.) and any custom object types you have defined. Each object includes its field definitions with types, constraints, and validation rules.

This endpoint is designed for AI agents and developer tools that need to understand the data model before making API calls.

Example

curl "$REX_URL/schema" \
  -H "X-Api-Key: $REX_API_KEY"

Response

{
  "data": {
    "objects": [
      {
        "name": "Contact",
        "slug": "contact",
        "kind": "built_in",
        "enforcement_level": "hard",
        "fields": [
          {
            "name": "email",
            "label": "Email",
            "type": "email",
            "required": true,
            "unique": true
          },
          {
            "name": "first_name",
            "label": "First Name",
            "type": "string"
          },
          {
            "name": "stage",
            "label": "Stage",
            "type": "enum",
            "enum_values": ["lead", "prospect", "customer", "churned"]
          }
        ]
      },
      {
        "id": "ot_01HQ...",
        "name": "Support Ticket",
        "slug": "support-ticket",
        "kind": "custom",
        "status": "active",
        "enforcement_level": "soft",
        "fields": [
          {
            "name": "priority",
            "label": "Priority",
            "type": "enum",
            "enum_values": ["low", "medium", "high", "critical"],
            "required": true
          },
          {
            "name": "assigned_to",
            "label": "Assigned To",
            "type": "reference",
            "reference_target": "user"
          }
        ]
      }
    ]
  }
}

Field types

TypeDescription
stringFree text
numberNumeric value
booleanTrue/false
dateDate (no time)
datetimeDate and time (RFC 3339)
emailEmail address
urlURL
phonePhone number
currencyMoney value in cents
enumOne of a fixed set of values (see enum_values)
referenceForeign key to another object (see reference_target)
arrayList of values (see nested items field definition)

Enforcement levels

LevelDescription
noneNo validation; fields are advisory only
softValidation warnings are returned but writes succeed
hardValidation errors reject the write

Was this page helpful?

·