Please note: Each instance has unique endpoints, which can be retrieved on the user absence planner settings page in the Jira administration by system administrators. The email address of the user you want to manage absences for is always required as parameter.
Authentication
When accessing any of the REST API endpoints mentioned below, users must authenticate themselves using the email associated with their Atlassian account and an app API token obtainable either from the app's administration, or from the api token tab on the User Absence Planner global page.
To generate your token as Jira administrator, navigate to Marketplace Apps → User Absence Planner Settings (left sidebar) → API token tab.
Personal API token
Click Create new API token to generate a token for your admin Jira account. In the dialog, enter a name and choose an expiration: 30, 90, 180, 365 days, or never.
Please remember that your generated token is only visible during the creation process in the modal dialog. It is crucial to copy it to your clipboard and securely store it. Once generated, the token cannot be displayed again. In case you misplace your token and fail to save it, you will need to delete the current token and generate a new one.
API token for Service Accounts
For Atlassian service accounts, create API tokens from the API token tab using its button. This is useful when you use service accounts for external integrations and interfaces.
Service accounts in your instance are fetched regularly. They may not be available immediately after app installation or update.
You can also fetch service accounts manually using the Refresh now button in the token creation dialog.
API tokens for service accounts always expire; you cannot set them to never expire.
Please remember to grant permission to edit/view absences for other users to service accounts if you want to use them for external system integration.
If non-admin users receive permission to use the API, they will also see an API token tab on the global User Absence Planner page.
You can get the REST API endpoints from the corresponding button.
REST API Endpoints
1. Create Absence
Create a new absence entry for a specific user.
-
Method: POST
-
Parameters:
-
user: The email address or account id of the user you want to create an absence for.
-
-
Body:
JSON{ "title": "<title>", "type": "<type>", "start": "<date_format_YYYY-MM-DD>", "end": "<date_format_YYYY-MM-DD>", "message": "<message>", "startTime": "<time_HH:mm_or_h:mm_AM/PM>", "endTime": "<time_HH:mm_or_h:mm_AM/PM>" }Example:
JSON{ "title": "Summer holidays", "type": "Holiday", "start": "2024-08-03", "end": "2024-08-14", "message": "I am currently out of office with no access to my Jira tasks." }
All values required except message, start and end time.
-
Endpoint URL: Unique endpoint for your cloud instance. As system administrator, get it from Marketplace Apps → User Absence Planner Settings → REST API Endpoints tab
Responses:
|
Status code |
Status text |
Body |
Reason |
|---|---|---|---|
|
201 |
|
JSON object of new absence including new id. JSON
|
|
|
500 |
|
JSON
|
An error occurred when the new absence is saved. |
|
405 |
|
JSON
|
Another method than POST has been used to call the endpoint. |
|
400 |
|
JSON
|
The error can be returned for multiple reasons:
|
|
401 |
|
JSON
|
Either email address or api token used for authentication isn’t correct. The user couldn’t be authenticated on the instance with the provided credentials. |
|
404 |
|
JSON
|
No user could be found with the provided email address. |
|
403 |
|
JSON
|
An absence for another user than the one calling the api should be created, but the user calling the api doesn’t have the permission to create absences for other users. |
2. Edit Absence
Edit an existing absence entry for a specific user.
-
Method: PUT
-
Parameters:
-
user: The email address or account id of the user you want to edit an absence for.
-
title or absenceId: Title or absence id of the absence you want to edit
-
-
Body:
JSON{ "title": "<title>", "type": "<type>", "start": "<date_format_YYYY-MM-DD>", "end": "<date_format_YYYY-MM-DD>", "message": "<message>", "startTime": "<time_HH:mm_or_h:mm_AM/PM>", "endTime": "<time_HH:mm_or_h:mm_AM/PM>", "allDay": <true_or_false> }Example:
JSON{ "id": "_.gee4i65", "end": "2024-08-21", "message": "My holidays have been extended until August 21." }
No required attributes. The absence attributes included in the body will be updated.
-
Endpoint URL: Unique endpoint for your cloud instance. As system administrator, get it from Marketplace Apps → User Absence Planner Settings → REST API Endpoints tab
Responses:
|
Status code |
Status text |
Body |
Reason |
|---|---|---|---|
|
201 |
|
JSON object of edited absence. JSON
|
|
|
500 |
|
JSON
|
An error occurred when the edited absence is saved. |
|
405 |
|
JSON
|
Another method than PUT has been used to call the endpoint. |
|
400 |
|
JSON
|
The error can be returned for multiple reasons:
|
|
401 |
|
JSON
|
Either email address or api token used for authentication isn’t correct. The user couldn’t be authenticated on the instance with the provided credentials. |
|
404 |
|
JSON
|
No user could be found with the provided email address. |
|
404 |
|
JSON
|
No absence to edit could be found for the provided id. |
|
403 |
|
JSON
|
An absence for another user than the one calling the api should be edited, but the user calling the api doesn’t have the permission to edit absences for other users. |
3. Delete Absence
Delete an existing absence entry for a specific user.
-
Method: DELETE
-
Parameters:
-
user: The email address or account id of the user you want to edit an absence for.
-
One of the following is required:
-
title: Title of the absence you want to delete
-
absenceId: Absence id of the absence you want to delete
-
date: Delete all absences that are planned for this date
-
Date range - from and to: Delete all absences that are planned in this date range
-
-
-
Body: None
-
Endpoint URL: Unique endpoint for your cloud instance. As system administrator, get it from Marketplace Apps → User Absence Planner Settings → REST API Endpoints tab
Responses:
|
Status code |
Status text |
Body |
Reason |
|---|---|---|---|
|
200 |
|
Id of the absence that has been deleted JSON
|
|
|
500 |
|
JSON
|
An error occurred when deleting the absence. |
|
405 |
|
JSON
|
Another method than DELETE has been used to call the endpoint. |
|
400 |
|
JSON
|
No id for an absence to be deleted has been provided as parameter. |
|
401 |
|
JSON
|
Either email address or api token used for authentication isn’t correct. The user couldn’t be authenticated on the instance with the provided credentials. |
|
404 |
|
JSON
|
No user could be found with the provided email address. |
|
404 |
|
JSON
|
No absence to delete could be found for the provided id. |
|
403 |
|
JSON
|
Absence for another user than the one calling the api should be deleted, but the user calling the api doesn’t have the permission to delete absences for other users. |
4. Check Availability
Check availability for a specific user on the current day.
-
Method: GET
-
Parameters:
-
user: The email address or account id of the user you want to edit an absence for.
-
-
Body: None
-
Endpoint URL: Unique endpoint for your cloud instance. As system administrator, get it from Marketplace Apps → User Absence Planner Settings → REST API Endpoints tab