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

# 진행 중 통화에 맥락 주입

> 진행 중인 통화에 텍스트 맥락을 넣습니다. 에이전트는 넣은 맥락을 이후 모든 턴에서 외부 데이터로 참고합니다. `response`가 `when_idle`이면 통화가 조용해질 때 에이전트가 한 번 먼저 말하고, `interrupt_agent`이면 에이전트가 말하는 중인 발화를 끊고 바로 응답합니다. 202 응답은 서버가 보낸 제어 패킷을 LiveKit 룸이 수락했다는 뜻일 뿐입니다. 에이전트가 맥락을 반영했는지, 실제로 말했는지는 이후 `call_context` 웹훅이 `control_id`로 짝을 맞춰 알립니다. 웹훅에는 맥락 텍스트가 담기지 않습니다. 요청 한도는 통화당 초당 2회, 분당 10회, 응답 대기 8건, 누적 텍스트 64 KiB이며, 넘으면 429 `CONTEXT_LIMIT_EXCEEDED`로 응답합니다.



## OpenAPI

````yaml /api-reference/v3/openapi.json post /calls/{call_id}/context
openapi: 3.1.0
info:
  title: vox.ai API
  description: >
    vox.ai API v3


    ### v3 공개 계약 규칙


    - 인증은 `Authorization: Bearer <token>` 헤더를 사용합니다. 워크스페이스 API 키를 Bearer 토큰으로
    전달합니다.

    - 요청과 응답 필드는 기본적으로 `snake_case`를 사용합니다.

    - `agent.data`는 에이전트 레지스트리와 호환되어야 하므로 `callSettings`, `toolIds`,
    `builtInTools`, `presetDynamicVariables` 같은 camelCase 필드를 유지합니다.

    - `_at`으로 끝나는 타임스탬프는 unix milliseconds입니다. 일부 입력값은 호환성을 위해 10~11자리 unix
    seconds도 허용하고 milliseconds로 정규화합니다.

    - 대량 발신 통화 가능 시간은 분 단위 정수(`start_min` / `end_min`)를 사용합니다. 알림 스케줄은 `HH:MM`
    문자열(`start_time` / `end_time`)을 사용합니다.

    - 응답 객체 자신의 식별자는 `id`입니다. 다른 리소스를 참조하는 필드와 path parameter는 `agent_id`,
    `call_id`, `telephone_line_id`처럼 명시적인 이름을 사용합니다.

    - 실패 응답은 `{ "error": { "code", "message", "details" } }` 형태입니다. 가능한 경우
    `details.field`, `details.reason`, `details.allowed_values`를 함께 제공합니다.
  version: 3.0.0
servers:
  - url: https://client-api.tryvox.co/v3
    description: 운영
