Registry /
type-stubs / mypy-boto3-apigatewaymanagementapi
Install & Compatibility
Where this runs
tested against v1.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.9s · import 0.000s · 19MB
71MB installed
● package 71MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ApiGatewayManagementApiClient
✓ from mypy_boto3_apigatewaymanagementapi import ApiGatewayManagementApiClient
✗ from mypy_boto3_apigatewaymanagementapi import ApiGatewayManagementApiClient
This quickstart demonstrates how to initialize an `ApiGatewayManagementApiClient` with type hints and make a sample call to `post_to_connection`. It highlights that `mypy-boto3` stubs provide compile-time type checking without altering `boto3`'s runtime behavior. Remember to provide a valid `endpoint_url` for `ApiGatewayManagementApi`.
import os
import boto3
from mypy_boto3_apigatewaymanagementapi.client import ApiGatewayManagementApiClient
# Initialize a boto3 client with type hints
# For local testing, ensure AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY are set.
# ApiGatewayManagementApi typically requires an endpoint_url.
client: ApiGatewayManagementApiClient = boto3.client(
"apigatewaymanagementapi",
region_name=os.environ.get("AWS_REGION", "us-east-1"),
endpoint_url=os.environ.get("APIGATEWAY_MGMT_ENDPOINT_URL", "https://example.execute-api.us-east-1.amazonaws.com/prod")
)
# Example: Post data to a connection
try:
connection_id = "some-connection-id" # Replace with an actual connection ID
data_to_send = b"Hello from mypy-boto3!"
response = client.post_to_connection(
ConnectionId=connection_id,
Data=data_to_send
)
print(f"Successfully posted to connection {connection_id}. Response: {response}")
except client.exceptions.GoneException:
print(f"Connection {connection_id} is gone.")
except Exception as e:
print(f"An error occurred: {e}")
# Mypy will now validate client method calls and argument types:
# client.non_existent_method() # Mypy would flag this as an error
Debug
Known issues
breakingAs of `mypy-boto3-builder` version 8.12.0, all generated `mypy-boto3` packages (including `mypy-boto3-apigatewaymanagementapi`) officially removed support for Python 3.8. Projects now require Python >= 3.9.fixUpgrade your project's Python interpreter to 3.9 or newer.
affects: >=8.12.0 of mypy-boto3-builder (and generated packages)
gotchaThese stubs provide static type checking only; they do not alter `boto3`'s runtime behavior. You still need to install and use `boto3` as usual for your application to function.fixEnsure `boto3` is installed alongside `mypy-boto3-apigatewaymanagementapi`. The stubs enhance developer experience, but `boto3` remains the runtime dependency.
affects: All versions
gotchaThe `ApiGatewayManagementApi` client typically requires an `endpoint_url` parameter to specify the API Gateway's invocation URL (e.g., `https://{api_id}.execute-api.{region}.amazonaws.com/{stage}`). This is crucial for correctly routing requests to your specific API Gateway instance.fixAlways provide the correct `endpoint_url` when initializing the `ApiGatewayManagementApiClient` for your environment, especially in production or when testing against deployed APIs.
affects: All versions
gotchaTo fully benefit from these type stubs, ensure `mypy` is installed in your development environment and configured to check your project. Run `mypy your_project_path` to enable type checking.fixInstall `mypy` (e.g., `pip install mypy`) and integrate it into your CI/CD pipeline or local development workflow.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredProvides runtime functionality; stubs are for type checking its API.