For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • BedrockAgent
      • CLI Tools
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions
      • LiveWire
      • MCP Gateway
      • PomBuilder
      • Prefabs
      • Search
      • SkillBase
      • Skills
      • SWAIGFunction
      • SWMLBuilder
      • SWMLService
      • WebService
        • add_directory
        • remove_directory
        • start
        • stop
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • Chat
      • Compat
      • Datasphere
      • Fabric
      • Imported Numbers
      • Logs
      • Lookup
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSub
      • Queues
      • Recordings
      • Registry
      • RestClient
      • Short Codes
      • SignalWireRestError
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
AgentsWebService

add_directory

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

remove_directory

Next
Built with

Mount a new directory at a URL route. A leading / is added automatically if missing. Raises ValueError if the directory does not exist or the path is not a directory.

If the FastAPI app is already running, the new directory is mounted immediately.

Parameters

route
strRequired

URL path to mount at (e.g., "/docs"). A leading / is added automatically if missing.

directory
strRequired

Local directory path to serve.

Returns

None

Example

1from signalwire import WebService
2
3web = WebService(port=8002)
4web.add_directory("/audio", "./audio_files")
5web.add_directory("/images", "./public/images")
6web.start()