Skip to content

API reference

A pipeline-analytics API client.

Every operation except :meth:get_version and the two webhook receivers requires an authenticated session. pipeline-analytics authenticates browsers with WebAuthn <https://webauthn.guide/>, not an API token -- there is no headless credential-grant flow in the spec (a real token flow is requested in alrayyes/pipeline-analytics#178 <https://github.com/alrayyes/pipeline-analytics/issues/178>), so this client can't log in for you. Get a session cookie by logging into the dashboard in a browser, opening dev tools, and copying the session cookie's value. Pass it as session_cookie or set PIPELINE_ANALYTICS_SESSION in the environment -- the constructor argument wins when both are given.

The underlying generated client is available as :attr:raw for any operation this wrapper doesn't have a dedicated method for; every generated pipeline_analytics._generated.api.<tag>.<operation> module's sync_detailed/asyncio_detailed functions take it as their client argument.

raw property

The underlying generated Client.

aget_version() async

Async counterpart of :meth:get_version.

get_version()

The running server's build version. Needs no session -- a good first call to prove the client reaches the server at all.

Bases: Exception

Raised for any pipeline-analytics response carrying an error body.

Attributes:

Name Type Description
status_code

The HTTP status code.

code

The API's own machine-readable error code (empty string if the body wasn't the documented {code, message} shape).

message

The API's human-readable error message.

request_id

The X-Request-Id response header, or None if absent.

Build an :class:APIError from response, or return None if its status code isn't an error.

Decodes response.content directly rather than trusting the generated per-operation .parsed field, which is only populated for status codes the spec documents on that specific operation -- a 500 or 429 that survived every retry attempt still needs an APIError, and the API returns the same {code, message} shape for those too.

Usage::

response = sync_detailed(client=client.raw, ...)
if error := decode_error(response):
    raise error