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

# Агент үүсгэх

> Шинэ агент, DRAFT төлөвтэй. Заавар, мэндчилгээг аюулгүй эсэхийг шалгаж хадгална.

Шаардлагатай эрх: `agents:write`



## OpenAPI

````yaml /api-reference/openapi.json post /v1/agents
openapi: 3.1.0
info:
  title: Raptora API
  version: 1.0.0
  description: >-
    Агент, утасны дугаар, дуудлага, чат, үнэлгээгээ өөрийн системээс унших,
    агент болон үнэлгээний шалгуураа удирдах API.
servers:
  - url: https://api.raptora.io
security:
  - apiKey: []
tags:
  - name: Утасны дугаар
  - name: Агент
  - name: Дуудлага
  - name: Чат
  - name: Үнэлгээ
  - name: Үнэлгээний шалгуур
  - name: Төсөл
paths:
  /v1/agents:
    post:
      tags:
        - Агент
      summary: Агент үүсгэх
      description: >-
        Шинэ агент, DRAFT төлөвтэй. Заавар, мэндчилгээг аюулгүй эсэхийг шалгаж
        хадгална.


        Шаардлагатай эрх: `agents:write`
      operationId: agents.create
      parameters:
        - $ref: '#/components/parameters/RaptoraProject'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentDetail'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '402':
          $ref: '#/components/responses/Error402'
        '403':
          $ref: '#/components/responses/Error403'
        '409':
          $ref: '#/components/responses/Error409'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '503':
          $ref: '#/components/responses/Error503'
components:
  parameters:
    RaptoraProject:
      name: Raptora-Project
      in: header
      required: false
      description: >-
        Байгууллагын API key аль төсөл дээр ажиллахыг заана. Өгөхгүй бол үндсэн
        төсөл. Төслийн API key зөвхөн өөрийн төслийг заана.
      schema:
        type: string
        format: uuid
  schemas:
    CreateAgentBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
        channels:
          description: Өгөхгүй бол CHAT.
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/AgentChannel'
        voice:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          description: Дуут агентын хоолой. Чат агентад null.
        languages:
          minItems: 1
          type: array
          items:
            type: string
            minLength: 2
            maxLength: 10
        instructions:
          type: string
          description: Агентын заавар.
        greeting:
          type: string
          description: Яриаг эхлүүлэх үг.
        toolIds:
          type: array
          items:
            type: string
            format: uuid
          description: Холбох хэрэгслүүд. Өгвөл одоогийнхыг бүхэлд нь солино.
        knowledgeBaseIds:
          type: array
          items:
            type: string
            format: uuid
          description: Холбох мэдлэгийн сангууд. Өгвөл одоогийнхыг бүхэлд нь солино.
      required:
        - name
    AgentDetail:
      type: object
      properties:
        object:
          type: string
          const: agent
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/AgentStatus'
        channels:
          type: array
          items:
            $ref: '#/components/schemas/AgentChannel'
        languages:
          type: array
          items:
            type: string
        voice:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        instructions:
          type: string
          description: Агентын заавар.
        greeting:
          type: string
          description: Яриаг эхлүүлэх үг.
        promptVersion:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Заавар, мэндчилгээ өөрчлөгдөх бүрт нэмэгдэнэ.
        toolIds:
          type: array
          items:
            type: string
            format: uuid
        knowledgeBaseIds:
          type: array
          items:
            type: string
            format: uuid
      required:
        - object
        - id
        - name
        - description
        - status
        - channels
        - languages
        - voice
        - createdAt
        - updatedAt
        - instructions
        - greeting
        - promptVersion
        - toolIds
        - knowledgeBaseIds
    AgentChannel:
      type: string
      enum:
        - VOICE
        - CHAT
        - SOCIAL
    AgentStatus:
      type: string
      enum:
        - LIVE
        - PAUSED
        - DRAFT
    Problem:
      type: object
      properties:
        type:
          type: string
          description: Алдааны төрлийг тодорхойлох URL.
        title:
          type: string
        status:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        detail:
          type: string
        requestId:
          type: string
          description: Тусламж хүсэхдээ энэ дугаарыг хэлнэ.
        errors:
          description: Буруу утгатай талбарууд.
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              message:
                type: string
            required:
              - path
              - message
        requiredScope:
          type: string
        retryAfter:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - type
        - title
        - status
        - detail
        - requestId
      description: RFC 9457 алдааны хариу.
  responses:
    Error400:
      description: Параметр буруу.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error401:
      description: API key байхгүй эсвэл хүчингүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error402:
      description: Багц шаардлагатай.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error403:
      description: API key-д энэ эрх байхгүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error409:
      description: Ижил нэртэй зүйл байна.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error429:
      description: >-
        Хэт олон хүсэлт. `Retry-After` header-т заасан секундын дараа дахин
        оролдоно.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error500:
      description: Серверийн алдаа.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error503:
      description: >-
        Түр ажиллахгүй байна. `Retry-After` header-т заасан секундын дараа дахин
        оролдоно.
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: '`rpt_live_` эсвэл `rpt_test_`-ээр эхэлсэн нууц API key.'

````

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