security: []
paths:
  /calls/{call_id}/context:
    post:
      tags:
        - Calls
      summary: 진행 중 통화에 맥락 주입
      description: >-
        진행 중인 통화에 텍스트 맥락을 넣습니다. 에이전트는 넣은 맥락을 이후 모든 턴에서 외부 데이터로 참고합니다.
        `response`가 `when_idle`이면 통화가 조용해질 때 에이전트가 한 번 먼저 말하고,
        `interrupt_agent`이면 에이전트가 말하는 중인 발화를 끊고 바로 응답합니다. 202 응답은 서버가 보낸 제어 패킷을
        LiveKit 룸이 수락했다는 뜻일 뿐입니다. 에이전트가 맥락을 반영했는지, 실제로 말했는지는 이후 `call_context`
        웹훅이 `control_id`로 짝을 맞춰 알립니다. 웹훅에는 맥락 텍스트가 담기지 않습니다. 요청 한도는 통화당 초당 2회,
        분당 10회, 응답 대기 8건, 누적 텍스트 64 KiB이며, 넘으면 429 `CONTEXT_LIMIT_EXCEEDED`로
        응답합니다.
      operationId: injectCallContext
      parameters:
        - name: call_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Call Id
            description: 통화 ID입니다.
          description: 통화 ID입니다.
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            description: >-
              상태를 변경하는 POST 요청에 필요한 멱등성 키입니다. 24시간 동안 안전하게 재시도할 때 사용합니다. 값은 비어
              있으면 안 됩니다. 최대 255자까지 허용합니다.
            minLength: 1
            maxLength: 255
            title: Idempotency-Key
          description: >-
            상태를 변경하는 POST 요청에 필요한 멱등성 키입니다. 24시간 동안 안전하게 재시도할 때 사용합니다. 값은 비어 있으면
            안 됩니다. 최대 255자까지 허용합니다.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InjectCallContextRequest'
        description: >-
          진행 중인 통화에 넣을 맥락의 요청 본문입니다. `response`가 `none`이거나 생략된 경우
          `expires_in_seconds`를 보내면 400 `INVALID_CONTEXT_REQUEST`로 거부됩니다. 자동 생성
          예시에 두 필드가 함께 있으면 `expires_in_seconds`를 제거하거나 `response`를 `when_idle`
          또는 `interrupt_agent`로 바꿉니다.


          유효한 요청 예시입니다.


          ```json

          {"text": "결제가 완료되었습니다.", "response": "interrupt_agent",
          "expires_in_seconds": 30}

          ```


          맥락만 넣는 요청 예시입니다.


          ```json

          {"text": "결제가 완료되었습니다.", "response": "none"}

          ```
      responses:
        '202':
          description: 성공 응답
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InjectCallContextResponse'
        '400':
          description: 요청 검증 오류
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validationError:
                  summary: 요청 검증 오류
                  value:
                    error:
                      code: VALIDATION_ERROR
                      message: Request validation failed.
                      details:
                        field: name
                        reason: must not be blank
        '401':
          description: 인증이 필요합니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                unauthorized:
                  summary: Bearer 토큰 누락 또는 오류
                  value:
                    error:
                      code: UNAUTHORIZED
                      message: Authentication is required.
                      details: {}
        '403':
          description: 권한이 없습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  summary: 권한이 없습니다.
                  value:
                    error:
                      code: FORBIDDEN
                      message: Permission denied.
                      details: {}
        '404':
          description: 리소스를 찾을 수 없습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                notFound:
                  summary: 리소스를 찾을 수 없습니다.
                  value:
                    error:
                      code: RESOURCE_NOT_FOUND
                      message: Resource not found.
                      details:
                        resource: agent
        '409':
          description: 충돌이 발생했습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                conflict:
                  summary: 상태 충돌이 발생했습니다.
                  value:
                    error:
                      code: CONFLICT
                      message: The requested operation conflicts with current state.
                      details:
                        current_status: draft
        '429':
          description: >-
            요청 한도를 초과했습니다. API 키 트래픽의 기본 한도는 워크스페이스당 초당 5회, 분당 120회입니다. Supabase
            JWT 트래픽의 기본 한도는 사용자당 초당 10회, 분당 240회입니다. 워크스페이스 대시보드에는 분당 2,400회의 기본
            백스톱 한도가 적용됩니다. 운영자는 한도를 조정할 수 있습니다. 초과한 버킷의 실제 한도와 윈도우는 429 응답 헤더에
            표시됩니다. 헤더 이름은 X-RateLimit-Limit와 X-RateLimit-Window입니다. 개별 경로의 자체
            리미터가 만든 429 응답에는 이 헤더가 없을 수 있습니다.
          headers:
            Retry-After:
              description: >-
                초과한 공용 v3 인증 주체 리미터의 윈도우가 초기화될 때까지 남은 시간입니다. 단위는 초입니다. 개별 경로의 자체
                리미터가 만든 429 응답에는 이 헤더가 없을 수 있습니다.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Limit:
              description: >-
                초과한 공용 v3 인증 주체 리미터 윈도우의 최대 요청 수입니다. 개별 경로의 자체 리미터가 만든 429 응답에는
                이 헤더가 없을 수 있습니다.
              schema:
                type: integer
                minimum: 1
            X-RateLimit-Window:
              description: >-
                초과한 공용 v3 인증 주체 리미터의 윈도우 길이입니다. 단위는 초입니다. 개별 경로의 자체 리미터가 만든 429
                응답에는 이 헤더가 없을 수 있습니다.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                rateLimited:
                  summary: 요청 한도를 초과했습니다.
                  value:
                    error:
                      code: RATE_LIMIT_EXCEEDED
                      message: Too many requests.
                      details:
                        limit: 10
                        window_seconds: 1
                        scope: user
        '500':
          description: 서버 내부 오류가 발생했습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                internalError:
                  summary: 서버 내부 오류가 발생했습니다.
                  value:
                    error:
                      code: INTERNAL_ERROR
                      message: Internal server error.
                      details: {}
        '503':
          description: 서비스를 일시적으로 사용할 수 없습니다.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                contextCommandUnavailableRetryable:
                  summary: 맥락 명령을 전달하지 못했으며 재시도할 수 있습니다
                  value:
                    error:
                      code: CONTEXT_COMMAND_UNAVAILABLE
                      message: 통화 맥락 명령을 전달할 수 없습니다.
                      details:
                        retryable: true
                contextCommandUnavailableNonRetryable:
                  summary: 전달 결과를 알 수 없으므로 새 키로 재시도하면 안 됩니다
                  value:
                    error:
                      code: CONTEXT_COMMAND_UNAVAILABLE
                      message: 통화 맥락 명령을 전달할 수 없습니다.
                      details:
                        retryable: false
      security:
        - BearerAuth: []
