Create field
Creates field_name on the customer with customer_id. Field names may only contain lowercase Latin letters, numbers, and _.
Path Parameters
- Type: integercustomer
_id requiredIdentifier of the customer.
- Type: stringfield
_name Pattern: ^[a-z0-9_]+$requiredName of the custom field. Only lowercase Latin letters, numbers, and
_are allowed.
Body·
required
application/json
- Type: string · enumtyperequired
dateis an ISO 8601 string.datetimeis a Unix timestamp.values- string
- integer
- float
- boolean
- date
- datetime
- valuerequired
Field value. Type must match
type.- Type: string
Field value. Type must match
type.
- Type: objectextra
Optional extra metadata. Pass
{}if not used.
Responses
- application/json
- application/json
- application/json
- application/json
Request Example for post/customers/{customer_id}/fields/{field_name}/
curl 'https://api.landbot.io/v1/customers/1/fields/{field_name}/' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Token YOUR_AGENT_TOKEN' \
--data '{
"type": "datetime",
"extra": {},
"value": 1536155712.1234
}'
{
"success": true,
"field": {
"name": "payment_date",
"type": "datetime",
"extra": {},
"value": 1536155712.1234
}
}