새로운 문서를 작성 중입니다.새 문서로 이동
ClawOps Docs
API Reference

발신 전화 생성

POST
/v1/accounts/{accountId}/calls

아웃바운드 전화를 발신합니다. From 번호는 계정에 등록된 번호여야 합니다.

전화 발신: To에 전화번호를 입력하면 일반 전화로 발신됩니다.

  • 예: "To": "01012345678"

매니지드 에이전트: AgentId를 지정하면 콘솔에서 만든 AI 에이전트가 통화를 처리합니다. 이때 CallContext이번 통화에만 적용되는 요구사항(Instruction)과 참조 데이터 (Variables)를 얹을 수 있습니다. 콘솔에 저장된 에이전트 설정은 바뀌지 않으므로 같은 에이전트로 동시에 거는 다른 통화에는 영향이 없습니다. AgentId 모드 전용이라 다른 모드와 함께 보내면 400으로 거절됩니다.

Agent SDK: Url, AgentId, CallFlowId를 모두 생략하면 From 번호에 연결된 Agent SDK로 통화가 연결됩니다. Agent가 연결되어 있지 않으면 409 에러를 반환합니다.

Url, AgentId, CallFlowId는 서로 배타적입니다. 201 Created는 발신 요청이 큐에 들어갔다는 뜻이며 통화 연결 성공을 뜻하지 않습니다. 반환된 callIdGET /v1/accounts/{accountId}/calls/{callId}로 조회해 최종 상태를 확인하세요.

AI Completion 모드는 종료되었습니다. AI 필드를 포함한 요청은 410으로 거절됩니다. Url(VoiceML), AgentId, CallFlowId 또는 Agent SDK를 사용하세요.

Authorization

BearerAuth
AuthorizationBearer <token>

API Key를 Bearer 토큰으로 전달

In: header

Path Parameters

accountId*string

계정 ID

Request Body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/accounts/AC1a2b3c4d/calls" \  -H "Content-Type: application/json" \  -d '{    "To": "01012345678",    "From": "07052358010"  }'
{
  "callId": "CAabcdef1234567890",
  "status": "queued",
  "to": "01012345678",
  "from": "07052358010",
  "direction": "outbound",
  "duration": 30,
  "accountId": "AC1a2b3c4d",
  "answeredBy": "human",
  "recordingUrl": "/v1/accounts/AC1a2b3c4d/recordings/CAabcdef1234567890",
  "hangupCause": "invalid_number",
  "hangupCauseQ850": 1,
  "sipResponseCode": 404,
  "hangupSource": "carrier",
  "transferTo": "01012345678",
  "transferStatus": "completed",
  "transferDuration": 60,
  "transferHangupCauseQ850": 16,
  "transferSipResponseCode": 500,
  "transferReasonText": "CS_NORMAL_RELEASE",
  "transfers": [
    {
      "sequence": 0,
      "to": "string",
      "mode": "string",
      "destinationType": "string",
      "status": "string",
      "duration": 0,
      "billable": true,
      "billableDuration": 0,
      "hangupCauseQ850": 0,
      "sipResponseCode": 0,
      "reasonText": "string",
      "startedAt": "2019-08-24T14:15:22Z",
      "connectedAt": "2019-08-24T14:15:22Z",
      "endedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "dateCreated": "2019-08-24T14:15:22Z",
  "dateUpdated": "2019-08-24T14:15:22Z"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}
{
  "error": "string",
  "code": "recipient_blocked"
}