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

# Draft an Agent From a Description

> Write an agent from a plain description of what it should do: a name, an opening line, a prompt organized for phone calls, the language, and transfer routes when the description gives a number to transfer to. Nothing is saved: review and edit the draft, then create the agent with [Create Agent](/api-reference/agents/create).

The draft uses only facts from the description. Facts the agent will need but the description does not give (opening hours, prices, an address) are listed in `toFillIn` instead of being made up; until they are added to the prompt, the agent offers a callback for them. Details that differ for each call (the person's name, an appointment time) appear as `{{variables}}` and are listed in `variables`.

A draft takes about 10 seconds. Up to 30 drafts per hour per organization.



## OpenAPI

````yaml POST /agents/draft
openapi: 3.1.0
info:
  title: RevRing Voice AI API
  description: >-
    RevRing Voice AI platform API for managing AI voice agents, phone calls, SIP
    trunks, and analytics. Build intelligent voice applications that can handle
    inbound and outbound phone calls with AI-powered conversational agents.
  version: 1.0.0
  contact:
    name: RevRing Support
    url: https://revring.ai
servers:
  - url: https://api.revring.ai/v1
    description: Production API
security:
  - apiKeyAuth: []
tags:
  - name: Messaging Connections
    description: Connect messaging providers so agents can send text messages
  - name: Messages
    description: Send text messages and read your message log
  - name: Conversations
    description: List and clear managed conversation threads
  - name: SIP Trunks
    description: Manage SIP trunks for connecting agents to the phone network
  - name: Agents
    description: Manage AI voice agents and their configuration
  - name: Agent Folders
    description: Organize agents into folders for dashboard navigation
  - name: Calls
    description: Manage and query phone calls
  - name: Analytics
    description: Get analytics and metrics about your calls
  - name: Knowledge Bases
    description: >-
      Manage knowledge bases and sources for agent retrieval-augmented
      generation
  - name: Test Suites
    description: Manage test suites, test cases, and test runs for agent evaluation
  - name: Voices
    description: Browse the voices available to your organization for agent speech
  - name: Webhooks
    description: Webhook delivery settings for your organization
  - name: Alerts
    description: Alert rules on call metrics, delivered to a webhook or Slack
  - name: Contacts
    description: What your agents remember about people
  - name: Integrations
    description: Calendars your agents book on
paths:
  /agents/draft:
    post:
      tags:
        - Agents
      summary: Draft an Agent From a Description
      description: >-
        Write an agent from a plain description of what it should do: a name, an
        opening line, a prompt organized for phone calls, the language, and
        transfer routes when the description gives a number to transfer to.
        Nothing is saved: review and edit the draft, then create the agent with
        [Create Agent](/api-reference/agents/create).


        The draft uses only facts from the description. Facts the agent will
        need but the description does not give (opening hours, prices, an
        address) are listed in `toFillIn` instead of being made up; until they
        are added to the prompt, the agent offers a callback for them. Details
        that differ for each call (the person's name, an appointment time)
        appear as `{{variables}}` and are listed in `variables`.


        A draft takes about 10 seconds. Up to 30 drafts per hour per
        organization.
      operationId: draftAgent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - description
              properties:
                description:
                  type: string
                  minLength: 20
                  maxLength: 4000
                  description: >-
                    What the agent should do, in your own words: who calls or
                    who it calls, what it should get done, what it must not do,
                    and where to send callers it cannot help
                companyName:
                  type: string
                  maxLength: 100
                  description: >-
                    The business the agent works for. Used in the prompt and the
                    opening line
            example:
              companyName: Bright Smile Dental
              description: >-
                Answer calls for our dental office. Book cleanings and checkups,
                answer basic questions, and send billing questions to our office
                manager at 415-555-0142.
      responses:
        '200':
          description: The draft
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      name:
                        type: string
                        description: A short name for the agent
                      direction:
                        type: string
                        enum:
                          - inbound
                          - outbound
                          - either
                        description: Whether the agent answers calls, places them, or both
                      language:
                        type: string
                        description: >-
                          The language code the agent speaks, or `multi`. Pass
                          it as `language` when you create the agent
                      firstMessage:
                        type: string
                        description: The opening line
                      promptTemplate:
                        type: string
                        description: The prompt
                      variables:
                        type: array
                        items:
                          type: string
                        description: >-
                          Variables the prompt and opening line use, to send
                          with each call
                      endCallEnabled:
                        type: boolean
                        description: Whether the agent should end calls itself
                      transferRoutes:
                        type: array
                        items:
                          type: object
                          properties:
                            to_number:
                              type: string
                              description: E.164 number
                            condition:
                              type: string
                        description: >-
                          Transfer routes, only when the description gave a
                          number. Pass them as `transferRoutes` with
                          `transferEnabled: true`
                      toFillIn:
                        type: array
                        items:
                          type: string
                        description: >-
                          Up to five facts to add to the prompt, most important
                          first
              example:
                data:
                  name: Dental front desk
                  direction: inbound
                  language: en
                  firstMessage: >-
                    Thank you for calling Bright Smile Dental. How can I help
                    you today?
                  promptTemplate: >-
                    Role:

                    You are Maya, the front desk agent for Bright Smile
                    Dental...
                  variables: []
                  endCallEnabled: true
                  transferRoutes:
                    - to_number: '+14155550142'
                      condition: Billing questions about charges or payments
                  toFillIn:
                    - Weekday opening hours
                    - Office address
        '400':
          description: The description is missing, too short or too long
        '429':
          description: Too many drafts this hour
        '502':
          description: The draft could not be written; try again
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key for authentication. Generate API keys from the RevRing
        dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.