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

# Create Prompt

> Create a new prompt or a new version of an existing prompt

## Overview

Create a new prompt for use with your AI agents. If a prompt with the same name already exists, a new version is automatically created with an incremented version number.

Prompts support two types:

* **main** — Used as the agent's system prompt / instructions
* **analysis** — Used for post-conversation analysis

## Authentication

<ParamField header="X-API-Key" type="string" required>
  Your eigi.ai API key. Must be prefixed with `vk_`.
</ParamField>

## Request Body

<ParamField body="prompt_name" type="string" required>
  Unique prompt name (1-100 characters). If a prompt with this name exists, a new version is created.
</ParamField>

<ParamField body="prompt_content" type="string" required>
  The prompt text content — the instructions or system message for your agent.
</ParamField>

<ParamField body="prompt_metadata" type="object">
  Optional metadata for the prompt.

  <Expandable title="properties">
    <ParamField body="prompt_type" type="string" default="main">
      Type of prompt: `main` for agent prompts, `analysis` for conversation analysis prompts.
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="prompt_name" type="string">
  The unique prompt name.
</ResponseField>

<ResponseField name="prompt_version" type="integer">
  Version number (starts at 1, auto-increments for existing prompts).
</ResponseField>

<ResponseField name="prompt_content" type="string">
  The prompt text content.
</ResponseField>

<ResponseField name="prompt_metadata" type="object">
  Metadata including prompt\_type.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 creation timestamp.
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 last update timestamp.
</ResponseField>


## OpenAPI

````yaml POST /v1/public/prompts
openapi: 3.0.0
info:
  title: eigi.ai API
  description: REST API for managing AI voice agents and conversations
  version: 1.0.0
  contact:
    email: buddy@eigi.ai
    url: https://eigi.ai
servers:
  - url: https://api.eigi.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v1/public/prompts:
    post:
      tags:
        - Prompts
      summary: Create Prompt
      description: >-
        Create a new prompt or a new version of an existing prompt. If a prompt
        with the same name exists, a new version is auto-created with an
        incremented version number.
      operationId: createPrompt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromptCreate'
            examples:
              basic:
                summary: Create a simple prompt
                value:
                  prompt_name: customer_support_v1
                  prompt_content: >-
                    You are a helpful customer support agent. Be polite and
                    professional.
                  prompt_metadata:
                    prompt_type: main
      responses:
        '201':
          description: Prompt created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromptResponse'
        '400':
          description: Bad request - Missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PromptCreate:
      type: object
      required:
        - prompt_name
        - prompt_content
      properties:
        prompt_name:
          type: string
          minLength: 1
          maxLength: 100
          description: Unique prompt name (1-100 characters)
          example: customer_support_v1
        prompt_content:
          type: string
          minLength: 1
          description: The prompt text content
          example: >-
            You are a helpful customer support agent for TechCorp. Be polite,
            professional, and solve customer issues efficiently.
        prompt_metadata:
          type: object
          description: Metadata for the prompt
          properties:
            prompt_type:
              type: string
              enum:
                - main
                - analysis
              default: main
              description: >-
                Type of prompt: 'main' for agent prompts, 'analysis' for
                analysis prompts
          example:
            prompt_type: main
    PromptResponse:
      type: object
      properties:
        prompt_name:
          type: string
          description: Unique prompt name
        prompt_version:
          type: integer
          description: Version number of the prompt
        prompt_content:
          type: string
          description: The prompt text content
        prompt_metadata:
          type: object
          description: Additional metadata
        created_at:
          type: string
          format: date-time
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Error message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your API key from the eigi.ai Dashboard
        under Settings â†’ API Keys.

````