Skip to main content

Parloa Python SDK

Official Python client for the Parloa API.

Installation

pip install parloa

Usage

Authenticate with Parloa.token_provider(). It caches OAuth tokens and refreshes them before expiry. Pass provider.create_sync_fetcher() to Parloa and provider.create_async_fetcher() to AsyncParloa. Any RefreshableTokenProvider or AsyncRefreshableTokenProvider is retried once after a 401 by calling refresh(). base_url is required. Pass EnvironmentBaseUrl to derive the gateway from a Parloa environment and resolve tenant gateways, or StaticBaseUrl to pin every request to one URL (see Automatic gateway resolution).

from parloa import Parloa, ParloaEnvironment
from parloa.base_url import EnvironmentBaseUrl

CLIENT_ID = "client_01HZX9YQK0V4N4G9Z8B7Q1T2C3"
CLIENT_SECRET = "client_secret"
BLUEPRINT_ID = "9e107d9d-372b-4144-a03c-1b1a5f9b4b18"

base_url = EnvironmentBaseUrl(environment=ParloaEnvironment.PRODUCTION_EU)
provider = Parloa.token_provider(
    client_id=CLIENT_ID,
    client_secret=CLIENT_SECRET,
    base_url=base_url,
)

client = Parloa(base_url=base_url, token=provider.create_sync_fetcher())
channels = client.channels.list()
print(channels.data[0].name)

skills = client.skills.list(blueprint_id=BLUEPRINT_ID)
print(skills.data[0].name)

Async usage follows the same pattern with AsyncParloa:

import asyncio

from parloa import AsyncParloa, ParloaEnvironment
from parloa.base_url import EnvironmentBaseUrl

async def main() -> None:
    base_url = EnvironmentBaseUrl(environment=ParloaEnvironment.PRODUCTION_EU)
    provider = AsyncParloa.token_provider(
        client_id="client_01HZX9YQK0V4N4G9Z8B7Q1T2C3",
        client_secret="client_secret",
        base_url=base_url,
    )
    client = AsyncParloa(base_url=base_url, token=provider.create_async_fetcher())
    channels = await client.channels.list()
    print(channels.data[0].name)

asyncio.run(main())

Custom request headers

Pass headers to send extra headers on every request, for example a User-Agent that identifies your tool. Pass the same headers to token_provider() so token requests carry them too. The SDK's own X-Fern-* headers are still sent.

headers = {"User-Agent": "example-tool/1.2.3"}
provider = Parloa.token_provider(
    client_id=CLIENT_ID,
    client_secret=CLIENT_SECRET,
    base_url=EnvironmentBaseUrl(environment=ParloaEnvironment.PRODUCTION_EU),
    headers=headers,
)
client = Parloa(
    base_url=EnvironmentBaseUrl(environment=ParloaEnvironment.PRODUCTION_EU),
    token=provider.create_sync_fetcher(),
    headers=headers,
)

Automatic gateway resolution

base_url is required. It is one of two objects, distinguished by type:

  • EnvironmentBaseUrl (type="environment") — the SDK derives the control-plane gateway from environment (default ParloaEnvironment.PRODUCTION_US) and resolves the correct API gateway for each API group before sending a request.
  • StaticBaseUrl (type="static") — every sub-client is pinned to base_url by default. Automatic resolution is off. Use this only if you were explicitly instructed to do so for the SDK integration.

StaticBaseUrl also takes a resolve_base_url flag (default False). Set it to True to resolve tenant gateways through the tenant URLs API — using base_url as the control-plane host for the resolution request — for a host that isn't one of the published ParloaEnvironment members, for example a testing gateway. Use this only for testing against your local testing mocks, or if explicitly instructed by a Parloa representative.

from parloa import Parloa, ParloaEnvironment
from parloa.base_url import EnvironmentBaseUrl, StaticBaseUrl

client = Parloa(
    base_url=EnvironmentBaseUrl(environment=ParloaEnvironment.PRODUCTION_EU),
    token=provider.create_sync_fetcher(),
)
channels = client.channels.list()

client = Parloa(
    base_url=StaticBaseUrl(base_url="https://your.special.host"),
    token=provider.create_sync_fetcher(),
)

# A host outside the published environments, with resolution turned back on
client = Parloa(
    base_url=StaticBaseUrl(base_url="https://your.special.host", resolve_base_url=True),
    token=provider.create_sync_fetcher(),
)

What happens on each request

With EnvironmentBaseUrl, each request follows this flow:

  1. You access a sub-client, for example client.channels.
  2. Before the HTTP request is sent, an httpx event hook looks up your URL map — from an in-memory cache when available, otherwise from the tenant URLs API (GET /v1/urls).
  3. The hook looks up the tag for that sub-client (e.g. channels) and rewrites the request host to the tenant URL.
  4. The actual API call goes to the resolved gateway. A resolved host that is not parloa.com, parloa.us, or a subdomain of either is refused and the request is not sent.

Tenant URLs are cached for one hour, so later calls to the same process reuse the map without another /v1/urls round trip.

@startuml
actor User
participant "Parloa" as Client
participant "__getattribute__" as GetAttr
participant "Tenant URLs\n(/v1/urls)" as TenantUrls
participant "Channels API" as Channels

User -> Client : channels.list()
Client -> GetAttr : access client.channels
GetAttr -> Client : build ChannelsClient\n(with URL resolver hook)
Client -> TenantUrls : GET /v1/urls\n(cached after first call)
TenantUrls --> Client : {"channels": "https://runtime.example.com", ...}
Client -> Channels : GET /v1/channels\n(host rewritten)
Channels --> Client : response
Client --> User : channels
@enduml

The tenant_urls sub-client is excluded from this rewrite — it must always hit the default API gateway to fetch the map.

Metadata

Release files for parloa 1.0.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 parloa 1.0.0
File Size Uploaded Provenance Actions
parloa-1.0.0.tar.gz 718.5 kB With provenance Details for parloa-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 2.2 MB

Release files / parloa-1.0.0.tar.gz

Download URL parloa-1.0.0.tar.gz
Size 718.5 kB
Tags Source
SHA-256 checksum
How to use checksums
55e60d7167976fbcc4e8e9a34add669c42bf1b26d9a299c6f40abd2fdbe05d9f
BLAKE2b-256 checksum
How to use checksums
90a3441a58ff3a59be411194f87febdf548a2d6f350a6a6611f3a1371405ad41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Release files / parloa-1.0.0-py3-none-any.whl

Download URL parloa-1.0.0-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0f17f5947445bb2cc6f9d3c9e087560c403ba21f40f09bd5bf392bf34b6064ea
BLAKE2b-256 checksum
How to use checksums
612de2d74d6e91ec77a5803eb6211b2b30280ec095c30875f60c8d23605aa5ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Security for parloa 1.0.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for parloa-1.0.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 Nov 3, 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

1.0.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