chatformdocs

Templates

Start a form from one of the official templates.

The templates in the dashboard's gallery are available over the API too. Read one to see its questions, or turn it into a draft form of your own in one call.

Endpoints

EndpointScopeWhat it does
GET /v1/templatesform:readEvery template, most used first
GET /v1/templates/{slug}form:readOne template, with the doc it would create
POST /v1/templates/{slug}/useform:writeCreate a draft form from it
curl -X POST https://api.chatform.in/v1/templates/$TEMPLATE_SLUG/use \
  -H "x-api-key: $CHATFORM_SECRET_KEY" \
  -H "idempotency-key: $(uuidgen)"

The reply is the new form's summary, the same shape POST /v1/forms returns.

Good to know

  • It is a draft. Nothing is live until you call POST /v1/forms/{id}/publish.
  • It counts as a new form. A plan at its form limit gets a 402, exactly as POST /v1/forms would.
  • Want to change it first? Read the template's doc, edit it, and send it to POST /v1/forms as doc instead of using the template.
  • A template that no longer matches the current form schema answers 404 with invalid_template.
  • POST /v1/templates/{slug}/use takes an Idempotency-Key, so a retry after a timeout does not create a second form.
  • The list answers in the usual page shape, with has_more always false.

On this page