{
  "components": {
    "schemas": {
      "CallAnalysis": {
        "properties": {
          "intent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Intent"
          },
          "outcome": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Outcome"
          },
          "sentiment": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sentiment"
          },
          "summary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Summary"
          }
        },
        "title": "CallAnalysis",
        "type": "object"
      },
      "CallCosts": {
        "properties": {
          "base": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Base",
            "type": "string"
          },
          "charged": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Charged"
          },
          "currency": {
            "default": "USD",
            "title": "Currency",
            "type": "string"
          },
          "language_model": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Language Model",
            "type": "string"
          },
          "livekit": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Livekit",
            "type": "string"
          },
          "speech_to_text": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Speech To Text",
            "type": "string"
          },
          "telephony": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Telephony",
            "type": "string"
          },
          "text_to_speech": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Text To Speech",
            "type": "string"
          },
          "total": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Total",
            "type": "string"
          }
        },
        "required": [
          "base",
          "livekit",
          "telephony",
          "speech_to_text",
          "language_model",
          "text_to_speech",
          "total"
        ],
        "title": "CallCosts",
        "type": "object"
      },
      "CallCustomer": {
        "properties": {
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Country"
          },
          "customer_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Customer Id"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          }
        },
        "title": "CallCustomer",
        "type": "object"
      },
      "CallDetailResponseV1": {
        "description": "A single call.",
        "properties": {
          "call": {
            "$ref": "#/components/schemas/CallPayloadV1"
          }
        },
        "required": [
          "call"
        ],
        "title": "CallDetailResponseV1",
        "type": "object"
      },
      "CallEvaluation": {
        "properties": {
          "evaluation_id": {
            "title": "Evaluation Id",
            "type": "string"
          },
          "initial_result": {
            "title": "Initial Result",
            "type": "string"
          },
          "rationale": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rationale"
          },
          "recovered": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recovered"
          },
          "result": {
            "title": "Result",
            "type": "string"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "evaluation_id",
          "title",
          "result",
          "initial_result"
        ],
        "title": "CallEvaluation",
        "type": "object"
      },
      "CallFollowUp": {
        "properties": {
          "channel": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Channel"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "CallFollowUp",
        "type": "object"
      },
      "CallListResponseV1": {
        "description": "One page of calls, newest first.",
        "properties": {
          "calls": {
            "items": {
              "$ref": "#/components/schemas/CallPayloadV1"
            },
            "title": "Calls",
            "type": "array"
          },
          "has_more": {
            "description": "True when a further page is available. Loop on this, not on next_cursor.",
            "title": "Has More",
            "type": "boolean"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opaque cursor for the next page. Pass it back unchanged as `cursor`. Absent on the last page.",
            "title": "Next Cursor"
          }
        },
        "required": [
          "calls",
          "has_more"
        ],
        "title": "CallListResponseV1",
        "type": "object"
      },
      "CallPayloadV1": {
        "description": "The `call` object inside a delivery. Only `call`-group fields are required.",
        "properties": {
          "analysis": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallAnalysis"
              },
              {
                "type": "null"
              }
            ]
          },
          "assistant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assistant Id"
          },
          "assistant_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assistant Name"
          },
          "call_id": {
            "title": "Call Id",
            "type": "string"
          },
          "call_type": {
            "title": "Call Type",
            "type": "string"
          },
          "config_snapshot": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config Snapshot"
          },
          "costs": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallCosts"
              },
              {
                "type": "null"
              }
            ]
          },
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallCustomer"
              },
              {
                "type": "null"
              }
            ]
          },
          "direction": {
            "title": "Direction",
            "type": "string"
          },
          "duration_seconds": {
            "title": "Duration Seconds",
            "type": "integer"
          },
          "end_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Reason"
          },
          "ended_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ended At"
          },
          "evaluations": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CallEvaluation"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Evaluations"
          },
          "follow_ups": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/CallFollowUp"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Follow Ups"
          },
          "is_test": {
            "default": false,
            "title": "Is Test",
            "type": "boolean"
          },
          "performance_metrics": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallPerformanceMetrics"
              },
              {
                "type": "null"
              }
            ]
          },
          "recording": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CallRecording"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "transcript": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transcript"
          },
          "workspace_id": {
            "title": "Workspace Id",
            "type": "string"
          }
        },
        "required": [
          "call_id",
          "workspace_id",
          "call_type",
          "direction",
          "status",
          "duration_seconds"
        ],
        "title": "CallPayloadV1",
        "type": "object"
      },
      "CallPerformanceMetrics": {
        "properties": {
          "end_of_utterance": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Of Utterance"
          },
          "language_model": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language Model"
          },
          "speech_to_text": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Speech To Text"
          },
          "text_to_speech": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text To Speech"
          },
          "voice_activity": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Voice Activity"
          }
        },
        "title": "CallPerformanceMetrics",
        "type": "object"
      },
      "CallRecording": {
        "properties": {
          "available": {
            "default": false,
            "title": "Available",
            "type": "boolean"
          },
          "download_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Url"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          }
        },
        "title": "CallRecording",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    },
    "securitySchemes": {
      "PartnerApiKey": {
        "description": "A workspace API key from Settings > Developers, e.g. `vk_live_...`.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "contact": {
      "name": "Voicetta developer docs",
      "url": "https://voicetta.com/developers"
    },
    "description": "Read the calls your Voicetta assistants handled, and receive each one as a\nwebhook the moment it ends.\n\nAuthenticate every request with a workspace API key as\n`Authorization: Bearer <key>`. Keys are created in the Voicetta dashboard under\nSettings > Developers and are scoped to one workspace, so a request can only\never return that workspace's calls.\n\nNull fields are omitted from responses rather than sent as `null`. Treat a\nmissing key as \"no value\", not as an error.\n\nGuides, webhook payload reference and HMAC verification examples:\nhttps://voicetta.com/developers",
    "title": "Voicetta Call Data API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/calls": {
      "get": {
        "description": "Calls newest first. Page with `next_cursor` until `has_more` is false.",
        "operationId": "list_workspace_calls_v1_calls_get",
        "parameters": [
          {
            "description": "Cursor from a previous page",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor from a previous page",
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "Only calls that ended at or after this time (ISO 8601)",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls that ended at or after this time (ISO 8601)",
              "title": "From"
            }
          },
          {
            "description": "Only calls that ended at or before this time (ISO 8601)",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls that ended at or before this time (ISO 8601)",
              "title": "To"
            }
          },
          {
            "description": "Only calls handled by this assistant",
            "in": "query",
            "name": "assistant_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only calls handled by this assistant",
              "title": "Assistant Id"
            }
          },
          {
            "description": "Include test calls",
            "in": "query",
            "name": "include_test",
            "required": false,
            "schema": {
              "default": false,
              "description": "Include test calls",
              "title": "Include Test",
              "type": "boolean"
            }
          },
          {
            "description": "Comma-separated field groups to narrow the response. You can only request groups granted on the API key. Defaults to the key's allowlist. Available groups: call, customer, transcript, analysis, evaluations, recording, costs, performance_metrics, config_snapshot, follow_ups",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated field groups to narrow the response. You can only request groups granted on the API key. Defaults to the key's allowlist. Available groups: call, customer, transcript, analysis, evaluations, recording, costs, performance_metrics, config_snapshot, follow_ups",
              "title": "Fields"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallListResponseV1"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Invalid cursor, or an unknown name in `fields`"
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked API key"
          },
          "403": {
            "description": "The API key is not permitted to access the requested field groups"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "The partner API is disabled for this deployment"
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ],
        "summary": "List calls, newest first",
        "tags": [
          "Partner API"
        ]
      }
    },
    "/v1/calls/{call_id}": {
      "get": {
        "description": "The same call object the webhook delivers, fetched on demand.",
        "operationId": "get_workspace_call_v1_calls__call_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "call_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Call Id",
              "type": "string"
            }
          },
          {
            "description": "Comma-separated field groups to narrow the response. You can only request groups granted on the API key. Defaults to the key's allowlist. Available groups: call, customer, transcript, analysis, evaluations, recording, costs, performance_metrics, config_snapshot, follow_ups",
            "in": "query",
            "name": "fields",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated field groups to narrow the response. You can only request groups granted on the API key. Defaults to the key's allowlist. Available groups: call, customer, transcript, analysis, evaluations, recording, costs, performance_metrics, config_snapshot, follow_ups",
              "title": "Fields"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallDetailResponseV1"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "Unknown name in `fields`"
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked API key"
          },
          "403": {
            "description": "The API key is not permitted to access the requested field groups"
          },
          "404": {
            "description": "No such call in this workspace"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "The partner API is disabled for this deployment"
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ],
        "summary": "Get one call",
        "tags": [
          "Partner API"
        ]
      }
    },
    "/v1/calls/{call_id}/recording": {
      "get": {
        "description": "Redirect to a freshly signed storage URL.\n\nThe webhook payload points here rather than carrying a signed URL directly,\nbecause signed URLs expire within the hour and would rot inside a stored\npayload. Each request mints a new one.",
        "operationId": "get_call_recording_v1_calls__call_id__recording_get",
        "parameters": [
          {
            "in": "path",
            "name": "call_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Call Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to a freshly signed, short-lived audio URL"
          },
          "401": {
            "description": "Missing, malformed, unknown, or revoked API key"
          },
          "403": {
            "description": "The API key is not permitted to access recordings"
          },
          "404": {
            "description": "No such call in this workspace, or it has no recording"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "Recording storage is temporarily unavailable"
          }
        },
        "security": [
          {
            "PartnerApiKey": []
          }
        ],
        "summary": "Redirect to the call recording",
        "tags": [
          "Partner API"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Production",
      "url": "https://api.voicetta.com"
    }
  ]
}
