{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/simple-ai/json-schema/simple-ai-external-call-create-response-schema.json",
  "title": "External Call Create Response",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/simple-ai-external-calls-api-openapi.yml#/components/schemas/ExternalCallCreateResponse",
  "type": "object",
  "required": [
    "success",
    "external_call"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "external_call": {
      "$ref": "#/$defs/ExternalCallDetails"
    }
  },
  "$defs": {
    "ExternalCallDetails": {
      "allOf": [
        {
          "$ref": "#/$defs/ExternalCallSummary"
        },
        {
          "type": "object",
          "required": [
            "recordings"
          ],
          "properties": {
            "recordings": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ExternalCallRecording"
              }
            }
          }
        }
      ],
      "title": "External Call Details"
    },
    "ExternalCallRecording": {
      "type": "object",
      "required": [
        "id",
        "file_name",
        "status",
        "started_at",
        "transcript",
        "summary",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "file_name": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "transcribing",
            "transcribed",
            "error"
          ]
        },
        "started_at": {
          "type": "string",
          "format": "date-time"
        },
        "transcript": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ExternalCallTranscriptUtterance"
              }
            },
            {
              "type": "null"
            }
          ]
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "title": "External Call Recording"
    },
    "ExternalCallSource": {
      "type": "object",
      "required": [
        "id",
        "name",
        "provider"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        }
      },
      "title": "External Call Source"
    },
    "ExternalCallSummary": {
      "type": "object",
      "required": [
        "id",
        "external_call_id",
        "title",
        "direction",
        "from_number",
        "to_number",
        "duration_seconds",
        "started_at",
        "status",
        "recording_count",
        "source",
        "created_at",
        "updated_at",
        "recording_presigned_urls"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "external_call_id": {
          "type": "string"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "direction": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "from_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "to_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "duration_seconds": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "started_at": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "type": "string",
          "enum": [
            "processing",
            "transcribed",
            "error"
          ]
        },
        "recording_count": {
          "type": "integer",
          "minimum": 0
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/ExternalCallSource"
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        },
        "recording_presigned_urls": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "description": "Presigned URLs for all playable recordings in chronological order. External calls can have multiple recordings per session. URLs expire after one hour. Deleted, excluded, and recordings awaiting required audio redaction are omitted; an empty array means no recordings are currently playable. If URL signing fails for a recording, its URL is omitted and the call data is still returned."
        }
      },
      "title": "External Call Summary"
    },
    "ExternalCallTranscriptUtterance": {
      "type": "object",
      "required": [
        "speaker",
        "text",
        "start",
        "end",
        "confidence",
        "channel"
      ],
      "properties": {
        "speaker": {
          "type": "string"
        },
        "text": {
          "type": "string"
        },
        "start": {
          "type": "number",
          "description": "Start time in milliseconds."
        },
        "end": {
          "type": "number",
          "description": "End time in milliseconds."
        },
        "confidence": {
          "type": "number"
        },
        "channel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "title": "External Call Transcript Utterance"
    }
  }
}