Skip to main content

Facilio Connections SDK (Python)

Integrator client for Connections /api/v1 using httpx. Concepts: ../README.md. HTTP paths, JSON shapes, headers: ../docs/api-reference.md.

Requirements: Python 3.10+. Import package: facilio_connections_sdk.


Installation

pip :

pip install facilio-connections-sdk

Walkthrough

Linear script-style example. With the default internal httpx client, call client.close() when finished (or pass your own http_client).

from facilio_connections_sdk import ConnectionsClient

# initialize connections client

client = ConnectionsClient("https://your-host", "your-service-token")

'''
Using Cookies instead of service token

 cfg = ConnectionsClientConfig(
    base_url="https://connections.facilio.com",
    service_token=None,
    csrf_token="",
    extra_headers={
        "Cookie": "fc.idToken.connections=xxxxxxxx; JSESSIONID=xxxxxx",
    },
    timeout_seconds=120.0,
)

client = ConnectionsClient.from_config(cfg) '''


# list connections
print(client.list_connections())


# get connection name
print(client.get_connection("servicenow-connection").get("connection").get("display_name"))

# get actions for the connection
print(client.list_actions("servicenow-connection"))

# get action inputs for the action
print(client.list_action_inputs("servicenow-connection", "add-comment-in-servicenow-task"))

result = client.connection("servicenow-connection").actions().execute("add-comment-in-servicenow-task", {
    "input": {
        "parentId": "1234567890",
        "body": "This is a test comment",
    }
})

print(result)
if result.get("job_id"):
    client.get_job_result(str(result["job_id"]))

# Same calls via fluent: client.connection("crm-prod").actions().execute("fetch-deal", {...})

client.close()

Request/response JSON uses snake_case. Failures raise ConnectionsApiError (status_code, body).


Method reference

Errors and lifecycle

Item Notes
ConnectionsApiError Raised on HTTP ≥ 400 or bad JSON. status_code, body.
client.close() Close the default internal httpx client.
Context manager with ConnectionsClient(...) as c: calls close() on exit.
Custom client ConnectionsClient(..., http_client=httpx.Client(...)) or from_config(..., http_client=…) — you own the client’s lifetime.

ConnectionsClientConfig (optional headers)

Field Sent as header (when set)
base_url Origin only; client calls {base_url}/api/v1/....
service_token X-Service-Token.
csrf_token X-CSRF-Token.
timeout_seconds httpx read/connect timeout.
extra_headers Merged last (e.g. Cookie).

Client construction

Method Purpose
ConnectionsClient(base_url, service_token="", *, http_client=None) Simple integrator ctor.
ConnectionsClient.from_config(ConnectionsClientConfig, *, http_client=None) Full config — see Local development.

Fluent roots (same HTTP as flat helpers)

Fluent HTTP
client.jobs().result(job_id) GET /jobs/{job_id}
client.connections().list(relay_id=None, *, authorized=None) GET /connections — lists all. authorized is accepted for compatibility but ignored; optional relay_id / template_id still narrow
client.actions_catalog().list() GET /actions (tenant-wide catalog; not per-connection)
client.connection(slug) Scope for one connection — see below

Jobs

Flat Fluent
get_job_result(job_id) jobs().result(job_id)

Connections

Flat Fluent (connection(slug)) HTTP
list_connections(relay_id=None, *, authorized=None) connections().list(...) GET /connections — lists all; authorized ignored. Call with no args to list everything
get_connection(slug) get() GET /connections/{slug}
authorize_connection(slug) authorize() POST /connections/{slug}/authorize body {}
unauthorize_connection(slug) unauthorize() POST /connections/{slug}/unauthorize body {}
toggle_connection_active(slug, active) set_active(active) POST /connections/{slug}/toggle-active body {"active": bool}

Actions — read (catalog vs connection)

