Skip to main content

Pidgeon for Python

Mailboxes for AI agents. Pidgeon is the email inbox API for AI agents. It gives agents their own inboxes so they can work with emails just like a human.

pidgeon.ai · Documentation

pip install pidgeon

Create an address, send from it, wait for the answer, and reply in the thread:

import os

from pidgeon import AuthenticatedClient
from pidgeon.api.identities import identities_create
from pidgeon.api.messages import messages_await, messages_reply, messages_send
from pidgeon.models import (
    Error,
    IdentitiesCreateBody,
    IdentitiesCreateBodyType,
    MessagesReplyBody,
    MessagesSendBody,
)

client = AuthenticatedClient(
    base_url="https://pidgeon.ai/api/v1",
    token=os.environ["PIDGEON_API_KEY"],
)

# 1. An address of its own. Any free name on pidgeon.email works with no DNS.
created = identities_create.sync(
    client=client,
    body=IdentitiesCreateBody(address="scout@pidgeon.email", type_=IdentitiesCreateBodyType.AGENT),
)
if isinstance(created, Error):
    raise RuntimeError(created.error.message)
address = created.data

# 2. Send from it.
messages_send.sync(
    client=client,
    body=MessagesSendBody(
        from_=address.email,
        to="ops@example.com",
        subject="Staging access",
        text="Could you send me the access code?",
    ),
)

# 3. Receive: one held-open request until the answer arrives, up to 60 seconds.
awaited = messages_await.sync(client=client, identity_id=address.id, timeout=60)

# 4. Reply into the same conversation. Recipients and subject come off the original.
if not isinstance(awaited, Error) and awaited.data.message:
    print(awaited.data.message.extracted.codes)
    messages_reply.sync(
        awaited.data.message.id,
        client=client,
        body=MessagesReplyBody(text="Thanks, that worked."),
    )

PIDGEON_API_KEY is a pgn_live_… key. Make one at pidgeon.ai/app/developers/keys, or let your agent sign itself up: pidgeon.ai/skill.md.

Webhook signatures verify with pidgeon.webhooks.verify_webhook, which does the timing-safe compare and the replay window for you.

Contributing

The client is generated from openapi.json, the contract the API validates against, published at https://pidgeon.ai/openapi.json. The application that serves it is closed source; this client is not. This repository is copied from that one on every release.

So a pull request against generated code cannot be merged as written — the fix belongs in the schema it came from. Open an issue and say what is wrong.

Issues and questions: open one, or email support@pidgeon.ai.

MIT licensed.

Metadata

Release files for pidgeon 1.14.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pidgeon 1.14.1
File Size Uploaded
pidgeon-1.14.1.tar.gz 152.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pidgeon 1.14.1
File Interpreter ABI Platform
pidgeon-1.14.1-py3-none-any.whl Python 3 none any Details

Total release size: 577.3 kB

Release files / pidgeon-1.14.1.tar.gz

Download URL pidgeon-1.14.1.tar.gz
Size 152.2 kB
Tags Source
SHA-256 checksum
How to use checksums
51d8e8cbc6e10b4b262bbd44d92d81140cc61ad7cea8b34c508b6999e12e3fd9
BLAKE2b-256 checksum
How to use checksums
55354c74c08c9f46ac3fbdce86e884684811759eed50e1c5696f1e506b001e2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release files / pidgeon-1.14.1-py3-none-any.whl

Download URL pidgeon-1.14.1-py3-none-any.whl
Size 425.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ad49302d1beda42bcd29a4cd3f44d83a5e762e3093731d84f62c014393d8a00
BLAKE2b-256 checksum
How to use checksums
f8ffeb53ca34ee689bed3c31b42f0dc3fa22e9db590e01b950be08c16b1d6444
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.14.1 This release

2 release files

1.14.0

2 release files

1.13.0

2 release files

1.12.0

2 release files

1.11.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page