knockapi
The official Python library for the knock API
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and is Apache-2.0 licensed. It provides a well-typed, modern Python interface to Knock's API with both sync and async support. Install it if you need to integrate Knock notifications into a Python application.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; KNOCK_API_KEY environment variable or explicit api_key parameter needed for authentication.
- Low install friction with a pure-Python wheel distribution.
- The package is actively maintained with a recent release (29 days old) and supports current Python versions (3.9–3.14).
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing use in commercial and private projects with minimal restrictions; attribution required.
last release 2026-07-16 (29 days) · last repo commit 2026-08-14 · 16 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,044,728 downloads/mo, #4,453 on PyPI
Alternatives
Verify before relying
pip install knockapi
import os
from knockapi import Knock
client = Knock(api_key=os.environ.get("KNOCK_API_KEY"))
response = client.workflows.trigger(
key="dinosaurs-loose",
recipients=["dnedry"],
data={"dinosaur": "triceratops"},
)
print(response.workflow_run_id)- Whether the Knock service itself has SLA/uptime guarantees relevant to production use.
- Rate-limit behavior and backoff strategy beyond the documented 2x automatic retry default.
- Performance characteristics of auto-pagination for large result sets.
What it is and what it does
knockapi is the official Python client for Knock's REST API, generated by Stainless. It wraps HTTP calls to Knock's notification and workflow service with a typed, object-oriented interface. Both synchronous (Knock) and asynchronous (AsyncKnock) clients are provided, powered by httpx; the async client can optionally use aiohttp for higher concurrency. All request parameters and response fields are typed using TypedDicts and Pydantic models, enabling IDE autocomplete and type checking.
The library handles pagination automatically, error classification (connection errors, 4xx/5xx responses), and retries (2x by default for transient failures, 408, 429, and 5xx errors). Responses include helper methods for serialization (to_json, to_dict). It targets developers building notification workflows, triggering campaigns, or managing user data through Knock's API.
Use it for
- Trigger notification workflows programmatically from a Python application with typed parameters and response validation.
- Build async notification systems using AsyncKnock for high-concurrency environments without blocking I/O.
- Iterate over paginated user or message lists automatically without manual page-fetching logic.
- Handle API errors with specific exception types (RateLimitError, AuthenticationError, etc.) for granular retry/fallback logic.
- Integrate Knock notifications into a Django, FastAPI, or other Python web framework with full type hints for IDE support.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, low install friction, and is Apache-2.0 licensed. It provides a well-typed, modern Python interface to Knock's API with both sync and async support. Install it if you need to integrate Knock notifications into a Python application.
Install
knockapi on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release (29 days old) and supports current Python versions (3.9–3.14). Six runtime dependencies are all well-established libraries.
Requires Python 3.9 or later; KNOCK_API_KEY environment variable or explicit api_key parameter needed for authentication.
License in practice
Licensed under Apache-2.0 (permissive), allowing use in commercial and private projects with minimal restrictions; attribution required.
Quickstart
pip install knockapi
import os
from knockapi import Knock
client = Knock(api_key=os.environ.get("KNOCK_API_KEY"))
response = client.workflows.trigger(
key="dinosaurs-loose",
recipients=["dnedry"],
data={"dinosaur": "triceratops"},
)
print(response.workflow_run_id)
Verify before relying
- Whether the Knock service itself has SLA/uptime guarantees relevant to production use.
- Rate-limit behavior and backoff strategy beyond the documented 2x automatic retry default.
- Performance characteristics of auto-pagination for large result sets.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesanyiodistrohttpxpydanticsniffiotyping-extensions |
| Maintenance | Actively maintained 29 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,044,728 / month, #4,453 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: knockapi-1.29.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “knock api client python”
- knockapiProvides a typed Python client library for the Knock REST API,…
- twentyc.rpcA client library for consuming 20c's RESTful API, built on top of the…
- codewords-clientA Python client library for the Codewords API with built-in FastAPI…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also agentex-client · composio-client · arcadepy · opencode-ai · letta-client · sambanova · simple-rest-client · braintrust-api · hiddenlayer-sdk · vkbottle-types