DailyRest

Daily REST Helpers.

Methods that wrap the Daily API to create rooms, check room URLs, and get meeting tokens.

class pipecat.transports.services.helpers.daily_rest.DailyRoomSipParams(*, display_name='sw-sip-dialin', video=False, sip_mode='dial-in', num_endpoints=1)[source]

Bases: BaseModel

SIP configuration parameters for Daily rooms.

Parameters:
  • display_name (str)

  • video (bool)

  • sip_mode (str)

  • num_endpoints (int)

display_name

Name shown for the SIP endpoint

Type:

str

video

Whether video is enabled for SIP

Type:

bool

sip_mode

SIP connection mode, typically ‘dial-in’

Type:

str

num_endpoints

Number of allowed SIP endpoints

Type:

int

display_name: str
video: bool
sip_mode: str
num_endpoints: int
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.services.helpers.daily_rest.RecordingsBucketConfig(*, bucket_name, bucket_region, assume_role_arn, allow_api_access=False)[source]

Bases: BaseModel

Configuration for storing Daily recordings in a custom S3 bucket.

Refer to the Daily API documentation for more information: https://docs.daily.co/guides/products/live-streaming-recording/storing-recordings-in-a-custom-s3-bucket

Parameters:
  • bucket_name (str)

  • bucket_region (str)

  • assume_role_arn (str)

  • allow_api_access (bool)

bucket_name: str
bucket_region: str
assume_role_arn: str
allow_api_access: bool
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.services.helpers.daily_rest.DailyRoomProperties(*, exp=None, enable_chat=False, enable_prejoin_ui=False, enable_emoji_reactions=False, eject_at_room_exp=False, enable_dialout=None, enable_recording=None, geo=None, max_participants=None, recordings_bucket=None, sip=None, sip_uri=None, start_video_off=False, **extra_data)[source]

Bases: BaseModel

Properties for configuring a Daily room.

Parameters:
  • exp (float | None)

  • enable_chat (bool)

  • enable_prejoin_ui (bool)

  • enable_emoji_reactions (bool)

  • eject_at_room_exp (bool)

  • enable_dialout (bool | None)

  • enable_recording (Literal['cloud', 'local', 'raw-tracks'] | None)

  • geo (str | None)

  • max_participants (int | None)

  • recordings_bucket (RecordingsBucketConfig | None)

  • sip (DailyRoomSipParams | None)

  • sip_uri (dict | None)

  • start_video_off (bool)

  • extra_data (Any)

exp

Optional Unix epoch timestamp for room expiration (e.g., time.time() + 300 for 5 minutes)

Type:

float | None

enable_chat

Whether chat is enabled in the room

Type:

bool

enable_prejoin_ui

Whether the pre-join UI is enabled

Type:

bool

enable_emoji_reactions

Whether emoji reactions are enabled

Type:

bool

eject_at_room_exp

Whether to remove participants when room expires

Type:

bool

enable_dialout

Whether SIP dial-out is enabled

Type:

bool | None

enable_recording

Recording settings (‘cloud’, ‘local’, ‘raw-tracks’)

Type:

Literal[‘cloud’, ‘local’, ‘raw-tracks’] | None

geo

Geographic region for room

Type:

str | None

max_participants

Maximum number of participants allowed in the room

Type:

int | None

sip

SIP configuration parameters

Type:

pipecat.transports.services.helpers.daily_rest.DailyRoomSipParams | None

sip_uri

SIP URI information returned by Daily

Type:

dict | None

start_video_off

Whether video is off by default

Type:

bool

Reference: https://docs.daily.co/reference/rest-api/rooms/create-room#properties

exp: float | None
enable_chat: bool
enable_prejoin_ui: bool
enable_emoji_reactions: bool
eject_at_room_exp: bool
enable_dialout: bool | None
enable_recording: Literal['cloud', 'local', 'raw-tracks'] | None
geo: str | None
max_participants: int | None
recordings_bucket: RecordingsBucketConfig | None
sip: DailyRoomSipParams | None
sip_uri: dict | None
start_video_off: bool
property sip_endpoint: str

Get the SIP endpoint URI if available.

Returns:

SIP endpoint URI or empty string if not available

Return type:

str

