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

# Create Agent

> Creates a new AI agent with the specified configuration. The agent will be created with a single prompt-based flow.

Create a new assistant programmatically. This endpoint is best for productized setup flows where your application creates Ringg assistants from templates or customer-provided configuration.

## When to use

* Onboard customers into a pre-defined assistant template.
* Create one assistant per team, location, or campaign type.
* Provision assistants from your own admin backend.

## Integration notes

* For most teams, creating the assistant in the dashboard first is simpler.
* Store the returned `agent_id`; it is required for calls and campaigns.
* Keep prompts concise and make every variable explicit in `custom_args_values` or campaign CSV mappings.

## After creation

Use [get assistants](/api-reference/endpoint/assistant/get-assistants) to confirm the assistant is visible, then test with one [individual call](/api-reference/endpoint/calling/initiate-individual-call) before using campaigns.


## OpenAPI

````yaml post /public/agent
openapi: 3.0.0
info:
  title: Ringg AI API Documentation
  description: >-
    This is the documentation for the Ringg AI APIs. The Ringg AI API follows
    RESTful principles, making it intuitive and easy to integrate with your
    applications. All API requests should be made to the base URL. The API
    accepts and returns data in JSON format. Ensure your requests include the
    appropriate Content-Type header for POST and PATCH requests.
  version: 2.0.0
servers:
  - url: https://prod-api.ringg.ai/ca/api/v0
security: []
tags:
  - name: workspace
    description: Endpoints for managing your workspace.
  - name: agent
    description: Endpoints for managing assistants (agents).
  - name: calling
    description: Endpoints for making and managing calls.
  - name: campaign
    description: Endpoints for managing campaigns.
  - name: analytics
    description: Endpoints for accessing call analytics and performance metrics.
  - name: termination
    description: Endpoints for terminating active calls using different methods.
  - name: knowledgebase
    description: Endpoints for managing knowledge bases.
paths:
  /public/agent:
    post:
      tags:
        - agent
      summary: Create Agent
      description: >-
        Creates a new AI agent with the specified configuration. The agent will
        be created with a single prompt-based flow.
      operationId: createAgent
      parameters:
        - name: X-API-KEY
          in: header
          description: (Required) Your Ringg AI API key.
          required: true
          schema:
            type: string
            example: 7251cb4b-3373-43a4-844c-b27a1d45e0c9
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent_name
                - introduction_and_objective
                - response_guidelines
                - task
                - primary_language
                - voice_id
                - intro_message
              properties:
                agent_name:
                  type: string
                  maxLength: 100
                  description: (Required) Name of the agent
                  example: My Sales Agent
                introduction_and_objective:
                  type: string
                  maxLength: 2000
                  description: (Required) Introduction and objective of the agent
                  example: You are a customer support agent for Acme Corp.
                response_guidelines:
                  type: string
                  maxLength: 3000
                  description: (Required) Guidelines for how the agent should respond
                  example: >-
                    Be polite, helpful, and concise. Always confirm
                    understanding.
                task:
                  type: string
                  maxLength: 1500
                  description: (Required) The task the agent should perform
                  example: >-
                    Help customers with their orders and answer product
                    questions.
                faq:
                  type: string
                  maxLength: 5000
                  description: (Optional) FAQ content for the agent
                  example: 'Q: What are your hours? A: We are open 9am-6pm IST.'
                sample_conversations:
                  type: string
                  maxLength: 5000
                  description: >-
                    (Optional) Example conversations for the agent. Use \n for
                    newlines between turns.
                  example: |-
                    User: Hi
                    Agent: Hello! How can I help you today?
                primary_language:
                  type: string
                  enum:
                    - en-US
                    - en-IN
                    - hi-IN
                    - ta-IN
                    - te-IN
                    - bn-IN
                    - mr-IN
                    - kn-IN
                    - ka-IN
                  description: (Required) Primary language locale for the agent
                  example: en-IN
                secondary_language:
                  type: string
                  enum:
                    - en-US
                    - en-IN
                    - hi-IN
                    - ta-IN
                    - te-IN
                    - bn-IN
                    - mr-IN
                    - kn-IN
                    - ka-IN
                  description: (Optional) Secondary language locale for the agent
                  example: hi-IN
                voice_id:
                  type: string
                  format: uuid
                  description: >-
                    (Required) Internal AgentVoice ID (UUID). Get available
                    voices from the Get Assistant Voices endpoint.
                  example: 02ad256b-092b-4048-bea0-5af46a452b98
                intro_message:
                  type: string
                  maxLength: 500
                  description: >-
                    (Required) Introduction message the agent will speak when
                    the call starts
                  example: >-
                    Hello, this is Sarah from Acme Corp. How can I assist you
                    today?
                agent_type:
                  type: string
                  enum:
                    - inbound
                    - outbound
                    - outbound_inbound
                  default: outbound
                  description: (Required) Type of agent. Defaults to outbound.
                  example: outbound
                custom_variables:
                  type: array
                  items:
                    type: string
                  description: >-
                    (Optional) Custom variables for the agent. For outbound
                    agents, callee_name and mobile_number are always included
                    automatically.
                  example:
                    - callee_name
                    - mobile_number
                    - company
                    - lead_source
      responses:
        '200':
          description: Agent created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The unique ID of the created agent
                        example: edd618d3-f473-4ac1-b5fa-f1a3981666ff
                      version:
                        type: string
                        description: The version slug of the agent
                        example: v1
                      created_at:
                        type: string
                        format: date-time
                        example: '2024-12-16T13:03:29.947147+00:00'
                  message:
                    type: string
                    example: Agent created successfully
        '400':
          description: >-
            Bad Request - Invalid parameters or voice does not support the
            selected language.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        example: VOICE_LANGUAGE_MISMATCH
                      message:
                        type: string
                        example: Voice does not support language 'en-US'
        '401':
          description: Unauthorized - Invalid or missing API key.

````