Create Fields

Field Type Rules

Supported type and format combinations

  • text fields may use format.text values email, phone, uuid, url, or regex.
  • When format.text is regex, provide format.pattern with the validation pattern.
  • date and datetime fields may use format.iso_format to define the accepted incoming date format.
  • integer and boolean fields typically omit format.
  • Field names must be unique within the workspace and may not use reserved names.
POST
/v1/workspaces/:workspace/fields

Create one or more custom fields

Path parameters

workspacestring Required

ID of your workspace

Request body

fieldsarray Required

Array of field definitions to create

Create Fields
curl -X POST https://api.leadpush.io/v1/workspaces/:workspace/fields \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {token}" \
-d '{
  "fields": [
    {
      "name": "company_name",
      "type": "text",
      "format": {
        "text": "url"
      }
    }
  ]
}'
Response Example
{
"data": [
  {
    "uuid": "<field_uuid>",
    "name": "company_name",
    "type": "text",
    "format": {
      "text": "url",
      "pattern": null,
      "iso_format": null
    },
    "created_at": "2021-01-01T00:00:00.000Z"
  }
]
}