Skip to main content
Documentation

API Reference

Create column

HTTP ReferenceCLI Available
POST/api/tables/{table_id}/columns

Required scope: columns:write

Create a new column definition (manual or enrichment), including optional auto-run behavior.

Updated September 3, 2026

This page documents the canonical HTTP contract. Switch to the CLI example when you want the operator workflow.

Path parameters

  • table_idRequired

    string

    Target table ID.

Body parameters

  • keyRequired

    string

    Stable machine key for the column.

  • labelRequired

    string

    Human-readable column label.

  • kindOptional

    string

    Column kind (manual, enrichment, etc).

  • dataTypeOptional

    string

    text, number, date, boolean, email, url, json.

  • positionOptional

    number

    Optional explicit float sort order. If provided, afterColumnId/beforeColumnId are ignored.

  • afterColumnIdOptional

    string

    Optional insertion anchor. Place the new column after this column when position is omitted.

  • beforeColumnIdOptional

    string

    Optional insertion anchor. Place the new column before this column when position is omitted.

  • isImportantOptional

    boolean

    Marks the column as a favorite/starred context field for draft and calling fallback.

  • configOptional

    object

    Kind-specific configuration payload.

  • config.providerOptional

    string

    Optional hint. Server policy decides final provider/model.

  • config.destinationTableIdOptional

    string

    For sync_to_table single-destination mode.

  • config.columnMappingsOptional

    array<object>

    For sync_to_table single-destination mappings (sourceKey/destKey) or route-level mappings.

  • config.routesOptional

    array<object>

    For sync_to_table router mode (evaluated top-to-bottom); each route can define condition, syncMode, syncBehavior, listSourceColumnId, listPath, and columnMappings.

  • config.syncModeOptional

    string

    For sync_to_table mode: row or list.

  • config.syncBehaviorOptional

    string

    For sync_to_table behavior: link or copy.

  • config.listSourceColumnIdOptional

    string

    For sync_to_table list mode: source JSON column ID whose canonical items[] payload should be expanded.

  • config.listPathOptional

    string

    For sync_to_table list mode: optional item array path (default items).

  • config.columnMappings[].sourceScopeOptional

    string

    For sync_to_table list mode: row or item.

  • config.columnMappings[].itemKeyOptional

    string

    For sync_to_table list mode when sourceScope=item: item field name to map.

  • config.columnMappings[].sourceKeyOptional

    string

    For sync_to_table when sourceScope=row: parent/source row column key to map.

  • config.columnMappings[].pathOptional

    string

    For sync_to_table when sourceScope=row: optional nested JSON path inside sourceKey.

  • config.fieldMappingsOptional

    object

    For add_to_crm / Add to Leads: field mapping contract from source columns into canonical lead fields.

  • config.fieldMappings.companyDomainOptional

    string

    For add_to_crm: source column key for the company domain. Required.

  • config.fieldMappings.linkedinUrlOptional

    string

    For add_to_crm: source column key for LinkedIn URL (optional but recommended).

  • config.fieldMappings.emailAddressesOptional

    array<object>

    For add_to_crm: email mappings. Each mapping can point to a primitive column or a structured source column plus explicit path.

  • config.fieldMappings.emailAddresses[].columnOptional

    string

    For add_to_crm email mappings: source column key.

  • config.fieldMappings.emailAddresses[].pathOptional

    string

    For add_to_crm email mappings: required when the source column stores JSON/object output (example: response).

  • config.fieldMappings.phoneNumbersOptional

    array<object>

    For add_to_crm: phone mappings. Each mapping can point to a primitive column or a structured source column plus explicit path.

  • config.fieldMappings.phoneNumbers[].columnOptional

    string

    For add_to_crm phone mappings: source column key.

  • config.fieldMappings.phoneNumbers[].pathOptional

    string

    For add_to_crm phone mappings: required when the source column stores JSON/object output (example: mobile_number).

  • config.fieldMappings.commonOptional

    object

    For Add to Leads multi-source mode: parent-row mappings applied to every lead source, usually companyDomain and companyName.

  • config.fieldMappings.leadSourcesOptional

    array<object>

    For Add to Leads multi-source mode: row and array lead sources to materialize from one table row.

  • config.fieldMappings.leadSources[].kindOptional

    string

    For Add to Leads multi-source mode: row or array.

  • config.fieldMappings.leadSources[].sourceColumnOptional

    string

    For Add to Leads array source: source JSON column key.

  • config.fieldMappings.leadSources[].sourceArrayPathOptional

    string

    For Add to Leads array source: array path inside sourceColumn, commonly items.

  • config.fieldMappings.leadSources[].templateOptional

    object

    For Add to Leads multi-source mode: canonical lead fields mapped from row columns or __array_item paths.

  • config.sourceColumnsOptional

    array<string>

    For add_to_crm: optional explicit dependency/source column list.

  • config.sequenceIdOptional

    string

    For add_to_sequence: target sequence id. The sequence must be ACTIVE and its sourceTableId must match the table this column belongs to.

  • config.sourceLeadColumnOptional

    string

    For add_to_sequence: the column key (not field name) of an add_to_crm or lead_finder column whose cell output contains lead IDs.

  • config.assignedToUserIdOptional

    string

    For add_to_sequence: assignee for generated sequence tasks. Easy path: set this and omit senderAccountIds/assignmentPlan.

  • config.skipActiveSequenceConflictsOptional

    boolean

    For add_to_sequence: skip people already active in another sequence. Recommended for automated/table-driven handoffs.

  • config.senderAccountIdsOptional

    object

    For add_to_sequence advanced routing: explicit sender account IDs keyed by email/linkedin.

  • config.assignmentPlanOptional

    array<object>

    For add_to_sequence advanced/team routing: routes with assigneeUserId, optional senderAccountIds, and optional weight.

  • config.routingModeOptional

    string

    For add_to_sequence advanced/team routing: single, round_robin, or weighted_round_robin.

  • config.urlOptional

    string

    For http_request: URL template. Use {{column_key}} for row values and {{secrets.name}} for workspace secrets.

  • config.methodOptional

    string

    For http_request: HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS).

  • config.headersOptional

    object

    For http_request: key-value header pairs. Values support {{secrets.name}} templates.

  • config.bodyOptional

    string | object

    For http_request: request body template. Can be null, a string template, or an object sent as JSON.

  • config.timeoutSecondsOptional

    number

    For http_request: request timeout in seconds (default 30).

  • autoRunOptional

    string

    never, onInsert, onSourceUpdate.

  • config.runConditionOptional

    RunCondition

    Optional recursive column-owned predicate. Applied to candidate rows for auto-run, /run, and /estimate; omit to consider all candidate rows.

