Skip to main content

Python SDK for the Slotflow API — scheduling infrastructure for AI agents

Project description

Slotflow Python SDK

The official Python SDK for the Slotflow API — scheduling infrastructure for AI agents.

PyPI version Python 3.8+

Installation

pip install slotflow

Quick Start

from slotflow import Slotflow

client = Slotflow(api_key="sk_live_...")

# Create a human
human = client.humans.create(
    name="Alice Smith",
    timezone="America/New_York",
)

# Set their availability (Mon-Fri, 9am-5pm, 30/60 min meetings)
client.availability.set(
    human["id"],
    working_days=[1, 2, 3, 4, 5],
    work_start="09:00",
    work_end="17:00",
    meeting_durations=[30, 60],
)

# Find available slots
slots = client.slots.list(
    human["id"],
    date_from="2026-03-20",
    date_to="2026-03-25",
    duration=30,
)

# Book a slot
booking = client.bookings.create(
    human_id=human["id"],
    starts_at=slots["slots"][0]["starts_at"],
    duration=30,
    attendee_name="Bob Jones",
    attendee_email="bob@example.com",
)

Async Support

from slotflow import AsyncSlotflow

client = AsyncSlotflow(api_key="sk_live_...")
humans = await client.humans.list()

Resources

Humans

# List all humans
response = client.humans.list()

# Create a human
human = client.humans.create(
    name="Alice Smith",
    timezone="America/New_York",
    email="alice@example.com",  # optional
    role="Consultant",          # optional
)

# Get a human by ID
human = client.humans.get("human-id")

# Delete a human (soft delete)
client.humans.delete("human-id")

Availability

# Set availability (full replace)
client.availability.set(
    "human-id",
    working_days=[1, 2, 3, 4, 5],  # Mon-Fri
    work_start="09:00",
    work_end="17:00",
    meeting_durations=[30, 60],
)

Slots

# Get available slots
response = client.slots.list(
    "human-id",
    date_from="2026-03-20",
    date_to="2026-03-25",
    duration=30,
)

for slot in response["slots"]:
    print(f"{slot['starts_at']}{slot['ends_at']}")

Bookings

# Create a booking
booking = client.bookings.create(
    human_id="human-id",
    starts_at="2026-03-20T14:00:00.000Z",
    duration=30,
    attendee_name="Bob Jones",
    attendee_email="bob@example.com",
    metadata={"lead_id": "lead_123"},
)

# List bookings
response = client.bookings.list(
    human_id="human-id",
    status="confirmed",
    limit=10,
)

# Cancel a booking
client.bookings.cancel("booking-id")

Schedule Overrides

# Block time (vacation)
client.schedule_overrides.create(
    "human-id",
    type="block",
    title="Vacation",
    all_day=True,
    start_date="2026-04-01",
    end_date="2026-04-05",
)

# Add extra availability (weekend overtime)
client.schedule_overrides.create(
    "human-id",
    type="open",
    title="Weekend hours",
    all_day=False,
    start_date="2026-03-22",
    start_time="10:00",
    end_time="14:00",
)

# Recurring block (weekly team meeting)
client.schedule_overrides.create(
    "human-id",
    type="block",
    title="Team standup",
    all_day=False,
    start_date="2026-03-17",
    start_time="09:00",
    end_time="09:30",
    recurrence={"freq": "weekly", "interval": 1, "days": [1]},
)

# List overrides
response = client.schedule_overrides.list("human-id")

# Delete an override
client.schedule_overrides.delete("human-id", "override-id")

Webhooks

# Register a webhook
webhook = client.webhooks.create(
    url="https://your-app.com/webhooks/slotflow",
    events=["booking.confirmed", "booking.cancelled"],
)

# Save the signing secret for payload verification
print(webhook["signing_secret"])  # whsec_...

# List webhooks
response = client.webhooks.list()

# Delete a webhook
client.webhooks.delete("webhook-id")

Error Handling

from slotflow import Slotflow, NotFoundError, ConflictError, ValidationError

client = Slotflow(api_key="sk_live_...")

try:
    booking = client.bookings.create(
        human_id="human-id",
        starts_at="2026-03-20T14:00:00.000Z",
        duration=30,
        attendee_name="Bob",
    )
except ConflictError:
    print("Slot already taken")
except ValidationError as e:
    print(f"Invalid request: {e.message}")
except NotFoundError:
    print("Human not found")

Configuration

client = Slotflow(
    api_key="sk_live_...",
    base_url="https://api.slotflow.dev",  # default
    timeout=30.0,                          # seconds, default
)

Requirements

  • Python 3.8+
  • httpx (installed automatically)

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slotflow-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slotflow-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file slotflow-0.1.0.tar.gz.

File metadata

  • Download URL: slotflow-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for slotflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cac603eddf07037b34a006fa1bd3894ef603890262789f17c072ab89e7aabe1f
MD5 5959bb32679c6514a5adbed898d2fdb3
BLAKE2b-256 33d6ed6da76854ce5de308d8ff0cea55e7071ba493472be5cbf2f6069ef76c9e

See more details on using hashes here.

File details

Details for the file slotflow-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: slotflow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for slotflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dfa8d48c537ccefaf53072a700c02d91a3bd3e8e3bb648132d925d167cd7972
MD5 9783a0ddce8d2c9a5f4027925a292d3b
BLAKE2b-256 d20be673e844c9a95867d5b9a2ee463afba76b1a070ce7bf390774bbc134cf87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page