Flat Fluent HTTP
list_all_actions() actions_catalog().list() GET /actions
list_actions(connection_slug) actions().list() GET /connections/{slug}/actions
get_action(connection_slug, action_slug) actions().get(action_slug) GET /connections/{slug}/actions/{action_slug}
list_action_inputs(connection_slug, action_slug) actions().list_inputs(action_slug) GET /connections/{slug}/actions/{action_slug}/inputs
list_action_output_meta(connection_slug, action_slug) actions().list_outputs(action_slug) GET /connections/{slug}/actions/{action_slug}/outputs

Saved action execute

Flat Fluent
execute_action(connection_slug, action_slug, body=None, *, async_=False, timeout_ms=None) connection(slug).actions().execute(action_slug, body=None, *, async_=False, timeout_ms=None)
  • HTTP: POST /connections/{slug}/actions/{action_slug}/execute with optional query async=true, timeout_ms=<int> (same rules as typed executors below).
  • Body: maps to JSON keys input, options (and any other keys the server accepts). Use list_action_inputs to discover input field names.

Execution options (source, purpose, debug, …)

Optional, forward-compatible execution metadata is passed as a separate argument, not nested in the body — available uniformly on every execute method (saved action + typed HTTP/file/SQL). Pass an options= dict or plain keyword arguments; the SDK merges them into the request body's options map, where the server reads them. No SDK change is needed when the server adds a new optional field — just pass it.

client.execute_action("gmail", "send", {"input": {"to": "a@b.com"}},
                      options={"source": "agent", "purpose": "sync", "debug": True})
# keyword form (equivalent):
client.execute_action("gmail", "send", {"input": {"to": "a@b.com"}},
                      source="agent", purpose="sync", debug=True)
# typed executors take the same options=:
client.execute_http_get("my-api", {"path": "/x"}, options={"source": "job"})

Omit options entirely and the request is byte-identical to before (fully backward compatible). Explicit keyword args win over the options= dict on conflict.

POST query combinations (async + timeout)

These apply to saved action execute and every typed HTTP / file / SQL POST below. Valid combinations:

async_ timeout_ms Query string
False None (none)
True None ?async=true
False 5000 ?timeout_ms=5000
True 5000 ?async=true&timeout_ms=5000

Async responses may include job_id → poll get_job_result.

Typed HTTP (same parameters, async_, timeout_ms on every row)

parameters typically includes path, query, headers, body (see api-reference.md).

Flat Fluent Path (under /api/v1/connections/{slug})
execute_http_get(...) http().get(...) POST .../http/get
execute_http_post(...) http().post(...) POST .../http/post
execute_http_patch(...) http().patch(...) POST .../http/patch
execute_http_put(...) http().put(...) POST .../http/put
execute_http_delete(...) http().delete(...) POST .../http/delete

Each flat signature: (connection_slug, parameters=None, *, async_=False, timeout_ms=None). Each fluent: (parameters=None, *, async_=False, timeout_ms=None).

Filesystem (FS connections)

Flat Fluent Path suffix
execute_file_read_file file().read /file/readFile
execute_file_upload_file file().upload /file/uploadFile
execute_file_append_file file().append /file/appendFile
execute_file_list_files file().list_files /file/listFiles
execute_file_rename_file file().rename /file/renameFile
execute_file_move_file file().move /file/moveFile
execute_file_delete_file file().delete /file/deleteFile

Same async_, timeout_ms as HTTP table.

SQL (SQL connections)

Flat Fluent Path suffix
execute_sql_query sql().query /sql/query
execute_sql_select sql().select /sql/select
execute_sql_insert sql().insert /sql/insert
execute_sql_update sql().update /sql/update
execute_sql_delete sql().delete /sql/delete
execute_sql_execute sql().execute /sql/execute (raw execute; not saved actions)

Same async_, timeout_ms as HTTP table. Parameter shapes: api-reference.md.

Triggers