Definitions

RunCondition

Canonical recursive predicate saved at config.runCondition to decide whether each candidate row is eligible for a column run. Omit it to consider every candidate row.

Fields

  • typeRequired

    string

    Node type: condition, all, any, or not.

  • childrenOptional

    array<RunCondition>

    Child predicates for all/any; not must contain exactly one child.

  • columnKey | columnIdOptional

    string

    Source column identity for a condition leaf. Use the key or id that identifies the table column.

  • jsonPathOptional

    string

    Optional path inside a JSON column value for a condition leaf.

  • operatorOptional

    string

    Condition operator, such as equals, isNotEmpty, contains, in, between, before, or dateBetween.

  • missingPolicyRequired

    string

    Behavior when a referenced value is missing: unknown, true, or false.

  • value | value2Optional

    string | number | boolean | array

    Comparison values for a condition leaf. between and dateBetween require both value and value2; valueless operators omit them.

RunCondition example

json
{
  "type": "all",
  "children": [
    {
      "type": "condition",
      "columnKey": "linkedin_url",
      "operator": "isNotEmpty",
      "missingPolicy": "unknown"
    },
    {
      "type": "condition",
      "columnKey": "country",
      "operator": "equals",
      "missingPolicy": "unknown",
      "value": "United States"
    }
  ]
}

Example

bash
curl -X POST "https://app.autotouch.ai/api/tables/67bd8c39c7d3e80f0a95b560/columns" \
    -H "Authorization: Bearer stk_your_key_id.your_secret" \
    -H "Content-Type: application/json" \
    -d '{
      "key":"company_summary",
      "label":"Company Summary",
      "kind":"enrichment",
      "dataType":"text",
      "afterColumnId":"67bd8cd8c7d3e80f0a95b58e",
      "autoRun":"onInsert",
      "config":{
        "provider":"llm",
        "mode":"basic",
        "instructions":"Summarize this company",
        "promptSource":"generated",
        "runCondition":{
          "type":"condition",
          "columnKey":"linkedin_url",
          "operator":"isNotEmpty",
          "missingPolicy":"unknown"
        }
      }
    }'

Request body

json
{
    "key": "company_summary",
    "label": "Company Summary",
    "kind": "enrichment",
    "dataType": "text",
    "afterColumnId": "67bd8cd8c7d3e80f0a95b58e",
    "autoRun": "onInsert",
    "config": {
      "provider": "llm",
      "mode": "basic",
      "instructions": "Write a concise one sentence summary of the company.",
      "promptSource": "generated",
      "temperature": 0.2,
      "runCondition": {
        "type": "condition",
        "columnKey": "linkedin_url",
        "operator": "isNotEmpty",
        "missingPolicy": "unknown"
      }
    }
  }

Response example

json
{
    "id": "67bd8cd8c7d3e80f0a95b58f",
    "key": "company_summary",
    "label": "Company Summary",
    "kind": "enrichment",
      "dataType": "text",
      "status": "idle",
      "autoRun": "onInsert",
      "config": {
        "provider": "llm",
        "mode": "basic",
        "promptSource": "generated",
        "advancedPrompt": "Write a concise one sentence summary of the company.",
        "runCondition": {
          "type": "condition",
          "columnKey": "linkedin_url",
          "operator": "isNotEmpty",
          "missingPolicy": "unknown"
        }
      }
  }

Errors

  • 401

    Invalid API key or missing auth.

  • 403

    Missing columns:write scope or table access denied.

  • 409

    Column key conflict for this table.

Docs