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

Form Templates

List Form Templates

get

List all form templates for a workspace.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
Query parameters
categorystring · enum · nullableOptionalPossible values:
patient_typestring · enum · nullableOptionalPossible values:
Responses
200

Successful Response

application/json

List of form templates for a workspace.

get/v1/{workspace_id}/settings/form-templates
GET /v1/{workspace_id}/settings/form-templates HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "templates": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "category": "custom",
      "patient_type": "any",
      "fields": [
        {
          "key": "text",
          "label": "text",
          "field_type": "text",
          "required": true,
          "options": [
            "text"
          ],
          "description": "text",
          "placeholder": "text",
          "validation": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "sensitive": false,
          "condition": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "consent_text": "text",
          "prefill_path": "text",
          "layout_group": "text"
        }
      ],
      "sections": [
        {
          "id": "text",
          "title": "text",
          "description": "text",
          "field_keys": [
            "text"
          ],
          "condition": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        }
      ],
      "branding": {
        "logo_url": "text",
        "primary_color": "text",
        "background_color": "text",
        "font_family": "text"
      },
      "completion_title": "text",
      "completion_message": "text",
      "completion_action_url": "text",
      "submit_button_text": "text",
      "active": true,
      "version": 1
    }
  ]
}

Update Form Templates

put

Replace all form templates for a workspace.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
Body

Replace all form templates.

Responses
200

Successful Response

application/json

List of form templates for a workspace.

put/v1/{workspace_id}/settings/form-templates
PUT /v1/{workspace_id}/settings/form-templates HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 838

{
  "templates": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "category": "custom",
      "patient_type": "any",
      "fields": [
        {
          "key": "text",
          "label": "text",
          "field_type": "text",
          "required": true,
          "options": [
            "text"
          ],
          "description": "text",
          "placeholder": "text",
          "validation": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "sensitive": false,
          "condition": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "consent_text": "text",
          "prefill_path": "text",
          "layout_group": "text"
        }
      ],
      "sections": [
        {
          "id": "text",
          "title": "text",
          "description": "text",
          "field_keys": [
            "text"
          ],
          "condition": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        }
      ],
      "branding": {
        "logo_url": "text",
        "primary_color": "text",
        "background_color": "text",
        "font_family": "text"
      },
      "completion_title": "text",
      "completion_message": "text",
      "completion_action_url": "text",
      "submit_button_text": "text",
      "active": true,
      "version": 1
    }
  ]
}
{
  "templates": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "text",
      "description": "text",
      "category": "custom",
      "patient_type": "any",
      "fields": [
        {
          "key": "text",
          "label": "text",
          "field_type": "text",
          "required": true,
          "options": [
            "text"
          ],
          "description": "text",
          "placeholder": "text",
          "validation": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "sensitive": false,
          "condition": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          },
          "consent_text": "text",
          "prefill_path": "text",
          "layout_group": "text"
        }
      ],
      "sections": [
        {
          "id": "text",
          "title": "text",
          "description": "text",
          "field_keys": [
            "text"
          ],
          "condition": {
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        }
      ],
      "branding": {
        "logo_url": "text",
        "primary_color": "text",
        "background_color": "text",
        "font_family": "text"
      },
      "completion_title": "text",
      "completion_message": "text",
      "completion_action_url": "text",
      "submit_button_text": "text",
      "active": true,
      "version": 1
    }
  ]
}

Get Form Template

get

Get a single form template by ID.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
template_idstring · uuidRequired
Responses
200

Successful Response

application/json

Reusable form template with sections, prefill, branding.

Extends DataTemplate concept. Up to 200 fields, organized in sections. Stored in workspace settings["form_templates"] JSONB.

Examples:

  • New patient intake (85 fields, 11 sections)
  • Returning patient update (27 fields, 5 sections)
  • Pre-surgery checklist (15 fields, 3 sections)
  • PHQ-9 screening (10 fields, 1 section)
idstring · uuidOptional
namestring · min: 1 · max: 256Required
descriptionstring · max: 2000 · nullableOptional
categorystring · enumOptionalDefault: customPossible values:
patient_typestring · enumOptionalDefault: anyPossible values:
completion_titlestring · max: 256 · nullableOptional
completion_messagestring · max: 2000 · nullableOptional
completion_action_urlstring · max: 2048 · nullableOptional
submit_button_textstring · max: 128 · nullableOptional
activebooleanOptionalDefault: true
versioninteger · min: 1OptionalDefault: 1
get/v1/{workspace_id}/settings/form-templates/{template_id}
GET /v1/{workspace_id}/settings/form-templates/{template_id} HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "text",
  "description": "text",
  "category": "custom",
  "patient_type": "any",
  "fields": [
    {
      "key": "text",
      "label": "text",
      "field_type": "text",
      "required": true,
      "options": [
        "text"
      ],
      "description": "text",
      "placeholder": "text",
      "validation": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "sensitive": false,
      "condition": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "consent_text": "text",
      "prefill_path": "text",
      "layout_group": "text"
    }
  ],
  "sections": [
    {
      "id": "text",
      "title": "text",
      "description": "text",
      "field_keys": [
        "text"
      ],
      "condition": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ],
  "branding": {
    "logo_url": "text",
    "primary_color": "text",
    "background_color": "text",
    "font_family": "text"
  },
  "completion_title": "text",
  "completion_message": "text",
  "completion_action_url": "text",
  "submit_button_text": "text",
  "active": true,
  "version": 1
}

Resolve Form Template

post

Resolve a form template with prefill values from entity state.

Returns a hydrated SurfaceSpec ready to be passed to create_surface. Fields with matching data in entity state get prefill_value set. For returning patient templates, completed optional fields are stripped.

Authorizations
AuthorizationstringRequired

API key issued via POST /v1/{workspace_id}/api-keys. Pass the returned api_key value as a Bearer token.

Path parameters
workspace_idstring · uuidRequired
template_idstring · uuidRequired
Body

Resolve a form template for a specific entity.

entity_idstring · uuidRequired
Responses
200

Successful Response

application/json

Resolved SurfaceSpec with prefill values.

prefilled_countintegerRequired
total_fieldsintegerRequired
post/v1/{workspace_id}/settings/form-templates/{template_id}/resolve
POST /v1/{workspace_id}/settings/form-templates/{template_id}/resolve HTTP/1.1
Host: api.platform.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 52

{
  "entity_id": "123e4567-e89b-12d3-a456-426614174000"
}
{
  "spec": {
    "entity_id": "123e4567-e89b-12d3-a456-426614174000",
    "title": "text",
    "description": "text",
    "fields": [
      {
        "key": "text",
        "label": "text",
        "field_type": "text",
        "required": true,
        "options": [
          "text"
        ],
        "description": "text",
        "placeholder": "text",
        "prefill_value": null,
        "validation": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "sensitive": false,
        "condition": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        },
        "consent_text": "text"
      }
    ],
    "channel": "web",
    "expires_in_hours": 168,
    "context": {
      "ANY_ADDITIONAL_PROPERTY": "anything"
    },
    "resource_type": "text",
    "branding": {
      "logo_url": "text",
      "primary_color": "text",
      "background_color": "text",
      "font_family": "text"
    },
    "sections": [
      {
        "title": "text",
        "description": "text",
        "field_keys": [
          "text"
        ],
        "condition": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      }
    ],
    "completion_title": "text",
    "completion_message": "text",
    "completion_action_url": "text",
    "submit_button_text": "text"
  },
  "prefilled_count": 1,
  "total_fields": 1
}

Last updated

Was this helpful?