The APIv3 is a hypermedia REST API, a shorthand for “Hypermedia As The Engine Of Application State” (HATEOAS). This means that each endpoint of this API will have links to other resources or actions defined in the resulting body.
These related resources and actions for any given resource will be context sensitive. For example, only actions that the authenticated user can take are being rendered. This can be used to dynamically identify actions that the user might take for any given response.
As an example, if you fetch a work package through the Work Package endpoint, the
update link will only be present when the user you authenticated has been granted a permission to update the work package in the assigned project.
HAL is a simple format that gives a consistent and easy way to hyperlink between resources in your API. Read more in the following specification: https://tools.ietf.org/html/draft-kelly-json-hal-08
OpenProject API implementation of HAL+JSON format enriches JSON and introduces a few meta properties:
_type- specifies the type of the resource (e.g.: WorkPackage, Project)
_links- contains all related resource and action links available for the resource
_embedded- contains all embedded objects
HAL does not guarantee that embedded resources are embedded in their full representation, they might as well be partially represented (e.g. some properties can be left out). However in this API you have the guarantee that whenever a resource is embedded, it is embedded in its full representation.
All API responses contain a single HAL+JSON object, even collections of objects are technically represented by a single HAL+JSON object that itself contains its members. More details on collections can be found in the Collections Section.
The API supports the following authentication schemes: OAuth2, session based authentication, and basic auth.
Depending on the settings of the OpenProject instance many resources can be accessed without being authenticated. In case the instance requires authentication on all requests the client will receive an HTTP 401 status code in response to any request.
Otherwise unauthenticated clients have all the permissions of the anonymous user.
This means you have to login to OpenProject via the Web-Interface to be authenticated in the API. This method is well-suited for clients acting within the browser, like the Angular-Client built into OpenProject.
In this case, you always need to pass the HTTP header
X-Requested-With "XMLHttpRequest" for authentication.
Users can authenticate towards the API v3 using basic auth with
apikey (as a string, NOT your API key) as the user name and their API key as the password. Users can find their API key on their account page.
API_KEY=2519132cdf62dcf5a66fd96394672079f9e9cad1 curl -u apikey:$API_KEY https://community.openproject.com/api/v3/users/42
OpenProject allows authentication and authorization with OAuth2 with Authorization code flow, as well as Client credentials operation modes.
To get started, you first need to register an application in the OpenProject OAuth administration section of your installation. This will save an entry for your application with a client unique identifier (
client_id) and an accompanying secret key (
You can then use one the following guides to perform the supported OAuth 2.0 flows:
Client credentials - Requires an application to be bound to an impersonating user for non-public access
The simplest way to do basic auth would be to use a user’s username and password naturally. However, OpenProject already has supported API keys in the past for the API v2, though not through basic auth.
Using username and password directly would have some advantages:
It is intuitive for the user who then just has to provide those just as they would when logging into OpenProject.
No extra logic for token management necessary.
On the other hand using API keys has some advantages too, which is why we went for that:
If compromised while saved on an insecure client the user only has to regenerate the API key instead of changing their password, too.
They are naturally long and random which makes them invulnerable to dictionary attacks and harder to crack in general.
Most importantly users may not actually have a password to begin with. Specifically when they have registered through an OpenID Connect provider.
By default, the OpenProject API is not responding with any CORS headers. If you want to allow cross-domain AJAX calls against your OpenProject instance, you need to enable CORS headers being returned.
Please see our API settings documentation on how to selectively enable CORS.
GET- Get a single resource or collection of resources
POST- Create a new resource or perform
PATCH- Update a resource
DELETE- Delete a resource
Responses are compressed if requested by the client. Currently gzip and deflate are supported. The client signals the desired compression by setting the
Accept-Encoding header. If no
Accept-Encoding header is send,
Accept-Encoding: identity is assumed which will result in the API responding uncompressed.