---
title: "Declare the per-row inputs a prompt needs"
method: POST
path: "/table-enrichments/saved-agents/inputs/generate/"
tags: ["table-enrichments"]
---

# Declare the per-row inputs a prompt needs

`POST /table-enrichments/saved-agents/inputs/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/saved-agents/inputs/generate/`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Read a prompt, work out which values have to change from row to row, declare them, and return the prompt with each literal mention replaced by a reference to what was declared. Inputs the agent already declares keep their ids and are never dropped. Nothing is stored. The caller drops the result into the editor and decides what to keep. Counts against the workspace's daily AI Assistant allowance; a refused call answers 429.

## Request body

- SavedAgentInputGenerateRequestSchema: A prompt to work out the per-row inputs of.
  - `inputs` AgentInputSchema[]
    - `id` string, uuid, required
    - `name` string, required
  - `prompt` AgentPromptTemplateInput, required: A saved agent's prompt: literal text with references between the runs. The same convention every other stored prompt in the product uses (``EnrichmentPromptTemplate`` for columns, template segments for sequences): identity-keyed segments, so renaming what a reference points at never rewrites the prompt. Structurally parallel to the enrichment template rather than importing it: an agent prompt references INPUTS, an enrichment prompt references COLUMNS, and the import hierarchy keeps the two domains apart.
    - `segments` union[]
      - union
        - AgentPromptTextSegment: A literal run of prompt text.
          - `text` string, required
          - `type` 'text'
        - AgentPromptInputRefSegment: A reference to one declared input, resolved per row at run time.
          - `input_id` string, uuid, required
          - `type` 'input_ref'
        - AgentPromptContextRefSegment: A reference to the org's business context, resolved per org.
          - `section` 'all' | 'company' | 'icp' | 'personas' | 'signals' | 'social_proof': One section of the org's AI business context a prompt can reference. ``ALL`` is the whole context document; the rest are its named sections.
          - `type` 'context_ref'

## Response `200`

Successful Response

- SavedAgentInputGenerateResponseSchema: The declared inputs, and the prompt rewritten to reference them.
  - `inputs` AgentInputSchema[], required: Every declared input after the pass: the ones already held, each keeping its id, plus any the prompt turned out to need.
    - `id` string, uuid, required
    - `name` string, required
  - `prompt` AgentPromptTemplateOutput, required: A saved agent's prompt: literal text with references between the runs. The same convention every other stored prompt in the product uses (``EnrichmentPromptTemplate`` for columns, template segments for sequences): identity-keyed segments, so renaming what a reference points at never rewrites the prompt. Structurally parallel to the enrichment template rather than importing it: an agent prompt references INPUTS, an enrichment prompt references COLUMNS, and the import hierarchy keeps the two domains apart.
    - `segments` union[]
      - union
        - AgentPromptTextSegment: A literal run of prompt text.
          - `text` string, required
          - `type` 'text'
        - AgentPromptInputRefSegment: A reference to one declared input, resolved per row at run time.
          - `input_id` string, uuid, required
          - `type` 'input_ref'
        - AgentPromptContextRefSegment: A reference to the org's business context, resolved per org.
          - `section` 'all' | 'company' | 'icp' | 'personas' | 'signals' | 'social_proof': One section of the org's AI business context a prompt can reference. ``ALL`` is the whole context document; the rest are its named sections.
          - `type` 'context_ref'
  - `summary` string, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `422`: Invalid request made to the API.
- `429`: The workspace's AI Assistant allowance is spent, or the AI Assistant is paused
- `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)
