Installing
Your first request
You’ll need an API key from Settings > API keys (see API keys). Then:isinstance check matters. A failed request doesn’t raise: it comes back as an ErrorResponse, so result is one of the two. Your type checker will tell you if you skip the check.
How endpoints work
Every endpoint is a module with four functions:syncreturns the parsed body, or anErrorResponsefor a documented error.sync_detailedreturns aResponsewithstatus_code,headers, andparsed. This is the most direct way to tell success from failure.asyncioandasyncio_detailedare the async versions of the two above, and share the same client.
Pagination
List endpoints are cursor-paginated. Read the next cursor frompagination_meta.after and pass it back as after:
UNSET rather than None, which is why the check above looks for Unset.
Configuration
AuthenticatedClient takes keyword arguments:
raise_on_unexpected_status=True raises incident_io.errors.UnexpectedStatus for a status code the schema doesn’t document, instead of returning None. Documented errors still come back as an ErrorResponse.
The client is built on httpx. 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(...).
Deprecated endpoints
Endpoints we’ve deprecated (for example thev1 incidents and custom fields endpoints, superseded by v2) stay 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
The SDK is kept up to date with the API automatically. Additions to the API are minor versions. A change that would break your code, like a removed field, is released as a new major version, and its release notes list what changed.Resources
PyPI
The
incident-io package and its versions.GitHub
Source, README, and issues for the Python SDK.
API reference
Endpoints, authentication, rate limits, and errors.
All SDKs
Clients for Go, TypeScript, Rust, Ruby, PHP, and .NET.