Python SDK

The official Slotflow SDK for Python. Supports both synchronous and asynchronous usage, with typed errors and full API coverage.

Installation

$pip install slotflow

Quick example

1from slotflow import Slotflow
2
3client = Slotflow(api_key="sk_live_your_api_key")
4
5# Find available slots
6response = client.slots.list(
7 "HUMAN_ID",
8 date_from="2026-03-15",
9 date_to="2026-03-20",
10 duration=30,
11)
12
13# Book the first slot
14booking = client.bookings.create(
15 human_id="HUMAN_ID",
16 starts_at=response["slots"][0]["starts_at"],
17 duration=30,
18 attendee_name="Alex Rivera",
19 attendee_email="alex@startup.io",
20 metadata={
21 "lead_id": "lead_8294",
22 "source": "ai_sdr",
23 },
24)

Async support

1from slotflow import AsyncSlotflow
2
3client = AsyncSlotflow(api_key="sk_live_your_api_key")
4
5response = await client.slots.list(
6 "HUMAN_ID",
7 date_from="2026-03-15",
8 date_to="2026-03-20",
9 duration=30,
10)

Both clients support context managers:

1with Slotflow(api_key="sk_live_...") as client:
2 humans = client.humans.list()
3
4async with AsyncSlotflow(api_key="sk_live_...") as client:
5 humans = await client.humans.list()

Resources

All API resources are available as methods on the client:

ResourceMethods
client.humanscreate, get, list, delete
client.availabilityset
client.schedule_overridescreate, list, delete
client.slotslist
client.bookingscreate, list, cancel
client.webhookscreate, list, delete

Error handling

The SDK raises typed exceptions you can catch and handle:

1from slotflow import Slotflow, ConflictError, PaymentRequiredError, NotFoundError, ValidationError
2
3client = Slotflow(api_key="sk_live_your_api_key")
4
5try:
6 booking = client.bookings.create(
7 human_id="HUMAN_ID",
8 starts_at="2026-03-15T14:00:00.000Z",
9 duration=30,
10 attendee_name="Alex Rivera",
11 )
12except ConflictError:
13 # 409 — slot was just booked by someone else
14 # Re-query slots and try the next one
15 pass
16except PaymentRequiredError:
17 # 402 — booking limit reached
18 pass
19except NotFoundError:
20 # 404 — human not found
21 pass
22except ValidationError as e:
23 # 422 — validation error (outside working hours, invalid duration, etc.)
24 print(e.code, e.message)

Configuration

1client = Slotflow(
2 api_key="sk_live_your_api_key",
3
4 # Override the default base URL
5 base_url="https://api.slotflow.dev",
6
7 # Override the default timeout (seconds)
8 timeout=30.0,
9)

Requirements