model_config: ClassVar[ConfigDict] = {'extra': 'allow'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.services.helpers.daily_rest.DailyRoomParams(*, name=None, privacy='public', properties=<factory>)[source]

Bases: BaseModel

Parameters for creating a Daily room.

Parameters:
  • name (str | None)

  • privacy (Literal['private', 'public'])

  • properties (DailyRoomProperties)

name

Optional custom name for the room

Type:

str | None

privacy

Room privacy setting (‘private’ or ‘public’)

Type:

Literal[‘private’, ‘public’]

properties

Room configuration properties

Type:

pipecat.transports.services.helpers.daily_rest.DailyRoomProperties

name: str | None
privacy: Literal['private', 'public']
properties: DailyRoomProperties
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.services.helpers.daily_rest.DailyRoomObject(*, id, name, api_created, privacy, url, created_at, config)[source]

Bases: BaseModel

Represents a Daily room returned by the API.

Parameters:
  • id (str)

  • name (str)

  • api_created (bool)

  • privacy (str)

  • url (str)

  • created_at (str)

  • config (DailyRoomProperties)

id

Unique room identifier

Type:

str

name

Room name

Type:

str

api_created

Whether room was created via API

Type:

bool

privacy

Room privacy setting (‘private’ or ‘public’)

Type:

str

url

Full URL for joining the room

Type:

str

created_at

Timestamp of room creation in ISO 8601 format (e.g., “2019-01-26T09:01:22.000Z”).

Type:

str

config

Room configuration properties

Type:

pipecat.transports.services.helpers.daily_rest.DailyRoomProperties

id: str
name: str
api_created: bool
privacy: str
url: str
created_at: str
config: DailyRoomProperties
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.services.helpers.daily_rest.DailyMeetingTokenProperties(*, room_name=None, eject_at_token_exp=None, eject_after_elapsed=None, nbf=None, exp=None, is_owner=None, user_name=None, user_id=None, enable_screenshare=None, start_video_off=None, start_audio_off=None, enable_recording=None, enable_prejoin_ui=None, start_cloud_recording=None, permissions=None)[source]

Bases: BaseModel

Properties for configuring a Daily meeting token.

Refer to the Daily API documentation for more information: https://docs.daily.co/reference/rest-api/meeting-tokens/create-meeting-token#properties

Parameters:
  • room_name (str | None)

  • eject_at_token_exp (bool | None)

  • eject_after_elapsed (int | None)

  • nbf (int | None)

  • exp (int | None)

  • is_owner (bool | None)

  • user_name (str | None)

  • user_id (str | None)

  • enable_screenshare (bool | None)

  • start_video_off (bool | None)

  • start_audio_off (bool | None)

  • enable_recording (Literal['cloud', 'local', 'raw-tracks'] | None)

  • enable_prejoin_ui (bool | None)

  • start_cloud_recording (bool | None)

  • permissions (dict | None)

room_name: str | None
eject_at_token_exp: bool | None
eject_after_elapsed: int | None
nbf: int | None
exp: int | None
is_owner: bool | None
user_name: str | None
user_id: str | None
enable_screenshare: bool | None
start_video_off: bool | None
start_audio_off: bool | None
enable_recording: Literal['cloud', 'local', 'raw-tracks'] | None
enable_prejoin_ui: bool | None
start_cloud_recording: bool | None
permissions: dict | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.services.helpers.daily_rest.DailyMeetingTokenParams(*, properties=<factory>)[source]

Bases: BaseModel

Parameters for creating a Daily meeting token.

Refer to the Daily API documentation for more information: https://docs.daily.co/reference/rest-api/meeting-tokens/create-meeting-token#body-params

Parameters:

properties (DailyMeetingTokenProperties)

properties: DailyMeetingTokenProperties
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pipecat.transports.services.helpers.daily_rest.DailyRESTHelper(*, daily_api_key, daily_api_url='https://api.daily.co/v1', aiohttp_session)[source]

Bases: object

Helper class for interacting with Daily’s REST API.

Provides methods for creating, managing, and accessing Daily rooms.

Parameters:
  • daily_api_key (str) – Your Daily API key

  • daily_api_url (str) – Daily API base URL (e.g. “https://api.daily.co/v1”)

  • aiohttp_session (ClientSession) – Async HTTP session for making requests

get_name_from_url(room_url)[source]

Extract room name from a Daily room URL.

Parameters:

room_url (str) – Full Daily room URL

Returns:

Room name portion of the URL

Return type:

str

async get_room_from_url(room_url)[source]

Get room details from a Daily room URL.

Parameters:

room_url (str) – Full Daily room URL

Returns:

DailyRoomObject instance for the room

Return type:

DailyRoomObject

async create_room(params)[source]

Create a new Daily room.

Parameters:

params (DailyRoomParams) – Room configuration parameters

Returns:

DailyRoomObject instance for the created room

Return type:

DailyRoomObject

Raises:

Exception – If room creation fails or response is invalid

async get_token(room_url, expiry_time=3600, eject_at_token_exp=False, owner=True, params=None)[source]

Generate a meeting token for user to join a Daily room.

Parameters:
  • room_url (str) – Daily room URL

  • expiry_time (float) – Token validity duration in seconds (default: 1 hour)

  • eject_at_token_exp (bool) – Whether to eject user when token expires

  • owner (bool) – Whether token has owner privileges

  • params (DailyMeetingTokenParams | None) – Optional additional token properties. Note that room_name, exp, and is_owner will be set based on the other function parameters regardless of values in params.

Returns:

Meeting token

Return type:

str

Raises:

Exception – If token generation fails or room URL is missing

async delete_room_by_url(room_url)[source]

Delete a room using its URL.

Parameters:

room_url (str) – Daily room URL

Returns:

True if deletion was successful

Return type:

bool

async delete_room_by_name(room_name)[source]

Delete a room using its name.

Parameters:

room_name (str) – Name of the room to delete

Returns:

True if deletion was successful

Return type:

bool

Raises:

Exception – If deletion fails (excluding 404 Not Found)