components:
  schemas:
    InjectCallContextRequest:
      properties:
        text:
          type: string
          title: Text
          description: >-
            통화에 넣을 맥락 텍스트입니다. 공백만 있는 값은 거부하며, 직렬화한 control envelope이 16
            KiB(UTF-8 bytes)를 넘으면 거부합니다. 이후 모든 추론에 사업장 시스템이 보낸 외부 데이터로 들어가며 사용자
            발화나 지시로 취급되지 않습니다.
        response:
          type: string
          enum:
            - none
            - when_idle
            - interrupt_agent
          title: Response
          description: >-
            `none`은 맥락을 기억만 하고 먼저 말하지 않습니다(다음 사용자 턴의 응답부터 참고). `when_idle`은 통화가
            조용해지는 순간 에이전트가 한 번 먼저 말하도록 예약합니다. `interrupt_agent`는 에이전트가 말하는 중이면 그
            발화를 끊고 바로 이 맥락으로 응답하게 합니다(사용자가 말하는 중이면 그 턴이 끝난 뒤 응답에 합칩니다).
          default: none
        expires_in_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          maximum: 180
          minimum: 1
          title: Expires In Seconds
          description: >-
            `when_idle`·`interrupt_agent`에서만 지정할 수 있는 응답 **시작**까지의 대기 기한(초).
            1~180 범위이며 생략하면 90초입니다. `response=none`에서 지정하거나 범위를 벗어나면
            `INVALID_CONTEXT_REQUEST`로 거부합니다.
      additionalProperties: false
      type: object
      required:
        - text
      title: InjectCallContextRequest
      description: >-
        진행 중인 통화에 텍스트 맥락을 넣는 요청입니다. 빈 `text`와 범위를 벗어난 `expires_in_seconds`는 스키마가
        아니라 서비스가 400 `INVALID_CONTEXT_REQUEST`로 거부합니다.
    InjectCallContextResponse:
      properties:
        call_id:
          type: string
          format: uuid
          title: Call Id
          description: 맥락을 넣은 통화 UUID입니다.
        control_id:
          type: string
          title: Control Id
          description: >-
            이 요청의 안정적인 control ID입니다. `call_context` webhook의 `control_id`와 짝을
            맞추는 데 사용합니다.
        status:
          type: string
          const: accepted
          title: Status
          description: >-
            LiveKit Room으로 control packet 전달을 수락한 상태입니다. 맥락 반영이나 에이전트 발화 결과는
            `call_context` webhook으로 따로 알립니다.
      type: object
      required:
        - call_id
        - control_id
        - status
      title: InjectCallContextResponse
      description: 맥락 제어 패킷 전달을 수락했을 때의 202 응답입니다.
    ErrorResponse:
      type: object
      required:
        - error
      title: ErrorResponse
      description: 모든 실패 응답에서 사용하는 v3 error envelope입니다.
      examples:
        - error:
            code: VALIDATION_ERROR
            message: Request validation failed.
            details:
              field: name
              reason: must not be blank
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: 오류 payload입니다.
    ErrorDetail:
      type: object
      required:
        - code
        - message
        - details
      title: ErrorDetail
      description: 기계가 읽을 수 있는 v3 오류 상세 정보입니다.
      examples:
        - code: VALIDATION_ERROR
          message: Request validation failed.
          details:
            field: name
            reason: must not be blank
      properties:
        code:
          type: string
          title: Code
          description: 기계가 읽을 수 있는 오류 code입니다. message parsing 대신 이 값을 사용합니다.
          examples:
            - VALIDATION_ERROR
        message:
          type: string
          title: Message
          description: 사용자에게 표시할 수 있는 오류 메시지입니다. 프로그램 처리는 `code`를 사용합니다.
          examples:
            - Request validation failed.
        details:
          type: object
          title: Details
          additionalProperties: true
          description: 구조화된 context입니다. 주로 `field`, `reason`, `allowed_values`를 포함합니다.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Organization API key
      description: '워크스페이스 API 키를 `Authorization: Bearer <token>` 형식으로 보냅니다.'

````

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