Skip to main content

incident.io Python SDK

PyPI

The official Python SDK for the incident.io public API.

It is generated automatically from our published OpenAPI schema, so it always tracks the live API — there is a function for every endpoint, and a type for every request and response.

Install

pip install incident-io

Requires Python 3.11 or later.

Quickstart

Create an API key in your incident.io dashboard under Settings → API keys, then:

from incident_io import AuthenticatedClient
from incident_io.api.incidents_v2 import incidents_v2_list
from incident_io.models import IncidentsListResultV2

client = AuthenticatedClient(
    base_url="https://api.incident.io",
    token="my-api-key",
)

result = incidents_v2_list.sync(client=client, page_size=25)
if isinstance(result, IncidentsListResultV2):
    for incident in result.incidents:
        print(incident.reference, incident.name)

The isinstance check isn't ceremony: a failed request comes back as an ErrorResponse rather than raising, so result is one of the two. The SDK ships type annotations, so a type checker will tell you if you skip it.

Every endpoint is a module with four functions. sync returns the parsed body — but note that our error responses are typed too, so a failed request returns an ErrorResponse rather than raising. sync_detailed returns a Response carrying status_code, headers and parsed, which is the straightforward way to tell the two apart:

response = incidents_v2_list.sync_detailed(client=client)
if response.status_code != 200:
    raise RuntimeError(f"unexpected status {response.status_code}: {response.content!r}")

Async

asyncio and asyncio_detailed mirror the two functions above, and share the same client:

result = await incidents_v2_list.asyncio(client=client, page_size=25)

Configuration

AuthenticatedClient takes keyword arguments:

client = AuthenticatedClient(
    base_url="https://api.incident.io",
    token="my-api-key",
    timeout=httpx.Timeout(30.0),                  # defaults to httpx's own
    headers={"User-Agent": "my-app/1.0.0"},       # identify your integration
    raise_on_unexpected_status=True,              # raise instead of returning None
    httpx_args={"proxy": "http://localhost:8080"},
)

Pass raise_on_unexpected_status=True to raise incident_io.errors.UnexpectedStatus on a status the schema doesn't document, instead of returning None. Documented errors still come back as an ErrorResponse; check status_code for those.

To reuse a connection pool or bring your own transport, pass httpx_args, or hand the client a configured instance with client.set_httpx_client(...).

Pagination

List endpoints are cursor-paginated. Read the next cursor from pagination_meta.after and pass it back as after:

from incident_io.types import UNSET, Unset

after: str | Unset = UNSET
while True:
    page = incidents_v2_list.sync(client=client, page_size=100, after=after)
    if not isinstance(page, IncidentsListResultV2):
        raise RuntimeError(f"request failed: {page}")

    for incident in page.incidents:
        print(incident.reference, incident.name)

    # Both the metadata and the cursor within it are optional: the last page
    # has no cursor to follow.
    if isinstance(page.pagination_meta, Unset) or isinstance(page.pagination_meta.after, Unset):
        break
    after = page.pagination_meta.after

Deprecated endpoints

Endpoints that incident.io has deprecated (for example the v1 incidents and custom fields endpoints, superseded by v2) remain available, but calling one issues a DeprecationWarning naming the endpoint. Python hides these by default, so run with -W default::DeprecationWarning to see them.

Versioning

Releases are cut automatically whenever the API schema changes. We use SemVer: additive API changes bump the minor version. Changes that would break existing code bump the major version, and the release notes list what broke.

Support

Found a bug or missing something? Please open an issue. For questions about the API itself, see the API docs.

Note that everything under incident_io/ is generated - please don't send PRs editing it directly; changes there come from the upstream schema.

License

MIT - see LICENSE.

This SDK's generated code is produced by openapi-python-client, which is licensed under MIT.

Metadata

Release files for incident-io 2.8.0

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

Source distribution (sdist)

Source distribution for incident-io 2.8.0
File Size Uploaded Provenance
incident_io-2.8.0.tar.gz 1.0 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for incident-io 2.8.0
File Interpreter ABI Platform
incident_io-2.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.7 MB

Release files / incident_io-2.8.0.tar.gz

Download URL incident_io-2.8.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
8ff4ec6a388c6f1d9fb3d3a26361669687e4be428f3e3f5d5e7d02841580e3da
BLAKE2b-256 checksum
How to use checksums
a62d852a5a3690370528d4ccabde580f4490f592b23d257594b4fa2fd4866f98
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 6, 2026.

Transparency log

Release files / incident_io-2.8.0-py3-none-any.whl

Download URL incident_io-2.8.0-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cd5776ff66509e8ffe38d17599fa64316a457e9382475dedc403bb224e81bb6f
BLAKE2b-256 checksum
How to use checksums
a92cda85857ef1253594cd7f357ea26f11bd55436166ab38bea7a843e0e3fd9a
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 6, 2026.

Transparency log

Security for incident-io 2.8.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for incident_io-2.8.0.tar.gz

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 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.8.0 This release

2 release files Full provenance

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