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
  • With HTTPS
AgentsWebService

start

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

stop

Next
Built with

Start the HTTP server. Blocks until the server is stopped. Raises RuntimeError if FastAPI or uvicorn are not available.

When ssl_cert and ssl_key are provided, the server starts with HTTPS. Otherwise, SSL configuration is loaded from the SecurityConfig environment variables.

Parameters

host
strDefaults to 0.0.0.0

Host address to bind to.

port
Optional[int]

Port to bind to. Defaults to the port set in the constructor.

ssl_cert
Optional[str]

Path to an SSL certificate file. Overrides environment-based SSL configuration.

ssl_key
Optional[str]

Path to an SSL key file. Overrides environment-based SSL configuration.

Returns

None — This method blocks and does not return until the server is stopped.

Example

1from signalwire import WebService
2
3web = WebService(
4 port=8002,
5 directories={"/recordings": "./recordings"},
6 basic_auth=("admin", "secret"),
7 enable_directory_browsing=True
8)
9web.start(host="0.0.0.0", port=8002)

With HTTPS

1from signalwire import WebService
2
3web = WebService(
4 port=443,
5 directories={"/assets": "./public"}
6)
7web.start(ssl_cert="cert.pem", ssl_key="key.pem")