chatformdocs
Blocks

Date

A date, or a date and time they choose: an arrival time, a preferred day. This is the right type when YOU are asking them when; `scheduling` is for booking against a calendar you own.

Numberdate

A date, or a date and time they choose: an arrival time, a preferred day. This is the right type when YOU are asking them when; scheduling is for booking against a calendar you own.

How it gets answered — extracted from free text by the agent, then re-validated.

Configuration

Fields specific to date. The fields every block has — id, ref, title, required, visibility, media, agentHints, prefillParam, identityField — are documented once.

date configuration
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "buttonLabel": {
      "type": "string",
      "maxLength": 60
    },
    "type": {
      "type": "string",
      "const": "date"
    },
    "min": {
      "type": "string"
    },
    "max": {
      "type": "string"
    },
    "disablePast": {
      "default": false,
      "type": "boolean"
    },
    "dateFormat": {
      "default": "YYYY-MM-DD",
      "type": "string",
      "enum": [
        "YYYY-MM-DD",
        "DD/MM/YYYY",
        "MM/DD/YYYY"
      ]
    },
    "includeTime": {
      "default": false,
      "type": "boolean"
    },
    "timeStepMinutes": {
      "default": 30,
      "type": "integer",
      "minimum": 5,
      "maximum": 120
    },
    "timeMin": {
      "default": "09:00",
      "type": "string",
      "pattern": "^\\d{2}:\\d{2}$"
    },
    "timeMax": {
      "default": "18:00",
      "type": "string",
      "pattern": "^\\d{2}:\\d{2}$"
    },
    "timeZone": {
      "type": "string",
      "maxLength": 64
    }
  },
  "required": [
    "id",
    "ref",
    "title",
    "type"
  ],
  "$defs": {
    "__schema0": {
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "and",
            "or"
          ]
        },
        "conditions": {
          "default": [],
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "left": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "ref"
                      },
                      "ref": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{1,40}$"
                      }
                    },
                    "required": [
                      "kind",
                      "ref"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "variable"
                      },
                      "name": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,40}$"
                      }
                    },
                    "required": [
                      "kind",
                      "name"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "hidden"
                      },
                      "name": {
                        "type": "string",
                        "pattern": "^[a-zA-Z_][a-zA-Z0-9_.-]{0,60}$"
                      }
                    },
                    "required": [
                      "kind",
                      "name"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "literal"
                      }
                    },
                    "required": [
                      "kind"
                    ]
                  }
                ]
              },
              "op": {
                "type": "string",
                "enum": [
                  "eq",
                  "neq",
                  "gt",
                  "gte",
                  "lt",
                  "lte",
                  "contains",
                  "not_contains",
                  "starts_with",
                  "ends_with",
                  "matches_regex",
                  "is_empty",
                  "is_not_empty",
                  "is_checked",
                  "is_not_checked",
                  "includes",
                  "not_includes",
                  "ranked_above",
                  "ranked_below"
                ]
              },
              "value": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              }
            },
            "required": [
              "left",
              "op"
            ]
          }
        },
        "groups": {
          "default": [],
          "type": "array",
          "items": {
            "$ref": "#/$defs/__schema0"
          }
        }
      },
      "required": [
        "op"
      ]
    }
  }
}

In a generated draft these arrive as config pairs: disablePast=true to refuse dates already gone.

What you receive

GET /v1/forms/{id} and every "next question" projects blocks through toPublicBlock. For the example above:

PublicBlock
{
  "id": "blk_date0001",
  "ref": "q_start",
  "type": "date",
  "title": "Start date?",
  "required": true,
  "imageKey": null,
  "media": null,
  "minDate": "2026-01-01",
  "maxDate": "2026-12-31",
  "disablePast": false,
  "dateFormat": "YYYY-MM-DD",
  "includeTime": false,
  "timeStepMinutes": 30,
  "timeMin": "09:00",
  "timeMax": "18:00"
}

What you send

A date as YYYY-MM-DD. When the block includes a time, one moment in UTC, YYYY-MM-DDTHH:mm:ss.sssZ; send it with a Z or an offset (2026-06-01T17:00+05:30), since a bare YYYY-MM-DDTHH:mm is read as UTC.

type Answer = string;
curl -X POST https://api.chatform.in/v1/responses/{RESPONSE_ID}/answers \
  -H "x-api-key: $CHATFORM_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"ref": "q_start", "value": "2026-06-01"}'

What gets stored

The value is normalised before it is saved, so what you read back is not always what you sent.

You sendStored
"2026-06-01""2026-06-01"

Errors

CodeWhenMessage
requiredan empty answer on a required blockThis question needs an answer.
type20260601Please provide a date.
invalid_date"01/06/2026" — always ISO on the wire, whatever the display formatPlease provide a date in YYYY-MM-DD format.
invalid_time—
time_out_of_range—
past_date—
too_early"2025-12-31"Date must be on or after 2026-01-01.
too_late"2027-01-01"Date must be on or before 2026-12-31.

On this page