---
title: "Generate an enrichment column draft"
method: POST
path: "/table-enrichments/generate/"
tags: ["table-enrichments"]
---

# Generate an enrichment column draft

`POST /table-enrichments/generate/`

## Request

- Base URL: `https://api.getoneprofile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.getoneprofile.ai/table-enrichments/generate/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Turn one plain-language sentence into a draft AI-column configuration: display name, prompt with column references, output fields and a model suggestion. The draft seeds the editor and is not saved.

## Request body

- GenerateEnrichmentColumnRequestSchema: One sentence to turn into a draft AI-column configuration.
  - `instruction` string, required: A plain-language description of the column to build.
  - `table_id` string, uuid, required: The table whose columns the prompt may reference.

## Response `200`

Successful Response

- EnrichmentColumnDraftSchema: A generated draft configuration that seeds the column editor.
  - `action_key` string, required
  - `display_name` string, required
  - `model_key` string, nullable, required: The suggested model; null keeps the catalog default.
  - `output` union, required
    - EnrichmentOutputFieldsOutput: The fields-mode output shape: repeatable named typed fields. The default is Clay's: one text field named ``response``.
      - `fields` EnrichmentOutputField[]
        - `choices` string[], nullable: The fixed option list for a select field; None elsewhere.
        - `description` string, nullable: Shown to the model: what this field should contain.
        - `field_type` 'text' | 'paragraph' | 'url' | 'email' | 'image_url' | 'person' | 'select' | 'number' | 'decimal' | 'currency' | 'checkbox' | 'date' | 'multi_select' | 'list' | 'object': The type a user picks for a table column. Ordered as the picker shows them, which is also the order the groups below run in: text-ish, then numeric, then choice, then structured.
        - `name` string, required
      - `mode` 'fields'
    - EnrichmentOutputRawSchema: The advanced output shape: a raw strict-mode JSON schema, verbatim. Held to every strict-mode constraint at SAVE time by the service layer. The shape is stored exactly as authored, and validation failures name the exact violated rule rather than surfacing at run time.
      - `json_schema` object, required: A strict-mode JSON schema with an object root.
      - `mode` 'json_schema'
  - `prompt` EnrichmentPromptTemplate, required: The persisted prompt: an ordered mix of text and column references. Resolution to a per-row string happens at run time; the segment list is the single source of truth the editor renders pills from and the executor substitutes values into.
    - `format` 'plain' | 'markdown': How the editor reads text segments: 'markdown' renders them as markdown source, 'plain' verbatim. Templates saved before the field existed carry no value and default to 'plain', the safe reading. Purely editor metadata: run-time resolution concatenates text segments identically either way.
    - `segments` union[]
      - union
        - EnrichmentPromptTextSegment: A literal run of prompt text.
          - `text` string, required
          - `type` 'text'
        - EnrichmentPromptColumnRefSegment: An inline reference to another column's per-row value. Stored by column IDENTITY, never by display name, so renaming a column can never change what a prompt means, and a deleted column is detectable rather than silently resolving to nothing.
          - `column_id` string, uuid, required
          - `path` string, nullable: Dot-separated address of a sub-value inside a structured cell: output field names and zero-based list indices, e.g. 'competitors.0'. None references the whole cell. Emptiness for the required rule is judged on the addressed sub-value.
          - `required` boolean: Whether a row whose value for this column is empty is skipped entirely instead of run with a blank substituted.
          - `type` 'column_ref'
  - `web_research` boolean, required: Whether the drafted task needs live web research. Always false for actions other than Use AI, which is the only one with a web-research switch to prefill.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Table not found
- `422`: Invalid request made to the API.
- `500`: Internal server error.
- `502`: Bad gateway error.
- `503`: Service unavailable.

---

[API](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile.md) · [All operations](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/llms.txt) · [OpenAPI document](https://skmtc.dev/getoneprofile/apis/api-reference-oneprofile/revisions/4a6bd71e3f02?raw)
