Create field

Creates field_name on the customer with customer_id. Field names may only contain lowercase Latin letters, numbers, and _.

Path Parameters
  • customer_id
    Type: integer
    required

    Identifier of the customer.

  • field_name
    Type: string Pattern: ^[a-z0-9_]+$
    required

    Name of the custom field. Only lowercase Latin letters, numbers, and _ are allowed.

Body·
required
application/json
  • type
    Type: string · enum
    required

    date is an ISO 8601 string. datetime is a Unix timestamp.

    values
    • string
    • integer
    • float
    • boolean
    • date
    • datetime
  • value
    required

    Field value. Type must match type.

    • Type: string

      Field value. Type must match type.

  • extra
    Type: object

    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
  }
}