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

# 発信前の確認

> 電話はかけずに、発信を止める理由（番号の形式、架電禁止、発信できる時間帯、残高、発信の上限など）がないかを確認します。本文は「電話をかける」と同じです。



## OpenAPI

````yaml POST /calls/preflight
openapi: 3.1.0
info:
  title: AIコール API
  version: '1.0'
  description: 自社のシステムからAIエージェントで電話をかけ、通話の結果を受け取るためのAPIです。
servers:
  - url: https://api.ai-call.co
security:
  - bearerAuth: []
tags:
  - name: 通話
  - name: エージェント・電話番号
  - name: Webhook
paths:
  /calls/preflight:
    post:
      tags:
        - 通話
      summary: 発信前の確認
      description: >-
        電話はかけずに、発信を止める理由（番号の形式、架電禁止、発信できる時間帯、残高、発信の上限など）がないかを確認します。本文は「電話をかける」と同じです。
      operationId: preflightCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallCreate'
      responses:
        '200':
          description: 確認の結果
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Preflight'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    CallCreate:
      type: object
      required:
        - agent_id
        - to
      properties:
        agent_id:
          type: string
          description: 使うAIエージェントのID
          example: 0123456789abcdef01234567
        to:
          type: string
          description: 発信先の日本の電話番号（フリーダイヤル等は不可）
          example: 090-1234-5678
        phone_number_id:
          type: string
          description: 発信元の電話番号のID。省略時はこのエージェントの発信番号、既定の発信番号、使える番号の順
        purpose:
          type: string
          maxLength: 500
          description: 今回の電話の目的（通話記録に残ります）
          example: 資料請求のお礼と面談のご案内
        contact:
          type: object
          description: この通話だけの相手の情報
          properties:
            name:
              type: string
              maxLength: 120
              example: 山田
            company:
              type: string
              maxLength: 120
              example: 株式会社サンプル
            email:
              type: string
              format: email
              example: yamada@example.com
        variables:
          type: object
          description: 会話で使う項目（英数字の名前40文字・値500文字、50個まで）
          additionalProperties:
            type: string
            maxLength: 500
          example:
            plan: スタンダード
        metadata:
          type: object
          description: 通話とWebhookにそのまま返す自由な値（英数字の名前40文字・値500文字、20個まで）
          additionalProperties:
            type: string
            maxLength: 500
          example:
            crm_id: A-1024
    Preflight:
      type: object
      properties:
        ok:
          type: boolean
          description: 今すぐかけられるか
        to:
          type:
            - string
            - 'null'
          example: '+819012345678'
        agent:
          $ref: '#/components/schemas/AgentRef'
        from:
          type:
            - object
            - 'null'
          properties:
            id:
              type: string
            phone_number:
              type: string
        calling_hours:
          type: object
          properties:
            start:
              type: string
              example: '09:00'
            end:
              type: string
              example: '20:00'
            timezone:
              type: string
              example: Asia/Tokyo
            open_now:
              type: boolean
        limits:
          type: object
          properties:
            per_minute:
              type: object
              properties:
                limit:
                  type: integer
                remaining:
                  type: integer
            per_day:
              type: object
              properties:
                limit:
                  type: integer
                remaining:
                  type: integer
        problems:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                example: do_not_call
              message:
                type: string
                example: この番号は架電しない設定です。
    AgentRef:
      type:
        - object
        - 'null'
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: 機械で判断するための英字のコード
              example: do_not_call
            message:
              type: string
              description: 日本語の説明
              example: この番号は架電しない設定です。
  responses:
    BadRequest:
      description: >-
        入力が正しくありません（`invalid_request` `invalid_json` `invalid_number`
        `invalid_email` `invalid_url` `invalid_cursor`
        `idempotency_key_required`）。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: APIキーがないか無効です（`missing_api_key` `invalid_api_key`）。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: このAPIキーに必要な権限がありません（`insufficient_scope`）。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: 回数の上限を超えました（`rate_limited`）。少し待って再試行してください。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 管理画面「設定 → API」で作成したAPIキー（`aic_sk_…`）。

````

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