> ## 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.

# Салбар нэмэх

> Байршлыг өргөрөг, уртрагаар нь өгнө.

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



## OpenAPI

````yaml /api-reference/openapi.json post /v1/tools/{toolId}/branches
openapi: 3.1.0
info:
  title: Raptora API
  version: 1.0.0
  description: >-
    Агент, хэрэгсэл, мэдлэгийн сан, виджет, webhook үүсгэж, агентаа нийтлэх,
    дуудлага, чат, үнэлгээгээ өөрийн системээс унших API.
servers:
  - url: https://api.raptora.io
security:
  - apiKey: []
tags:
  - name: Утасны дугаар
  - name: Агент
  - name: Дуудлага
  - name: Чат
  - name: Үнэлгээ
  - name: Үнэлгээний шалгуур
  - name: Төсөл
  - name: Хоолой
  - name: Хэрэгсэл
  - name: Мэдлэгийн сан
  - name: Виджет
  - name: Webhook
  - name: Хэрэглээ
paths:
  /v1/tools/{toolId}/branches:
    post:
      tags:
        - Хэрэгсэл
      summary: Салбар нэмэх
      description: |-
        Байршлыг өргөрөг, уртрагаар нь өгнө.

        Шаардлагатай эрх: `tools:write`
      operationId: branches.create
      parameters:
        - name: toolId
          in: path
          required: true
          description: '"Хаяг байршил" хэрэгслийн id.'
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/RaptoraProject'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBranchBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Branch'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
components:
  parameters:
    RaptoraProject:
      name: Raptora-Project
      in: header
      required: false
      description: >-
        Байгууллагын API key аль төсөл дээр ажиллахыг заана. Өгөхгүй бол үндсэн
        төсөл. Төслийн API key зөвхөн өөрийн төслийг заана.
      schema:
        type: string
        format: uuid
  schemas:
    CreateBranchBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        address:
          type: string
          minLength: 1
          maxLength: 300
        landmark:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
        phone:
          anyOf:
            - type: string
              maxLength: 60
            - type: 'null'
        hours:
          maxItems: 14
          type: array
          items:
            $ref: '#/components/schemas/BranchHours'
        note:
          anyOf:
            - type: string
              maxLength: 300
            - type: 'null'
        latitude:
          type: number
          minimum: -90
          maximum: 90
        longitude:
          type: number
          minimum: -180
          maximum: 180
        enabled:
          type: boolean
      required:
        - name
        - address
        - latitude
        - longitude
    Branch:
      type: object
      properties:
        object:
          type: string
          const: branch
        id:
          type: string
          format: uuid
        toolId:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
          maxLength: 120
        address:
          type: string
          minLength: 1
          maxLength: 300
        landmark:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
        phone:
          anyOf:
            - type: string
              maxLength: 60
            - type: 'null'
        hours:
          maxItems: 14
          type: array
          items:
            $ref: '#/components/schemas/BranchHours'
        note:
          anyOf:
            - type: string
              maxLength: 300
            - type: 'null'
        latitude:
          type: number
          minimum: -90
          maximum: 90
        longitude:
          type: number
          minimum: -180
          maximum: 180
        enabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - object
        - id
        - toolId
        - name
        - address
        - landmark
        - phone
        - hours
        - note
        - latitude
        - longitude
        - enabled
        - createdAt
        - updatedAt
    BranchHours:
      type: object
      properties:
        days:
          minItems: 1
          type: array
          items:
            type: integer
            minimum: 1
            maximum: 7
          description: 1 = Даваа ... 7 = Ням.
        start:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
        end:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
      required:
        - days
        - start
        - end
    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'
    Error403:
      description: API key-д энэ эрх байхгүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error404:
      description: Олдсонгүй.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Error409:
      description: >-
        Зөрчил: ижил нэртэй зүйл байна, эсвэл `Idempotency-Key` өөр хүсэлтэд
        ашиглагдсан.
      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'
  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.