> ## Documentation Index
> Fetch the complete documentation index at: https://developer.instantly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create AI enrichment

> Create an AI enrichment for a resource (list or campaign)


Requires one of the following scopes: `supersearch_enrichments:create`, `supersearch_enrichments:all`, `all:create`, `all:all`



## OpenAPI

````yaml https://api.instantly.ai/openapi/api_v2.json post /api/v2/supersearch-enrichment/ai
openapi: 3.1.0
info:
  title: API Explorer
  description: >-
    The entire API V2 documentation is interactive and can be tested here. To
    the right side of every endpoint you will see a box with an example request.
    You can click on the "Try it" button to send a request to the server right
    from the docs. You will need to provide an API key by clicking the
    `ApiKeyAuth_token` blue text.
  version: 2.0.0
servers:
  - url: https://api.instantly.ai
    description: Instantly API Server
security:
  - ApiKeyAuth: []
tags:
  - name: Analytics
    description: Endpoints related to analytics
    x-displayName: Analytics
  - name: OAuth
    description: >-
      OAuth authentication endpoints for connecting Google and Microsoft email
      accounts
    x-displayName: OAuth
  - name: Account
    description: An email account that can be used to send campaigns
    x-displayName: Account
  - name: Campaign
    description: A campaign that can be sent to a list of recipients
    x-displayName: Campaign
  - name: Email
    description: >-
      A campaign email, a reply, a manually sent email, or any other email
      that's visible in the Unibox
    x-displayName: Email
  - name: EmailVerification
    description: A single email verification
    x-displayName: Email Verification
  - name: LeadList
    description: A list used to store leads
    x-displayName: Lead List
  - name: InboxPlacementTest
    description: An inbox placement test
    x-displayName: Inbox Placement Test
  - name: InboxPlacementAnalytics
    description: Analytics data for individual emails in inbox placement tests
    x-displayName: Inbox Placement Analytics
  - name: InboxPlacementBlacklist&SpamAssassinReport
    description: Report data for an inbox placement test
    x-displayName: Inbox Placement Blacklist & SpamAssassin Report
  - name: APIKey
    description: API Key
    x-displayName: API Key
  - name: AccountCampaignMapping
    description: Account Campaign Mapping
    x-displayName: Account Campaign Mapping
  - name: Lead
    description: A lead entity representing an individual lead
    x-displayName: Lead
  - name: BackgroundJob
    description: A background job that can be used to perform long-running tasks
    x-displayName: Background Job
  - name: CustomTag
    description: >-
      A custom tag for organizing and categorizing accounts and campaigns. You
      can use them as filters in apis that list accounts and campaigns.
    x-displayName: Custom Tag
  - name: CustomTagMapping
    description: >-
      This entity represents a tag being assigned to a specific campaign or
      email account. When an email account is assigned a tag, a new custom tag
      mapping entry is created, which connects the tag (`tag_id` field) with the
      email account (`resource_id` field). You can use it to see which tag si
      connected to which resource.
    x-displayName: Custom Tag Mapping
  - name: BlockListEntry
    description: A blocked email or domain
    x-displayName: Block List Entry
  - name: LeadLabel
    description: A custom label for categorizing and managing leads
    x-displayName: Lead Label
  - name: Workspace
    description: A workspace entity representing a workspace
    x-displayName: Workspace
  - name: SuperSearchEnrichment
    description: >-
      An enrichment can take different forms, such as email enrichment or
      LinkedIn enrichment. Leads may be imported from SuperSearch using the
      dedicated endpoint, or enriched directly within a list or campaign by
      attaching an enrichment to it.
    x-displayName: SuperSearch Enrichment
  - name: WorkspaceGroupMember
    description: >-
      A member of a workspace group. You can use the endpoints within this
      entity to manage the members of a workspace group.
    x-displayName: Workspace Group Member
  - name: WorkspaceMember
    description: A member of a workspace with associated user details
    x-displayName: Workspace Member
  - name: CampaignSubsequence
    description: A subsequence entity representing a follow-up sequence
    x-displayName: Campaign Subsequence
  - name: AuditLog
    description: Audit log records for tracking system activities
    x-displayName: Audit Log
  - name: Webhook
    description: A webhook subscription for receiving event notifications
    x-displayName: Webhook
  - name: WebhookEvent
    description: A webhook event that was sent or attempted to be sent
    x-displayName: Webhook Event
  - name: DFYEmailAccountOrder
    description: A Done-For-You email account order
    x-displayName: DFY Email Account Order
  - name: CustomPromptTemplate
    description: Custom prompt templates for creating custom prompts
    x-displayName: Custom Prompt Template
  - name: SalesFlow
    description: >-
      Manages how sales users view and interact with campaign and lead lists
      within the sales flow.
    x-displayName: Sales Flow
  - name: EmailTemplate
    description: A campaign email template
    x-displayName: Email Template
  - name: WorkspaceBilling
    description: Workspace Billing
    x-displayName: Workspace Billing
  - name: CRMActions
    description: CRM related actions
    x-displayName: CRM Actions
