openproject-api-client
Python client and CLI for the OpenProject API v3. Full read/write/delete access to projects, work packages, relations, time entries, notifications, and more.
API documentation: https://www.openproject.org/docs/api/
Installation
pip install git+https://github.com/MHx-Operations/openproject-api-client.git#egg=openproject_api_client
Quick Start (Python)
from openproject_api_client import ApiClient
client = ApiClient("https://openproject.example.com/", "your-api-key")
# discover available types and priorities
types = client.get_types() # [Type(1): Task, Type(2): Bug, ...]
priorities = client.get_priorities() # [Priority(1): Low, Priority(2): High, ...]
# list all projects
for project in client.get_projects():
print(project)
# fetch open work packages for a project
work_packages = client.get_workpackages_by_project_id(46, status='open')
# create a new work package
new_wp = client.create_workpackage(
project_id=1, subject="Implement feature X",
type_id=1, assignee_id=3, priority_id=2,
)
# update status
client.update_workpackage(new_wp.id, lock_version=new_wp.lockversion, status_id=7)
# add a comment
client.add_workpackage_comment(new_wp.id, "Done with implementation")
# log time
client.create_time_entry(new_wp.id, hours="PT2H", spent_on="2024-03-15")
# create a relation
client.create_relation(from_id=42, to_id=50, relation_type="blocks")
# delete
client.delete_workpackage(99)
client.delete_relation(100)
Quick Start (CLI)
export OPENPROJECT_BASEURL="https://openproject.example.com/"
export OPENPROJECT_APIKEY="your-api-key"
# without installation (from repo root)
python -m openproject_api_client.cli --json get-projects
# show full usage guide (for humans and AI agents)
openproject-cli guide
# read
openproject-cli --json get-projects
openproject-cli --json get-types
openproject-cli --json get-priorities
openproject-cli --json get-statuses
openproject-cli --json get-work-packages --project-id 5 --status open
openproject-cli --json get-time-entries --work-package-id 42
# write
openproject-cli create-work-package --project-id 1 --subject "New task" --type-id 1
openproject-cli update-work-package 42 --status-id 7
openproject-cli add-comment 42 --message "Status update: done"
openproject-cli create-time-entry --work-package-id 42 --hours PT2H --spent-on 2024-03-15
openproject-cli create-relation --from-id 42 --to-id 50 --type blocks
openproject-cli mark-notification-read 55
# delete
openproject-cli delete-work-package 99
openproject-cli delete-relation 100
openproject-cli delete-time-entry 55
Use openproject-cli guide for the full reference including AI-agent workflow.
Read Methods
| Method | Description |
|---|---|
get_projects() |
All projects as list |
get_projects_dict() |
All projects as dict (keyed by ID, with hierarchy paths) |
get_workpackage(id) |
Single work package by ID |
get_workpackages(status, status_ids) |
All work packages, optionally filtered |
get_workpackages_by_project_id(id, status) |
Work packages for a specific project |
get_workpackages_by_query_id(id) |
Work packages from a saved query |
get_type(id) / get_types() |
Work package types (Task, Bug, etc.) |
get_types_by_project_id(id) |
Types available in a specific project |
get_priority(id) / get_priorities() |
Priority levels |
get_category(id) / get_categories_by_project_id(id) |
Work package categories |
get_relation(id) / get_relations() |
Relations between work packages |
get_version(id) / get_versions() |
Project versions (milestones) |
get_user(id) / get_users() |
User accounts |
get_placeholder_user(id) / get_placeholder_users() |
Placeholder users |
get_project_member(id) / get_project_members() |
Project memberships |
get_status(id) / get_statuses() |
Work package statuses |
get_time_entry(id) / get_time_entries(wp_id, project_id) |
Time tracking entries |
get_activities(wp_id) |
Work package activities/journal |
get_attachment(id) / get_attachments_by_work_package(wp_id) |
File attachments |
get_notification(id) / get_notifications() |
In-app notifications |
get_grid(id) / get_grids(scope) |
Dashboard grids (boards) |
get_query(id) |
Saved query definition |
get(resource, payload) |
Generic GET for any API v3 endpoint |
Write Methods
| Method | Description |
|---|---|
create_workpackage(project_id, subject, ...) |
Create a new work package |
update_workpackage(id, lock_version, ...) |
Update a work package (optimistic locking) |
add_workpackage_comment(id, message) |
Add a comment/activity to a work package |
create_relation(from_id, to_id, type, ...) |
Create a relation between work packages |
create_time_entry(wp_id, hours, spent_on, ...) |
Log time on a work package |
update_time_entry(id, lock_version, ...) |
Update a time entry |
mark_notification_read(id) |
Mark notification as read |
mark_notification_unread(id) |
Mark notification as unread |
mark_all_notifications_read() |
Mark all notifications as read |
post(resource, body) |
Generic POST for any API v3 endpoint |
patch(resource, body) |
Generic PATCH for any API v3 endpoint |
Delete Methods
| Method | Description |
|---|---|
delete_workpackage(id) |
Delete a work package |
delete_relation(id) |
Delete a relation |
delete_time_entry(id) |
Delete a time entry |
delete_attachment(id) |
Delete an attachment |
delete(resource) |
Generic DELETE for any API v3 endpoint |
API Coverage
Supported (Read / Write / Delete)
| Resource | List | Get | Create | Update | Delete | Filter | Notes |
|---|---|---|---|---|---|---|---|
| Projects | ✅ | ✅ | — | — | — | — | Hierarchy paths via get_projects_dict() |
| Work Packages | ✅ | ✅ | ✅ | ✅ | ✅ | status, project, query | Embedded relations on single fetch |
| Relations | ✅ | ✅ | ✅ | — | ✅ | — | Directed (from → to), with lag |
| Types | ✅ | ✅ | — | — | — | project | Work package types (Task, Bug, etc.) |
| Priorities | ✅ | ✅ | — | — | — | — | Priority levels |
| Categories | ✅ | ✅ | — | — | — | project | Work package categories |
| Time Entries | ✅ | ✅ | ✅ | ✅ | ✅ | wp, project | Time tracking |
| Activities | ✅ | — | ✅ | — | — | wp | Comments / journal entries |
| Attachments | ✅ | ✅ | — | — | ✅ | wp | File attachments |
| Notifications | ✅ | ✅ | — | ✅ | — | — | Read/unread state |
| Versions | ✅ | ✅ | — | — | — | — | Milestones |
| Users | ✅ | ✅ | — | — | — | — | |
| Placeholder Users | ✅ | ✅ | — | — | — | — | |
| Memberships | ✅ | ✅ | — | — | — | — | With roles |
| Statuses | ✅ | ✅ | — | — | — | — | |
| Grids | ✅ | ✅ | — | — | — | scope | Boards / dashboards |
| Queries | — | ✅ | — | — | — | — | Saved queries |
Not yet supported
| Resource | Priority | Notes |
|---|---|---|
| Budgets | Medium | Project budgets |
| Custom Actions | Low | Custom workflow actions |
| Custom Fields / Options | Low | Custom field definitions |
| Days / Work Schedule | Low | Working/non-working days |
| Documents | Low | Project documents |
| File Links | Low | External storage links |
| Groups | Low | User groups |
| Help Texts | Low | Attribute help texts |
| Meetings | Low | Meeting resources |
| News | Low | Project news |
| OAuth | Low | OAuth applications/credentials |
| Portfolios | Low | Project portfolios |
| Posts | Low | Forum posts |
| Principals | Low | Users, groups, placeholder users |
| Programs | Low | Programs |
| Project Storages | Low | Project ↔ storage links |
| Reminders | Low | Work package reminders |
| Rendering | Low | Markdown/plain text rendering |
| Revisions | Low | SCM revisions |
| Roles | Low | Permission roles |
| Storages | Low | External file storages |
| Views | Low | Saved views |
| Wiki Pages | Low | Wiki content |
| Workspaces | Low | Projects (OpenProject 17+) |
OpenProject Compatibility
Works with OpenProject 10 and later. Uses the stable API v3 (/api/v3/).
Notes for specific versions
-
OpenProject 14+: The Relations API renamed the
delayattribute tolag. This client exposes the field as returned by the API, so the attribute name depends on your OpenProject version. -
OpenProject 17+: Introduces the Workspaces concept. Project-scoped endpoints like
/api/v3/projects/{id}/work_packagesare deprecated in favor of/api/v3/workspaces/{id}/work_packages. The old endpoints still work but may be removed in a future version.
Requirements
- Python >= 3.9
- requests >= 2.25.1
License
MIT
Metadata
Release files for openproject-api-client 0.4.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 | Actions |
|---|---|---|---|---|
| openproject_api_client-0.4.0.tar.gz | 44.0 kB | With provenance | Details for openproject_api_client-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openproject_api_client-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for openproject_api_client-0.4.0-py3-none-any.whl |
Total release size: 67.1 kB
Release files / openproject_api_client-0.4.0.tar.gz
| Download URL | openproject_api_client-0.4.0.tar.gz |
|---|---|
| Size | 44.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22f7ac7f79bc5d91003b592ff8caa2a800dadd8047ecbf8dbdc60dc310a6e630
|
|
BLAKE2b-256 checksum How to use checksums |
68caf6ba933319071f615bffb9eb08b177e5d175a033d18d9b9aab9da8d5fdeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 19, 2026.
Transparency logRelease files / openproject_api_client-0.4.0-py3-none-any.whl
| Download URL | openproject_api_client-0.4.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3e7cd2b684d8e699471b9739983fa54aece25e6372440df68e283cd8b3a7214
|
|
BLAKE2b-256 checksum How to use checksums |
0448c271af3e4b5b4d5c6cc147f5c6f90934c36b7f20ea1230efe412d1205efa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 19, 2026.
Transparency logSecurity for openproject-api-client 0.4.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.
Attestation for openproject_api_client-0.4.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 Aug 19, 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.