For the complete documentation index, see llms.txt. This page is also available as Markdown.

Examples

The Data Schema is the essence of your Object Type. Created using JSON, Data Schemas can be as simple or complex as your needs demand. Several examples of this powerful Contextual capability are provided.

An example of a Customer Object Type typical to a simple business or CRM system.

Object Type Definition
Value

ID

customer

Display Name

Customer

Display Name (Plural)

Customers

Description

Customers of my company.

Category

Data

AI Assistant prompts you might consider to modify this schema:

  • "Add validation to the zip property"

  • "Instead of separate name fields, combine into a single fullName field"

  • "Add validation to the phone property so it meets US standard"

  • "Add a description to each property"

Example Data Schema
{
  "primaryKey": "customerId",
  "type": "object",
  "properties": {
    "customerId": {
      "type": "string",
      "generate": {
        "type": "uuid",
        "format": "v4"
      }
    },
    "firstName": {
      "type": "string",
      "minLength": 1
    },
    "lastName": {
      "type": "string",
      "minLength": 1
    },
    "email": {
      "type": "string",
      "format": "email",
      "minLength": 1
    },
    "phone": {
      "type": "string",
      "minLength": 1
    },
    "address": {
      "type": "object",
      "properties": {
        "street": {
          "type": "string",
          "minLength": 1
        },
        "city": {
          "type": "string",
          "minLength": 1
        },
        "state": {
          "type": "string",
          "minLength": 1
        },
        "zip": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "street",
        "city",
        "state",
        "zip"
      ]
    }
  },
  "required": [
    "firstName",
    "lastName",
    "email",
    "phone",
    "address"
  ],
  "additionalProperties": false
}

This schema defines an object for storing customer data, using customerId as the primary key, which is generated as a UUID version 4 string. The schema includes properties such as firstName, lastName, email (which must be a valid email format), and phone, each requiring a minimum length of one character. It also details an address object with mandatory properties like street, city, state, and zip, each also requiring a minimum length of one. All these properties are required for the object to be valid. Additionally, the schema disallows any properties not explicitly defined (additionalProperties is set to false).

An example of an Invoice Object Type, typical to a simple business or CRM system.

Object Type Definition
Value

ID

invoice

Display Name

Invoice

Display Name (Plural)

Invoices

Description

Invoices for my services.

Category

Data

AI Assistant prompts you might consider to modify this schema:

  • "Add validation to the zip property"

  • "Add state names and 2-letter abbreviations to the state property"

  • "Add validation to the phone property so it meets US standard"

  • "Add a description to each property"

This schema defines an object for an invoice, using invoiceId as the primary key, which is generated as a UUID version 4 string. It includes properties such as clientName, clientAddress (an embedded object with required properties like street, city, state, and zip), consultantName, date (in date format), hours (a number with a minimum of 1), hourlyRate (also a number with a minimum of 1), totalAmount (a number with a minimum of 1), and status (restricted to "draft", "sent", "paid", or "overdue"). All properties listed are required, and no additional properties are allowed outside those defined.

An example of a ZIP Code Object Type which could be used to store a record of every ZIP Code in the United States, and associated geo-location information.

Object Type Definition
Value

ID

zipcode

Display Name

ZIP Code

Display Name (Plural)

ZIP Codes

Description

ZIP Codes throughout the United States.

Category

Setting

AI Assistant prompts you might consider to modify this schema:

  • "Add arrays for the cities, states, and counties associated with each ZIP code"

  • "Add a description to each property"

This schema defines an object that primarily uses zipCode as its unique identifier. The zipCode is a required property, characterized by the type "string" and must follow a specific pattern. The acceptable format for the zipCode is either a five-digit number or a five-digit number followed by a dash or space and then four additional digits (e.g., 12345 or 12345-6789). The schema restricts any properties other than those explicitly defined (additionalProperties is set to false), emphasizing that the only data this schema will accept pertains to the zipCode.

An example of a Freeform Object Type which simply creates a unique ID and records any valid JSON properties and values that are provided.

Object Type Definition
Value

ID

freeform

Display Name

Freeform

Display Name (Plural)

Freeform

Description

Uniquely identified records of various schema shapes.

Category

Data

This schema defines a simple object where the primary key is id. The id is a string that is automatically generated as a UUID version 4. The schema specifies only this one property, focusing solely on the identifier for the object. Notably, the schema does not restrict additional properties, meaning it will allow any data posted to be processed alongside the id.

Last updated

Was this helpful?