paths:
  /api/v2/supersearch-enrichment/ai:
    post:
      tags:
        - SuperSearchEnrichment
      summary: Create AI enrichment
      description: >-
        Create an AI enrichment for a resource (list or campaign)



        Requires one of the following scopes: `supersearch_enrichments:create`,
        `supersearch_enrichments:all`, `all:create`, `all:all`
      operationId: createAIEnrichment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - resource_id
                - output_column
                - resource_type
                - model_version
              properties:
                resource_id:
                  type: string
                  format: uuid
                  description: Id of the resource (list or campaign) to enrich
                  example: 01234567-89ab-cdef-0123-456789abcdef
                output_column:
                  type: string
                  description: >-
                    Name of the column where the AI enrichment results will be
                    stored
                  example: ai_generated_content
                resource_type:
                  type: number
                  enum:
                    - 1
                    - 2
                  x-enumDescriptions:
                    '1': Campaign
                    '2': List
                  description: Type of the entity to enrich
                  example: 2
                input_columns:
                  type: array
                  items:
                    type: string
                    example: first_name
                  description: >-
                    List of column names to use as input data for the AI
                    enrichment. These are the fields from your leads that will
                    be used to generate content.
                model_version:
                  type: string
                  enum:
                    - '3.5'
                    - '4.0'
                    - gpt-4o
                    - o3
                    - gpt-4.1
                    - gpt-4.1-mini
                    - gpt-5-mini
                    - gpt-5-nano
                    - gpt-5
                    - gpt-5.4
                    - claude-3.7-sonnet
                    - claude-3.5-sonnet
                    - claude-4.5-sonnet
                    - r1
                    - grok-4
                    - gemini-2.0-flash
                    - gemini-3.0-flash
                    - gemini-3.0-pro
                    - sonar
                    - sonar-pro
                    - instantly-ai-lightspeed-agent-for-web-research
                    - instantly-ai-lightspeed-agent-for-email-generation
                  x-enumDescriptions:
                    '3.5': >-
                      GPT-3.5 Turbo - OpenAI's standard model with good
                      performance and low cost
                    gpt-5: >-
                      GPT-5 is OpenAI’s most advanced model, offering major
                      improvements in reasoning, code quality, and user
                      experience.
                    gpt-5.4: >-
                      GPT-5.4 is the latest generation non-reasoning model,
                      optimized for fast, high-quality responses at low latency.
                    gpt-5-mini: >-
                      GPT-5 Mini is a compact version of GPT-5, designed to
                      handle lighter-weight reasoning tasks.
                    gpt-5-nano: >-
                      GPT-5-Nano is the smallest and fastest variant in the
                      GPT-5 system, optimized for developer tools, rapid
                      interactions, and ultra-low latency environments.
                    '4.0': GPT-4 - OpenAI's advanced model with improved reasoning
                    gpt-4o: >-
                      GPT-4o - OpenAI's optimized model with improved
                      performance
                    o3: >-
                      o3 is a well-rounded and powerful model across domains. It
                      sets a new standard for math, science, coding, and visual
                      reasoning tasks.
                    gpt-4.1: >-
                      GPT-4.1 is a flagship large language model optimized for
                      advanced instruction following, real-world software
                      engineering, and long-context reasoning.
                    gpt-4.1-mini: >-
                      GPT-4.1 Mini is a mid-sized model delivering performance
                      competitive with GPT-4o at substantially lower latency and
                      cost.
                    claude-3.7-sonnet: Claude 3.7 Sonnet - Anthropic's most capable model
                    claude-3.5-sonnet: Claude 3.5 Sonnet - Anthropic's balanced model
                    claude-4.5-sonnet: >-
                      Claude Sonnet 4.5 is Anthropic's most advanced Sonnet
                      model to date, optimized for real-world agents and coding
                      workflows.
                    r1: R1 - Deepseek's advanced chat model
                    grok-4: Grok 4 - X AI's latest reasoning model
                    gemini-2.0-flash: Gemini 2.0 Flash - Google's powerful and versatile model
                    gemini-3.0-flash: >-
                      Gemini 3.0 Flash - Is a high speed, high value thinking
                      model designed for agentic workflows, multi turn chat, and
                      coding assistance
                    gemini-3.0-pro: >-
                      Gemini 3.0 Pro - Google's latest model with improved
                      capabilities
                    sonar: >-
                      Sonar - Perplexity's lightweight, affordable, fast, and
                      simple to use model.
                    sonar-pro: Sonar Pro  - Perplexity's most advanced model.
                    instantly-ai-lightspeed-agent-for-web-research: Instantly AI - LightSpeed Agent for Web Research
                    instantly-ai-lightspeed-agent-for-email-generation: Instantly AI - LightSpeed Agent for Email Generation
                  description: >-
                    Version of the AI model to use for enrichment. Different
                    models have different capabilities, costs, and token limits.
                  example: gpt-4o
                use_instantly_account:
                  type: boolean
                  description: >-
                    When true, the enrichment will use Instantly's account for
                    API calls. When false, it will use your own API keys
                    configured in settings.
                  example: true
                overwrite:
                  type: boolean
                  description: >-
                    When true, will overwrite existing values in the output
                    column. When false, only empty fields will be enriched.
                  example: false
                auto_update:
                  type: boolean
                  description: >-
                    When true, new leads added to the campaign/list will be
                    automatically enriched using these same settings.
                  example: true
                skip_leads_without_email:
                  type: boolean
                  description: When true, leads without an email will be skipped.
                  example: false
                limit:
                  type: number
                  description: Maximum number of leads to enrich.
                  minimum: 1
                  maximum: 1000000
                  example: 100
                prompt:
                  type: string
                  description: >-
                    Custom prompt to guide the AI enrichment. Use {{variables}}
                    to reference input data. Only used when templateId is not
                    provided.
                  example: >-
                    Write a personalized email to {{first_name}} from
                    {{company_name}} about our new product
                template_id:
                  type: string
                  description: >-
                    ID of a predefined AI prompt template to use instead of a
                    custom prompt. Templates are reusable prompt configurations.
                  example: '123'
                status:
                  type: number
                  enum:
                    - 1
                    - 2
                    - 3
                    - 4
                  x-enumDescriptions:
                    '1': Job is pending processing
                    '2': Job is currently being processed
                    '3': Job has been completed successfully
                    '4': Job processing failed
                  description: Status of the job
                  example: 1
                filters:
                  type: array
                  items:
                    type: object
                    properties: {}
                    description: Filters to apply to the enrichment
                    example:
                      column_name: email
                      type: 1
                      value:
                        - test@test.com
        required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier for the enrichment
                    example: 01234567-89ab-cdef-0123-456789abcdef
                  resource_id:
                    type: string
                    format: uuid
                    description: ID of the resource being enriched
                    example: 01234567-89ab-cdef-0123-456789abcdef
                  resource_type:
                    type: number
                    description: Type of the resource (1 for Campaign, 2 for List)
                    enum:
                      - CAMPAIGN
                      - LIST
                      - 1
                      - 2
                    x-enumDescriptions:
                      '1': Campaign
                      '2': List
                    example: 1
                  output_column:
                    type: string
                    description: Name of the column where results will be stored
                    example: ai_generated_content
                  status:
                    type: number
                    description: Status of the enrichment job
                    example: 1
                  model_version:
                    type: string
                    description: AI model version used for enrichment
                    example: gpt-4o
                  input_columns:
                    type: array
                    items:
                      type: string
                      example: first_name
                    description: Input columns used for enrichment
                  overwrite:
                    type: boolean
                    description: Whether to overwrite existing data
                    example: false
                  auto_update:
                    type: boolean
                    description: Whether to auto-update new leads
                    example: true
                  limit:
                    type: number
                    description: Maximum number of leads to process
                    example: 100
                  template_id:
                    type:
                      - 'null'
                      - string
                    description: ID of the prompt template used
                    example: '15762598695796759'
                required:
                  - id
                  - resource_id
                  - resource_type
                  - output_column
                  - status
                  - model_version
                  - overwrite
                  - auto_update
                additionalProperties: false
        '401':
          description: >-
            This request is unauthorized (either the Authorization header is
            missing or invalid, or the API key has been revoked)
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 401
                    example: 401
                  error:
                    type: string
                    enum:
                      - Unauthorized
                    example: Unauthorized
                  message:
                    type: string
                    example: Missing Authorization header
                required:
                  - statusCode
                  - error
                  - message
        '402':
          description: >-
            This request cannot be fulfilled because the workspace does not have
            an active paid plan
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 402
                    example: 402
                  error:
                    type: string
                    enum:
                      - Payment Required
                    example: Payment Required
                  message:
                    type: string
                    example: Workspace does not have an active paid plan
                required:
                  - statusCode
                  - error
                  - message
        '404':
          description: The requested resource was not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 404
                    example: 404
                  error:
                    type: string
                    enum:
                      - Not Found
                    example: Not Found
                  message:
                    type: string
                    example: Resource not found
                required:
                  - statusCode
                  - error
                  - message
        '429':
          description: >-
            You have exceeded the rate limit. Please check the rate limit docs
            for more information.
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    enum:
                      - 429
                    example: 429
                  error:
                    type: string
                    enum:
                      - Too Many Requests
                    example: Too Many Requests
                  message:
                    type: string
                    example: Rate limit exceeded
                required:
                  - statusCode
                  - error
                  - message
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer

````