Skip to main content

AITP-03: Data Request Schema Reference

  • Version: 1.0.0
  • Spec Status: Draft
Auto-generated Documentation

Parts of this documentation were auto-generated from the schema and example messages by an AI model.

Schema URL

https://aitp.dev/capabilities/aitp-03-data-request/v1.0.0/schema.json

Schema Overview

The AITP-03 Data Request capability defines a JSON schema that supports two main message types:

  1. Request Data - Asking the user or agent to fill out a form
  2. Data - Responding with the filled form data

Complete Schema Definition

The schema is structured as an "anyOf" with two possible object types.

Request Data Schema

{
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"request_data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"fillButtonLabel": {
"type": "string",
"default": "Fill out form"
},
"form": {
"type": "object",
"properties": {
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"default_value": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"text",
"number",
"email",
"textarea",
"select",
"combobox",
"tel"
],
"default": "text"
},
"options": {
"type": "array",
"items": {
"type": "string"
}
},
"required": {
"type": "boolean",
"default": false
},
"autocomplete": {
"type": "string"
}
},
"required": ["id"],
"additionalProperties": true
},
"minItems": 1
},
"json_url": {
"type": "string",
"format": "uri"
}
},
"additionalProperties": true
}
},
"required": ["id", "description", "form"],
"additionalProperties": true
}
},
"required": ["$schema", "request_data"],
"additionalProperties": true
}

Data Response Schema

{
"type": "object",
"properties": {
"$schema": {
"type": "string",
"format": "uri"
},
"data": {
"type": "object",
"properties": {
"request_data_id": {
"type": "string"
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["id"],
"additionalProperties": true
},
"minItems": 1
}
},
"required": ["fields"],
"additionalProperties": true
}
},
"required": ["$schema", "data"],
"additionalProperties": true
}

Field Descriptions

Request Data Fields

FieldTypeRequiredDescription
$schemastringYesURI reference to the schema: https://aitp.dev/capabilities/aitp-03-data-request/v1.0.0/schema.json
request_dataobjectYesContainer for the data request
request_data.idstringYesUnique identifier for this form request
request_data.titlestringNoTitle for the form UI
request_data.descriptionstringYesDetailed explanation of what information is being requested
request_data.fillButtonLabelstringNoCustom text for the submit button (defaults to "Fill out form")
request_data.formobjectYesContainer for form definition
request_data.form.fieldsarrayNo*Array of field definitions (required if json_url is not provided)
request_data.form.json_urlstringNo*URL to external form definition (required if fields is not provided)
request_data.form.fields[].idstringYesUnique identifier for this field
request_data.form.fields[].labelstringNoDisplay label for this field
request_data.form.fields[].descriptionstringNoDescriptive text or help text for this field
request_data.form.fields[].default_valuestringNoDefault value for this field
request_data.form.fields[].typestringNoField input type (defaults to "text")
request_data.form.fields[].optionsarrayNoArray of options for select/combobox fields
request_data.form.fields[].requiredbooleanNoWhether this field is required (defaults to false)
request_data.form.fields[].autocompletestringNoHTML autocomplete attribute value

Data Response Fields

FieldTypeRequiredDescription
$schemastringYesURI reference to the schema: https://aitp.dev/capabilities/aitp-03-data-request/v1.0.0/schema.json
dataobjectYesContainer for the response data
data.request_data_idstringNoReference to the ID of the request being responded to
data.fieldsarrayYesArray of field values
data.fields[].idstringYesID of the field (should match ID in the request)
data.fields[].labelstringNoLabel of the field (for human readability)
data.fields[].valuestringNoValue provided for this field

Field Types

The type property of a field can be one of the following values:

TypeDescriptionUI Representation
textSimple text inputSingle-line text field
numberNumeric inputNumber field with increment/decrement controls
emailEmail addressEmail field with format validation
textareaMulti-line textText area for longer content
selectSelection from optionsDropdown select menu
comboboxSelection from options with custom inputDropdown with text input
telTelephone numberPhone number input with format hints

Common Autocomplete Values

The autocomplete property can be set to the following values to help browsers auto-fill forms:

ValueDescription
nameFull name
given-nameFirst name
family-nameLast name
emailEmail address
telTelephone number
street-addressStreet address
address-line1Address line 1
address-line2Address line 2
address-level1State or province
address-level2City
postal-codePostal or ZIP code
countryCountry
cc-nameName on credit card
cc-numberCredit card number
cc-expCredit card expiration date
cc-exp-monthCredit card expiration month
cc-exp-yearCredit card expiration year
cc-cscCredit card security code
offDisable autocomplete

Validation Rules

Form fields should be validated according to these rules:

  1. Fields marked as required: true must have a non-empty value
  2. Fields with type email must contain a valid email format
  3. Fields with type number should contain numeric values
  4. Fields with type tel should contain a valid phone number format
  5. Fields with type select should have a value from the provided options

Schema Versioning

The schema URL includes a version number that follows semver:

https://aitp.dev/capabilities/aitp-03-data-request/v1.0.0/schema.json

Future versions will maintain backward compatibility within the same major version.