lansweeper-helpdesk
A Python SDK for the Lansweeper Helpdesk API. Create, retrieve, search, and manage helpdesk tickets programmatically.
Note: The Lansweeper Helpdesk API appears to be unmaintained and may be deprecated in the future. This SDK wraps the existing API as-is.
Installation
pip install lansweeper-helpdesk
Quick Start
from lansweeper_helpdesk import HelpdeskAPI
api = HelpdeskAPI(
base_url="https://your-helpdesk-url:443/api.aspx",
api_key="your-api-key",
cert_path="/path/to/cert.pem", # optional
)
# Create a ticket
ticket = api.create_ticket(
subject="Network Issue",
description="Cannot reach internal network",
email="user@example.com",
)
# Get ticket details (HTML is auto-stripped)
ticket = api.get_ticket("12345")
print(ticket["Description"])
API Reference
HelpdeskAPI(base_url, api_key, cert_path=None)
Initialize the client.
| Parameter | Type | Description |
|---|---|---|
base_url |
str |
Base URL of the Lansweeper Helpdesk API |
api_key |
str |
API key for authentication |
cert_path |
str or None |
Path to SSL certificate file (optional) |
Ticket Operations
create_ticket(subject, description, email) -> dict
Create a new helpdesk ticket.
api.create_ticket(
subject="Printer not working",
description="Office printer on floor 3 is offline",
email="user@company.com",
)
get_ticket(ticket_id) -> dict
Retrieve ticket details. HTML in the Description field is automatically converted to plain text.
ticket = api.get_ticket("12345")
get_ticket_history(ticket_id) -> list[dict]
Get all notes for a ticket. HTML content in note text fields is auto-stripped.
notes = api.get_ticket_history("12345")
for note in notes:
print(note["Text"])
edit_ticket(ticket_id, state, ticket_type, email) -> dict
Update a ticket's state and type.
api.edit_ticket(
ticket_id="12345",
state="Closed",
ticket_type="Hardware Repair",
email="agent@company.com",
)
Notes
add_note(ticket_id, text, email, note_type="Public") -> dict
Add a note to a ticket. Use note_type="Internal" for agent-only notes.
api.add_note(
ticket_id="12345",
text="Router restart resolved the issue",
email="agent@company.com",
note_type="Internal",
)
Search
search_tickets(*, state, from_user_id, agent_id, description, subject, ticket_type, max_results, min_date, max_date) -> dict
Search tickets with optional filters. All parameters are keyword-only and optional.
results = api.search_tickets(
state="Open",
ticket_type="Hardware Repair",
max_results=50,
min_date="2024-01-01",
max_date="2024-12-31",
)
get_user(email) -> dict
Look up a user by email address.
user = api.get_user("user@company.com")
Enums
The SDK provides convenience enums for common values:
from lansweeper_helpdesk import TicketState, NoteType
api.search_tickets(state=TicketState.OPEN)
api.add_note("12345", "note text", "a@b.com", note_type=NoteType.INTERNAL)
Error Handling
All API methods raise typed exceptions instead of returning None:
from lansweeper_helpdesk import HelpdeskAPI, APIError, ConfigurationError
try:
api = HelpdeskAPI(base_url="", api_key="key")
except ConfigurationError as e:
print(f"Bad config: {e}")
try:
ticket = api.get_ticket("99999")
except APIError as e:
print(f"API error (HTTP {e.status_code}): {e}")
| Exception | When |
|---|---|
HelpdeskError |
Base class for all SDK exceptions |
ConfigurationError |
Invalid client configuration |
APIError |
HTTP or API-level error (has .status_code) |
TicketNotFoundError |
Requested ticket does not exist |
Configuration
You can load credentials from a JSON config file:
import json
from lansweeper_helpdesk import HelpdeskAPI
with open("config/config.json") as f:
config = json.load(f)
api = HelpdeskAPI(**config)
Example config/config.json:
{
"base_url": "https://your-helpdesk-url:443/api.aspx",
"api_key": "your-api-key-here",
"cert_path": "path/to/your/certificate.pem"
}
Development
# Clone and install in dev mode
git clone https://github.com/ds-brandao/Lansweeper.Helpdesk-Python.git
cd Lansweeper.Helpdesk-Python
pip install -e ".[dev]"
# Run tests
pytest --cov
# Lint & format
ruff check src/ tests/
ruff format src/ tests/
# Type check
mypy src/
See CONTRIBUTING.md for full guidelines.
License
MIT License — see LICENSE for details.
Metadata
Release files for lansweeper-helpdesk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lansweeper_helpdesk-0.1.0.tar.gz | 10.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lansweeper_helpdesk-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.4 kB
Release files / lansweeper_helpdesk-0.1.0.tar.gz
| Download URL | lansweeper_helpdesk-0.1.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
728e96afd403f645273a0c2e6a2f5755f18190a6e49f3288ff6c33bdd583d134
|
|
BLAKE2b-256 checksum How to use checksums |
50810b170249ba572024c7e1ae7b187fedbd17ea279b2088c3e0a4749c2c5be6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 29, 2026.
Transparency logRelease files / lansweeper_helpdesk-0.1.0-py3-none-any.whl
| Download URL | lansweeper_helpdesk-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a15ad3d649180a9b24ae8b63e95e103911b7eab6849a559af4ec5e776d4672e
|
|
BLAKE2b-256 checksum How to use checksums |
cd6919e9bf0c789c7b0936c8088c3e4b988ea3c2e5cf246e5f7669759146a193
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 29, 2026.
Transparency logSecurity for lansweeper-helpdesk 0.1.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.
Attestation for lansweeper_helpdesk-0.1.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 Mar 29, 2026.
Transparency logA 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.