Consent
Agreeing to terms, a waiver, a code of conduct. Put the wording in `description`. By default the only answer is yes; add decline=true when a refusal has to be a real answer you can route on: an eligibility gate, a policy someone may decline.
legal_consentAgreeing to terms, a waiver, a code of conduct. Put the wording in description. By default the only answer is yes; add decline=true when a refusal has to be a real answer you can route on: an eligibility gate, a policy someone may decline.
How it gets answered — matched exactly — never sent to a model.
Configuration
Fields specific to legal_consent. The fields every block has — id, ref, title, required, visibility, media, agentHints, prefillParam, identityField — are documented once.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"buttonLabel": {
"type": "string",
"maxLength": 60
},
"type": {
"type": "string",
"const": "legal_consent"
},
"consentText": {
"type": "string",
"minLength": 1,
"maxLength": 10000
},
"allowDecline": {
"default": false,
"type": "boolean"
},
"agreeLabel": {
"default": "I agree",
"type": "string",
"maxLength": 60
},
"declineLabel": {
"default": "I do not agree",
"type": "string",
"maxLength": 60
}
},
"required": [
"id",
"ref",
"title",
"type",
"consentText"
],
"$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: decline=true to offer an explicit refusal; agree=<label>, declineLabel=<label> to relabel the two buttons.
What you receive
GET /v1/forms/{id} and every "next question" projects blocks through toPublicBlock. For the example above:
{
"id": "blk_legal001",
"ref": "q_consent",
"type": "legal_consent",
"title": "One last thing",
"required": true,
"imageKey": null,
"media": null,
"consentText": "I agree to receive product updates.",
"allowDecline": false,
"agreeLabel": "I agree",
"declineLabel": "I do not agree"
}What you send
true. The stored answer records what was agreed to, and when. A block with allowDecline also accepts false — a recorded refusal, which a branch can route on; without it false is rejected.
type Answer = boolean;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_consent", "value": true}'Errors
| Code | When | Message |
|---|---|---|
required | an empty answer on a required block | This question needs an answer. |
consent_required | false — this block does not offer a refusal; one with allowDecline stores it as accepted: false | Please accept to continue. |
Field group
A small form asked once per person or item, repeated as many times as needed: two to five team members each with a name and an email, guests on a booking, line items on an order. Use this whenever the request describes the SAME set of details collected several times over; never a numbered run of separate questions ("Member 1 name", "Member 2 name"), which cannot stretch to a team of six or shrink to a team of two.
Verified payments
Take payment on your own Razorpay, Cashfree or Stripe account, and move on only once the gateway confirms it.