Flat Fluent HTTP
list_triggers(slug, *, account_slug=None) connection(slug).triggers(account_slug=...) GET /connections/{slug}/triggers
get_trigger(slug, trigger, *, account_slug=None) connection(slug).trigger(trigger).get(account_slug=...) GET …/triggers/{trigger}
subscribe(slug, trigger, *, target_url, ...) connection(slug).trigger(trigger).subscribe(...) POST …/triggers/{trigger}/subscribers
unsubscribe(subscriber_id) flat only (the subscriber id alone names it) DELETE /subscribers/{id}
out = client.connection("github").trigger("issues").subscribe(
    target_url="https://app.facilio.com/api/v3/github",
    service="facilio",                     # service token, runs as you; add user_id=7 to run as someone else
    # or api_key="...", api_key_header="X-Key" (header defaults to x-api-key)
    account_id=414,                        # or account="github-account-2"; may be left out with one usable account
    inputs={"repository": "owner/name"},   # what the trigger needs (trigger["config"]["inputs"])
    name="Work orders",                    # optional
)
# out["created"] is False when already subscribed (safe on every start-up).
# ConnectionsApiError with status_code 502: the provider refused, nothing was saved.

listed = client.connection("github").triggers()
# listed["triggers"][i]["subscriptions"]: your subscribers on it, for listed["account"]
# (the one an action run would use for you; pass account_slug="..." for another of yours).
client.connection("github").trigger("issues").get()   # {"trigger", "account"}; trigger["subscriptions"] too

removed = client.unsubscribe(out["subscriber"]["id"])
# {"id", "deleted", "webhook"?}: deleted is False when it was already gone (safe to retry). "webhook" appears
# when it was the last subscriber, and says whether the webhook was removed at the provider.
# ConnectionsApiError with status_code 403: you're not an org admin (only admins may unsubscribe).

Flat equivalents: list_triggers(slug), get_trigger(slug, trigger), subscribe(slug, trigger, ...), unsubscribe(subscriber_id). Subscribers are changed in the Connections UI.

Full flat → fluent equivalence (checklist)

Every execute_* row above is client.connection(slug).<executor>().<verb>(parameters, async_=…, timeout_ms=…). list_* / get_* / lifecycle methods either have the fluent shown in the tables or are only on connection(slug) / actions_catalog() / connections() / jobs().


Local development without a service token (cookies + CSRF)

from facilio_connections_sdk import ConnectionsClient, ConnectionsClientConfig

cfg = ConnectionsClientConfig(
    base_url="http://localhost:8081",
    service_token=None,
    csrf_token="paste-fc-csrfToken-cookie-value",
    extra_headers={
        "Cookie": "JSESSIONID=...; fc.idToken.connections=...; fc.csrfToken=...",
    },
    timeout_seconds=120.0,
)

client = ConnectionsClient.from_config(cfg)

Metadata

Release files for facilio-connections-sdk 0.7.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 facilio-connections-sdk 0.7.0
File Size Uploaded Provenance Actions
facilio_connections_sdk-0.7.0.tar.gz 18.1 kB Without provenance Details for facilio_connections_sdk-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for facilio-connections-sdk 0.7.0
File Interpreter ABI Platform Actions
facilio_connections_sdk-0.7.0-py3-none-any.whl Python 3 none any Details for facilio_connections_sdk-0.7.0-py3-none-any.whl

Total release size: 36.2 kB

Release files / facilio_connections_sdk-0.7.0.tar.gz

Download URL facilio_connections_sdk-0.7.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e11352e7686529b4075dc4af667b013136712eaabe61ffe3a60248bfe32c8ff1
BLAKE2b-256 checksum
How to use checksums
1e9c27ec063b4e8973c61583208ce6dfa7afa12b29af41d6507612e1edd81180
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Release files / facilio_connections_sdk-0.7.0-py3-none-any.whl

Download URL facilio_connections_sdk-0.7.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8902db748ff1f35d4621cf63850f5de3c7d8ba5a31059ab28c3ebbb4dc6c245
BLAKE2b-256 checksum
How to use checksums
3931ac21d7646eda05fba25073710ce069db036a2abc3ae59f89cb09cee793de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.8

Security for facilio-connections-sdk 0.7.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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