# List agent insights Source: https://docs.freyavoice.ai/api-reference/agent-insights/list-agent-insights https://staging-app.freyavoice.ai/api/openapi.json get /agents/{agentId}/insights Returns the structured data field IDs assigned to an agent. # Update agent insights Source: https://docs.freyavoice.ai/api-reference/agent-insights/update-agent-insights https://staging-app.freyavoice.ai/api/openapi.json put /agents/{agentId}/insights Replaces the set of structured data fields assigned to an agent. # Create agent Source: https://docs.freyavoice.ai/api-reference/agents/create-agent https://staging-app.freyavoice.ai/api/openapi.json post /agents Creates a new AI agent with the specified configuration. # Delete agent Source: https://docs.freyavoice.ai/api-reference/agents/delete-agent https://staging-app.freyavoice.ai/api/openapi.json delete /agents Deletes an agent and all associated versions. # Get agent Source: https://docs.freyavoice.ai/api-reference/agents/get-agent https://staging-app.freyavoice.ai/api/openapi.json get /agents/{agentId} Returns detailed agent information including configuration. # Get default agent config Source: https://docs.freyavoice.ai/api-reference/agents/get-default-agent-config https://staging-app.freyavoice.ai/api/openapi.json get /agents/defaults Returns the platform default agent configuration (with language localization applied) used by the editor's reset-to-default controls. # List agents Source: https://docs.freyavoice.ai/api-reference/agents/list-agents https://staging-app.freyavoice.ai/api/openapi.json get /agents Returns agents for a workspace with pagination. # Update agent Source: https://docs.freyavoice.ai/api-reference/agents/update-agent https://staging-app.freyavoice.ai/api/openapi.json put /agents/{agentId} Updates an existing agent's name, configuration, or files. # Batch update widget positions Source: https://docs.freyavoice.ai/api-reference/analytics/batch-update-widget-positions https://staging-app.freyavoice.ai/api/openapi.json put /analytics/widgets Updates the positions (rowIndex, sortOrder) of multiple widgets at once. # Create widget Source: https://docs.freyavoice.ai/api-reference/analytics/create-widget https://staging-app.freyavoice.ai/api/openapi.json post /analytics/widgets Creates a new analytics widget for a workspace. # Delete widget Source: https://docs.freyavoice.ai/api-reference/analytics/delete-widget https://staging-app.freyavoice.ai/api/openapi.json delete /analytics/widgets/{widgetId} Deletes an analytics widget. # Get analytics Source: https://docs.freyavoice.ai/api-reference/analytics/get-analytics https://staging-app.freyavoice.ai/api/openapi.json get /analytics Returns call analytics for a workspace including summary statistics, time series data, ended reasons, top locations, sentiment distribution, and more. **Available Metrics:** - `summary`: Total calls, answered calls, voicemail, durations, answer rate - `timeSeries`: Call volume over time with configurable granularity - `endedReasons`: Distribution of call end reasons - `topCalls`: Longest or most recent calls - `geoDistribution`: Geographic distribution by country and state - `callThemes`: Common topics from call analysis - `sentimentDistribution`: Customer sentiment breakdown # Get credits analytics Source: https://docs.freyavoice.ai/api-reference/analytics/get-credits-analytics https://staging-app.freyavoice.ai/api/openapi.json get /analytics/credits Returns credit usage analytics for a workspace including daily breakdown and totals. # Get structured data analytics Source: https://docs.freyavoice.ai/api-reference/analytics/get-structured-data-analytics https://staging-app.freyavoice.ai/api/openapi.json get /analytics/structured-data Returns analytics for structured data fields including time series, summaries, distributions, and value counts. # Get widget Source: https://docs.freyavoice.ai/api-reference/analytics/get-widget https://staging-app.freyavoice.ai/api/openapi.json get /analytics/widgets/{widgetId} Returns a single analytics widget by ID. # List widgets Source: https://docs.freyavoice.ai/api-reference/analytics/list-widgets https://staging-app.freyavoice.ai/api/openapi.json get /analytics/widgets Returns all analytics widgets for a workspace. # Update widget Source: https://docs.freyavoice.ai/api-reference/analytics/update-widget https://staging-app.freyavoice.ai/api/openapi.json put /analytics/widgets/{widgetId} Updates an existing analytics widget. # Check API key Source: https://docs.freyavoice.ai/api-reference/api-keys/check-api-key https://staging-app.freyavoice.ai/api/openapi.json get /api-keys/check Verifies the caller's API key is valid and returns key metadata. Only API key authentication is accepted. # Create API key Source: https://docs.freyavoice.ai/api-reference/api-keys/create-api-key https://staging-app.freyavoice.ai/api/openapi.json post /api-keys Creates a new API key. The key value is only returned in this response. Every key expires: `expiresAt` defaults to 90 days from now and may be at most 365 days out. It cannot be changed after creation. # Delete API keys Source: https://docs.freyavoice.ai/api-reference/api-keys/delete-api-keys https://staging-app.freyavoice.ai/api/openapi.json delete /api-keys Deletes one or more API keys. # List API keys Source: https://docs.freyavoice.ai/api-reference/api-keys/list-api-keys https://staging-app.freyavoice.ai/api/openapi.json get /api-keys Returns all API keys for a workspace. # Update API keys Source: https://docs.freyavoice.ai/api-reference/api-keys/update-api-keys https://staging-app.freyavoice.ai/api/openapi.json put /api-keys Updates one or more API keys (name, active status, rate limits). Expiry is set at creation and is immutable — an `expiresAt` field in the payload is ignored. # Create speech Source: https://docs.freyavoice.ai/api-reference/audio/create-speech https://staging-app.freyavoice.ai/api/openapi.json post /audio/speech Generates speech audio from text using Freya's speech model. (Closed Beta) # Create transcription Source: https://docs.freyavoice.ai/api-reference/audio/create-transcription https://staging-app.freyavoice.ai/api/openapi.json post /audio/transcriptions Transcribes an uploaded audio file using Freya's transcription models. (Closed Beta) # Authentication Source: https://docs.freyavoice.ai/api-reference/authentication Get your API key to start using the Freya APIs All Freya API endpoints require a **Bearer token** for authentication. This token is tied to your workspace and can be generated from the dashboard. ## 1. Create an account Head to [app.freyavoice.ai](https://app.freyavoice.ai) and sign up for a free account. Create your account and workspace at app.freyavoice.ai ## 2. Create a workspace After signing in, you'll be prompted to create your first workspace. Workspaces are isolated environments — each one has its own agents, phone numbers, and API keys. If you already have a workspace, you can skip this step and go straight to generating an API key. ## 3. Generate an API key Once inside your workspace: In the sidebar, scroll to the **Settings** section and click **API Keys**. Click **Create API Key**, give it a name, and copy the generated token. Store it somewhere safe — it won't be shown again. You can also find a link to the API documentation directly on the API Keys page — click **View API Docs** next to the Create button. ## 4. Use the token in requests Pass the token as a `Bearer` token in the `Authorization` header of every API request: ```bash theme={null} Authorization: Bearer ``` ### Example ```bash theme={null} curl -X POST "https://stt.freyavoice.ai/v1/audio/transcriptions" \ -H "Authorization: Bearer " \ -F "file=@audio.wav" ``` Never expose your API key in client-side code or public repositories. Use environment variables or a secrets manager to keep it secure. # Branch activity Source: https://docs.freyavoice.ai/api-reference/branches/branch-activity https://staging-app.freyavoice.ai/api/openapi.json get /branches/{branchId}/activity The side sheet's tabs: the branch's commits, simulations, and unit-test runs. # Commit to branch Source: https://docs.freyavoice.ai/api-reference/branches/commit-to-branch https://staging-app.freyavoice.ai/api/openapi.json post /branches/{branchId}/commit Stacks a new full-snapshot commit on the branch head (a branch save). # Create branch Source: https://docs.freyavoice.ai/api-reference/branches/create-branch https://staging-app.freyavoice.ai/api/openapi.json post /branches Forks the edited config off a base mainline version into a new branch's first commit. # Discard branch Source: https://docs.freyavoice.ai/api-reference/branches/discard-branch https://staging-app.freyavoice.ai/api/openapi.json post /branches/{branchId}/discard Marks an open branch as discarded. # Get branch Source: https://docs.freyavoice.ai/api-reference/branches/get-branch https://staging-app.freyavoice.ai/api/openapi.json get /branches/{branchId} The merge view: commits, net change, closed issues, and a dry-run conflict preview. # List branches Source: https://docs.freyavoice.ai/api-reference/branches/list-branches https://staging-app.freyavoice.ai/api/openapi.json get /branches Lists an entity's branches (proposed changes). A branch is a side-line of versions. # Merge branch Source: https://docs.freyavoice.ai/api-reference/branches/merge-branch https://staging-app.freyavoice.ai/api/openapi.json post /branches/{branchId}/rebase 3-way merges the branch onto mainline, minting a mainline draft (Apply) or publishing it (Apply & Publish). Returns 409 with per-path conflicts when mainline drifted. # Download call recording Source: https://docs.freyavoice.ai/api-reference/call-recordings/download-call-recording https://staging-app.freyavoice.ai/api/openapi.json get /call/{callId}/recording Returns the MP3 audio recording for a call. # Add call tag Source: https://docs.freyavoice.ai/api-reference/call-tags/add-call-tag https://staging-app.freyavoice.ai/api/openapi.json post /call/{callId}/tags Adds a tag to a call. # Remove call tag Source: https://docs.freyavoice.ai/api-reference/call-tags/remove-call-tag https://staging-app.freyavoice.ai/api/openapi.json delete /call/{callId}/tags Removes a tag from a call. # Update call tag Source: https://docs.freyavoice.ai/api-reference/call-tags/update-call-tag https://staging-app.freyavoice.ai/api/openapi.json patch /call/{callId}/tags Updates an existing tag or adds a new one. Can also delete a tag if delete=true. # Bulk delete calls Source: https://docs.freyavoice.ai/api-reference/calls/bulk-delete-calls https://staging-app.freyavoice.ai/api/openapi.json delete /call Deletes multiple calls by their IDs. # Bulk update calls Source: https://docs.freyavoice.ai/api-reference/calls/bulk-update-calls https://staging-app.freyavoice.ai/api/openapi.json patch /call Updates multiple calls. Currently supports archiving/unarchiving calls. # Get call details Source: https://docs.freyavoice.ai/api-reference/calls/get-call-details https://staging-app.freyavoice.ai/api/openapi.json get /call/{callId} Returns detailed call information including transcript, messages, tags, and feedbacks. # Import calls from a raw ZIP export Source: https://docs.freyavoice.ai/api-reference/calls/import-calls-from-a-raw-zip-export https://staging-app.freyavoice.ai/api/openapi.json post /call/import Accepts a multipart/form-data upload of a ZIP archive produced by /call/export-raw. Phase A inserts bundled workflows/agents/versions (ON CONFLICT DO NOTHING, flagged is_imported) so imported calls preserve their call → agent → workflow → version FK chain inside the target workspace. Phase B creates calls (flagged is_imported), uploads recordings to the target workspace S3 path, and inserts related tags/feedbacks/assertion results. Workspace-scoped; requires the `calls:import` permission. # Initiate call Source: https://docs.freyavoice.ai/api-reference/calls/initiate-call https://staging-app.freyavoice.ai/api/openapi.json post /call Initiates an outbound call. Requires phoneNumber, callerNumber, and workspaceId. Add campaignId to trigger the campaign call flow. Routes via Asterisk ARI or FreeSWITCH ESL based on phone number trunk config. # List calls Source: https://docs.freyavoice.ai/api-reference/calls/list-calls https://staging-app.freyavoice.ai/api/openapi.json get /call Returns calls for a workspace with filters, sorting, pagination, and export support. # Raw ZIP export Source: https://docs.freyavoice.ai/api-reference/calls/raw-zip-export https://staging-app.freyavoice.ai/api/openapi.json post /call/export-raw Lossless dump of calls + related sub-tables + recordings + debug blobs + upstream FK targets (agents/workflows/versions) for round-trip with the import endpoint. Returns a ZIP containing calls.json, agents.json, workflows.json, versions.json, recordings/[_user|_assistant].{mp3,wav}, and traces/.json.gz + logs/.json.gz (gzip-compressed OTel traces and application logs). Workspace-scoped; requires the `calls:export` permission. # Register an inbound web call Source: https://docs.freyavoice.ai/api-reference/calls/register-an-inbound-web-call https://staging-app.freyavoice.ai/api/openapi.json post /inbound/web Registers an inbound web (LiveKit) call session for the authenticated workspace. The workspace is resolved from the bearer token — it is not accepted from the request body. Returns the LiveKit room metadata that the agent uses to bootstrap the session (workspaceId, webhook URL, assistant id, customer data). # Bulk delete campaigns Source: https://docs.freyavoice.ai/api-reference/campaigns/bulk-delete-campaigns https://staging-app.freyavoice.ai/api/openapi.json delete /campaign Deletes multiple campaigns by their IDs. # Create campaign Source: https://docs.freyavoice.ai/api-reference/campaigns/create-campaign https://staging-app.freyavoice.ai/api/openapi.json post /campaign Creates an outbound voice campaign and schedules calls to the provided customers. **Timezone handling:** All time values (`startTime`, `endTime`, and `daySchedules` entries) are wall-clock times interpreted in the campaign's `timezone`. For example, `startTime: "09:00"` with `timezone: "Europe/Prague"` means 09:00 CET/CEST (depending on DST). See the [IANA timezone list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for valid identifiers. **Per-day schedule overrides:** Use `daySchedules` to set different calling hours for specific days. Days not listed in `daySchedules` use the global `startTime`/`endTime` window. Days not in `activeDays` are inactive regardless of `daySchedules`. # Delete campaign Source: https://docs.freyavoice.ai/api-reference/campaigns/delete-campaign https://staging-app.freyavoice.ai/api/openapi.json delete /campaign/{campaignId} Deletes a campaign and all associated data. # Get campaign Source: https://docs.freyavoice.ai/api-reference/campaigns/get-campaign https://staging-app.freyavoice.ai/api/openapi.json get /campaign/{campaignId} Returns campaign configuration, customers, events, and call IDs. # List campaign customers Source: https://docs.freyavoice.ai/api-reference/campaigns/list-campaign-customers https://staging-app.freyavoice.ai/api/openapi.json get /campaign/{campaignId}/customers Returns customers for a campaign with retry status, property keys, pagination, and exports. # List campaigns Source: https://docs.freyavoice.ai/api-reference/campaigns/list-campaigns https://staging-app.freyavoice.ai/api/openapi.json get /campaign Returns campaigns for a workspace with filters, sorting, pagination, and export support. # Update campaign Source: https://docs.freyavoice.ai/api-reference/campaigns/update-campaign https://staging-app.freyavoice.ai/api/openapi.json patch /campaign/{campaignId} Updates editable fields (currently the name) of a campaign. # Close a chat call Source: https://docs.freyavoice.ai/api-reference/chat/close-a-chat-call https://staging-app.freyavoice.ai/api/openapi.json post /chat/end Closes a chat call. Tells pipecat to fire the end-of-call lifecycle (webhook + post-conversation analysis + end-of-call tools) — analysis runs async on pipecat; the webhook arrives at the dashboard shortly after with summary, sentiment, themes, problems, and assertions. Idempotent: a second call on an already-ended call returns 200 with `alreadyEnded: true` without re-triggering pipecat. # Fork a chat call at an anchor Source: https://docs.freyavoice.ai/api-reference/chat/fork-a-chat-call-at-an-anchor https://staging-app.freyavoice.ai/api/openapi.json post /chat/fork Creates a brand-new chat call that copies the parent call's messages up to and including `fromMessageId` and retargets a different `versionId`, `agentId`, or `workflowId`. The forked call is dormant until the caller drives it via POST /chat/message. Cross-entity forks are allowed; the inherited workflowSnapshot may be partially incompatible with the new target (pipecat's resume path degrades gracefully). # Send a chat message Source: https://docs.freyavoice.ai/api-reference/chat/send-a-chat-message https://staging-app.freyavoice.ai/api/openapi.json post /chat/message Drives a Freya agent or workflow turn-by-turn over text. Omit `callId` and provide `agentId` or `workflowId` to start a new call; the response returns a `callId` to pass on subsequent turns. Branch by passing `fromMessageId` pointing at an earlier assistant turn. # Get TTS abbreviations Source: https://docs.freyavoice.ai/api-reference/custom/get-tts-abbreviations https://staging-app.freyavoice.ai/api/openapi.json get /custom/abbreviations Returns the current TTS abbreviations list (`textSubstitutions`) for an agent or workflow. Identify the target by either `id` (UUID, preferred) or `name`. The resolver checks agents first, then workflows. If `name` matches multiple rows in either table, or matches both an agent and a workflow, the request fails with 409 — pass `id` to disambiguate. # Replace TTS abbreviations Source: https://docs.freyavoice.ai/api-reference/custom/replace-tts-abbreviations https://staging-app.freyavoice.ai/api/openapi.json put /custom/abbreviations Replaces the TTS abbreviations list (`textSubstitutions`) on an agent or on a workflow's embedded agent config. Behaves like a UI save: persists to the JSONB config and creates a new version for audit and rollback. Identify the target by either `id` (UUID, preferred) or `name`. The resolver checks agents first, then workflows, so `id` is unambiguous. If `name` is provided and it matches multiple rows in either table, or matches both an agent and a workflow, the request fails with 409 — pass `id` to disambiguate. The full `abbreviations` list is replaced — there is no per-rule patch. # Request export Source: https://docs.freyavoice.ai/api-reference/export/request-export https://staging-app.freyavoice.ai/api/openapi.json post /export Requests a data export from one of the supported endpoints. The export can be delivered as a direct download URL or sent via email. **Supported Endpoints:** - `/api/v2/call` - Export calls - `/api/v2/campaign` - Export campaigns - `/api/v2/phone-numbers` - Export phone numbers - `/api/v2/feedbacks` - Export feedbacks **Export Formats:** - `csv` - Comma-separated values - `xlsx` - Excel spreadsheet - `markdown` - Markdown table - `json` - JSON array The `params` object should include the same query parameters you would use when calling the endpoint directly, including `workspaceId`. # Add feedback assignee Source: https://docs.freyavoice.ai/api-reference/feedback-assignees/add-feedback-assignee https://staging-app.freyavoice.ai/api/openapi.json post /feedbacks/{feedbackId}/assignees Adds an assignee to a feedback. # List feedback assignees Source: https://docs.freyavoice.ai/api-reference/feedback-assignees/list-feedback-assignees https://staging-app.freyavoice.ai/api/openapi.json get /feedbacks/{feedbackId}/assignees Returns all assignees for a feedback. # Remove feedback assignee Source: https://docs.freyavoice.ai/api-reference/feedback-assignees/remove-feedback-assignee https://staging-app.freyavoice.ai/api/openapi.json delete /feedbacks/{feedbackId}/assignees Removes an assignee from a feedback. # Replace feedback assignees Source: https://docs.freyavoice.ai/api-reference/feedback-assignees/replace-feedback-assignees https://staging-app.freyavoice.ai/api/openapi.json put /feedbacks/{feedbackId}/assignees Replaces all assignees for a feedback. # Add feedback comment Source: https://docs.freyavoice.ai/api-reference/feedback-comments/add-feedback-comment https://staging-app.freyavoice.ai/api/openapi.json post /feedbacks/{feedbackId}/comments Adds a comment to a feedback. # Delete feedback comment Source: https://docs.freyavoice.ai/api-reference/feedback-comments/delete-feedback-comment https://staging-app.freyavoice.ai/api/openapi.json delete /feedbacks/{feedbackId}/comments Deletes a comment from a feedback. # List feedback comments Source: https://docs.freyavoice.ai/api-reference/feedback-comments/list-feedback-comments https://staging-app.freyavoice.ai/api/openapi.json get /feedbacks/{feedbackId}/comments Returns all comments for a feedback. # Update feedback comment Source: https://docs.freyavoice.ai/api-reference/feedback-comments/update-feedback-comment https://staging-app.freyavoice.ai/api/openapi.json patch /feedbacks/{feedbackId}/comments Updates a comment's content. # Add feedback reference Source: https://docs.freyavoice.ai/api-reference/feedback-references/add-feedback-reference https://staging-app.freyavoice.ai/api/openapi.json post /feedbacks/{feedbackId}/references Links a feedback to an entity in the same workspace. Returns the full list. # List feedback references Source: https://docs.freyavoice.ai/api-reference/feedback-references/list-feedback-references https://staging-app.freyavoice.ai/api/openapi.json get /feedbacks/{feedbackId}/references Returns the entities (personas, simulations, calls, versions, solutions) a feedback references. # Remove feedback reference Source: https://docs.freyavoice.ai/api-reference/feedback-references/remove-feedback-reference https://staging-app.freyavoice.ai/api/openapi.json delete /feedbacks/{feedbackId}/references Removes a reference from a feedback. Returns the full list. # Get feedback statuses Source: https://docs.freyavoice.ai/api-reference/feedback-status-config/get-feedback-statuses https://staging-app.freyavoice.ai/api/openapi.json get /feedbacks/statuses Returns all unique feedback statuses used in the workspace. # Bulk delete feedbacks Source: https://docs.freyavoice.ai/api-reference/feedbacks/bulk-delete-feedbacks https://staging-app.freyavoice.ai/api/openapi.json delete /feedbacks Deletes multiple feedbacks by their IDs. # Create feedback Source: https://docs.freyavoice.ai/api-reference/feedbacks/create-feedback https://staging-app.freyavoice.ai/api/openapi.json post /feedbacks Creates a new feedback. Can be linked to a call or agent, or standalone. # List feedbacks Source: https://docs.freyavoice.ai/api-reference/feedbacks/list-feedbacks https://staging-app.freyavoice.ai/api/openapi.json get /feedbacks Returns feedbacks for a workspace with filters, sorting, pagination, and histogram data. # Open feedbacks for an agent Source: https://docs.freyavoice.ai/api-reference/feedbacks/open-feedbacks-for-an-agent https://staging-app.freyavoice.ai/api/openapi.json get /feedbacks/open-for-agent Unresolved feedbacks (call-linked + standalone) for an agent, used by the #N issue-linking control. # Update feedback Source: https://docs.freyavoice.ai/api-reference/feedbacks/update-feedback https://staging-app.freyavoice.ai/api/openapi.json patch /feedbacks Updates a feedback's status, assignment, resolution, or content. # Create insight Source: https://docs.freyavoice.ai/api-reference/insights/create-insight https://staging-app.freyavoice.ai/api/openapi.json post /insights Creates a new structured data field definition. # Delete insight Source: https://docs.freyavoice.ai/api-reference/insights/delete-insight https://staging-app.freyavoice.ai/api/openapi.json delete /insights/{insightId} Deletes a structured data field definition and all associated values. # Get insight Source: https://docs.freyavoice.ai/api-reference/insights/get-insight https://staging-app.freyavoice.ai/api/openapi.json get /insights/{insightId} Returns a structured data field definition with assigned agents. # List insights Source: https://docs.freyavoice.ai/api-reference/insights/list-insights https://staging-app.freyavoice.ai/api/openapi.json get /insights Returns all structured data field definitions for a workspace. # Update insight Source: https://docs.freyavoice.ai/api-reference/insights/update-insight https://staging-app.freyavoice.ai/api/openapi.json put /insights/{insightId} Updates a structured data field definition. Type is immutable after creation. # List integrations Source: https://docs.freyavoice.ai/api-reference/integrations/list-integrations https://staging-app.freyavoice.ai/api/openapi.json get /integrations Returns available integrations with optional connection status for the workspace. When `detail=true`, returns full integration metadata from Nango including available actions, endpoints, and whether the workspace has an active connection. When `detail=false` (default), returns only connected integrations from the database. # Remove integration Source: https://docs.freyavoice.ai/api-reference/integrations/remove-integration https://staging-app.freyavoice.ai/api/openapi.json delete /integrations Disconnects an integration from the workspace. This removes the connection but does not affect data that was synced. # Introduction Source: https://docs.freyavoice.ai/api-reference/introduction Freyavoice v2 Call API overview ## Overview The Freyavoice Call API under `/api/v2/call` powers call search, details, recordings, tags, and problems. The Mintlify API playground below is generated from our OpenAPI spec. Browse the full schema for calls, tags, problems, recordings, and stats. Please note that this REST interface is still experimental and the definitions may change without immediate notice. We welcome all inquiries on slack for support. ## Authentication All endpoints require a bearer token issued by the workspace. # Permission catalog Source: https://docs.freyavoice.ai/api-reference/permissions/permission-catalog https://staging-app.freyavoice.ai/api/openapi.json get /permissions Returns the full permission catalog (used by the role-picker UI and the API-key permission-picker UI). Auth-only — any logged-in user can read. # Create persona Source: https://docs.freyavoice.ai/api-reference/personas/create-persona https://staging-app.freyavoice.ai/api/openapi.json post /personas Creates a new persona for simulation testing. # Delete persona Source: https://docs.freyavoice.ai/api-reference/personas/delete-persona https://staging-app.freyavoice.ai/api/openapi.json delete /personas/{personaId} Deletes a persona. # Generate persona preview Source: https://docs.freyavoice.ai/api-reference/personas/generate-persona-preview https://staging-app.freyavoice.ai/api/openapi.json post /personas/preview Generates AI-powered persona previews based on a prompt. # Get persona Source: https://docs.freyavoice.ai/api-reference/personas/get-persona https://staging-app.freyavoice.ai/api/openapi.json get /personas/{personaId} Returns detailed persona information. # List personas Source: https://docs.freyavoice.ai/api-reference/personas/list-personas https://staging-app.freyavoice.ai/api/openapi.json get /personas Returns personas for a workspace. # Update persona Source: https://docs.freyavoice.ai/api-reference/personas/update-persona https://staging-app.freyavoice.ai/api/openapi.json put /personas/{personaId} Updates an existing persona. # Create phone book contact Source: https://docs.freyavoice.ai/api-reference/phone-aliases/create-phone-book-contact https://staging-app.freyavoice.ai/api/openapi.json post /phone-aliases Creates a new contact with one or more phone numbers in the workspace. # Delete phone book contacts Source: https://docs.freyavoice.ai/api-reference/phone-aliases/delete-phone-book-contacts https://staging-app.freyavoice.ai/api/openapi.json delete /phone-aliases Deletes one or more contacts by ID; each contact's phone numbers are removed with it. # List phone book contacts Source: https://docs.freyavoice.ai/api-reference/phone-aliases/list-phone-book-contacts https://staging-app.freyavoice.ai/api/openapi.json get /phone-aliases Returns the workspace's phone book contacts (each with its phone numbers) with pagination and search over names and numbers. # Update phone book contact Source: https://docs.freyavoice.ai/api-reference/phone-aliases/update-phone-book-contact https://staging-app.freyavoice.ai/api/openapi.json put /phone-aliases Updates a single contact by ID: renames it and replaces its full set of phone numbers. # Create phone number Source: https://docs.freyavoice.ai/api-reference/phone-numbers/create-phone-number https://staging-app.freyavoice.ai/api/openapi.json post /phone-numbers Registers a new phone number with optional agent configuration for inbound and outbound calls. # Delete phone numbers Source: https://docs.freyavoice.ai/api-reference/phone-numbers/delete-phone-numbers https://staging-app.freyavoice.ai/api/openapi.json delete /phone-numbers Deletes one or more phone numbers by ID. # List phone numbers Source: https://docs.freyavoice.ai/api-reference/phone-numbers/list-phone-numbers https://staging-app.freyavoice.ai/api/openapi.json get /phone-numbers Returns phone numbers for a workspace with pagination, filtering, and optional counts by column. # Update phone numbers Source: https://docs.freyavoice.ai/api-reference/phone-numbers/update-phone-numbers https://staging-app.freyavoice.ai/api/openapi.json put /phone-numbers Updates one or more phone numbers. Returns updated records and any validation errors. # Add assignee Source: https://docs.freyavoice.ai/api-reference/review-assignees/add-assignee https://staging-app.freyavoice.ai/api/openapi.json post /reviews/{reviewId}/assignees Adds a user as an assignee to the review. # List assignees Source: https://docs.freyavoice.ai/api-reference/review-assignees/list-assignees https://staging-app.freyavoice.ai/api/openapi.json get /reviews/{reviewId}/assignees Returns all users assigned to a review. # Remove assignee Source: https://docs.freyavoice.ai/api-reference/review-assignees/remove-assignee https://staging-app.freyavoice.ai/api/openapi.json delete /reviews/{reviewId}/assignees Removes a user from the review's assignees. # Replace assignees Source: https://docs.freyavoice.ai/api-reference/review-assignees/replace-assignees https://staging-app.freyavoice.ai/api/openapi.json put /reviews/{reviewId}/assignees Replaces all assignees with the provided list. Pass an empty array to remove all assignees. # Get review Source: https://docs.freyavoice.ai/api-reference/reviews/get-review https://staging-app.freyavoice.ai/api/openapi.json get /reviews Returns the review for a specific call, or null if no review exists. # Upsert review Source: https://docs.freyavoice.ai/api-reference/reviews/upsert-review https://staging-app.freyavoice.ai/api/openapi.json put /reviews Creates or updates a review for a call. **Review Statuses:** - `No Review Status` - Default state - `Pending Review` - Waiting for review - `In Progress` - Currently being reviewed - `Completed` - Review finished - `Not Needed` - No review required **Review Tags:** - `Successful` - Call achieved its goal - `Technical Issue` - Technical problems occurred - `Wrong Number` - Reached wrong contact - `No Answer` - Customer didn't answer - `Needs Review` - Flagged for further review # List iterations Source: https://docs.freyavoice.ai/api-reference/simulation-iterations/list-iterations https://staging-app.freyavoice.ai/api/openapi.json get /simulations/{simulationId}/iterations Returns iteration history for a simulation. # Create simulation Source: https://docs.freyavoice.ai/api-reference/simulations/create-simulation https://staging-app.freyavoice.ai/api/openapi.json post /simulations Creates a new simulation for agent testing. # Delete simulation Source: https://docs.freyavoice.ai/api-reference/simulations/delete-simulation https://staging-app.freyavoice.ai/api/openapi.json delete /simulations/{simulationId} Deletes a simulation and all associated data. # Get simulation Source: https://docs.freyavoice.ai/api-reference/simulations/get-simulation https://staging-app.freyavoice.ai/api/openapi.json get /simulations/{simulationId} Returns detailed simulation information including personas and assertions. # List simulation checks for a version Source: https://docs.freyavoice.ai/api-reference/simulations/list-simulation-checks-for-a-version https://staging-app.freyavoice.ai/api/openapi.json get /simulations/version-checks Returns the simulations that ran against a single agent/workflow version as check rows (latest iteration per simulation, bucketed as passed/failed/running), newest first. # List simulation persona runs for a version Source: https://docs.freyavoice.ai/api-reference/simulations/list-simulation-persona-runs-for-a-version https://staging-app.freyavoice.ai/api/openapi.json get /simulations/version-persona-runs Returns the personas that ran against a single agent/workflow version as check rows (one per persona on each simulation's latest iteration, bucketed as passed/failed/running), newest first. # List simulation tags Source: https://docs.freyavoice.ai/api-reference/simulations/list-simulation-tags https://staging-app.freyavoice.ai/api/openapi.json get /simulations/tags Returns the distinct tags across all simulations in the workspace. # List simulations Source: https://docs.freyavoice.ai/api-reference/simulations/list-simulations https://staging-app.freyavoice.ai/api/openapi.json get /simulations Returns simulations for a workspace. # Rerun simulation Source: https://docs.freyavoice.ai/api-reference/simulations/rerun-simulation https://staging-app.freyavoice.ai/api/openapi.json post /simulations/{simulationId}/rerun Triggers a new run of the simulation, creating a new iteration. # Update simulation Source: https://docs.freyavoice.ai/api-reference/simulations/update-simulation https://staging-app.freyavoice.ai/api/openapi.json put /simulations/{simulationId} Updates an existing simulation. # Speech-to-Text Source: https://docs.freyavoice.ai/api-reference/stt Transcribe audio files or stream real-time audio to text using Freya ASR ## File Transcription Upload an audio file and receive a text transcription. This endpoint is compatible with the [OpenAI Audio Transcription API](https://platform.openai.com/docs/api-reference/audio/createTranscription). View the full OpenAPI reference for file transcription. ### Supported Formats `wav`, `mp3`, `flac`, `ogg`, `m4a`, `webm` — up to **15 MB** per file. ### Request ```bash theme={null} curl -X POST "https://stt.freyavoice.ai/v1/audio/transcriptions" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@audio.wav" \ -F "model=freya-stt" \ -F "response_format=verbose_json" ``` | Parameter | Type | Default | Description | | :---------------- | :----- | :---------- | :------------------------------------------------------- | | `file` | binary | *required* | The audio file to transcribe. | | `model` | string | `freya-stt` | Model identifier. | | `response_format` | string | `json` | One of `json`, `text`, or `verbose_json`. | | `temperature` | number | `0.0` | Sampling temperature (0–1). Lower is more deterministic. | ### Response Formats ```json theme={null} { "text": "Merhaba, bu bir test konuşmasıdır.", "inference_time_ms": 342.5 } ``` Includes detected language and word-level confidence scores: ```json theme={null} { "text": "Merhaba, bu bir test konuşmasıdır.", "language": "Turkish", "inference_time_ms": 342.5, "words": [ { "word": "Merhaba,", "confidence": 0.98 }, { "word": "bu", "confidence": 0.95 }, { "word": "bir", "confidence": 0.97 }, { "word": "test", "confidence": 0.92 }, { "word": "konuşmasıdır.", "confidence": 0.89 } ] } ``` Returns plain text with no JSON wrapper: ``` Merhaba, bu bir test konuşmasıdır. ``` *** ## Real-Time Streaming (WebSocket) For real-time transcription, connect via WebSocket and stream audio frames. The server uses **LocalAgreement** to emit stable (confirmed) words as they are recognized, plus tentative partial results. Real-time streaming is currently in **beta**. The WebSocket endpoint is available at `wss://stt.freyavoice.ai/v1/audio/stream`. ### Connection ``` wss://stt.freyavoice.ai/v1/audio/stream?token=YOUR_API_KEY ``` Pass your API key as the `token` query parameter. Non-browser clients can alternatively use the `Authorization: Bearer YOUR_API_KEY` header during the WebSocket handshake. ### Wire Protocol The session follows a simple three-phase protocol: **1. Configure** — Send a JSON text frame with session settings: ```json theme={null} { "type": "config", "sample_rate": 16000 } ``` | Field | Type | Default | Description | | :------------ | :------ | :------ | :--------------------------------------------------------------------- | | `sample_rate` | integer | `16000` | Sample rate of the audio you'll send (resampled to 16 kHz internally). | **2. Stream audio** — Send raw PCM audio as **binary WebSocket frames**. * Format: **16-bit signed integer, little-endian, mono** * Send frames continuously as audio is captured (e.g. every 100–500 ms) **3. End session** — Send a JSON text frame to signal end-of-audio: ```json theme={null} { "type": "eof" } ``` ### Server Messages The server sends JSON text frames throughout the session: | Type | Description | Fields | | :-------- | :-------------------------------------------------------------- | :------------------------------------- | | `partial` | Tentative (not yet confirmed) transcription of the latest audio | `text` | | `final` | Newly confirmed words — append these to your transcript | `text` | | `result` | Final result after `eof` — the complete transcription | `text`, `word_confidences`, `language` | | `error` | An error occurred | `message` | ```json theme={null} { "type": "partial", "text": "merhaba nasıl" } ``` ```json theme={null} { "type": "final", "text": "merhaba" } ``` ```json theme={null} { "type": "result", "text": "Merhaba, nasılsınız?", "word_confidences": [ { "word": "Merhaba,", "confidence": 0.97 }, { "word": "nasılsınız?", "confidence": 0.94 } ], "language": "Turkish" } ``` ```json theme={null} { "type": "error", "message": "Invalid config frame." } ``` ### How LocalAgreement Works The server re-transcribes the accumulated audio buffer on every tick (\~500 ms). It compares consecutive hypotheses and only emits words that both agree on as `final`. The unstable tail is sent as `partial` and may change on the next tick. This gives you low-latency confirmed words without hallucinated flicker. ### JavaScript Example ```javascript theme={null} const token = "YOUR_API_KEY"; const ws = new WebSocket(`wss://stt.freyavoice.ai/v1/audio/stream?token=${token}`); ws.onopen = () => { // 1. Send config ws.send(JSON.stringify({ type: "config", sample_rate: 16000 })); // 2. Stream audio from microphone navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => { const ctx = new AudioContext({ sampleRate: 16000 }); const source = ctx.createMediaStreamSource(stream); const processor = ctx.createScriptProcessor(4096, 1, 1); processor.onaudioprocess = (e) => { const float32 = e.inputBuffer.getChannelData(0); const int16 = new Int16Array(float32.length); for (let i = 0; i < float32.length; i++) { int16[i] = Math.max(-32768, Math.min(32767, float32[i] * 32768)); } ws.send(int16.buffer); }; source.connect(processor); processor.connect(ctx.destination); }); }; let transcript = ""; ws.onmessage = (event) => { const msg = JSON.parse(event.data); if (msg.type === "final") { transcript += (transcript ? " " : "") + msg.text; console.log("Confirmed:", transcript); } else if (msg.type === "partial") { console.log("Tentative:", transcript + " " + msg.text); } else if (msg.type === "result") { console.log("Final result:", msg.text); } }; // 3. When done recording: // ws.send(JSON.stringify({ type: "eof" })); ``` ### Python Example ```python theme={null} import asyncio import json import wave import websockets API_KEY = "YOUR_API_KEY" async def transcribe_stream(audio_path: str): uri = f"wss://stt.freyavoice.ai/v1/audio/stream?token={API_KEY}" async with websockets.connect(uri) as ws: # 1. Configure await ws.send(json.dumps({ "type": "config", "sample_rate": 16000, })) # 2. Stream audio in chunks with wave.open(audio_path, "rb") as wf: chunk_size = 8000 # 250ms at 16kHz mono 16-bit while True: data = wf.readframes(chunk_size // 2) if not data: break await ws.send(data) await asyncio.sleep(0.1) # 3. Signal end await ws.send(json.dumps({"type": "eof"})) # 4. Collect results async for message in ws: msg = json.loads(message) if msg["type"] == "final": print(f"[confirmed] {msg['text']}") elif msg["type"] == "partial": print(f"[partial] {msg['text']}") elif msg["type"] == "result": print(f"\nFull transcript: {msg['text']}") break asyncio.run(transcribe_stream("audio.wav")) ``` # Add do-not-call numbers Source: https://docs.freyavoice.ai/api-reference/suppression-list/add-do-not-call-numbers https://staging-app.freyavoice.ai/api/openapi.json post /suppression-list Adds one or more numbers to the workspace's do-not-call list. Numbers already on the list are skipped (reported in `skipped`). # List do-not-call numbers Source: https://docs.freyavoice.ai/api-reference/suppression-list/list-do-not-call-numbers https://staging-app.freyavoice.ai/api/openapi.json get /suppression-list Returns the workspace's do-not-call (DNC) suppression list with pagination and search over numbers and reasons. Numbers on this list are blocked from outbound dialing. # Remove do-not-call numbers Source: https://docs.freyavoice.ai/api-reference/suppression-list/remove-do-not-call-numbers https://staging-app.freyavoice.ai/api/openapi.json delete /suppression-list Removes one or more numbers from the do-not-call list by ID. # Update a do-not-call number Source: https://docs.freyavoice.ai/api-reference/suppression-list/update-a-do-not-call-number https://staging-app.freyavoice.ai/api/openapi.json put /suppression-list Updates a single suppression entry by ID: its number and/or reason. # Text-to-Speech Source: https://docs.freyavoice.ai/api-reference/tts POST /v1/audio/speech Convert text into natural-sounding speech using Freya TTS ## Available Voices | Name | Code | Gender | Notes | | :-------- | :-------- | :----- | :------ | | **Leyla** | `leyla` | Female | Default | | Zeynep | `zeynep` | Female | - | | Alev | `alev` | Female | - | | Ali | `ali` | Male | - | | Alper | `alper` | Male | - | | Mustafa | `mustafa` | Male | - | # Archive unit test Source: https://docs.freyavoice.ai/api-reference/unit-tests/archive-unit-test https://staging-app.freyavoice.ai/api/openapi.json delete /unit-tests/{unitTestId} Soft-deletes a unit test by setting is_archived = true; historical runs stay queryable. # Create unit test Source: https://docs.freyavoice.ai/api-reference/unit-tests/create-unit-test https://staging-app.freyavoice.ai/api/openapi.json post /unit-tests Creates a new unit test against an agent or workflow snapshot. # Get unit test Source: https://docs.freyavoice.ai/api-reference/unit-tests/get-unit-test https://staging-app.freyavoice.ai/api/openapi.json get /unit-tests/{unitTestId} Returns a single unit test by ID. # Get unit-test run Source: https://docs.freyavoice.ai/api-reference/unit-tests/get-unit-test-run https://staging-app.freyavoice.ai/api/openapi.json get /unit-tests/runs/{runId} Returns a single unit-test run, including its verdict and metrics. # List unit-test runs Source: https://docs.freyavoice.ai/api-reference/unit-tests/list-unit-test-runs https://staging-app.freyavoice.ai/api/openapi.json get /unit-tests/{unitTestId}/runs Returns the non-stale runs for a unit test on a specific entity version (the run drill-down list). Requires agents:read or workflows:read. # List unit-test version runs Source: https://docs.freyavoice.ai/api-reference/unit-tests/list-unit-test-version-runs https://staging-app.freyavoice.ai/api/openapi.json get /unit-tests/version-runs Returns one summary per entity version that has at least one non-stale run, with run-level outcome counts folded in a single GROUP BY (no per-test fan-out), ordered newest-activity-first and paged. Backs the runs-oriented list. Requires agents:read or workflows:read. # List unit tests Source: https://docs.freyavoice.ai/api-reference/unit-tests/list-unit-tests https://staging-app.freyavoice.ai/api/openapi.json get /unit-tests Returns the unit tests for an agent or workflow, plus the latest run per (test, version) pair. # Run all unit tests Source: https://docs.freyavoice.ai/api-reference/unit-tests/run-all-unit-tests https://staging-app.freyavoice.ai/api/openapi.json post /unit-tests/run-all Enqueues a run for every active unit test on an agent or workflow, deduping against pending jobs. # Unit tests overview Source: https://docs.freyavoice.ai/api-reference/unit-tests/unit-tests-overview https://staging-app.freyavoice.ai/api/openapi.json get /unit-tests/overview Returns every non-archived unit test in the workspace grouped by entity, with each test's latest run aggregated against its entity's mainline head version. Requires agents:read or workflows:read. # Update unit test Source: https://docs.freyavoice.ai/api-reference/unit-tests/update-unit-test https://staging-app.freyavoice.ai/api/openapi.json patch /unit-tests/{unitTestId} Updates a unit test's name, expectation, input snapshot, ordinal, or archived flag. # Create version Source: https://docs.freyavoice.ai/api-reference/versions/create-version https://staging-app.freyavoice.ai/api/openapi.json post /versions/{entityType}/{entityId} Creates a new version of an entity with the provided configuration snapshot. For entities with a live working copy (agent, workflow) the snapshot is validated against that entity's config schema and applied to the working copy, so an invalid snapshot is rejected with 422. # Get version Source: https://docs.freyavoice.ai/api-reference/versions/get-version https://staging-app.freyavoice.ai/api/openapi.json get /versions/{entityType}/{entityId}/{versionId} Returns a specific version including full config snapshot. # Get version graph Source: https://docs.freyavoice.ai/api-reference/versions/get-version-graph https://staging-app.freyavoice.ai/api/openapi.json get /versions/{entityType}/{entityId}/graph Returns every commit (mainline + all branch commits) and every branch for an entity in one payload, for the full commit-graph history view. # List versions Source: https://docs.freyavoice.ai/api-reference/versions/list-versions https://staging-app.freyavoice.ai/api/openapi.json get /versions/{entityType}/{entityId} Returns version history for an entity (agent or workflow) with pagination. # Update version Source: https://docs.freyavoice.ai/api-reference/versions/update-version https://staging-app.freyavoice.ai/api/openapi.json put /versions/{entityType}/{entityId}/{versionId} Updates version metadata. # Call outcome webhook Source: https://docs.freyavoice.ai/api-reference/webhooks/call-outcome-webhook https://staging-app.freyavoice.ai/api/openapi.json post /webhooks/campaign-call-outcome Sent to the campaign's webhookUrl when a call completes or fails. **Payload Types:** - **WebhookCallOutcome**: Sent when a call completes (success or failure with ended_reason) - **WebhookApiError**: Sent when call initiation fails before a call is created **Failure Categories:** - `no_answer`: Customer didn't answer - `busy`: Line was busy - `voicemail`: Reached voicemail - `timeout`: Call timed out (infrastructure) - `api_error`: API call failed before call started - `llm_fail`: LLM evaluation failed (if successPrompt configured) - `other`: Unknown failure **Retry Behavior:** - If `willRetry: true`, check `retryScheduledAt` for next attempt time - Retries respect the campaign's schedule (activeDays, startTime, endTime, and daySchedules overrides) - `retriesRemaining` shows how many retries are left # End of call report webhook Source: https://docs.freyavoice.ai/api-reference/webhooks/end-of-call-report-webhook https://staging-app.freyavoice.ai/api/openapi.json post /webhooks/end-of-call-report Sent when a call completes with detailed information about the call. **Payload includes:** - Call identification (callId, workspaceId) - Call outcome (summary, endedReason, status) - Timing information (startedAt, endedAt, durationMs) - Call content (transcript, recordingUrl) - Customer information (customer phone number) This webhook provides comprehensive call data including AI-generated summaries, full transcripts, and recording URLs for post-call analysis and reporting. # Get workflow Source: https://docs.freyavoice.ai/api-reference/workflows/get-workflow https://staging-app.freyavoice.ai/api/openapi.json get /workflow/{workflowId} Returns detailed workflow information including nodes and canvas state. # List workflow templates Source: https://docs.freyavoice.ai/api-reference/workflows/list-workflow-templates https://staging-app.freyavoice.ai/api/openapi.json get /workflow/templates Returns available workflow templates for a workspace. # List workflows Source: https://docs.freyavoice.ai/api-reference/workflows/list-workflows https://staging-app.freyavoice.ai/api/openapi.json get /workflow Returns workflows for a workspace with pagination. # Get credits Source: https://docs.freyavoice.ai/api-reference/workspace-credits/get-credits https://staging-app.freyavoice.ai/api/openapi.json get /workspaces/{workspaceId}/credits Returns the current credit balance for the workspace. # Invite member Source: https://docs.freyavoice.ai/api-reference/workspace-invitations/invite-member https://staging-app.freyavoice.ai/api/openapi.json post /workspaces/invitations Sends an email invitation to join the workspace. The invitee can accept within 7 days. # List invitations Source: https://docs.freyavoice.ai/api-reference/workspace-invitations/list-invitations https://staging-app.freyavoice.ai/api/openapi.json get /workspaces/invitations Returns all pending invitations for the workspace. # Revoke invitation Source: https://docs.freyavoice.ai/api-reference/workspace-invitations/revoke-invitation https://staging-app.freyavoice.ai/api/openapi.json delete /workspaces/invitations Revokes a pending workspace invitation. # Get audit logs Source: https://docs.freyavoice.ai/api-reference/workspace-logs/get-audit-logs https://staging-app.freyavoice.ai/api/openapi.json get /workspaces/logs Returns audit log entries for workspace events (login, API key changes, member changes, exports, etc.). # Change member role Source: https://docs.freyavoice.ai/api-reference/workspace-members/change-member-role https://staging-app.freyavoice.ai/api/openapi.json patch /workspaces/members/role Assigns a workspace role to an existing member. The actor must hold the members:role-change permission and the target role must be assignable by their own role (you can't promote a member into a role that exceeds yours). System role assignment is allowed; system roles themselves are immutable. Effective immediately, on the member's next request. # List members Source: https://docs.freyavoice.ai/api-reference/workspace-members/list-members https://staging-app.freyavoice.ai/api/openapi.json get /workspaces/members Returns all members of the specified workspace with their roles. # Remove member Source: https://docs.freyavoice.ai/api-reference/workspace-members/remove-member https://staging-app.freyavoice.ai/api/openapi.json delete /workspaces/members Removes a member from the workspace. Admins can remove other members; members can remove themselves. # Update member Source: https://docs.freyavoice.ai/api-reference/workspace-members/update-member https://staging-app.freyavoice.ai/api/openapi.json patch /workspaces/members Updates the authenticated user's display name in the workspace. # Create workspace role Source: https://docs.freyavoice.ai/api-reference/workspace-roles/create-workspace-role https://staging-app.freyavoice.ai/api/openapi.json post /workspaces/{workspaceId}/roles Creates a new custom role. The actor can only grant permissions they themselves hold; `workspace:delete` cannot be assigned to a custom role. # Delete workspace role Source: https://docs.freyavoice.ai/api-reference/workspace-roles/delete-workspace-role https://staging-app.freyavoice.ai/api/openapi.json delete /workspaces/{workspaceId}/roles/{roleId} Deletes a custom role. System roles, the workspace's default role, and roles with assigned members all reject with 409. # List workspace roles Source: https://docs.freyavoice.ai/api-reference/workspace-roles/list-workspace-roles https://staging-app.freyavoice.ai/api/openapi.json get /workspaces/{workspaceId}/roles Returns every role for the workspace — three system roles (Owner / Admin / Member) plus any custom roles. # Update workspace role Source: https://docs.freyavoice.ai/api-reference/workspace-roles/update-workspace-role https://staging-app.freyavoice.ai/api/openapi.json patch /workspaces/{workspaceId}/roles/{roleId} Updates a custom role. System roles (Owner / Admin / Member) reject this with 409. Permission changes (additions or removals) take effect immediately, on each affected member's next request. # Create workspace Source: https://docs.freyavoice.ai/api-reference/workspaces/create-workspace https://staging-app.freyavoice.ai/api/openapi.json post /workspaces Creates a new workspace with the authenticated user as owner. # Delete workspace Source: https://docs.freyavoice.ai/api-reference/workspaces/delete-workspace https://staging-app.freyavoice.ai/api/openapi.json delete /workspaces Permanently deletes a workspace and all associated data. Only the workspace owner can delete. # List workspaces Source: https://docs.freyavoice.ai/api-reference/workspaces/list-workspaces https://staging-app.freyavoice.ai/api/openapi.json get /workspaces Returns all workspaces the authenticated user has access to, including settings and members. # Update workspace Source: https://docs.freyavoice.ai/api-reference/workspaces/update-workspace https://staging-app.freyavoice.ai/api/openapi.json put /workspaces Updates workspace name, logo, settings, or integration configuration. # Configuring Your Workspace Source: https://docs.freyavoice.ai/getting-started/configuring-workspace Learn how to configure workspace settings, team members, and preferences ## Overview After creating a workspace, you'll want to configure it to match your needs. This includes setting up workspace preferences, inviting team members, managing integrations, and configuring billing. ## Accessing Workspace Settings To access workspace settings: 1. Click on the **Settings** icon in the top navigation bar 2. Or navigate to `/workspace/settings` in your browser ## Workspace Configuration Options ### Basic Information Update your workspace's basic information: * **Workspace Name** - Change the name of your workspace * **Logo URL** - Update the workspace logo that appears in the header * **Integration Version** - Choose between v1 and v2 integration versions ### Workspace Settings Configure workspace-level preferences: Default language for the workspace. Options: English (en), Czech (cs), Spanish (es) Enable or disable outbound calling capabilities for this workspace Monthly credit allowance for the workspace Day of the month when credits reset (1-31) ### Team Members Manage who has access to your workspace: #### Inviting Members 1. Click **"Invite Member"** in the Members section 2. Enter the email address of the person you want to invite 3. Select their role: * **Admin** - Full access to all workspace features * **Member** - Can create and manage resources but can't modify workspace settings 4. Click **"Send Invitation"** The invited user will receive an email with an invitation link. Once they accept, they'll have access to the workspace. #### Managing Members * **View Members** - See all current workspace members and their roles * **Remove Members** - Remove team members from the workspace * **View Invitations** - See pending invitations and their status ### Assistant IDs Configure assistant IDs for workspace integrations. These are used to connect your workspace with external systems. ## Saving Changes After making any changes to workspace settings: 1. Click the **"Save"** button at the top of the settings page 2. Changes will be applied immediately 3. You'll see a success notification confirming the update ## Workspace Billing Access billing settings to: * View credit balance * Manage subscription plans * View usage history * Configure payment methods Navigate to **Workspace > Billing** to access billing settings. ## Best Practices Always save your changes after modifying workspace settings. Unsaved changes will be lost if you navigate away. Use descriptive workspace names to easily identify different projects or environments. Regularly review team member access to ensure only authorized users have access to your workspace. ## Next Steps Now that your workspace is configured, learn how to create your first AI agent. # Connect a Phone Number Source: https://docs.freyavoice.ai/getting-started/connect-phone-number Learn how to connect phone numbers to agents or workflows in Freya ## Overview After importing a phone number, you need to connect it to agents or workflows to start handling calls. This guide shows you how to configure phone number routing for both inbound and outbound calls. ## Accessing Phone Number Configuration ### Step 1: Navigate to Phone Numbers 1. Click on **"Phone Numbers"** in the sidebar navigation 2. Find the phone number you want to configure 3. Click the **"Edit"** button (three dots menu) on the phone number row ### Step 2: Open Configuration Dialog Clicking **"Edit"** opens the phone number configuration dialog where you can: * Set basic information (number, friendly name) * Choose configuration type (Agents or Workflows) * Configure inbound routing * Configure outbound routing ## Configuration Types Freya supports two configuration types for phone numbers: ### Agents Configuration Connect your phone number directly to AI agents: * **Inbound Agent** - Agent that handles incoming calls * **Outbound Agent** - Agent used for outbound calls ### Workflows Configuration Connect your phone number to workflows: * **Inbound Workflow** - Workflow that processes incoming calls * **Outbound Workflow** - Workflow used for outbound calls ## Configuring a Phone Number ### Step 1: Basic Information Fill in the basic details: The phone number (usually pre-filled from import) A descriptive name for this phone number (e.g., "Main Business Line", "Support Line") ### Step 2: Choose Configuration Type Select how you want to configure this number: **Agents:** * Best for simple setups * Direct connection to a single agent * Easier to manage **Workflows:** * Best for complex routing * Multiple agents and logic * More flexible ### Step 3: Configure Inbound Routing Set up how incoming calls are handled: #### For Agents Configuration: 1. Select **"Inbound Agent"** dropdown 2. Choose an agent from the list 3. Or select "No agent selected" to disable inbound calls #### For Workflows Configuration: 1. Select **"Inbound Workflow"** dropdown 2. Choose a workflow from the list 3. Or select "No workflow selected" to disable inbound calls ### Step 4: Configure Outbound Routing Set up how outbound calls are handled: #### For Agents Configuration: 1. Select **"Outbound Agent"** dropdown 2. Choose an agent from the list 3. Or select "No agent selected" to disable outbound calls #### For Workflows Configuration: 1. Select **"Outbound Workflow"** dropdown 2. Choose a workflow from the list 3. Or select "No workflow selected" to disable outbound calls ### Step 5: Save Configuration 1. Review your configuration 2. Click **"Create Phone Number"** or **"Update Phone Number"** 3. Your phone number is now configured and ready to use ## Phone Number Display After configuration, your phone number will show: * **Type** - Whether it's configured with Agents or Workflows * **Inbound Configuration** - Which agent/workflow handles inbound calls * **Outbound Configuration** - Which agent/workflow handles outbound calls * **Capabilities** - Voice, SMS icons indicating enabled features ## Configuration Examples ### Example 1: Simple Agent Setup ``` Phone Number: +1234567890 Friendly Name: Customer Support Line Configuration Type: Agents Inbound Agent: Customer Support Agent Outbound Agent: (None) ``` This setup handles all inbound calls with a single agent and doesn't allow outbound calls. ### Example 2: Workflow with Transfer ``` Phone Number: +1234567890 Friendly Name: Sales Line Configuration Type: Workflows Inbound Workflow: Sales Workflow (with agent and transfer logic) Outbound Workflow: Sales Outbound Campaign ``` This setup uses a workflow for both inbound and outbound calls, allowing for complex routing. ## Switching Configuration Types You can switch between Agents and Workflows: 1. Open the phone number configuration 2. Change the **"Configuration Type"** dropdown 3. Select new agents/workflows for inbound and outbound 4. Save the changes Switching configuration types will clear your previous agent/workflow selections. Make sure to select new ones before saving. ## Best Practices Use descriptive friendly names that indicate the phone number's purpose (e.g., "Support Line", "Sales Hotline"). Start with Agents configuration for simplicity, then upgrade to Workflows when you need more complex routing. You can use different agents/workflows for inbound and outbound calls to optimize for each use case. Make sure your selected agents or workflows exist and are properly configured before connecting them to phone numbers. ## Troubleshooting ### Agent/Workflow Not Available If an agent or workflow doesn't appear in the dropdown: 1. Verify it exists in your workspace 2. Check that it's not deleted or archived 3. Refresh the page and try again 4. Create the agent/workflow if it doesn't exist ### Configuration Not Saving If your configuration won't save: 1. Ensure all required fields are filled 2. Verify the phone number format is correct 3. Check that selected agents/workflows are valid 4. Try refreshing and reconfiguring ## Next Steps Learn how to test and start receiving inbound calls with your configured phone number. Learn how to start making outbound calls using your configured phone number. # Creating Your First Agent Source: https://docs.freyavoice.ai/getting-started/creating-agent Learn how to create and configure an AI voice agent in Freya ## Overview AI agents are the core of Freya. They are intelligent voice assistants that can handle phone conversations, understand natural language, and execute functions. This guide will walk you through creating your first agent. ## Creating an Agent ### Step 1: Navigate to Agents 1. Click on **"Agents"** in the sidebar navigation 2. If you don't have any agents yet, you'll see an empty state with a **"Create Agent"** button ### Step 2: Create a New Agent Click the **"Create Agent"** button. This will: 1. Create a new agent with default settings 2. Automatically redirect you to the agent configuration page 3. Open the agent editor where you can customize your agent ### Step 3: Configure Your Agent The agent configuration page allows you to customize: #### Basic Information * **Agent Name** - A descriptive name for your agent * **Description** - Optional description of what the agent does #### System Prompt The system prompt is the most important part of your agent. It defines: * The agent's personality and tone * What the agent can and cannot do * How the agent should respond to different situations * Instructions for handling edge cases The system prompt directly affects your agent's behavior. Take time to craft a clear, detailed prompt. #### Model Configuration Choose the AI model your agent will use: * **Model Provider** - Select from available providers (OpenAI, Anthropic, etc.) * **Model** - Choose the specific model (GPT-4, Claude, etc.) * **Temperature** - Control the randomness of responses (0-1) * **Max Tokens** - Maximum response length #### Voice Settings Configure how your agent sounds: * **Voice Provider** - Select a voice provider * **Voice** - Choose a specific voice * **Voice Speed** - Adjust speaking speed * **Voice Stability** - Control voice consistency #### Functions Add functions that your agent can call: * **Function Name** - Unique identifier for the function * **Description** - What the function does * **Parameters** - Input parameters the function accepts * **Endpoint** - API endpoint to call #### Advanced Settings * **First Message** - Optional greeting message * **Response Delay** - Delay before responding * **Max Duration** - Maximum call duration * **Language** - Agent's primary language ### Step 4: Save Your Agent 1. Click **"Save"** to save your agent configuration 2. Your agent is now ready to use 3. You can test it using the simulation feature ## Testing Your Agent Before connecting your agent to a phone number: 1. Navigate to the **Simulations** page 2. Create a test simulation 3. Make a test call to see how your agent performs 4. Iterate on the prompt and settings based on the results ## Agent Best Practices Start with a clear, specific system prompt. Be explicit about what the agent should and shouldn't do. Test your agent thoroughly before deploying it to production phone numbers. Use the AI Studio to iteratively improve your agent's prompt based on real conversations. ## Next Steps Learn how to use AI Studio to improve your agent's prompts and performance. Learn how to create workflows that combine multiple agents and logic. # Creating Your First Workflow Source: https://docs.freyavoice.ai/getting-started/creating-workflow Learn how to create and configure workflows in Freya ## Overview Workflows allow you to create complex call routing and processing logic by combining multiple agents, conditions, and integrations. Workflows are perfect for handling multi-step processes, conditional routing, and complex business logic. ## Creating a Workflow ### Step 1: Navigate to Workflows 1. Click on **"Workflows"** in the sidebar navigation 2. You'll see a list of all your workflows (or an empty state if you don't have any) ### Step 2: Create a New Workflow Click the **"Create Workflow"** button. You can also: * Click **"Create from Template"** to start from a pre-built template * Click **"Create Blank Workflow"** to start from scratch ### Step 3: Configure Your Workflow When you create a new workflow, you'll be taken to the workflow editor. Here you can: #### Basic Information * **Workflow Name** - A descriptive name for your workflow * **Description** - Optional description of what the workflow does * **Tags** - Add tags to organize your workflows #### Workflow Structure Workflows are built using nodes: * **Initial Node** - The starting point of your workflow * **Agent Nodes** - Connect to AI agents to handle conversations * **Function Nodes** - Execute custom functions or API calls * **Condition Nodes** - Route calls based on conditions * **Transfer Nodes** - Transfer to human agents or other systems #### Adding Nodes 1. Click **"Add Node"** in the workflow editor 2. Select the type of node you want to add 3. Configure the node's settings 4. Connect nodes by dragging from one node's output to another's input #### Configuring Nodes Each node type has different configuration options: **Agent Node:** * Select which agent to use * Configure agent-specific settings * Set response behavior **Function Node:** * Define the function to call * Set input parameters * Configure error handling **Condition Node:** * Define the condition to check * Set routing logic for true/false outcomes ### Step 4: Save Your Workflow 1. Click **"Save"** to save your workflow 2. Your workflow is now ready to be connected to phone numbers ## Workflow Templates Freya provides pre-built workflow templates to help you get started: * **Simple Agent** - Single agent workflow * **Agent with Transfer** - Agent that can transfer to humans * **Multi-Agent Routing** - Route calls to different agents based on conditions * **Function Integration** - Workflow with custom function calls ## Testing Workflows Before connecting your workflow to a phone number: 1. Use the workflow simulation feature 2. Test different scenarios and conditions 3. Verify that routing logic works as expected 4. Check that all integrations function properly ## Workflow Best Practices Start simple with a single agent node, then gradually add complexity as needed. Use descriptive names for nodes to make your workflow easy to understand. Test all conditional branches to ensure proper routing. Complex workflows can be difficult to debug. Start simple and add complexity incrementally. ## Copying Workflows You can copy existing workflows to: * Create variations of successful workflows * Use as templates for new workflows * Experiment without modifying the original 1. Click the **"Copy"** icon on any workflow card 2. The workflow will be duplicated with a new name 3. Edit the copy as needed ## Next Steps Learn how to import phone numbers from Twilio and other providers. Learn how to connect your phone numbers to agents or workflows. # Creating a Workspace Source: https://docs.freyavoice.ai/getting-started/creating-workspace Learn how to create your first workspace in Freya ## Overview A workspace is the foundation of your Freya setup. It organizes all your resources including agents, workflows, phone numbers, team members, and settings. When you first sign up for Freya, you'll need to create a workspace to get started. ## Creating Your First Workspace When you first log into Freya, you'll see a screen prompting you to create your first workspace. Here's how to do it: ### Step 1: Access the Workspace Creation Dialog If you don't have any workspaces yet, you'll automatically see the workspace creation screen. Otherwise, you can create a new workspace by: 1. Clicking on the workspace selector in the sidebar 2. Selecting "Create New Workspace" from the dropdown ### Step 2: Fill in Workspace Details The workspace creation dialog requires the following information: The name of your workspace. This will be displayed throughout the dashboard. Your display name - how you'd like to be addressed in this workspace. Optional URL to your workspace logo. This will be displayed in the header. Default language for the workspace (English, Czech, or Spanish). Defaults to English. ### Step 3: Create the Workspace Once you've filled in the required fields: 1. Click the **"Create Workspace"** button 2. Your workspace will be created and you'll be automatically switched to it 3. You'll be redirected to the home page ## Workspace Features After creating a workspace, you'll have access to: * **Agents** - Create and manage AI voice agents * **Workflows** - Build complex call routing workflows * **Phone Numbers** - Import and configure phone numbers * **Team Members** - Invite collaborators with different roles * **Settings** - Configure workspace preferences * **Billing** - Manage credits and subscriptions * **Analytics** - View call analytics and insights ## Multiple Workspaces You can create multiple workspaces to: * Separate different projects or clients * Organize by environment (development, staging, production) * Manage different teams or departments * Isolate resources for better organization Each workspace maintains its own: * Agents and workflows * Phone numbers * Team members and permissions * Settings and configurations * Credits and billing ## Next Steps Learn how to configure workspace settings, invite team members, and customize your workspace. # Import a Phone Number Source: https://docs.freyavoice.ai/getting-started/import-phone-number Learn how to import phone numbers from Twilio and other providers into Freya ## Overview Before you can start making and receiving calls, you need to import phone numbers into Freya. Freya supports importing phone numbers from various providers, with Twilio being the primary supported provider. ## Prerequisites Before importing a phone number, you need: 1. **A Twilio Account** - Sign up at [twilio.com](https://www.twilio.com) if you don't have one 2. **Twilio Phone Number** - Purchase or have a phone number in your Twilio account 3. **Twilio Integration Connected** - Connect your Twilio account in Freya's integrations page ## Connecting Twilio Integration Before you can import phone numbers, you must connect your Twilio account: ### Step 1: Navigate to Integrations 1. Click on **"Integrations"** in the sidebar navigation 2. Find the **Twilio** integration card ### Step 2: Connect Twilio 1. Click **"Connect"** on the Twilio integration 2. Enter your Twilio credentials: * **Account SID** - Found in your Twilio console * **Auth Token** - Found in your Twilio console 3. Click **"Save"** to connect Keep your Twilio credentials secure. Never share them publicly. ## Importing a Phone Number ### Step 1: Navigate to Phone Numbers 1. Click on **"Phone Numbers"** in the sidebar navigation 2. You'll see a list of all imported phone numbers ### Step 2: Start Import Process 1. Click the **"Import"** button in the top right 2. A modal will open showing available providers ### Step 3: Select Provider If Twilio is connected, you'll see: * **Twilio** - Available (if connected) * Other providers - May show as "Not Connected" Click on **Twilio** to proceed. ### Step 4: Enter Phone Number 1. Enter the phone number you want to import 2. Use the phone input field with country code selection 3. Or use raw input mode for custom formats 4. Click **"Import"** ### Step 5: Verify Import After clicking import: 1. Freya will fetch the phone number details from Twilio 2. The number will be added to your workspace 3. You'll see a success notification 4. The phone number will appear in your phone numbers list ## Imported Phone Number Details After importing, the phone number will have: * **Phone Number** - The actual number (e.g., +1234567890) * **Friendly Name** - A display name for the number * **Capabilities** - Voice, SMS, MMS, etc. * **Status** - Active, pending, etc. * **Provider** - Twilio or other provider ## Phone Number Configuration After importing, you'll need to: 1. **Configure the number** - Set up inbound and outbound routing 2. **Connect to agents/workflows** - Link the number to your AI agents or workflows 3. **Set capabilities** - Enable voice, SMS, etc. Learn how to connect your imported phone number to agents or workflows. ## Troubleshooting ### Twilio Not Connected If you see "Twilio Not Connected": 1. Navigate to **Integrations** 2. Connect your Twilio account 3. Verify your credentials are correct 4. Try importing again ### Phone Number Not Found If the import fails with "Phone number not found": 1. Verify the number exists in your Twilio account 2. Check that you're using the correct format (with country code) 3. Ensure the number is active in Twilio 4. Try using raw input mode with the exact Twilio format ### Import Errors If you encounter errors: 1. Check your Twilio account has sufficient credits 2. Verify your Twilio credentials are still valid 3. Check that the phone number hasn't been deleted in Twilio 4. Contact support if issues persist ## Best Practices Import all phone numbers you plan to use before configuring them. This makes setup easier. Use descriptive friendly names for phone numbers to easily identify their purpose. Imported phone numbers are linked to your Twilio account. If you disconnect Twilio, you may lose access to these numbers. ## Next Steps After importing, learn how to connect your phone number to agents or workflows. # Start Initiating Outbound Calls Source: https://docs.freyavoice.ai/getting-started/initiating-outbound-calls Learn how to start making outbound calls and running campaigns in Freya ## Overview Freya allows you to initiate outbound calls using your configured phone numbers and agents/workflows. This guide covers setting up outbound calling, creating campaigns, and managing outbound call operations. ## Prerequisites Before initiating outbound calls, ensure: 1. ✅ **Phone number configured** - Phone number is imported and has outbound routing set 2. ✅ **Outbound agent/workflow** - An agent or workflow is configured for outbound calls 3. ✅ **Outbound enabled** - Outbound calling is enabled in workspace settings 4. ✅ **Sufficient credits** - Your workspace has enough credits for outbound calls 5. ✅ **Twilio integration** - Twilio is connected and properly configured ## Enabling Outbound Calls ### Step 1: Check Workspace Settings 1. Navigate to **Workspace > Settings** 2. Find the **Workspace Settings** section 3. Ensure **"Outbound Enabled"** is checked 4. Save if you made changes ### Step 2: Configure Phone Number 1. Navigate to **Phone Numbers** 2. Edit your phone number 3. Set **"Outbound Agent"** or **"Outbound Workflow"** 4. Save the configuration ## Making Outbound Calls ### Method 1: One-Click Call Freya provides a one-click call feature for quick outbound calls: 1. Navigate to **One-Click Call** in the sidebar 2. Enter the phone number you want to call 3. Click **"Call"** 4. The call will be initiated using your configured outbound agent/workflow ### Method 2: Campaigns For larger-scale outbound calling, use campaigns: 1. Navigate to **Campaign** in the sidebar 2. Click **"Create Campaign"** 3. Configure campaign settings: * **Name** - Campaign name * **Phone Numbers** - List of numbers to call * **Agent/Workflow** - Which agent/workflow to use * **Schedule** - When to start calling 4. Launch the campaign ### Method 3: API You can also initiate calls programmatically using Freya's API: ```bash theme={null} POST /api/v2/call { "phoneNumber": "+1234567890", "customerPhoneNumber": "+0987654321", "agentId": "agent_123", "workspaceId": "workspace_456" } ``` ## Campaign Management ### Creating a Campaign 1. **Navigate to Campaigns** * Click **"Campaign"** in the sidebar * Click **"Create Campaign"** 2. **Configure Campaign** * **Name** - Descriptive campaign name * **Description** - Optional campaign description * **Phone Number** - Your outbound phone number * **Agent/Workflow** - Select the outbound agent or workflow * **Contact List** - Upload or enter phone numbers to call 3. **Set Campaign Parameters** * **Start Time** - When to begin calling * **Call Rate** - How many calls per hour * **Retry Logic** - How to handle failed calls * **Call Timeout** - Maximum call duration 4. **Launch Campaign** * Review configuration * Click **"Launch Campaign"** * Monitor progress in real-time ### Monitoring Campaigns Track campaign performance: 1. **Campaign Dashboard** * View active campaigns * See call statistics * Monitor success rates 2. **Call Logs** * View individual calls * Review call recordings * Analyze transcripts 3. **Analytics** * Campaign performance metrics * Success rates * Cost analysis ## Outbound Call Configuration ### Phone Number Settings When configuring outbound routing: The agent ID to use for outbound calls (if using Agents configuration) The workflow ID to use for outbound calls (if using Workflows configuration) ### Agent/Workflow Considerations For outbound calls, consider: * **Opening Message** - How the agent introduces itself * **Call Purpose** - Why you're calling (sales, support, etc.) * **Compliance** - Ensure compliance with calling regulations * **Opt-out Handling** - How to handle opt-out requests ## Best Practices Always test outbound calls with a small batch before launching large campaigns. Ensure your agent's opening message clearly identifies who is calling and why. Monitor call success rates and adjust your approach based on real data. Ensure compliance with local calling regulations (TCPA, GDPR, etc.) before making outbound calls. Respect opt-out requests immediately and maintain a do-not-call list. ## Troubleshooting ### Calls Not Initiating If outbound calls aren't starting: 1. **Check Workspace Settings** * Verify outbound is enabled * Check credit balance * Ensure workspace is active 2. **Verify Phone Number** * Confirm outbound routing is configured * Check phone number status * Verify Twilio integration 3. **Check Agent/Workflow** * Ensure outbound agent/workflow exists * Verify it's properly configured * Test it separately ### Low Success Rates If calls aren't connecting: 1. **Phone Number Validation** * Verify numbers are in correct format * Check for invalid numbers * Remove duplicates 2. **Call Timing** * Avoid calling outside business hours * Consider time zones * Respect calling restrictions 3. **Agent Performance** * Review call recordings * Analyze conversation quality * Improve agent prompts ## Compliance and Regulations When making outbound calls: * **TCPA Compliance** (US) - Obtain consent before calling * **GDPR Compliance** (EU) - Respect privacy regulations * **Do Not Call Lists** - Maintain and respect DNC lists * **Caller ID** - Use proper caller identification * **Opt-out** - Provide clear opt-out mechanisms ## Next Steps Monitor your outbound call performance and campaign analytics. Review individual calls and analyze performance. # Iterate Your Agents Source: https://docs.freyavoice.ai/getting-started/iterating-agents Learn how to use AI Studio to improve your agent prompts and performance ## Overview AI Studio is a powerful tool in Freya that helps you iteratively improve your agent's system prompt. Using AI assistance, you can refine prompts, add instructions, improve clarity, and optimize performance without manually editing long prompts. ## Accessing AI Studio To open AI Studio: 1. Navigate to an agent's configuration page 2. Find the **System Prompt** section 3. Click the **"AI Studio"** button (usually represented by a sparkles or magic wand icon) ## AI Studio Interface AI Studio opens in a split-screen modal with two panels: ### Left Panel: AI Assistant Chat The left panel contains a chat interface where you can: * **Ask for improvements** - Request specific changes to your prompt * **Get suggestions** - Ask the AI to suggest improvements * **Iterate on changes** - Refine prompts through conversation * **View thinking process** - See how the AI analyzes and improves your prompt ### Right Panel: Prompt Editor The right panel shows: * **Current Prompt** - Your agent's system prompt * **Live Updates** - Changes made by the AI assistant in real-time * **Direct Editing** - You can also edit the prompt manually ## Using AI Studio ### Step 1: Describe What You Want In the chat interface, describe what you want to change or improve. For example: * "Make the prompt more professional" * "Add instructions for handling angry customers" * "Improve clarity and remove ambiguity" * "Add context about our company's return policy" * "Make the agent sound more friendly and conversational" ### Step 2: Review AI Suggestions The AI assistant will: 1. Analyze your current prompt 2. Understand your request 3. Generate an improved version 4. Show you the changes in real-time ### Step 3: Iterate and Refine You can: * **Ask for more changes** - Request additional modifications * **Accept the changes** - Use the improved prompt * **Reject and try again** - Ask for a different approach * **Manually edit** - Make your own adjustments in the editor ### Step 4: Save Your Changes Once you're satisfied with the improved prompt: 1. Review the final prompt in the editor 2. Click **"Save"** to apply the changes to your agent 3. The AI Studio will close and your agent will be updated ## AI Studio Features ### Thinking Process AI Studio shows you the AI's thinking process: * **Evaluation Phase** - How the AI analyzes your current prompt * **Planning Phase** - What changes the AI plans to make * **Execution Phase** - The actual improvements being made This transparency helps you understand how your prompt is being improved. ### Copy Prompt You can copy the improved prompt at any time: 1. Click the **"Copy"** button in the prompt editor 2. The prompt will be copied to your clipboard 3. You can paste it elsewhere or use it in other agents ### Variable Support AI Studio understands Freya's variable syntax: * Use `{{variable}}` for dynamic values * The AI will preserve these variables in the improved prompt * Variables are highlighted in the editor ## Best Practices Be specific about what you want to change. Vague requests lead to less useful improvements. Iterate in small steps. Make one type of improvement at a time for better results. Test your agent after making changes to ensure the improvements work as expected. Always review AI-generated changes before saving. The AI is helpful but may not always understand your exact requirements. ## Example Use Cases ### Making Prompts More Professional ``` You: "Make this prompt sound more professional and business-appropriate" AI: [Analyzes prompt and suggests more formal language, removes casual phrases, adds professional tone] ``` ### Adding Specific Instructions ``` You: "Add instructions for handling customers who want to cancel their subscription" AI: [Adds a new section with specific cancellation handling instructions] ``` ### Improving Clarity ``` You: "This prompt is confusing. Make it clearer and easier to understand" AI: [Restructures prompt, simplifies language, adds clear sections] ``` ## Next Steps Once your agent is optimized, connect it to a phone number to start receiving calls. # Start Receiving Inbound Calls Source: https://docs.freyavoice.ai/getting-started/receiving-inbound-calls Learn how to test and start receiving inbound calls with your configured phone number ## Overview Once you've imported a phone number and connected it to an agent or workflow, you're ready to start receiving inbound calls. This guide covers testing your setup and ensuring everything works correctly. ## Prerequisites Before receiving inbound calls, make sure you have: 1. ✅ **Imported a phone number** - Phone number is imported from Twilio or another provider 2. ✅ **Connected the phone number** - Phone number is configured with an inbound agent or workflow 3. ✅ **Agent/Workflow is ready** - Your agent or workflow is properly configured and tested 4. ✅ **Twilio integration active** - Twilio webhooks are properly configured (if using Twilio) ## Testing Your Setup Before going live, test your inbound call setup: ### Step 1: Verify Configuration Check that your phone number is properly configured: 1. Navigate to **Phone Numbers** 2. Find your phone number 3. Verify it shows: * ✅ Type (Agents or Workflows) * ✅ Inbound agent/workflow is selected * ✅ Status is active ### Step 2: Test with Simulation Use Freya's simulation feature to test: 1. Navigate to **Simulations** 2. Create a new simulation 3. Select your phone number 4. Make a test call 5. Verify the agent/workflow responds correctly ### Step 3: Make a Test Call Call your phone number from another phone: 1. Dial the phone number you configured 2. The call should connect to your agent/workflow 3. Test a conversation to ensure everything works 4. Check the call logs to verify the call was recorded ## Monitoring Inbound Calls ### Viewing Call Logs Track all inbound calls: 1. Navigate to **Calls** in the sidebar 2. View the list of all calls 3. Filter by: * Phone number * Date range * Call status * Agent/workflow used ### Call Details Click on any call to see: * **Call Recording** - Listen to the full conversation * **Transcript** - Read the conversation transcript * **Agent Performance** - See how your agent handled the call * **Metadata** - Call duration, timestamps, etc. ## Troubleshooting ### Calls Not Connecting If calls aren't connecting: 1. **Check Twilio Configuration** * Verify webhooks are set correctly in Twilio * Ensure Twilio integration is still connected * Check Twilio account status 2. **Verify Phone Number Status** * Confirm the number is active in Freya * Check that inbound routing is configured * Ensure agent/workflow exists and is active 3. **Check Call Logs** * Look for error messages in call logs * Check if calls are being received but failing * Review any error notifications ### Agent Not Responding If the agent doesn't respond: 1. **Check Agent Configuration** * Verify the agent is properly configured * Ensure the system prompt is set * Check that the model is selected 2. **Test Agent Separately** * Use simulations to test the agent * Verify the agent works outside of phone calls * Check for configuration errors 3. **Review Call Transcripts** * See what the agent heard * Check if there were any errors * Verify the conversation flow ### Poor Call Quality If call quality is poor: 1. **Check Network Connection** * Ensure stable internet connection * Verify Twilio connection quality * Check for network issues 2. **Review Voice Settings** * Adjust voice provider settings * Try different voice options * Check voice speed and stability 3. **Monitor Call Metrics** * Check call duration * Review drop rates * Analyze quality metrics ## Best Practices Always test your setup with simulations before going live with real calls. Monitor call logs regularly to identify issues early and improve agent performance. Start with simple agent configurations and gradually add complexity as you gain experience. Make sure your agent is properly configured before connecting it to a production phone number. Test thoroughly first. ## Going Live Once you've tested and verified everything works: 1. **Monitor First Calls** - Watch the first few real calls closely 2. **Review Performance** - Check how your agent handles real conversations 3. **Iterate Quickly** - Make adjustments based on real call data 4. **Scale Gradually** - Start with one number and expand as you gain confidence ## Next Steps Learn how to start making outbound calls and running campaigns. Monitor your call performance and agent analytics. # Embed SDK Source: https://docs.freyavoice.ai/guides/embed/overview Add a Freya voice or chat agent to any web page — full control over your UI, powered by WebRTC under the hood ## Overview The Freya Client SDK connects a Freya agent directly from the browser. You build whatever UI you want; the SDK handles WebRTC transport, microphone input, remote audio playback, and the real-time event stream between the page and the agent. The SDK is loaded as a script tag — no build step or package manager required. ## How it works The connection flow has two parts: your backend mints a short-lived token, and the browser uses that token to open a WebRTC session. 1. The user does something on your page that should start a session (a button click, a page load, etc.) 2. Your page calls your own backend — never the Freya API directly 3. Your backend calls `POST /api/token/embed` with your API key and returns the token to the browser 4. The browser passes the token to `FreyaClient`, which connects to the agent over WebRTC 5. Events fire as the conversation unfolds — transcripts, speaking state, tool calls — and you handle them however your UI needs The API key never reaches the browser. The token is scoped to a single session and expires on its own. ## Minting a token Token minting must happen server-side. The API key used must have the **Issue web call tokens** permission (`calls:web-token`), which allows it to mint tokens for in-browser calls and external embed integrations. You can set this when creating a key from the **API Keys** button in the sidebar. ```python Python (FastAPI) theme={null} import requests @app.get("/api/assistant-token") def assistant_token(request: Request): resp = requests.post( f"{FREYA_BASE_URL}/api/token/embed", json={ "agentId": AGENT_ID, "allowedOrigin": f"{request.url.scheme}://{request.headers['host']}", "ttlSeconds": 300, }, headers={"Authorization": f"Bearer {API_KEY}"}, ) resp.raise_for_status() return resp.json() ``` ```javascript Node.js (Express) theme={null} app.get('/api/assistant-token', async (req, res) => { const resp = await fetch(`${process.env.FREYA_BASE_URL}/api/token/embed`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${process.env.FREYA_API_KEY}`, }, body: JSON.stringify({ agentId: process.env.FREYA_AGENT_ID, allowedOrigin: `${req.protocol}://${req.get('host')}`, ttlSeconds: 300, }), }); res.json(await resp.json()); }); ``` The response contains `token`, `expiresAt`, and `baseUrl`. Pass all three to `FreyaClient`. If your users are behind firewalls or strict NAT, also fetch TURN credentials server-to-server from `GET /api/token/webrtc/ice-servers` and forward them alongside the token. This saves a round-trip from the browser and keeps TURN credentials off the client. ## Installation Add the script to your page. The SDK is served directly from the Freya dashboard: ```html theme={null} ``` This exposes `window.Freya.FreyaClient` globally. No build step, bundler, or package manager is needed. ## Quick start ```html theme={null} ``` ## Configuration | Option | Type | Required | Default | Description | | ------------------- | ------------------------- | -------- | -------- | ------------------------------------------------------------ | | `baseUrl` | `string` | Yes | — | Freya API origin returned by the token endpoint | | `token` | `string` | Yes | — | Short-lived embed JWT | | `mode` | `"call"` \| `"chat"` | No | `"call"` | `"call"` activates the microphone; `"chat"` is text-only | | `metadata` | `Record` | No | `{}` | Arbitrary key-value pairs forwarded to the agent session | | `customerVariables` | `Record` | No | `{}` | Variables injected into the agent's system prompt at runtime | | `iceServers` | `RTCIceServer[]` | No | `[]` | TURN/STUN servers for production deployments | ## Modes ### Call mode The microphone is activated when `connect()` resolves. The agent hears the user in real time and responds with voice. This is the default. ```javascript theme={null} const { FreyaClient } = window.Freya; const client = new FreyaClient({ baseUrl, token }); // mode: "call" by default ``` ### Chat mode The microphone stays off. Send text with `sendMessage()` and listen to `botLlmText` or `botTranscript` for the agent's response. If the agent has TTS configured, audio is still played. ```javascript theme={null} const { FreyaClient } = window.Freya; const client = new FreyaClient({ baseUrl, token, mode: 'chat' }); await client.connect(); await client.sendMessage('What are your opening hours?'); ``` ## Token lifecycle * Tokens expire after `ttlSeconds` (default 300 seconds). Mint a fresh one each time the user starts a new session rather than caching across page loads. * Set `allowedOrigin` on the server to the exact origin of the embedding page. The Freya backend rejects WebRTC connection attempts from other origins. * Tokens are single-use for establishing a session. Once a session is open the token is consumed. ## Next steps Full reference for all FreyaClient methods, events, and their payloads. Configure the agent your embed session connects to — voice, system prompt, and tools. # Client Reference Source: https://docs.freyavoice.ai/guides/embed/reference Complete reference for FreyaClient methods, properties, and events `FreyaClient` is the main class exposed by the SDK. Access it via `window.Freya.FreyaClient` after loading the script. ```javascript theme={null} const { FreyaClient } = window.Freya; const client = new FreyaClient({ baseUrl, token }); ``` *** ## Methods ### `connect()` Opens the WebRTC session and, in call mode, activates the microphone. Returns a promise that resolves once the connection is established. ```javascript theme={null} await client.connect(); ``` Throws if called while already connected. Call `disconnect()` first if you need to start a new session. *** ### `disconnect()` Ends the current session and releases all media resources. Safe to call multiple times — subsequent calls after the session is already closed are no-ops. ```javascript theme={null} await client.disconnect(); ``` *** ### `sendMessage(text)` Sends a text message to the agent. Primarily used in `"chat"` mode, where the microphone is off and the user communicates by typing. ```javascript theme={null} await client.sendMessage('What are your opening hours?'); ``` | Parameter | Type | Description | | --------- | -------- | -------------------------------- | | `text` | `string` | The message to send to the agent | *** ### `mute()` Stops sending microphone audio to the agent without disconnecting the session. Has no effect in `"chat"` mode. ```javascript theme={null} client.mute(); ``` *** ### `unmute()` Resumes sending microphone audio after a call to `mute()`. ```javascript theme={null} client.unmute(); ``` *** ### `on(event, handler)` Registers a handler for the given event. Returns the client instance so calls can be chained. ```javascript theme={null} client.on('botTranscript', ({ text }) => { console.log(text); }); ``` See [Events](#events) below for the full list. *** ### `off(event, handler)` Removes a previously registered handler. The `handler` reference must be the same function passed to `on()`. ```javascript theme={null} const handler = ({ text }) => console.log(text); client.on('botTranscript', handler); // Later: client.off('botTranscript', handler); ``` *** ## Properties ### `state` The current transport state as a string. Reflects the underlying WebRTC connection lifecycle. | Value | Description | | ---------------- | ------------------------------------------ | | `"connecting"` | Session is being established | | `"connected"` | WebRTC handshake complete | | `"ready"` | Agent is initialized and ready to interact | | `"disconnected"` | Session has ended | ```javascript theme={null} console.log(client.state); // "ready" ``` *** ### `isMicEnabled` Boolean. `true` when the microphone is active and sending audio. Always `false` in `"chat"` mode and when the session is not connected. ```javascript theme={null} if (!client.isMicEnabled) { showMutedIndicator(); } ``` *** ## Events Register handlers with `client.on(event, handler)` and remove them with `client.off(event, handler)`. All handlers receive a single payload argument (or none, for events with no data). ### Connection events #### `stateChanged` Fires whenever the connection state changes. Use this to drive loading indicators, connected states, and error UI. ```javascript theme={null} client.on('stateChanged', (state) => { // state: "connecting" | "connected" | "ready" | "disconnected" }); ``` | Payload | Type | | ------- | ---------------------------------------------------------------- | | `state` | `"connecting"` \| `"connected"` \| `"ready"` \| `"disconnected"` | *** #### `disconnected` Fires when the session ends, whether closed locally via `disconnect()` or terminated remotely. No payload. ```javascript theme={null} client.on('disconnected', () => { resetUI(); }); ``` *** #### `error` Fires when an error occurs. When `fatal` is `true` the session has already ended — you do not need to call `disconnect()`. ```javascript theme={null} client.on('error', ({ message, fatal }) => { showError(message); if (fatal) resetUI(); }); ``` | Payload field | Type | Description | | ------------- | --------- | ----------------------------------------- | | `message` | `string` | Human-readable error description | | `fatal` | `boolean` | Whether the session has ended as a result | *** ### Agent speech events #### `botReady` Fires once after `connect()` when the agent has fully initialized and is ready to receive input. No payload. ```javascript theme={null} client.on('botReady', () => { enableInputControls(); }); ``` *** #### `botStartedSpeaking` Fires when the agent begins a spoken response. No payload. Use this to show a speaking indicator or pause user input. ```javascript theme={null} client.on('botStartedSpeaking', () => { showSpeakingIndicator(); }); ``` *** #### `botStoppedSpeaking` Fires when the agent finishes speaking. No payload. Use this to seal the current transcript turn and reset streaming state. ```javascript theme={null} client.on('botStoppedSpeaking', () => { hideSpeakingIndicator(); sealCurrentTurn(); }); ``` *** #### `botLlmText` Fires for each token as the LLM generates its response. Concatenate the `text` values to build the full message in real time. Stops firing before `botStoppedSpeaking`. ```javascript theme={null} let buffer = ''; client.on('botLlmText', ({ text }) => { buffer += text; renderStreamingMessage(buffer); }); client.on('botStoppedSpeaking', () => { buffer = ''; }); ``` | Payload field | Type | Description | | ------------- | -------- | ------------------------------------------- | | `text` | `string` | A single LLM output token or token fragment | *** #### `botTranscript` Fires once per agent turn with the complete response text, after the agent finishes speaking. Use this instead of `botLlmText` if you only need the final result rather than a streaming view. ```javascript theme={null} client.on('botTranscript', ({ text }) => { appendMessage('agent', text); }); ``` | Payload field | Type | Description | | ------------- | -------- | ----------------------------------------- | | `text` | `string` | The complete agent response for this turn | *** #### `botOutput` Fires with TTS-level text chunks. Only fires when LLM streaming (`botLlmText`) is not available. In most configurations you can ignore this event and use `botLlmText` / `botTranscript` instead. | Payload field | Type | Description | | ------------- | --------- | ---------------------------------- | | `text` | `string` | The spoken text chunk | | `spoken` | `boolean` | Whether this chunk was sent to TTS | *** ### User speech events #### `userStartedSpeaking` Fires when voice activity is detected from the user's microphone. No payload. Use this to show a recording indicator. ```javascript theme={null} client.on('userStartedSpeaking', () => { showRecordingIndicator(); }); ``` *** #### `userStoppedSpeaking` Fires when the user's voice activity stops. No payload. ```javascript theme={null} client.on('userStoppedSpeaking', () => { hideRecordingIndicator(); }); ``` *** #### `userTranscript` Fires with the transcription of the user's speech. Partial results arrive with `final: false` as the user speaks; the completed turn arrives with `final: true`. ```javascript theme={null} client.on('userTranscript', ({ text, final }) => { if (final) { appendMessage('user', text); } }); ``` | Payload field | Type | Description | | ------------- | --------- | ----------------------------------------- | | `text` | `string` | Transcription of the user's speech so far | | `final` | `boolean` | `true` when the user's turn is complete | *** ### Tool call events #### `toolCallStarted` Fires when the agent decides to invoke a tool, before arguments are assembled. | Payload field | Type | Description | | --------------- | --------- | ------------------------------------ | | `function_name` | `string?` | The name of the tool being called | | `tool_call_id` | `string?` | Unique identifier for this tool call | *** #### `toolCallInProgress` Fires once the agent has fully assembled the arguments for a tool call. This is the right place to update your UI in response to agent actions — you know exactly what the agent is about to do. ```javascript theme={null} client.on('toolCallInProgress', ({ function_name, arguments: args }) => { if (function_name === 'navigate') { showPage(args.page); } if (function_name === 'update_balance') { setBalance(args.amount); } }); ``` | Payload field | Type | Description | | --------------- | ------------------------- | ------------------------------------ | | `function_name` | `string` | The name of the tool being called | | `tool_call_id` | `string` | Unique identifier for this tool call | | `arguments` | `Record` | The fully assembled arguments object | *** #### `toolCallStopped` Fires when a tool call completes. | Payload field | Type | Description | | --------------- | --------- | ---------------------------------------- | | `function_name` | `string?` | The name of the tool that was called | | `tool_call_id` | `string?` | Unique identifier for the completed call | *** ### Media track events #### `trackStarted` Fires when a remote media track becomes active. The SDK handles remote audio playback automatically — you only need this event if you want access to the raw `MediaStreamTrack` for custom processing. | Payload | Type | | ------- | ------------------ | | `track` | `MediaStreamTrack` | *** #### `trackStopped` Fires when a remote media track ends. | Payload | Type | | ------- | ------------------ | | `track` | `MediaStreamTrack` | # Analytics Source: https://docs.freyavoice.ai/guides/features/analytics Track call performance, visualize trends, and build custom dashboards with structured data widgets ## What is Analytics? The Analytics page is your central hub for understanding how your voice agents are performing. It gives you a real-time view of call volume, duration, sentiment, outcomes, and conversation themes — all filterable by date range, call type, and phone number. Beyond the built-in call metrics, you can create custom widgets that visualize structured data collected during calls, letting you track the business-specific metrics that matter most to your team. ## The Two Tabs Analytics is split into two views, each serving a different purpose: | Tab | Purpose | | ------------------- | -------------------------------------------------------------------------------------------------- | | **Calls** | Pre-built charts for call volume, duration, status breakdown, and detected themes | | **Structured Data** | Custom widgets you build yourself, powered by the structured data your agents collect during calls | Switch between them using the tab bar at the top of the page. Filters like date range and call type are shared across both tabs. ## Calls Tab The Calls tab gives you three metric cards, a status breakdown, and a theme map — all updating in real time as new calls come in. ### Metric Cards Three interactive cards sit at the top of the page. Click any card to select it and see its trend chart below: **Total Calls** shows the number of calls in the selected period, with a percentage change compared to the previous equivalent period. When selected, the chart below breaks down calls by **caller sentiment** — Very Happy, Happy, Neutral, Unhappy, Very Unhappy, and Untagged — displayed as a stacked stream chart so you can see how sentiment shifts over time. **Average Duration** displays the mean call length in MM:SS format with a trend line chart. This helps you spot whether calls are getting longer (potentially more complex issues) or shorter (potentially more efficient handling). **Total Talk Time** shows cumulative minutes across all calls. This is useful for capacity planning and understanding overall agent utilization. Each card includes a percentage indicator showing the change from the previous period, so you can tell at a glance whether a metric is trending up or down. ### Call Status Breakdown A pie chart shows how calls ended — Connected, Abandoned, Failed, Voicemail, and other outcomes. Each slice displays its percentage (hidden for slices under 5% to keep the chart readable), and a legend below shows the exact count for each status. This is the fastest way to spot problems. If your "Failed" or "Abandoned" slice suddenly grows, something needs attention — maybe a provider issue, a misconfigured agent, or an unexpected spike in traffic. ### Call Themes A treemap visualization shows the top 15 conversation themes detected across your calls. Larger blocks represent more frequently occurring themes, giving you an instant read on what callers are asking about most. If no themes have been detected yet, the card displays a "No themes detected" message. Themes are generated automatically from call transcripts. ## Structured Data Tab The Structured Data tab is a blank canvas where workspace admins can build custom widgets that visualize the data agents collect during calls — things like customer satisfaction ratings, deal values, issue categories, or any other structured field you've defined in **Insights**. ### Creating a Widget 1. Click the **Add Widget** button in the filter bar (visible to admins only) 2. Give the widget a **name** and optional **description** 3. Select the **structured data source** — this is the Insight definition your agents report against 4. Choose a **chart type** based on your data: | Chart Type | Best For | Field Types | | --------------- | ----------------------------------- | ------------ | | **Area** | Trends over time (averages) | Numeric only | | **Stream** | Composition changes over time | Numeric only | | **Stacked Bar** | Comparing categories across periods | Numeric only | | **Radar** | Multi-dimensional comparison | Numeric only | | **Pie** | Proportional breakdown | All types | | **Donut** | Same as pie with a cleaner look | All types | | **Treemap** | Hierarchical volume comparison | All types | 5. For charts that support it (Area, Stacked Bar, Stream, Radar), you can enable **multi-field selection** to plot several numeric fields on the same chart 6. Optionally filter by specific **agents** if you only want data from certain agents 7. Pick a **color theme** — Ocean, Purple, Forest, Sunset, or Rainbow 8. Set a **default date range** for the widget, or leave it to follow the global filter ### Managing Widgets Once created, widgets appear as cards on the Structured Data tab. You can: * **Drag and drop** widgets to reorder them into rows * **Edit** any widget to change its chart type, data source, or filters * **Delete** widgets you no longer need Each widget can have its own date range preset. When a widget uses a custom range instead of the global filter, a label appears showing which preset is active — so you always know what time window you're looking at. Only workspace admins (owners and members with the admin role) can create, edit, or delete widgets. All other members can view them. ## Shared Filters Both tabs share a filter bar with the following controls: * **Date Range** — Preset options like "Last 7 Days", "Last 30 Days", or a custom range. The system automatically picks an appropriate granularity (hourly, daily, weekly, monthly) based on the range you select. * **View Mode** — Toggle between **Regular** and **Cumulative** to see values per-period or as a running total. Cumulative mode is useful for tracking progress toward targets. * **Call Type** — Multi-select filter for inbound, outbound, and other call types. Shows "All Call Types" when nothing is selected, or a count like "2 selected" when filtered. * **Phone Number** — Filter to a specific phone number to isolate its performance. * **Refresh** — Manually reload the data if you want the latest numbers without waiting for the auto-refresh cycle. ## Best Practices * **Start with the Calls tab for daily health checks.** The three metric cards and status pie give you an instant pulse on system health. Make it a habit to check these at the start of each day. * **Use the themes treemap to inform agent training.** If you notice a theme appearing frequently that your agents aren't handling well, update the agent's system prompt or add relevant content to the Knowledgebase. * **Build Structured Data widgets for business KPIs.** The Calls tab tells you about call operations; the Structured Data tab tells you about business outcomes. Create widgets for the metrics your stakeholders care about — conversion rates, satisfaction scores, issue resolution. * **Set widget-specific date ranges for dashboards.** If you have a widget tracking weekly targets, set it to "This Week" so it always shows current progress regardless of the global date filter. * **Filter by phone number to compare lines.** If you have different numbers for different purposes (support vs. sales), filter by number to compare performance across lines. ## Next Steps Define structured data fields that your agents collect during calls — the data that powers Structured Data widgets. Launch outbound calling campaigns and track their performance in Analytics. # Campaigns Source: https://docs.freyavoice.ai/guides/features/campaigns Launch outbound calling campaigns to reach customers at scale — with scheduling, retries, and real-time progress tracking ## What are Campaigns? Campaigns let you make outbound calls to a list of customers automatically. You provide the phone numbers, choose which agent handles the conversation, set a schedule, and Freya works through the list — calling each customer, handling retries for failed attempts, and tracking progress in real time. Common use cases include appointment reminders, payment follow-ups, customer surveys, sales outreach, and service notifications. ## Campaign Lifecycle Every campaign moves through a series of statuses as it progresses: | Status | Meaning | | ----------------------- | ----------------------------------------------------------------------------------------------------- | | **Draft** | Campaign is created but hasn't started yet. You can still edit everything. | | **Scheduled** | Campaign is configured with a future start date and waiting to begin. | | **Active** | Campaign is currently making calls. | | **Completed** | All customers have been called and all retries exhausted. | | **Partially Completed** | Some calls failed and retries are exhausted, but not all customers were reached. You can retry these. | ## Creating a Campaign ### 1. Name and Description Give your campaign a clear name so you can identify it later in the list. The name defaults to today's date, but you should use something descriptive — like "April Payment Reminders" or "Product Launch Outreach". The description is optional but helpful for team context. ### 2. Select a Phone Number Choose which phone number Freya will call from. The dropdown only shows numbers that have **outbound SIP enabled** and an **agent or workflow configured** — if your number doesn't appear, check its configuration on the Phone Numbers page. The phone number you pick determines which agent is pre-selected in the next step, based on the outbound agent configured for that number. ### 3. Choose an Agent Select the agent that will handle conversations during the campaign. This is auto-populated from the phone number's outbound agent, but you can change it. If your agent uses **variables** in its system prompt (like `{{customer_name}}` or `{{appointment_date}}`), those variables appear as columns in the customer table so you can provide personalized data for each call. ### 4. Add Customers The customer table is where you enter the phone numbers to call. Each row represents one customer: * **Phone number** (required) — the number to dial, in any common format * **Custom properties** — additional columns appear automatically based on variables detected in your agent's prompt Freya normalizes all phone numbers to **E.164 format** automatically. Use the country picker to set a default country code for numbers entered without one — for example, if you enter "555-1234" with the US country selected, it becomes "+15551234". The system validates for duplicates and empty numbers before you can start the campaign. If two rows have the same phone number, you'll be prompted to fix it. ### 5. Configure the Schedule By default, campaigns start calling immediately. To schedule calls for later: * **Start Date** — the first day calls will be made * **Start Time / End Time** — the daily calling window (e.g., 9:00 AM to 6:00 PM) * **Active Days** — which days of the week calls can happen (all seven enabled by default) * **Timezone** — auto-detected from your browser, used for all schedule calculations The summary at the bottom of the form shows exactly when calling will begin — either "Starting immediately" or "Starting on \[date] at \[time]". ### 6. Set Up Retries If a call fails (busy signal, no answer, network error), Freya can automatically retry: * **Call Retries** — number of retry attempts per customer (0–10, default 0) * **Retry Delay** — seconds to wait between attempts (default 300 seconds / 5 minutes) * **Retry Conditions** — which call outcomes trigger a retry (specific SIP codes and end reasons) Retries respect the active days and calling window — they won't happen outside your configured schedule. ### 7. Webhook (Optional) Under **Advanced Settings**, you can provide a webhook URL that receives a callback for each call as it completes. This is useful for updating external CRMs or triggering follow-up workflows in other systems. ### 8. Review and Start The form shows a summary of your configuration — how many calls are queued, when they'll start, and the calling window. Click **Start Campaign** and confirm in the dialog to begin. ## Managing Campaigns ### The Campaign List The campaigns page shows all your campaigns in a table with: * **Campaign name** and description * **Status** badge (Draft, Active, Scheduled, Completed, Partially Completed) * **Phone Numbers** — the number of customers in the campaign * **Created date** Use the status filter buttons above the table to quickly narrow down to campaigns in a specific state. ### Campaign Actions Right-click a campaign or use the actions menu to: * **Duplicate** — create a copy of an existing campaign with the same configuration, useful for running similar campaigns with different customer lists * **Retry** — available for Partially Completed campaigns, re-queues the customers that weren't successfully reached * **Delete** — permanently remove a campaign (with confirmation) * **Export to CSV** — download campaign data for reporting or external analysis You can also select multiple campaigns using the checkboxes for **bulk delete** operations. ### Quick Campaign For simple campaigns that don't need detailed scheduling, the **Quick Campaign** option opens a streamlined modal where you can set up and launch a campaign in seconds — just pick a number, add customers, and go. ## Best Practices * **Name campaigns descriptively.** You'll accumulate campaigns over time. Names like "2026-04 Appointment Reminders - Dental" are much easier to find than "Campaign 47". * **Test with a small list first.** Before launching a campaign to hundreds of customers, run it with 2–3 test numbers to verify the agent handles the conversation correctly and the variables are populated as expected. * **Set reasonable calling windows.** Nobody wants a robot call at 7 AM. Configure start and end times that respect your customers' time zones and local regulations. * **Use retries sparingly.** One or two retries with a 5-minute delay is usually enough. Excessive retries can annoy customers and waste resources. * **Check your phone number configuration.** If a number doesn't appear in the dropdown, it's missing outbound SIP or an assigned agent. Fix it on the Phone Numbers page first. * **Use the webhook for CRM integration.** If you track call outcomes in an external system, configure the webhook URL so each completed call automatically updates your records. ## Next Steps Configure phone numbers with outbound SIP and agents so they're available for campaigns. Track campaign call performance, sentiment, and outcomes in the Analytics dashboard. # Knowledgebase Source: https://docs.freyavoice.ai/guides/features/knowledgebase Give your AI agents access to your company's knowledge — documents, websites, and custom answers — for accurate, grounded responses ## What is the Knowledgebase? The Knowledgebase is a workspace-level content library that your AI agents can query in real time during calls. Instead of embedding all your information directly into an agent's system prompt, you store it in the Knowledgebase and let the agent retrieve only what's relevant to each conversation. This keeps prompts lean, responses accurate, and your content easy to maintain — update a document once and every agent in the workspace benefits immediately. The Knowledgebase is currently in **beta**. Features and limits may change as we continue to improve the system. ## How It Works When an agent needs information during a call, it sends a query to the Knowledgebase. The system runs a **hybrid search** — combining semantic (meaning-based) search with keyword and heading search — then returns the most relevant content with full citations back to the agent in under 200ms. The agent uses this retrieved content to ground its response, and can cite the exact document and section it used. ## Content Types ### Articles Articles are rich, long-form documents — product guides, FAQs, policy documents, or any structured content. They support full Markdown formatting and are displayed with auto-generated thumbnails in the dashboard. Articles can come from: * **Written directly** in the Freya editor * **Uploaded files** (PDF, TXT, Markdown, DOCX) * **Synced web pages** crawled from your website ### Snippets Snippets are short, reusable pieces of text — policies, macros, standard phrasing, or quick reference facts. They are designed to be concise and targeted, ideal for content that agents need to recite verbatim or reference frequently. Create a snippet and start typing immediately — no upload or processing required. The recommended format for snippets is a top-level title, followed by questions as subheadings with their answers below: ```markdown theme={null} # Refund Policy ## How long do refunds take? Refunds are processed within 5–7 business days and returned to the original payment method. ## Can I get a refund after 30 days? Refunds are only available within 30 days of purchase. After that, we can offer store credit instead. ``` This structure helps the retrieval system match the right answer to the caller's exact question. ## Adding Content ### Writing or Uploading a Document **Create a snippet manually:** 1. Go to **Knowledgebase** in the sidebar 2. Click **New Snippet** in the top-right corner 3. A new blank snippet opens — give it a title and start writing 4. When you save your content, it is automatically processed and indexed for search **Upload a file:** 1. In the **Add Content** section, click **Upload Document** 2. Select a PDF, TXT, Markdown, or DOCX file (up to 10MB) 3. The file is processed in the background — text is extracted, structured, and indexed 4. Once processing completes, the document is published and available to agents PDFs are processed with OCR support, so scanned documents work too. A thumbnail is generated automatically from the first page. ### Syncing a Website Sync entire websites or specific pages to keep your knowledgebase up to date with your online content. 1. In the **Add Content** section, click **Sync Website** 2. Enter the URL of the website or page you want to crawl 3. Freya discovers all available pages and lists them in real time 4. Select the pages you want to include, then click **Sync** 5. Each page is fetched, cleaned, and indexed as a separate article Syncing uses OpenGraph images as thumbnails where available, with an automatic screenshot as fallback. ### Content Processing After you add any content, it goes through an automatic processing pipeline: 1. **Extraction** — Text is extracted and cleaned from any supported file format 2. **Chunking** — Content is split into structured sections, respecting document headings and hierarchy 3. **Embedding** — Each section is encoded for semantic search 4. **Indexing** — Sections are stored and indexed for fast retrieval Processing happens asynchronously in the background. You can continue working while documents are being indexed. A status indicator shows when processing is complete. ## Testing Retrieval The right panel of the Knowledgebase page is a **live test chat**. You can type any query and see exactly what your agents would retrieve — including the matched content, document titles, and the heading path within the document (e.g. `Getting Started > Installation > Requirements`). Use this to: * Verify that important content is being retrieved correctly * Check that the right document ranks first for common queries * Identify gaps where no relevant content is found ## Using the Knowledgebase in Agents The Knowledgebase is available to all agents in the same workspace automatically. No per-agent configuration is needed to enable retrieval — agents query the shared workspace knowledgebase during calls. To get the best results, instruct your agent to use the knowledgebase in its system prompt. For example: ``` When a caller asks a question about our products, policies, or procedures, search the knowledgebase before responding. Always cite the source document when using retrieved information. ``` Agents receive search results with: * The matched content (with surrounding context for continuity) * Document title and type * The hierarchical heading path within the document * Source URL (for synced pages) ## Managing Your Content ### Published vs. Draft Documents can be in one of three states: | Status | Description | | ------------- | ----------------------------------------------------------------------- | | **Draft** | Not yet available to agents. New documents start here while processing. | | **Published** | Indexed and available for retrieval. | | **Archived** | Hidden from retrieval but preserved for reference. | The count shown next to each content type (e.g. `3 / 5`) reflects **published / total** documents. An **Enabled** badge appears when at least one document of that type is published and active. ### Updating Content Editing a published document triggers an automatic **reindex** — the old chunks are replaced with new ones derived from the updated content. Your agents always query the latest version. ## Best Practices * **Structure your documents with clear headings.** The retrieval system uses document structure to find the right section, not just keyword matches. Well-organized content retrieves more accurately. * **Keep snippets short and focused.** Snippets work best for single-topic content like refund policies, opening hours, or a specific product's pricing. Avoid mixing multiple topics in one snippet. * **Use the test chat before going live.** Run your most common caller questions through the test panel to confirm the right content surfaces before connecting agents to real calls. * **Sync website pages that change often.** Rather than manually updating documents, sync your public help center or product pages so the knowledgebase stays current automatically. * **Avoid duplicating content across documents.** Duplicate information can confuse retrieval ranking and cause agents to return inconsistent answers. ## Next Steps Use AI Studio to refine your agent's system prompt and teach it how to best use knowledgebase results. Test your agents end-to-end with simulated calls to verify knowledgebase-grounded responses. # Agents Source: https://docs.freyavoice.ai/guides/fundamentals/agents Comprehensive guide to creating, configuring, and optimizing AI agents in Freyavoice AI ## Understanding Agents Agents are intelligent voice assistants powered by advanced AI models. They are the core component that handles conversations, understands user intent, and executes actions during phone calls. ## Agent Components ### System Prompt The system prompt is the most critical component of an agent. It defines: **Personality and Tone**: How the agent speaks and interacts with users. Should it be formal or casual? Friendly or professional? **Capabilities**: What the agent can and cannot do. Clearly define the agent's purpose and limitations. **Instructions**: Step-by-step instructions for handling different scenarios, edge cases, and error conditions. **Context**: Information about your business, products, services, or domain that the agent needs to know. **Best Practices**: Guidelines for the agent to follow, such as always confirming important information or asking clarifying questions when needed. ### Model Configuration **Model Selection**: Choose the AI model that best fits your needs: * **GPT-4**: Best for complex reasoning, nuanced conversations, and handling edge cases * **Claude**: Excellent for long context windows and detailed analysis * **GPT-3.5**: Good balance of cost and performance for simpler use cases **Temperature**: Controls the randomness of responses. Lower values (0.1-0.3) produce more focused, deterministic responses. Higher values (0.7-1.0) produce more creative, varied responses. **Max Tokens**: Limit the maximum response length. This helps control costs and ensures responses stay concise. **Context Window**: Manage how much conversation history the agent remembers. Longer context allows for better continuity but increases costs. ### Voice Configuration **Voice Provider**: Choose a voice provider (ElevenLabs, etc.) that matches your quality and cost requirements. **Voice Selection**: Select a specific voice that matches your brand. Consider factors like gender, age, accent, and tone. **Speaking Speed**: Adjust how fast the agent speaks. Slower speeds are better for complex information, faster for simple confirmations. **Voice Stability**: Control how consistent the voice sounds. Higher stability means less variation in tone and delivery. ### Functions Functions allow agents to interact with external systems and perform actions: **Function Definition**: Define what the function does, what parameters it accepts, and what it returns. **API Integration**: Connect to external APIs to fetch data, update systems, or trigger actions. **Error Handling**: Define how the agent should handle function failures or errors. **Function Chaining**: Some functions can call other functions, enabling complex workflows within a single agent. ## Agent Lifecycle ### Creation When creating an agent: 1. **Define Purpose**: Clearly define what the agent is meant to do 2. **Choose Model**: Select the appropriate AI model 3. **Write Prompt**: Craft a detailed system prompt 4. **Configure Voice**: Select voice settings 5. **Add Functions**: Define any required functions 6. **Test**: Test the agent thoroughly before deployment ### Configuration Ongoing configuration includes: **Prompt Refinement**: Continuously improve the system prompt based on real conversations and feedback. **Function Updates**: Add, modify, or remove functions as your needs evolve. **Voice Tuning**: Adjust voice settings to optimize for your use case. **Model Optimization**: Experiment with different models and settings to find the best balance of quality and cost. ### Deployment Before deploying an agent: 1. **Test in Simulation**: Use the simulation feature to test thoroughly 2. **Review Prompt**: Ensure the prompt is clear and complete 3. **Check Functions**: Verify all functions work correctly 4. **Test Voice**: Listen to how the agent sounds 5. **Monitor First Calls**: Closely monitor the first real calls ### Monitoring and Optimization **Review Conversations**: Regularly review call transcripts to identify areas for improvement. **Analyze Metrics**: Track success rates, user satisfaction, and goal achievement. **Iterate Prompt**: Use AI Studio to quickly iterate on prompts based on real data. **Optimize Costs**: Monitor token usage and costs, optimize prompts to reduce unnecessary tokens. ## Advanced Agent Features ### Context Management **Conversation History**: Agents maintain context throughout a conversation, remembering previous exchanges. **Context Limits**: Be aware of context window limits. Very long conversations may exceed limits. **Context Strategy**: Choose how to manage context - append new messages, summarize old ones, or use sliding windows. ### Multi-Turn Conversations **State Management**: Agents can maintain state across multiple conversation turns. **Goal Tracking**: Agents can track conversation goals and work toward completing them. **Clarification**: Agents can ask clarifying questions when information is unclear. ### Error Handling **Graceful Degradation**: Agents should handle errors gracefully, providing helpful messages rather than technical errors. **Fallback Strategies**: Define fallback behaviors when functions fail or errors occur. **User Communication**: Clearly communicate errors to users in a helpful, non-technical way. ## Agent Best Practices ### Prompt Engineering **Be Specific**: Vague prompts lead to unpredictable behavior. Be as specific as possible about desired behavior. **Provide Examples**: Include examples of good interactions in your prompt. **Set Boundaries**: Clearly define what the agent should and shouldn't do. **Test Iteratively**: Continuously test and refine prompts based on real conversations. ### Function Design **Keep Functions Focused**: Each function should do one thing well. **Validate Inputs**: Always validate function inputs before processing. **Handle Errors**: Functions should return clear error information. **Document Functions**: Clearly document what each function does and how to use it. ### Voice Optimization **Match Brand**: Choose voices that match your brand identity. **Test Quality**: Always test voice quality on actual phone calls, not just in the dashboard. **Optimize Speed**: Adjust speaking speed based on content complexity and audience. ## Next Steps Learn how to build complex call routing and processing with workflows. # Integrations Source: https://docs.freyavoice.ai/guides/fundamentals/integrations Connecting Freyavoice AI with external systems, APIs, and services ## Integration Overview Integrations allow Freyavoice AI to connect with external systems, enabling your agents and workflows to interact with your existing infrastructure, fetch data, trigger actions, and synchronize information. ## Types of Integrations ### Telephony Providers **Twilio**: Primary telephony provider for phone numbers and call handling. Import numbers, manage calls, and handle SMS/MMS. **Other SIP Providers**: Connect to other Session Initiation Protocol (SIP) providers for call routing and management. **Provider Configuration**: Configure authentication, endpoints, and settings for each provider. ### CRM Systems **HubSpot**: Integrate with HubSpot to sync contact data, create records, and update customer information during calls. **Salesforce**: Connect to Salesforce to access and update customer records, create leads, and log interactions. **Custom CRM**: Build custom integrations with your CRM system using webhooks and API calls. ### Communication Platforms **Slack**: Send notifications to Slack channels when calls complete, errors occur, or important events happen. **Email**: Send email notifications, summaries, or transcripts after calls. **SMS/MMS**: Handle text messaging through integrated providers. ### Database Systems **Custom Databases**: Connect to your databases to fetch customer data, update records, or query information during calls. **Data Warehouses**: Integrate with data warehouses for analytics and reporting. **Real-time Data**: Access real-time data during conversations to provide up-to-date information. ### API Integrations **REST APIs**: Connect to any REST API to fetch data or trigger actions. **GraphQL APIs**: Integrate with GraphQL endpoints for flexible data queries. **Webhooks**: Receive webhooks from external systems to trigger workflows or update state. **Authentication**: Handle various authentication methods (API keys, OAuth, JWT, etc.). ## Integration Methods ### Function Calls Functions are the primary way agents interact with external systems: **Function Definition**: Define functions that agents can call during conversations. **API Endpoints**: Functions can call external API endpoints to fetch or update data. **Data Transformation**: Transform data between formats as needed. **Error Handling**: Handle API errors gracefully and provide fallback behavior. ### Webhooks Webhooks allow external systems to notify Freyavoice AI: **Incoming Webhooks**: Receive webhooks from external systems to trigger workflows or update state. **Outgoing Webhooks**: Send webhooks to external systems when events occur (call completed, error, etc.). **Webhook Security**: Validate webhook signatures to ensure authenticity. **Webhook Retries**: Handle webhook delivery failures with retry logic. ### Direct API Calls Make direct API calls from workflows: **HTTP Requests**: Make GET, POST, PUT, DELETE requests to external APIs. **Authentication**: Handle authentication for protected APIs. **Response Processing**: Process API responses and use data in workflows. **Error Handling**: Handle API failures and timeouts gracefully. ## Common Integration Patterns ### Customer Data Lookup **Pattern**: Look up customer information at the start of a call to personalize the conversation. **Implementation**: Function calls to CRM or database to fetch customer data. **Usage**: Use customer data to personalize greetings, access order history, or provide account information. ### Order Processing **Pattern**: Process orders or transactions during calls. **Implementation**: API calls to order management systems to create, update, or query orders. **Usage**: Agents can take orders, check order status, or process returns during calls. ### Appointment Scheduling **Pattern**: Schedule appointments or meetings during calls. **Implementation**: Integration with calendar systems (Google Calendar, Outlook, etc.) to check availability and book appointments. **Usage**: Agents can check availability, suggest times, and confirm appointments. ### Notification Systems **Pattern**: Send notifications when important events occur. **Implementation**: Webhooks or API calls to notification services (Slack, email, SMS). **Usage**: Notify teams when calls complete, errors occur, or important milestones are reached. ### Data Synchronization **Pattern**: Keep data synchronized between systems. **Implementation**: Bidirectional sync between Freyavoice AI and external systems. **Usage**: Sync contact information, call history, or other data between systems. ## Integration Best Practices ### Security **Secure Credentials**: Never expose API keys or credentials in code. Use secure storage and environment variables. **Authentication**: Use proper authentication methods (OAuth, API keys, JWT) for all integrations. **Data Encryption**: Encrypt sensitive data in transit and at rest. **Access Control**: Limit integration access to only what's necessary. ### Error Handling **Graceful Degradation**: Design integrations to fail gracefully. If an external system is unavailable, the agent should still function. **Retry Logic**: Implement retry logic for transient failures. **Error Logging**: Log integration errors with sufficient context for debugging. **User Communication**: Communicate integration failures to users in helpful, non-technical ways. ### Performance **Caching**: Cache frequently accessed data to reduce API calls and improve performance. **Async Processing**: Process non-critical integrations asynchronously to avoid blocking conversations. **Rate Limiting**: Respect API rate limits and implement backoff strategies. **Connection Pooling**: Reuse connections when possible to improve performance. ### Testing **Test Integrations**: Thoroughly test all integrations before deploying to production. **Mock Services**: Use mock services during development to avoid hitting production APIs. **Integration Tests**: Create automated tests for critical integrations. **Monitor Production**: Continuously monitor integrations in production for issues. ## Setting Up Integrations ### Telephony Integration (Twilio) 1. **Get Credentials**: Obtain Account SID and Auth Token from Twilio 2. **Connect in Freya**: Add credentials in the Integrations section 3. **Verify Connection**: Test the connection to ensure it works 4. **Import Numbers**: Import phone numbers from your Twilio account ### CRM Integration (HubSpot) 1. **Create API Key**: Generate an API key in HubSpot 2. **Configure in Freya**: Add API key in workspace integrations 3. **Define Functions**: Create functions that interact with HubSpot 4. **Test Integration**: Test functions to ensure they work correctly ### Custom API Integration 1. **Review API Documentation**: Understand the API endpoints and authentication 2. **Create Functions**: Define functions that call the API 3. **Handle Authentication**: Implement proper authentication 4. **Test Thoroughly**: Test all API interactions ## Monitoring Integrations ### Health Checks **Connection Status**: Monitor connection status for all integrations. **Response Times**: Track API response times to identify performance issues. **Error Rates**: Monitor error rates to catch integration problems early. **Usage Metrics**: Track integration usage to understand patterns and optimize. ### Alerts **Failure Alerts**: Set up alerts for integration failures. **Performance Alerts**: Alert when response times exceed thresholds. **Error Alerts**: Get notified of integration errors immediately. ## Next Steps Explore advanced features like AI Studio, simulations, and analytics. # Phone Numbers Source: https://docs.freyavoice.ai/guides/fundamentals/phone-numbers Connect phone numbers to your agents for inbound and outbound calls — with SIP configuration, agent assignment, and regional endpoints ## What are Phone Numbers? Phone numbers are the bridge between your AI agents and the real telephone network. Each number you add to Freya can receive inbound calls, make outbound calls, or both — depending on how you configure it. When a call comes in on a number, Freya routes it to the agent you've assigned. When a campaign or API call dials out, it uses the outbound agent and SIP configuration you've set up on the number. ## The Phone Numbers Page The phone numbers table shows all numbers in your workspace with the following columns: | Column | What it shows | | ------------------------ | ------------------------------------------------------------------------------------------------------- | | **Number** | The phone number in international format | | **Friendly Name** | A human-readable label you assign (e.g., "Main Support Line") | | **Agents** | Icons showing which agents are assigned for inbound and outbound | | **Capabilities** | Visual indicators for what the number supports — inbound SIP (blue), outbound SIP (green), SMS (purple) | | **Active Configuration** | Which endpoints are currently live (voice, messaging, or both) | ## Adding a Phone Number Click **Create** to open the phone number form. The form is split into two columns: inbound configuration on the left, outbound on the right. ### General Settings * **Phone Number** — enter the number in international format (e.g., +14155551234). A country picker helps with formatting. This field is required. * **Friendly Name** — a descriptive label like "Sales Hotline" or "Support - US East". Required, and shown everywhere in the dashboard instead of the raw number. ### Inbound SIP Configuration To receive calls on this number, configure the inbound SIP settings: **Origination URI** — select the Freya SIP endpoint closest to your telephony provider. This is the address your provider sends calls to: | Region | Endpoint | | ------------- | ---------------------------- | | United States | `sip.us1.freyavoice.ai:5080` | | Europe | `sip.eu1.freyavoice.ai:5080` | | Turkey | `sip.tr.freyavoice.ai:5060` | Choose the region that matches where your phone numbers are registered for the lowest latency and best call quality. **Inbound Agent** — select which agent handles incoming calls on this number. When a call arrives, Freya connects the caller to this agent immediately. ### Outbound SIP Configuration To make calls from this number (used by campaigns and the API), configure outbound SIP: **Endpoint and Port** — the SIP server address and port of your telephony provider (e.g., `sip.provider.com:5060`). This is where Freya sends outbound call requests. **Username and Password** — optional SIP authentication credentials if your provider requires them. **From Domain** — an optional field that sets the domain in the SIP `From` header. Expand the collapsible section to configure this if your provider requires a specific domain for caller ID or routing. **Outbound Agent** — select which agent handles outbound calls. This agent is used when campaigns dial out through this number, and is also auto-selected when you choose this number in the campaign creation form. A phone number needs both outbound SIP configuration **and** an outbound agent assigned before it appears in the campaign phone number dropdown. If your number is missing from campaigns, check these settings. ## Importing from Twilio If you have phone numbers in a Twilio account, you can import them directly instead of configuring SIP manually: 1. Go to **Integrations** and connect your Twilio account 2. Return to the **Phone Numbers** page 3. Click **Import from Twilio** 4. Select the numbers you want to import Imported numbers inherit their capabilities from Twilio and can be configured with agents immediately. ## Managing Phone Numbers ### Editing Click any phone number row to open the edit form. You can change the friendly name, swap agents, or update SIP configuration at any time. Changes take effect immediately for the next call. ### Deleting Delete a phone number from the actions menu. A confirmation dialog warns that the number will no longer receive calls. You can also select multiple numbers using checkboxes for bulk deletion. Deleting a phone number from Freya does not release it from your telephony provider. You still own the number — it just won't be connected to Freya anymore. ## Best Practices * **Use descriptive friendly names.** When you have many numbers, names like "Support - US", "Sales - UK", and "Appointments - EU" are far easier to manage than remembering raw phone numbers. * **Match the origination URI to your number's region.** A US number routed through the EU endpoint adds unnecessary latency to every call. Always pick the closest region. * **Assign different agents for inbound vs. outbound.** An agent optimized for answering support calls isn't necessarily the best for making outbound campaign calls. Tailor each agent to its purpose. * **Verify outbound configuration before launching campaigns.** Test an outbound call manually (using One-Click Call or a test campaign with one number) to confirm SIP credentials and agent behavior before dialing a full customer list. * **Review unused numbers periodically.** Numbers with no recent calls may be costing you monthly fees from your provider without providing value. Either repurpose them or remove them. ## Next Steps Use your configured phone numbers to launch outbound calling campaigns. Connect your Twilio account to import phone numbers and enable outbound calling. # Workflows Source: https://docs.freyavoice.ai/guides/fundamentals/workflows Building complex call routing and processing logic with visual workflows ## What Are Workflows? Workflows are visual, node-based systems that allow you to create sophisticated call routing and processing logic. They enable you to build applications that go beyond what a single agent can accomplish, combining multiple agents, conditional logic, function calls, and integrations. ## Workflow Components ### Nodes Nodes are the building blocks of workflows. Each node represents a specific action or decision: **Agent Nodes**: Connect to AI agents to handle conversations. You can use different agents for different parts of the workflow. **Function Nodes**: Execute custom functions or API calls. These can fetch data, update systems, or trigger external actions. **Condition Nodes**: Route calls based on conditions. Conditions can check time of day, caller information, conversation state, or any other data. **Transfer Nodes**: Transfer calls to human agents or external systems. This enables human-in-the-loop scenarios. **Wait Nodes**: Pause execution for a specified duration. Useful for delays or scheduled actions. **Loop Nodes**: Repeat actions based on conditions. Enable iterative processing or retry logic. ### Connections Connections define the flow between nodes: **Sequential Flow**: Standard connections that execute nodes one after another. **Conditional Flow**: Connections that branch based on node outputs or conditions. **Parallel Flow**: Multiple paths that can execute simultaneously. **Loop Flow**: Connections that create loops for iterative processing. ### Variables Variables store and pass data between nodes: **Input Variables**: Data that enters the workflow, such as caller information or initial context. **Node Outputs**: Data produced by nodes that can be used by subsequent nodes. **Global Variables**: Variables accessible throughout the workflow. **Type Safety**: Variables have types (string, number, boolean, object) to ensure data integrity. ## Workflow Design Patterns ### Simple Routing The simplest workflow pattern routes calls to a single agent: ``` Start → Agent Node → End ``` This is equivalent to using an agent directly but provides a foundation for expansion. ### Conditional Routing Route calls based on conditions: ``` Start → Condition Node → [True Path] → Agent A → [False Path] → Agent B ``` Common conditions include: * Time of day (business hours) * Caller ID or phone number * Language preference * Customer type or segment ### Multi-Agent Handoff Pass calls between multiple agents: ``` Start → Agent A (Initial Greeting) → Condition → Agent B (Support) → Agent C (Sales) ``` Each agent handles a specific part of the conversation, with smooth handoffs between them. ### Human Escalation Escalate to human agents when needed: ``` Start → Agent → Condition (Needs Human?) → Transfer to Human → Continue with Agent ``` The agent can detect when human intervention is needed and seamlessly transfer. ### Function Integration Integrate with external systems: ``` Start → Function (Fetch Customer Data) → Agent (Uses Data) → Function (Update System) → End ``` Functions can fetch data before conversations, update systems during calls, or trigger actions after calls. ### Parallel Processing Execute multiple operations simultaneously: ``` Start → [Function A] ┐ [Function B] ├→ Agent (Uses Both Results) [Function C] ┘ ``` Parallel execution improves performance when operations are independent. ## Building Workflows ### Planning Your Workflow Before building, plan: **Goal**: What should the workflow accomplish? Define clear success criteria. **Flow**: Map out the logical flow of the conversation or process. **Decisions**: Identify decision points and conditions. **Integrations**: Determine what external systems need to be involved. **Error Cases**: Plan how to handle errors and edge cases. ### Creating Nodes **Add Nodes**: Add nodes from the node palette to your workflow canvas. **Configure Nodes**: Set node properties including which agent to use, what function to call, or what condition to check. **Name Nodes**: Use descriptive names that make the workflow self-documenting. **Organize Visually**: Arrange nodes logically to show flow clearly. ### Connecting Nodes **Create Connections**: Connect nodes by dragging from output to input. **Set Conditions**: For conditional connections, define the conditions that determine which path to take. **Test Connections**: Verify that connections work as expected. **Handle Loops**: Be careful with loops to avoid infinite execution. ### Testing Workflows **Simulation**: Test workflows in simulation before connecting to real phone numbers. **Test All Paths**: Ensure all conditional paths are tested. **Test Edge Cases**: Test error conditions and edge cases. **Monitor Execution**: Watch workflow execution to identify issues. ## Advanced Workflow Features ### State Management **Workflow State**: Workflows maintain state throughout execution. **Variable Persistence**: Variables persist across nodes and can be accessed throughout the workflow. **State Transitions**: Define how state changes as the workflow progresses. ### Error Handling **Error Nodes**: Add error handling nodes to catch and handle failures. **Fallback Paths**: Define fallback paths when primary operations fail. **Error Logging**: Log errors with sufficient context for debugging. **User Communication**: Communicate errors to users in helpful ways. ### Performance Optimization **Minimize Nodes**: Each node adds processing time. Keep workflows efficient. **Use Parallel Processing**: Execute independent operations in parallel. **Cache Results**: Cache expensive function results when appropriate. **Optimize Conditions**: Place most common conditions first. ## Workflow Best Practices ### Organization **Keep Workflows Focused**: Each workflow should have a clear, single purpose. **Use Descriptive Names**: Name workflows and nodes clearly. **Document Complex Logic**: Add comments for complex routing logic. **Version Control**: Keep versions of workflows for easy rollback. ### Error Handling **Plan for Failures**: Always include error handling. **Provide Fallbacks**: Design fallback paths for critical operations. **Log Errors**: Ensure errors are logged with context. **User-Friendly Messages**: Provide helpful error messages to users. ### Testing **Test Thoroughly**: Test all paths and conditions. **Use Simulation**: Always test in simulation first. **Monitor Production**: Closely monitor workflows in production. **Iterate Based on Data**: Improve workflows based on real usage data. ## Next Steps Learn how to manage phone numbers and connect them to your agents and workflows. # Workspaces Source: https://docs.freyavoice.ai/guides/fundamentals/workspaces Understanding workspaces and how to effectively organize your Freyavoice AI resources ## What Are Workspaces? Workspaces are the foundational organizational unit in Freyavoice AI. They serve as containers that isolate and organize all your resources including agents, workflows, phone numbers, team members, settings, and integrations. ## Workspace Structure Each workspace is a self-contained environment with: **Resources**: All agents, workflows, and phone numbers belong to a specific workspace. This isolation ensures that resources from different projects or clients don't interfere with each other. **Team Members**: Workspaces have their own team with different roles (admin, member). Team members can be invited, assigned roles, and managed independently per workspace. **Settings**: Each workspace has its own configuration including language preferences, credit allowances, outbound calling settings, and integration versions. **Integrations**: Workspace-level integrations allow you to connect external services like Twilio, HubSpot, or custom APIs that are specific to that workspace. **Billing**: Workspaces can have independent billing and credit management, making it easy to track costs per project or client. ## When to Use Multiple Workspaces ### Project-Based Organization Create separate workspaces for different projects. This keeps resources organized and makes it easy to manage multiple client projects or internal initiatives independently. **Example**: You might have workspaces for "Client A Support", "Client B Sales", and "Internal Testing". ### Environment Separation Use different workspaces for development, staging, and production environments. This prevents accidental changes to production resources and allows safe testing. **Example**: "Production", "Staging", and "Development" workspaces with appropriate access controls. ### Team or Department Organization Organize workspaces by team or department. Each team can manage their own resources without interfering with others. **Example**: "Sales Team", "Support Team", and "Marketing Team" workspaces. ### Client Isolation For agencies or service providers, create separate workspaces for each client. This ensures complete data isolation and makes client management easier. **Example**: Each client gets their own workspace with their branding, settings, and resources. ## Workspace Management ### Creating Workspaces When creating a new workspace, consider: **Naming**: Use descriptive names that clearly indicate the workspace's purpose. Good names make it easy to identify workspaces at a glance. **Initial Settings**: Configure default language, credit allowances, and other settings during creation. You can always change these later, but setting them up front saves time. **Logo and Branding**: Add workspace logos and branding elements to make the dashboard feel customized for each workspace. ### Workspace Settings Key settings to configure: **Language**: Set the default language for the workspace. This affects agent behavior, UI language, and default voice settings. **Outbound Enabled**: Control whether outbound calling is allowed in this workspace. Disable for workspaces that should only handle inbound calls. **Credit Management**: Configure monthly credit allowances and reset schedules. This helps control costs and manage budgets per workspace. **Integration Version**: Choose between v1 and v2 integration versions based on your needs and compatibility requirements. ### Team Management **Inviting Members**: Invite team members by email. They'll receive an invitation link to join the workspace. **Role Assignment**: Assign appropriate roles: * **Admin**: Full access to all workspace features including settings and billing * **Member**: Can create and manage resources but cannot modify workspace settings **Member Management**: View all members, their roles, and when they joined. Remove members when they no longer need access. **Display Names**: Each member can have a display name that appears throughout the workspace. This personalizes the experience. ## Workspace Best Practices ### Organization Strategy **Consistent Naming**: Use a consistent naming convention across workspaces. This makes it easier to find and manage workspaces as your organization grows. **Documentation**: Document the purpose of each workspace, what resources it contains, and who has access. This helps team members understand the workspace structure. **Regular Cleanup**: Periodically review and archive or delete unused workspaces to keep your workspace list manageable. ### Security Considerations **Access Control**: Only invite team members who need access. Regularly review member lists and remove access when no longer needed. **Role Management**: Use the principle of least privilege. Give members only the permissions they need, not admin access by default. **Workspace Isolation**: Remember that workspaces are isolated. Resources in one workspace cannot access resources in another without explicit sharing mechanisms. ### Cost Management **Credit Allocation**: Set appropriate credit allowances per workspace based on expected usage. Monitor usage to adjust as needed. **Usage Tracking**: Use workspace-level analytics to track usage and costs. This helps identify which workspaces are consuming the most resources. **Budget Planning**: Plan credit allocations based on workspace needs. Production workspaces may need higher allowances than development workspaces. ## Workspace Analytics Each workspace provides analytics including: **Call Volume**: Track calls per workspace to understand usage patterns. **Resource Usage**: See how many agents, workflows, and phone numbers are in use. **Team Activity**: Monitor team member activity and contributions. **Cost Tracking**: Track credits consumed and costs per workspace. ## Next Steps Learn about creating and managing AI agents in your workspace. # Architecture Source: https://docs.freyavoice.ai/guides/learning-freyavoice-ai/architecture Understanding Freyavoice AI's system architecture and how components work together ## System Overview Freyavoice AI is built on a modern, scalable architecture designed to handle high-volume voice AI applications while maintaining low latency and high reliability. ## High-Level Architecture The platform consists of several key layers: ### Application Layer The **application layer** is where you interact with Freyavoice AI. This includes: * **Dashboard**: Web-based interface for managing agents, workflows, and settings * **API**: RESTful API for programmatic access * **Webhooks**: Event notifications for call events and status updates This layer handles authentication, authorization, and request routing to the appropriate services. ### Orchestration Layer The **orchestration layer** manages call flow and coordinates between different components: * **Call Router**: Determines which agent or workflow should handle each call * **Session Manager**: Maintains call state and context throughout the conversation * **Workflow Engine**: Executes workflow logic, manages node execution, and handles branching This layer ensures that calls are properly routed, state is maintained, and workflows execute correctly. ### AI Processing Layer The **AI processing layer** handles all AI-related operations: * **LLM Integration**: Connects to various language models (GPT-4, Claude, etc.) * **Prompt Management**: Handles system prompts, context management, and prompt optimization * **Function Execution**: Manages agent function calls and external API integrations * **Response Generation**: Converts AI responses into appropriate formats This layer is responsible for the intelligence of your agents, handling natural language understanding and generation. ### Telephony Layer The **telephony layer** manages all phone-related operations: * **SIP Handling**: Processes SIP protocol for call setup and teardown * **Audio Processing**: Handles audio encoding, decoding, and streaming * **Call Control**: Manages call state, transfers, and routing * **Provider Integration**: Interfaces with telephony providers like Twilio This layer ensures reliable call connectivity and high-quality audio transmission. ### Data Layer The **data layer** stores and manages all persistent data: * **Call Records**: Complete call history, transcripts, and recordings * **Agent Configurations**: Agent settings, prompts, and function definitions * **Workflow Definitions**: Workflow structures, node configurations, and connections * **Analytics Data**: Metrics, performance data, and usage statistics This layer provides data persistence, querying capabilities, and analytics. ## Component Interactions ### Call Flow Architecture When a call comes in, here's how components interact: 1. **Telephony Layer** receives the call and creates a call session 2. **Orchestration Layer** identifies the target agent or workflow 3. **Session Manager** loads or creates a conversation context 4. **AI Processing Layer** processes each turn of conversation 5. **Function Execution** calls external APIs if needed 6. **Telephony Layer** streams audio back to the caller 7. **Data Layer** stores all interactions and metadata ### Workflow Execution Architecture For workflows, the execution is more complex: 1. **Workflow Engine** loads the workflow definition 2. **Node Executor** processes each node in sequence 3. **Condition Evaluator** determines routing paths 4. **Agent Invoker** activates agents when needed 5. **Function Executor** runs custom functions 6. **State Manager** maintains workflow state 7. **Data Layer** logs all workflow execution steps ## Scalability Architecture Freyavoice AI is designed to scale horizontally: ### Horizontal Scaling * **Stateless Services**: Most services are stateless, allowing easy scaling * **Load Balancing**: Requests are distributed across multiple instances * **Session Affinity**: Call sessions are maintained through sticky sessions or shared state * **Auto-scaling**: Services automatically scale based on load ### Database Scaling * **Read Replicas**: Database reads are distributed across replicas * **Sharding**: Data can be sharded by workspace or other dimensions * **Caching**: Frequently accessed data is cached for performance * **Connection Pooling**: Database connections are pooled efficiently ### Telephony Scaling * **Provider Distribution**: Calls are distributed across multiple telephony providers * **Regional Routing**: Calls are routed to the nearest infrastructure * **Failover**: Automatic failover to backup providers if needed ## Security Architecture Security is built into every layer: ### Authentication & Authorization * **JWT Tokens**: API requests are authenticated using JWT tokens * **Workspace Isolation**: Each workspace is isolated from others * **Role-Based Access**: Fine-grained permissions control what users can do * **API Keys**: Secure API keys for programmatic access ### Data Security * **Encryption at Rest**: All data is encrypted when stored * **Encryption in Transit**: All communications use TLS/SSL * **PII Handling**: Personal information is handled according to privacy regulations * **Audit Logging**: All actions are logged for security auditing ### Network Security * **VPC Isolation**: Services run in isolated network segments * **Firewall Rules**: Strict firewall rules control network access * **DDoS Protection**: Protection against distributed denial of service attacks * **Rate Limiting**: API rate limiting prevents abuse ## Reliability Architecture Freyavoice AI is designed for high availability: ### Redundancy * **Multi-Region Deployment**: Services are deployed across multiple regions * **Active-Active Setup**: Multiple active instances handle traffic * **Database Replication**: Databases are replicated for redundancy * **Provider Redundancy**: Multiple telephony providers prevent single points of failure ### Fault Tolerance * **Circuit Breakers**: Prevent cascading failures * **Retry Logic**: Automatic retries for transient failures * **Graceful Degradation**: System continues operating with reduced functionality if needed * **Health Checks**: Continuous monitoring of service health ### Monitoring & Observability * **Distributed Tracing**: Track requests across all services * **Metrics Collection**: Comprehensive metrics for performance monitoring * **Log Aggregation**: Centralized logging for debugging and analysis * **Alerting**: Automated alerts for issues and anomalies ## Performance Optimization The architecture includes several performance optimizations: ### Caching Strategy * **Response Caching**: Frequently accessed data is cached * **CDN Integration**: Static assets are served via CDN * **Edge Caching**: Cache at edge locations for lower latency ### Connection Optimization * **Connection Pooling**: Reuse connections to reduce overhead * **Keep-Alive**: Maintain persistent connections when possible * **Compression**: Compress data in transit to reduce bandwidth ### Processing Optimization * **Async Processing**: Non-critical operations are processed asynchronously * **Batch Operations**: Group operations for efficiency * **Lazy Loading**: Load data only when needed ## Next Steps Learn proven patterns and strategies for building effective voice AI solutions. # Best Practices Source: https://docs.freyavoice.ai/guides/learning-freyavoice-ai/best-practices Proven patterns and strategies for building effective voice AI solutions with Freyavoice AI ## Introduction Building production-ready voice AI applications requires more than just technical knowledge. This guide covers best practices learned from real-world deployments that will help you build reliable, scalable, and effective voice AI solutions. ## Agent Design Best Practices ### System Prompt Design **Be Specific and Clear**: Your system prompt should clearly define the agent's role, capabilities, and limitations. Vague instructions lead to unpredictable behavior. **Include Examples**: Provide examples of good responses and interactions. This helps the AI model understand the desired tone and style. **Set Boundaries**: Clearly define what the agent should and shouldn't do. Include instructions for handling edge cases, sensitive topics, and error scenarios. **Use Variables**: Leverage dynamic variables in prompts for personalization and context-aware responses. **Iterate and Test**: Continuously refine your prompts based on real conversations. Use AI Studio to iterate quickly. ### Model Selection **Match Model to Use Case**: Different models have different strengths: * **GPT-4**: Best for complex reasoning and nuanced conversations * **Claude**: Excellent for long context and detailed analysis * **GPT-3.5**: Good balance of cost and performance for simpler use cases **Consider Cost vs Quality**: Higher-end models provide better quality but at higher cost. Balance your needs with your budget. **Test Multiple Models**: Don't assume one model is best for all use cases. Test different models and compare results. ### Voice Configuration **Choose Appropriate Voice**: Select voices that match your brand and use case. Professional voices for business, friendly voices for customer service. **Optimize Speaking Speed**: Adjust speaking speed based on your audience. Slower speeds for complex information, faster for simple confirmations. **Test Audio Quality**: Always test how your agent sounds on actual phone calls, not just in simulations. ## Workflow Design Best Practices ### Node Organization **Keep Workflows Focused**: Each workflow should have a clear, single purpose. Avoid creating overly complex workflows that are hard to maintain. **Use Descriptive Names**: Name nodes clearly so the workflow is self-documenting. "Check Business Hours" is better than "Condition 1". **Group Related Nodes**: Visually organize nodes to show logical flow. Use spacing and alignment to make workflows readable. **Document Complex Logic**: Add comments or documentation for complex routing logic that might not be immediately obvious. ### Error Handling **Plan for Failures**: Always include error handling nodes in your workflows. What happens if an API call fails? If an agent times out? **Provide Fallbacks**: Design fallback paths for critical operations. If the primary agent fails, route to a backup or human agent. **Log Errors**: Ensure errors are logged with sufficient context for debugging. Include call IDs, timestamps, and error details. **User-Friendly Messages**: When errors occur, provide helpful messages to users rather than technical error codes. ### Performance Optimization **Minimize Node Count**: Each node adds processing time. Keep workflows lean and efficient. **Use Parallel Processing**: When possible, execute independent operations in parallel rather than sequentially. **Cache Expensive Operations**: Cache results of expensive function calls or API requests when appropriate. **Optimize Condition Logic**: Place the most common conditions first to reduce evaluation time. ## Telephony Best Practices ### Phone Number Management **Use Descriptive Names**: Give phone numbers friendly names that indicate their purpose (e.g., "Support Line", "Sales Hotline"). **Organize by Purpose**: Group phone numbers by use case or department for easier management. **Monitor Usage**: Track usage patterns to optimize phone number allocation and costs. **Plan for Scaling**: Design your phone number strategy to scale as your business grows. ### Call Quality **Test Across Networks**: Test calls on different carriers and network conditions to ensure quality. **Monitor Call Metrics**: Track call quality metrics like drop rates, audio quality, and latency. **Optimize Audio Settings**: Adjust audio encoding settings to balance quality and bandwidth. **Handle Network Issues**: Design your agents to handle poor network conditions gracefully. ### Compliance **Follow Regulations**: Ensure compliance with telephony regulations (TCPA, GDPR, etc.) in your region. **Obtain Consent**: Get proper consent before making outbound calls or sending messages. **Maintain Do-Not-Call Lists**: Respect opt-out requests and maintain DNC lists. **Document Compliance**: Keep records of consent and compliance measures. ## Integration Best Practices ### API Design **Use Webhooks**: Leverage webhooks for real-time event notifications rather than polling. **Implement Retries**: Build retry logic into your integrations to handle transient failures. **Handle Rate Limits**: Respect API rate limits and implement backoff strategies. **Version Your APIs**: Use API versioning to maintain backward compatibility. ### Function Design **Keep Functions Focused**: Each function should do one thing well. Avoid monolithic functions that do too much. **Validate Inputs**: Always validate function inputs before processing to prevent errors. **Return Structured Data**: Return consistent, structured data from functions for easier processing. **Handle Errors Gracefully**: Functions should return error information in a consistent format. ### Security **Secure API Keys**: Never expose API keys in client-side code or logs. Use environment variables and secure storage. **Validate Webhooks**: Always validate webhook signatures to ensure requests are authentic. **Use HTTPS**: Always use HTTPS for all API communications. **Implement Rate Limiting**: Protect your endpoints with rate limiting to prevent abuse. ## Monitoring and Analytics ### Key Metrics to Track **Call Volume**: Track total calls, calls per hour/day, and trends over time. **Success Rates**: Monitor call completion rates, successful conversations, and goal achievement. **Performance Metrics**: Track response times, latency, and processing speeds. **Cost Metrics**: Monitor costs per call, API usage, and overall spending. ### Logging Strategy **Log Everything**: Log all important events including call starts, agent responses, function calls, and errors. **Include Context**: Include relevant context in logs like call IDs, user IDs, timestamps, and request details. **Use Structured Logging**: Use structured logging formats (JSON) for easier querying and analysis. **Retain Logs Appropriately**: Keep logs long enough for debugging but comply with data retention policies. ### Alerting **Set Up Alerts**: Configure alerts for critical issues like high error rates, service downtime, or unusual patterns. **Avoid Alert Fatigue**: Set thresholds appropriately to avoid too many false alarms. **Escalate Appropriately**: Have escalation procedures for different severity levels. ## Testing Best Practices ### Simulation Testing **Test Before Deploying**: Always test agents and workflows in simulation before connecting to real phone numbers. **Test Edge Cases**: Test unusual inputs, error conditions, and boundary cases. **Test with Real Data**: Use realistic test data that matches your production scenarios. **Automate Testing**: Create automated tests for critical workflows and agent behaviors. ### User Testing **Involve Real Users**: Get feedback from actual users, not just technical team members. **Test Different Scenarios**: Test various use cases and conversation flows. **Monitor First Calls**: Closely monitor the first real calls to catch issues early. **Iterate Based on Feedback**: Continuously improve based on user feedback and call data. ## Deployment Best Practices ### Gradual Rollout **Start Small**: Begin with a limited rollout to a small group of users or phone numbers. **Monitor Closely**: Watch metrics closely during initial deployment. **Scale Gradually**: Increase scale gradually as you gain confidence. **Have Rollback Plan**: Always have a plan to roll back if issues arise. ### Version Control **Version Your Configurations**: Keep versions of agent prompts, workflow definitions, and configurations. **Use Git**: Store configurations in version control for tracking changes. **Tag Releases**: Tag stable versions for easy rollback. **Document Changes**: Document what changed and why in each version. ## Next Steps Deep dive into the fundamental concepts of workspaces, agents, and workflows. # Core Concepts Source: https://docs.freyavoice.ai/guides/learning-freyavoice-ai/core-concepts Understanding the fundamental building blocks of Freyavoice AI ## Introduction Freyavoice AI is built on several core concepts that work together to create powerful voice AI applications. Understanding these concepts is essential for building effective solutions. ## Agents **Agents** are the heart of Freyavoice AI. They are intelligent voice assistants powered by advanced AI models that can understand natural language, maintain context, and execute actions. ### What Makes an Agent An agent consists of several key components: **System Prompt**: The agent's instructions and personality. This defines how the agent behaves, what it can do, and how it should respond to different situations. A well-crafted system prompt is crucial for agent performance. **Model Configuration**: The AI model that powers the agent (GPT-4, Claude, etc.). Different models have different strengths - some are better at reasoning, others at speed or cost efficiency. **Voice Settings**: How the agent sounds. This includes the voice provider, specific voice selection, speaking speed, and voice stability. The right voice can significantly impact user experience. **Functions**: Actions the agent can take. Functions allow agents to interact with external systems, query databases, make API calls, and perform other operations beyond just conversation. **Context Management**: How the agent maintains conversation history and context. This includes conversation length limits, context window management, and memory strategies. ### Agent Lifecycle When a call comes in, the agent goes through several stages: 1. **Initialization**: The agent loads its configuration, system prompt, and any required functions 2. **Context Loading**: Previous conversation history is loaded if available 3. **Listening**: The agent receives and processes audio input 4. **Understanding**: Speech is converted to text and analyzed 5. **Reasoning**: The AI model processes the input and generates a response 6. **Action Execution**: Any required functions are called 7. **Response Generation**: The response is converted to speech and delivered 8. **Context Update**: The conversation is saved for future reference ## Workflows **Workflows** are visual, node-based systems that allow you to create complex call routing and processing logic. They enable you to build sophisticated applications that go beyond what a single agent can do. ### Workflow Components **Nodes**: The building blocks of workflows. Each node represents a specific action or decision point: * **Agent Nodes**: Connect to AI agents to handle conversations * **Function Nodes**: Execute custom functions or API calls * **Condition Nodes**: Route calls based on conditions (time of day, caller ID, etc.) * **Transfer Nodes**: Transfer to human agents or other systems * **Wait Nodes**: Pause execution for a specified duration * **Loop Nodes**: Repeat actions based on conditions **Connections**: The lines between nodes that define the flow of execution. Connections can be conditional, allowing different paths based on node outputs. **Variables**: Data that flows between nodes. Variables can store user input, function results, or any other data needed during call processing. ### Workflow Execution When a workflow is triggered: 1. **Entry Point**: Execution starts at the initial node 2. **Node Processing**: Each node executes its logic 3. **Data Flow**: Variables are passed between nodes 4. **Conditional Routing**: Conditions determine which path to take 5. **Parallel Execution**: Some nodes can execute simultaneously 6. **Completion**: The workflow completes when reaching an end node or transfer ### When to Use Workflows vs Agents Use a **single agent** when: * Your use case is straightforward * You need a simple conversation flow * You want to get started quickly * The agent can handle everything independently Use **workflows** when: * You need complex routing logic * Multiple agents need to work together * You require conditional branching * You need to integrate with multiple systems * You want to add human-in-the-loop capabilities ## Telephony Layer The **telephony layer** connects your agents and workflows to the real world through phone numbers and call handling infrastructure. ### Phone Numbers Phone numbers are your connection point to the telephony network. They can be: * **Imported**: Brought in from providers like Twilio * **Purchased**: Acquired through Freya's marketplace (if available) * **Configured**: Set up with specific capabilities (voice, SMS, etc.) ### Call Routing When a call comes in, Freya routes it through several stages: 1. **Inbound Reception**: The call is received at the phone number 2. **Number Resolution**: Freya identifies which agent or workflow to use 3. **Session Creation**: A call session is created with unique identifiers 4. **Agent/Workflow Invocation**: The configured agent or workflow is activated 5. **Call Processing**: The agent/workflow handles the conversation 6. **Call Completion**: The call ends and data is saved ### Outbound Calling For outbound calls, the process is similar but initiated by your application: 1. **Call Request**: Your application requests an outbound call 2. **Number Selection**: Freya selects the appropriate phone number 3. **Call Initiation**: The call is placed to the destination 4. **Connection**: Once connected, the agent/workflow takes over 5. **Processing**: Same as inbound calls from this point ## Integration Points Freyavoice AI integrates with various external systems: **Telephony Providers**: Twilio, and other SIP providers for call handling **AI Models**: OpenAI, Anthropic, and other LLM providers for agent intelligence **External APIs**: Webhooks and function calls to integrate with your systems **Storage**: Conversation history, call recordings, and analytics data ## Data Flow Understanding how data flows through Freyavoice AI helps you build better applications: 1. **Audio Input**: Phone call audio is received 2. **Speech-to-Text**: Audio is converted to text 3. **Agent Processing**: The agent analyzes the text and generates a response 4. **Function Execution**: Any required functions are called 5. **Text-to-Speech**: The response is converted back to audio 6. **Audio Output**: The audio is sent back to the caller 7. **Data Storage**: All interactions are logged for analytics and improvement ## Next Steps Learn how these core concepts come together in Freyavoice AI's architecture. # Learning Freyavoice AI Source: https://docs.freyavoice.ai/guides/learning-freyavoice-ai/overview A guided path through the platform — from core concepts to architecture to production best practices ## Who This Section Is For Whether you're evaluating Freyavoice AI for the first time or preparing to deploy agents in production, this learning path gives you a structured understanding of how the platform works and how to get the most out of it. If you've already completed the [Getting Started](/getting-started/creating-workspace) guide and built your first agent, this section takes you deeper — explaining the architectural decisions behind the platform, the mental models that make agent design intuitive, and the patterns that separate a prototype from a production-ready deployment. ## What You'll Learn The learning path is organized into three sections, each building on the previous one: ### Core Concepts Start here. This section covers the three building blocks of every Freyavoice AI deployment: **agents**, **workflows**, and the **telephony layer**. You'll understand how an agent's lifecycle works from the moment a call connects to the moment it ends, how workflows chain multiple agents and decision points together, and how the telephony system bridges your AI to the phone network. ### Architecture Once you understand the concepts, this section explains how they're implemented. You'll learn about Freyavoice AI's layered architecture — from the API and application layers down to the telephony and data infrastructure. This is especially useful if you need to reason about latency, scaling, security, or integration design. ### Best Practices The final section distills practical lessons into actionable guidance. It covers agent prompt design, workflow structure, telephony optimization, integration patterns, monitoring strategies, and deployment workflows. These are the patterns that teams discover after months of iteration — laid out so you can apply them from day one. ## Learning Path Agents, workflows, and telephony — the three pillars of the platform. How the system is structured for scalability, reliability, and low latency. Proven patterns for agent design, workflows, testing, and deployment. ## Prerequisites Before starting this path, you should: * Have a Freya workspace set up ([create one here](/getting-started/creating-workspace)) * Have created at least one agent and made a test call * Be comfortable with the basics of REST APIs and webhooks Prior experience with voice applications or AI is helpful but not required — the Core Concepts section explains everything from the ground up. # Call Routing Source: https://docs.freyavoice.ai/guides/telephony/call-routing Configuring and optimizing call routing for various scenarios and use cases ## Call Routing Overview Call routing determines how calls are directed and processed in Freyavoice AI. Effective routing ensures calls reach the right agent or workflow, are handled efficiently, and provide the best possible experience for callers. ## Routing Types ### Direct Agent Routing **Simple Routing**: Route calls directly to a specific agent. This is the simplest routing method. **Use Cases**: Best for straightforward use cases where a single agent can handle all calls. **Configuration**: Simply select an agent for inbound or outbound routing. **Advantages**: Simple setup, low latency, easy to manage. **Limitations**: No conditional logic, can't route based on caller information. ### Workflow-Based Routing **Complex Routing**: Route calls through workflows that can implement complex logic. **Use Cases**: Best when you need conditional routing, multiple agents, or complex processing. **Configuration**: Select a workflow that handles routing decisions. **Advantages**: Flexible, powerful, supports complex scenarios. **Considerations**: More complex to set up and maintain. ## Routing Strategies ### Time-Based Routing **Business Hours**: Route to different agents or workflows based on time of day. **After Hours**: Handle after-hours calls with special agents or voicemail. **Holiday Routing**: Special routing for holidays or special dates. **Timezone Handling**: Properly handle timezones for global operations. ### Caller-Based Routing **Caller ID Routing**: Route based on the caller's phone number. **VIP Routing**: Route known customers or VIPs to specialized agents. **New vs Returning**: Different routing for new vs returning callers. **Language Routing**: Route to agents that speak the caller's language. ### Purpose-Based Routing **Department Routing**: Route to different departments based on caller selection or IVR. **Service Type**: Route based on the type of service needed. **Product Routing**: Route to agents specialized in specific products. **Issue Type**: Route based on the type of issue or inquiry. ### Geographic Routing **Area Code Routing**: Route based on caller's area code or location. **Regional Agents**: Route to agents in specific regions. **Local Presence**: Use local numbers for regional presence. **International Routing**: Handle international calls appropriately. ## Routing Configuration ### Basic Setup **Number Configuration**: Configure routing at the phone number level. **Agent Selection**: Choose which agent handles calls (for direct routing). **Workflow Selection**: Choose which workflow processes calls (for workflow routing). **Fallback Options**: Set up fallback routing for when primary routing fails. ### Advanced Configuration **Conditional Logic**: Set up conditions that determine routing paths. **Multi-Path Routing**: Configure multiple possible routing paths. **Priority Routing**: Set routing priorities for different scenarios. **Dynamic Routing**: Implement dynamic routing based on real-time conditions. ## Routing Optimization ### Performance **Minimize Latency**: Optimize routing to minimize time to agent response. **Efficient Paths**: Design routing paths for efficiency. **Reduce Complexity**: Simplify routing when possible to improve performance. **Cache Decisions**: Cache routing decisions when appropriate. ### User Experience **Quick Connection**: Route calls quickly to avoid long wait times. **Appropriate Routing**: Ensure calls reach the right agent or department. **Smooth Transfers**: Handle transfers smoothly when needed. **Clear Communication**: Communicate routing decisions to users when appropriate. ### Cost Optimization **Efficient Routing**: Route calls efficiently to minimize costs. **Right-Size Agents**: Use appropriate agents for each call type. **Optimize Workflows**: Optimize workflows to reduce processing time. **Monitor Costs**: Track routing costs and optimize accordingly. ## Common Routing Patterns ### IVR-Style Routing **Menu Options**: Present menu options to callers for self-service routing. **Digit Selection**: Route based on caller's digit selection. **Multi-Level Menus**: Support multi-level menu structures. **Default Options**: Provide default routing for timeouts or invalid selections. ### Skill-Based Routing **Agent Skills**: Route calls to agents with appropriate skills. **Skill Matching**: Match call requirements with agent capabilities. **Load Balancing**: Distribute calls across available agents. **Queue Management**: Manage queues when all agents are busy. ### Priority Routing **Priority Levels**: Define priority levels for different call types. **VIP Handling**: Route high-priority calls immediately. **Queue Prioritization**: Prioritize calls in queues. **Resource Allocation**: Allocate resources based on priority. ## Best Practices ### Planning **Define Requirements**: Clearly define routing requirements before implementation. **Map Flows**: Map out routing flows to visualize logic. **Consider Edge Cases**: Plan for edge cases and error conditions. **Test Scenarios**: Plan test scenarios for all routing paths. ### Implementation **Start Simple**: Begin with simple routing and add complexity as needed. **Test Thoroughly**: Test all routing paths before going live. **Document Logic**: Document routing logic for future reference. **Monitor Performance**: Monitor routing performance continuously. ### Optimization **Analyze Patterns**: Analyze call patterns to optimize routing. **A/B Testing**: Test different routing strategies to find what works best. **Iterate**: Continuously improve routing based on data and feedback. **Simplify**: Simplify routing when complexity doesn't add value. ## Troubleshooting ### Common Issues **Wrong Routing**: Verify routing configuration and test with simulations. **Slow Routing**: Optimize routing logic and check system performance. **Failed Routing**: Check fallback options and error handling. **Unexpected Behavior**: Review routing logic and test edge cases. ### Debugging **Routing Logs**: Review routing logs to understand routing decisions. **Test Calls**: Make test calls to verify routing behavior. **Configuration Review**: Verify all routing configurations are correct. **Provider Issues**: Check provider-side routing if applicable. ## Next Steps Learn how to configure voice settings for optimal audio quality and user experience. # Inbound Calls Source: https://docs.freyavoice.ai/guides/telephony/inbound-calls Handling, optimizing, and managing inbound call processing in Freyavoice AI ## Inbound Call Processing Inbound calls are calls that customers or users initiate to your phone numbers. These are typically support calls, sales inquiries, appointment requests, or other customer-initiated interactions. ## Inbound Call Flow ### Call Reception **Number Identification**: When a call arrives, Freyavoice AI identifies which phone number received it. **Number Resolution**: The system looks up the configuration for that number to determine routing. **Session Creation**: A new call session is created with a unique call ID for tracking. **Context Loading**: Any relevant context (customer data, previous interactions) is loaded. ### Routing **Agent Routing**: If configured with an agent, the call is routed directly to that agent. **Workflow Routing**: If configured with a workflow, the workflow engine processes the call. **Conditional Routing**: Workflows can route based on conditions like time of day, caller ID, or other factors. **Fallback Routing**: If primary routing fails, fallback paths are used. ### Processing **Agent Activation**: The agent loads its configuration, system prompt, and functions. **Conversation Start**: The agent greets the caller and begins the conversation. **Real-Time Processing**: The agent processes each turn of conversation in real-time. **Function Execution**: Functions are called as needed to fetch data or perform actions. **Context Management**: Conversation context is maintained throughout the call. ### Completion **Call End**: The call ends when either party hangs up or the conversation completes. **Data Storage**: Call data, transcript, and metadata are stored. **Webhooks**: Webhook events are sent for call completion. **Analytics**: Call data is processed for analytics and reporting. ## Optimizing Inbound Calls ### Response Time **Fast Connection**: Minimize time between call arrival and agent response. **Quick Greeting**: Agents should greet callers quickly to avoid silence. **Efficient Processing**: Optimize agent prompts and functions for speed. **Reduced Latency**: Monitor and optimize latency throughout the call flow. ### Call Quality **Audio Optimization**: Ensure high-quality audio for clear communication. **Network Quality**: Monitor network conditions and optimize for quality. **Codec Selection**: Use appropriate codecs for best quality and efficiency. **Echo Handling**: Proper echo cancellation for better call experience. ### User Experience **Clear Communication**: Ensure agents speak clearly and are easy to understand. **Helpful Responses**: Agents should provide helpful, accurate responses. **Efficient Resolution**: Resolve caller needs quickly and effectively. **Professional Service**: Maintain professional tone and service quality. ## Inbound Call Scenarios ### Customer Support **Issue Resolution**: Help customers resolve problems or answer questions. **Product Information**: Provide information about products or services. **Account Management**: Help with account-related inquiries. **Technical Support**: Provide technical assistance and troubleshooting. ### Sales Inquiries **Product Information**: Answer questions about products or services. **Pricing**: Provide pricing information and quotes. **Lead Qualification**: Qualify leads and gather information. **Appointment Scheduling**: Schedule sales meetings or demos. ### Appointment Management **Scheduling**: Help customers schedule appointments. **Reminders**: Send appointment reminders (if integrated). **Rescheduling**: Allow customers to reschedule appointments. **Cancellations**: Handle appointment cancellations. ### Information Services **Hours and Location**: Provide business hours and location information. **General Information**: Answer general questions about your business. **Directory Services**: Help callers find specific information or departments. ## Best Practices ### Preparation **Test Before Launch**: Always test inbound call handling before going live. **Monitor First Calls**: Closely monitor the first real calls to catch issues. **Have Fallbacks**: Plan fallback strategies for when things go wrong. **Document Processes**: Document your inbound call handling processes. ### Optimization **Analyze Performance**: Regularly analyze call performance and identify improvements. **Iterate on Prompts**: Continuously improve agent prompts based on real conversations. **Optimize Routing**: Refine routing logic based on call patterns and outcomes. **Improve Functions**: Optimize functions for speed and reliability. ### Monitoring **Track Metrics**: Monitor key metrics like call volume, duration, and success rates. **Review Transcripts**: Regularly review call transcripts to identify issues. **User Feedback**: Collect and act on user feedback about call experiences. **Error Tracking**: Monitor and address errors promptly. ## Troubleshooting ### Common Issues **Calls Not Connecting**: Check number configuration, provider connection, and routing setup. **Poor Audio Quality**: Verify network connectivity, codec settings, and provider quality. **Agent Not Responding**: Check agent configuration, system prompt, and model settings. **Slow Response Times**: Optimize prompts, reduce function call times, and check system load. ### Debugging **Call Logs**: Review call logs to identify issues and patterns. **Provider Logs**: Check provider-side logs for telephony issues. **Agent Logs**: Review agent execution logs for processing issues. **Network Diagnostics**: Check network connectivity and quality. ## Provider Setup Guides Once you've added a phone number to Freya and assigned an inbound agent, you need to configure your telephony provider to forward calls to Freya's SIP endpoint. The steps vary by provider — follow the guide for yours below. ### Twilio Twilio is the most common provider used with Freya. Setup takes under a minute: 1. Log in to the [Twilio Console](https://console.twilio.com) and navigate to **Phone Numbers** > **Manage** > **Active Numbers** 2. Click the phone number you want to connect to Freya 3. Scroll down to the **Voice Configuration** section 4. Under **"A call comes in"**, set the dropdown to **Webhook** and paste the following URL: ``` https://agents-eu1.freyavoice.ai/telephony/inbound/webhook ``` 5. Make sure the method is set to **HTTP POST** 6. Click **Save configuration** Twilio Voice Configuration showing the Freya inbound webhook URL That's it. Every call to this Twilio number will now be forwarded to Freya, which routes it to the inbound agent you've configured on the [Phone Numbers](/guides/fundamentals/phone-numbers) page. ## Next Steps Learn how to initiate and manage outbound calling operations. # Outbound Calls Source: https://docs.freyavoice.ai/guides/telephony/outbound-calls Initiating, managing, and optimizing outbound calling operations ## Outbound Call Overview Outbound calls are calls that your application initiates to customers, leads, or other parties. These are used for sales outreach, appointment reminders, customer surveys, marketing campaigns, and other proactive communications. ## Outbound Call Flow ### Call Initiation **Request Creation**: Your application or campaign creates an outbound call request. **Number Selection**: Freyavoice AI selects the appropriate phone number for the call. **Destination Validation**: The destination number is validated and formatted. **Call Setup**: SIP signaling begins to establish the call. ### Connection **Dialing**: The destination number is dialed. **Ringback**: Ringback tone is played while waiting for answer. **Answer Detection**: The system detects when the call is answered. **Connection Established**: Once answered, the call is connected. ### Processing **Agent Activation**: The configured agent or workflow is activated. **Greeting**: The agent greets the called party. **Conversation**: The agent conducts the conversation. **Goal Achievement**: The agent works toward achieving call goals. **Function Execution**: Functions are called as needed during the conversation. ### Completion **Call End**: The call ends when either party hangs up or conversation completes. **Result Recording**: Call results, outcomes, and data are recorded. **Webhook Events**: Webhook events are sent for call completion. **Analytics**: Call data is processed for analytics and campaign tracking. ## Outbound Call Methods ### One-Click Calling **Quick Calls**: Make individual calls quickly from the dashboard. **Simple Interface**: Easy-to-use interface for ad-hoc calling. **Immediate Execution**: Calls are placed immediately when requested. **Use Cases**: Perfect for quick follow-ups, test calls, or immediate outreach. ### Campaign-Based Calling **Bulk Operations**: Make many calls as part of organized campaigns. **Scheduled Execution**: Schedule campaigns to run at specific times. **Rate Control**: Control call rate to manage capacity and compliance. **Contact Management**: Manage contact lists and call progress. ### API-Initiated Calls **Programmatic Control**: Initiate calls programmatically via API. **Integration**: Integrate calling into your applications and workflows. **Automation**: Automate calling based on events or conditions. **Custom Logic**: Implement custom calling logic in your applications. ## Campaign Management ### Campaign Setup **Contact List**: Upload or enter the list of numbers to call. **Agent/Workflow Selection**: Choose which agent or workflow handles calls. **Scheduling**: Set when the campaign should run. **Configuration**: Configure call rate, retry logic, and other settings. ### Campaign Execution **Call Placement**: Calls are placed according to campaign configuration. **Rate Limiting**: Call rate is controlled to manage capacity and compliance. **Progress Tracking**: Monitor campaign progress in real-time. **Error Handling**: Failed calls are handled according to retry policies. ### Campaign Optimization **Performance Analysis**: Analyze campaign performance and identify improvements. **A/B Testing**: Test different approaches to find what works best. **Timing Optimization**: Find the best times to call your audience. **Message Refinement**: Improve agent prompts and messages based on results. ## Best Practices ### Compliance **Obtain Consent**: Always obtain proper consent before making calls. **Respect Preferences**: Honor opt-out requests immediately. **Follow Regulations**: Comply with all applicable regulations (TCPA, GDPR, etc.). **Maintain Records**: Keep records of consent and compliance measures. **Do-Not-Call Lists**: Maintain and respect do-not-call lists. ### Call Quality **Professional Greeting**: Ensure agents greet called parties professionally. **Clear Purpose**: Agents should clearly state why they're calling. **Respectful Interaction**: Maintain respectful, helpful interactions. **Opt-Out Option**: Always provide clear opt-out options. ### Optimization **Test Messages**: Test different messages to find what works best. **Optimize Timing**: Find optimal times to call your audience. **Improve Targeting**: Refine your target audience based on results. **Monitor Performance**: Continuously monitor and optimize campaign performance. ## Outbound Call Scenarios ### Sales Outreach **Lead Qualification**: Qualify leads and gather information. **Product Presentation**: Present products or services to potential customers. **Objection Handling**: Handle objections and answer questions. **Closing**: Work toward closing sales or scheduling follow-ups. ### Appointment Management **Reminders**: Remind customers of upcoming appointments. **Confirmations**: Confirm appointments and gather information. **Rescheduling**: Help customers reschedule appointments. **Cancellations**: Handle appointment cancellations gracefully. ### Customer Surveys **Feedback Collection**: Collect feedback from customers. **Satisfaction Surveys**: Conduct satisfaction surveys. **Research**: Gather market research data. **Follow-Up**: Follow up on previous interactions. ### Marketing Campaigns **Product Launches**: Announce new products or features. **Promotions**: Promote special offers or events. **Newsletters**: Deliver marketing messages via voice. **Brand Awareness**: Build brand awareness through outreach. ## Monitoring and Analytics ### Key Metrics **Call Volume**: Total calls made, attempted, and completed. **Connection Rate**: Percentage of calls that connect successfully. **Answer Rate**: Percentage of calls that are answered. **Completion Rate**: Percentage of calls that complete successfully. **Conversion Rate**: Percentage of calls that achieve goals. **Cost per Call**: Average cost per call including all expenses. ### Performance Tracking **Real-Time Monitoring**: Monitor campaigns in real-time. **Daily Reports**: Get daily summaries of campaign performance. **Detailed Analytics**: Access detailed analytics for optimization. **Trend Analysis**: Analyze trends to identify patterns and opportunities. ## Troubleshooting ### Common Issues **Low Connection Rates**: Check number formatting, verify numbers are valid, and optimize timing. **High Drop Rates**: Improve agent prompts, optimize call quality, and refine targeting. **Compliance Issues**: Review compliance practices, update consent processes, and audit records. **Cost Overruns**: Monitor costs, optimize call rates, and refine targeting. ## Next Steps Learn how to effectively manage phone numbers for your telephony operations. # Telephony Overview Source: https://docs.freyavoice.ai/guides/telephony/overview Understanding telephony systems, call handling, and voice infrastructure in Freyavoice AI ## Telephony in Freyavoice AI Telephony is the foundation that enables your AI agents and workflows to interact with the real world through phone calls. Understanding how telephony works in Freyavoice AI helps you build more reliable and effective voice AI applications. ## Telephony Architecture ### SIP-Based Infrastructure Freyavoice AI uses Session Initiation Protocol (SIP) for call handling, which is the industry standard for voice over IP (VoIP) communications. This enables: **Reliable Call Handling**: Robust call setup, management, and teardown. **Quality Audio**: High-quality audio transmission with support for various codecs. **Scalability**: Handle high call volumes with distributed infrastructure. **Provider Flexibility**: Work with multiple telephony providers and SIP trunks. ### Call Flow When a call is initiated or received: 1. **Call Signaling**: SIP messages establish the call session 2. **Media Negotiation**: Audio codecs and parameters are negotiated 3. **Media Streaming**: Audio streams bidirectionally between caller and agent 4. **Call Control**: Call state is managed throughout the conversation 5. **Call Termination**: Call is properly terminated and resources are released ## Phone Number Management ### Number Types **Local Numbers**: Numbers with specific area codes for local presence. **Toll-Free Numbers**: 800, 888, 877 numbers for nationwide calling. **International Numbers**: Numbers from various countries for global reach. **Vanity Numbers**: Memorable numbers with specific patterns (e.g., 1-800-FLOWERS). ### Number Capabilities **Voice**: Make and receive voice calls. **SMS**: Send and receive text messages. **MMS**: Send and receive multimedia messages (if supported). **Fax**: Send and receive faxes (if supported). ## Call Routing ### Inbound Routing **Number Resolution**: When a call comes in, Freyavoice AI identifies which agent or workflow to use based on the phone number configuration. **Session Creation**: A unique call session is created with identifiers for tracking. **Agent/Workflow Activation**: The configured agent or workflow is activated to handle the call. **Call Processing**: The agent/workflow processes the conversation in real-time. ### Outbound Routing **Call Initiation**: Your application or campaign initiates an outbound call. **Number Selection**: Freyavoice AI selects the appropriate phone number for the call. **Destination Dialing**: The destination number is dialed. **Connection**: Once connected, the agent/workflow takes over. **Processing**: Same as inbound calls from this point forward. ## Audio Processing ### Codecs **G.711**: Standard codec for high-quality audio, commonly used in telephony. **G.722**: Wideband codec for better audio quality. **Opus**: Modern codec with excellent quality and efficiency. **Codec Selection**: Codecs are automatically selected based on network conditions and provider support. ### Audio Quality **Network Optimization**: Audio is optimized for various network conditions. **Echo Cancellation**: Built-in echo cancellation for better call quality. **Noise Reduction**: Noise reduction algorithms improve audio clarity. **Adaptive Bitrate**: Bitrate adapts to network conditions for optimal quality. ## Provider Integration ### Twilio Integration **Primary Provider**: Twilio is the primary telephony provider for Freyavoice AI. **Number Import**: Import existing Twilio numbers into Freya. **Call Handling**: Twilio handles call routing and media streaming. **SMS/MMS**: Twilio provides SMS and MMS capabilities. ### Other Providers **SIP Trunks**: Connect to other SIP providers for additional flexibility. **Provider Redundancy**: Multiple providers ensure reliability and failover. **Regional Providers**: Use regional providers for better local presence and costs. ## Call Quality and Reliability ### Quality Metrics **Audio Quality**: Monitor audio quality metrics like MOS (Mean Opinion Score). **Latency**: Track call latency to ensure real-time conversation feel. **Packet Loss**: Monitor packet loss which can degrade audio quality. **Jitter**: Track jitter which can cause audio artifacts. ### Reliability Features **Automatic Failover**: Automatic failover to backup providers if primary fails. **Retry Logic**: Automatic retry for failed calls. **Health Monitoring**: Continuous monitoring of telephony infrastructure health. **Redundancy**: Multiple redundant systems ensure high availability. ## Compliance and Regulations ### Telephony Regulations **TCPA (US)**: Telephone Consumer Protection Act compliance for US calls. **GDPR (EU)**: General Data Protection Regulation compliance for EU operations. **Local Regulations**: Compliance with telephony regulations in various countries. **Do-Not-Call Lists**: Respect and maintain do-not-call lists. ### Best Practices **Consent Management**: Obtain and track consent before making calls. **Opt-Out Handling**: Immediately honor opt-out requests. **Caller ID**: Use proper caller identification. **Recording Consent**: Obtain consent before recording calls (where required). ## Next Steps Learn how to handle and optimize inbound call processing. # Voice Configuration Source: https://docs.freyavoice.ai/guides/telephony/voice-configuration Configuring voice settings for optimal audio quality and user experience ## Voice Configuration Overview Voice configuration determines how your agents sound to callers. Proper voice configuration is essential for creating professional, engaging, and effective voice AI experiences. ## Voice Components ### Voice Provider **Provider Selection**: Choose a voice provider (ElevenLabs, etc.) that matches your quality and cost requirements. **Provider Features**: Different providers offer different features, voices, and capabilities. **Cost Considerations**: Balance voice quality with cost based on your needs. **Reliability**: Choose providers with high reliability and uptime. ### Voice Selection **Voice Characteristics**: Select voices based on: * Gender * Age * Accent * Tone (professional, friendly, casual, etc.) **Brand Alignment**: Choose voices that align with your brand identity. **Use Case Matching**: Match voice characteristics to your use case (sales, support, etc.). **Testing**: Always test voices on actual phone calls, not just in the dashboard. ### Voice Settings **Speaking Speed**: Control how fast the agent speaks: * Slower speeds (0.8-0.9x) for complex information * Normal speeds (1.0x) for standard conversations * Faster speeds (1.1-1.2x) for simple confirmations **Voice Stability**: Control voice consistency: * Higher stability (0.7-0.9) for consistent, professional delivery * Lower stability (0.3-0.5) for more natural, varied delivery **Voice Similarity**: Control how closely the voice matches the original (if using cloned voices). ## Audio Quality ### Codec Selection **G.711**: Standard telephony codec, widely supported, good quality. **G.722**: Wideband codec for better audio quality. **Opus**: Modern codec with excellent quality and efficiency. **Automatic Selection**: Codecs are typically selected automatically based on network conditions. ### Quality Optimization **Network Conditions**: Audio quality adapts to network conditions automatically. **Bitrate Management**: Bitrate is optimized for quality and bandwidth. **Echo Cancellation**: Built-in echo cancellation improves call quality. **Noise Reduction**: Noise reduction algorithms enhance audio clarity. ## Voice Best Practices ### Selection **Match Brand**: Choose voices that match your brand personality. **Test Thoroughly**: Test voices on actual phone calls, not just simulations. **Consider Audience**: Select voices that resonate with your target audience. **Professional Quality**: Ensure voices sound professional and clear. ### Configuration **Optimize Speed**: Adjust speaking speed based on content complexity. **Balance Stability**: Find the right balance between consistency and naturalness. **Test Settings**: Test different voice settings to find optimal configuration. **Monitor Quality**: Continuously monitor voice quality in production. ### Content **Clear Scripts**: Write clear, natural scripts for agents. **Appropriate Tone**: Match agent tone to conversation context. **Pronunciation**: Ensure proper pronunciation of technical terms or names. **Pacing**: Structure content for natural pacing and pauses. ## Advanced Voice Features ### Voice Cloning **Custom Voices**: Create custom voices using voice cloning technology. **Brand Voices**: Use brand-specific voices for consistent experience. **Personality Voices**: Create voices with specific personalities. **Quality Requirements**: Ensure high-quality source audio for cloning. ### Multi-Language Support **Language Selection**: Configure different voices for different languages. **Accent Selection**: Choose appropriate accents for each language. **Language Switching**: Support language switching during conversations. **Cultural Considerations**: Consider cultural preferences for voice characteristics. ### Dynamic Voice **Context-Aware**: Adjust voice characteristics based on conversation context. **Emotion Expression**: Express emotions appropriately through voice. **Emphasis**: Use voice emphasis to highlight important information. **Natural Variation**: Add natural variation to avoid robotic sound. ## Quality Monitoring ### Metrics **Audio Quality**: Monitor audio quality metrics (MOS scores, etc.). **User Feedback**: Collect feedback about voice quality from users. **Technical Metrics**: Track technical metrics like latency and packet loss. **Subjective Quality**: Assess subjective quality through testing and feedback. ### Optimization **Continuous Improvement**: Continuously improve voice configuration based on feedback. **A/B Testing**: Test different voice configurations to find what works best. **Quality Analysis**: Analyze call recordings to assess voice quality. **Iterative Refinement**: Refine voice settings iteratively based on data. ## Troubleshooting ### Common Issues **Poor Audio Quality**: Check network conditions, codec settings, and provider quality. **Robotic Sound**: Adjust voice stability and add natural variation. **Unclear Speech**: Optimize speaking speed and ensure clear pronunciation. **Echo or Feedback**: Check echo cancellation settings and network quality. ### Debugging **Call Recordings**: Review call recordings to identify quality issues. **Network Diagnostics**: Check network connectivity and quality. **Provider Support**: Contact voice provider support for technical issues. **Configuration Review**: Verify all voice configuration settings are correct. ## Next Steps Explore the API reference for programmatic access to Freyavoice AI. # Introduction to Freya Source: https://docs.freyavoice.ai/index Welcome to Freya - Build AI-powered voice agents and workflows for phone calls ## What is Freya? Freya is a powerful voice AI platform that enables you to create intelligent AI agents and workflows to handle phone calls. Whether you need to automate customer support, conduct outbound campaigns, or build complex call routing systems, Freya provides the tools you need to create production-ready voice AI solutions. ## Key Features Create intelligent voice agents powered by advanced AI models that can handle natural conversations. Build complex call workflows with multiple nodes, conditions, and integrations. Import and connect phone numbers from providers like Twilio to start receiving and making calls. Iterate and improve your agents with AI-powered prompt editing and refinement. ## Getting Started Follow these steps to get up and running with Freya: 1. **Create a Workspace** - Organize your agents, workflows, and phone numbers in dedicated workspaces 2. **Configure Your Workspace** - Set up language preferences, credits, and other settings 3. **Create Your First Agent** - Build an AI agent that can handle phone conversations 4. **Create Your First Workflow** - Design a workflow to route and process calls 5. **Import a Phone Number** - Connect a phone number from Twilio or other providers 6. **Connect Your Phone Number** - Link your phone number to agents or workflows 7. **Start Receiving Calls** - Begin handling inbound calls with your AI agents 8. **Initiate Outbound Calls** - Launch outbound campaigns and automated calling ## Core Concepts ### Workspaces Workspaces are containers that organize all your Freya resources. Each workspace can have: * Multiple AI agents * Multiple workflows * Phone numbers * Team members with different roles * Custom settings and integrations ### Agents AI agents are the core of Freya. They are intelligent voice assistants that can: * Understand natural language * Respond to customer inquiries * Execute functions and integrations * Handle complex conversations * Transfer to human agents when needed ### Workflows Workflows allow you to create complex call routing and processing logic: * Multiple agent nodes * Conditional routing * Function calls and integrations * Custom business logic * Parallel processing ### Phone Numbers Phone numbers connect your agents and workflows to the real world: * Import from Twilio * Configure inbound and outbound routing * Connect to agents or workflows * Support voice and SMS capabilities ## Next Steps Get started by creating your first workspace and configuring it for your needs. # Introduction Source: https://docs.freyavoice.ai/model-api-reference/introduction Freya Model APIs for Speech-to-Text and Text-to-Speech ## Overview The Freya Model APIs provide direct access to our Speech-to-Text (STT) and Text-to-Speech (TTS) models. These are standalone inference endpoints — separate from the platform Call API. | Model | Endpoint | Description | | -------------- | ------------------- | -------------------------------------------------------- | | Speech-to-Text | `stt.freyavoice.ai` | Transcribe audio files or stream real-time audio to text | | Text-to-Speech | `tts.freyavoice.ai` | Convert text to natural-sounding speech | Browse the full schema for STT and TTS endpoints. ## Authentication All endpoints require a Bearer token issued by your workspace. See the [Authentication guide](/api-reference/authentication) for how to generate an API key. ```bash theme={null} Authorization: Bearer YOUR_API_KEY ``` ## Quick Start ### Speech-to-Text (File Upload) ```bash theme={null} curl -X POST "https://stt.freyavoice.ai/v1/audio/transcriptions" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@audio.wav" ``` ### Speech-to-Text (Real-Time Streaming) Connect via WebSocket for live transcription with partial results: ``` wss://stt.freyavoice.ai/v1/audio/stream?token=YOUR_API_KEY ``` See the [STT documentation](/api-reference/stt) for the full streaming wire protocol and code examples. ### Text-to-Speech ```bash theme={null} curl -X POST "https://tts.freyavoice.ai/v1/audio/speech" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"input": "Merhaba, Freya ile konuşuyorsunuz.", "voice": "leyla", "model": "tts-1"}' ``` These Model APIs are independent of the Freyavoice Call API. They can be used standalone for any speech processing task, not just within Freya call workflows. # Speech-to-Text Source: https://docs.freyavoice.ai/model-api-reference/speech-to-text /api-reference/model-apis-openapi.json post /v1/audio/transcriptions Transcribe an audio file to text. Accepts multipart form upload with the audio file and optional parameters. Compatible with the OpenAI audio transcription API. # Text-to-Speech Source: https://docs.freyavoice.ai/model-api-reference/text-to-speech /api-reference/model-apis-openapi.json post /v1/audio/speech Converts text into natural-sounding speech using Freya's TTS model. Returns a binary audio file. Supports the following emotion tags: [pause], [eee], [throat clearing], [mm-hmm], [laughter], [deep breath], [hmm], [cough], [breath]