User Absence Planner Cloud Documentation
Auto Light Dark
Auto Light Dark

API Documentation

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.

image-20260926-151934.png

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.

image-20260926-152357.png

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.

image-20260926-152906.png

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.

image-20260926-153359.png

You can get the REST API endpoints from the corresponding button.

image-20260926-153506.png
REST API endpoint information for non-admin users

Identifying absences with an external ID

Use externalId when you sync absences from another system, such as an Outlook calendar or an HR tool. You give the absence your own unique identifier when you create it. Later updates and deletions can then target that exact absence, without relying on the title, which does not have to be unique.

  • externalId is optional. Absences created without it, including all absences created before this feature, keep working as before and can still be targeted by title or absence ID.

  • It must be unique per user. Two different users can each have an absence with the same externalId, but one user cannot have two.

  • It is a string of up to 255 characters. Surrounding spaces are removed. Matching is exact and case-sensitive.

  • It is only available in the REST API. It is not shown in the app's UI and is not available in the automation actions.

  • When you pass it as a query parameter (Edit and Delete), URL-encode the value. Characters such as /, + and =, which are common in calendar IDs, must be encoded.

  • If a request contains externalId together with title, absenceId, date or from/to, the externalId decides which absence is affected.

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>",
        "externalId": "<your_unique_id>"
    }
    

    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.",
        "externalId": "outlook-040000008200E00074C5B7101A82E008"
    }
    

title, type, start and end are required. All other fields are optional.

  • 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: All responses are JSON objects with a message property. The response to a successful request does not contain the absence or its ID. To target the absence later, set an externalId.

Status code

Status text

Body (message)

Reason

201

Created

Absence created

The absence was created.

400

Bad request

Error: Missing required fields. Title, start, end and type are required in the request body.

One of the required fields is missing or empty.

400

Bad request

Error: Invalid JSON body. ...

The request body is not valid JSON.

400

Bad request

Error: Invalid absence type. ...

The type does not match a configured absence type.

400

Bad request

Error: Invalid date format. ...

start or end is not in format YYYY-MM-DD.

400

Bad request

Error: Start date cannot be after end date.

The start date is later than the end date.

400

Bad request

Error: Invalid time format. ... / Error: Both startTime and endTime must be provided, ... / Error: Start time must be earlier than end time.

Invalid time values.

400

Bad request

Error: Invalid externalId. ...

externalId is not a string or is longer than 255 characters.

409

Conflict

Error: Another absence of this user already uses the provided externalId. ...

The user already has an absence with this externalId.

401

Unauthorized

Error: Unauthorized - ...

Email address or API token is wrong.

403

No access

Error: Access denied - ...

You may not use the app, or you may not create absences for this user.

404

Not found

Error: We could not find an user with the provided email address or account ID.

No user could be found with the provided email address or account ID.

405

Method not allowed

Error: Method not allowed. ...

A method other than POST was used.

500

Internal Server Error

Error: Creation of absence failed. Please try again.

The absence could not be saved.


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 whose absence you want to edit.

    • One of the following identifies the absence:

      • externalId: the external ID you set when the absence was created (recommended)

      • title: the title of the absence. If the user has several absences with this title, the first one is edited.

      • absenceId: the internal absence ID

  • 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>,
        "externalId": "<new_unique_id>"
    }
    

    externalId in the body changes the absence's external ID. Send null or "" to remove it. Leave it out to keep the current one.

    Example: PUT <endpoint>?user=jane@example.com&externalId=outlook-040000008200E00074C5B7101A82E008

    JSON
    {
        "end": "2024-08-21",
        "message": "My holidays have been extended until August 21."
    }
    

No required body attributes. Send only the fields you want to change. Fields you leave out keep their current values.

  • 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: All responses are JSON objects with a message property.

Status code

Status text

Body (message)

Reason

200

OK

Absence updated

The absence was updated.

400

Bad request

Error: No absence identifier provided. ...

None of externalId, title or absenceId was provided.

400

Bad request

Error: Invalid JSON body. ...

The request body is not valid JSON.

400

Bad request

Error: Invalid absence type. ... / Error: Invalid date format. ... / Error: Start date cannot be after end date.

Invalid field values.

400

Bad request

Error: Invalid time format. ... / Error: Both startTime and endTime ... / Error: Start time must be earlier than end time. / Error: Invalid value for allDay. ...

Invalid time values.

400

Bad request

Error: Invalid externalId. ...

The new externalId is not a string or is longer than 255 characters.

409

Conflict

Error: Another absence of this user already uses the provided externalId. ...

The new externalId is already used by another absence of this user.

401

Unauthorized

Error: Unauthorized - ...

Email address or API token is wrong.

403

No access

Error: Access denied - ...

You may not use the app, or you may not edit absences for this user.

404

Not found

Error: We could not find an user with the provided email address or account ID.

No user could be found with the provided email address or account ID.

404

Not found

Error: No matching absence found for the provided externalId, title or absence ID.

No absence to edit could be found for the provided identifier.

405

Method not allowed

Error: Method not allowed. ...

A method other than PUT was used.

500

Internal Server Error

Error: Update of absence failed. Please try again.

The absence could not be saved.


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 whose absence you want to delete.

    • One of the following is required:

      • externalId: deletes the absence with this external ID (recommended)

      • title: deletes the first absence with this title

      • absenceId: deletes the absence with this internal ID

      • date: deletes all absences planned for this date

      • from and to: deletes all absences planned in this date range

    • If externalId is provided, only that absence is deleted, even if date or from/to are also sent.

  • 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: All responses are JSON objects with a message property. The response to a successful request does not contain the absence ID.

Status code

Status text

Body (message)

Reason

200

OK

Absence deleted

The absence was deleted.

400

Bad request

Error: No absence identifier provided. ...

None of the identifying parameters was provided.

400

Bad request

Error: Invalid date format. ... / Error: The from date cannot be after the to date.

Invalid date, from or to value.

401

Unauthorized

Error: Unauthorized - ...

Email address or API token is wrong.

403

No access

Error: Access denied - ...

You may not use the app, or you may not delete absences for this user.

404

Not found

Error: We could not find an user with the provided email address or account ID.

No user could be found with the provided email address or account ID.

404

Not found

Error: No matching absence found for the provided identifier (...)

No absence to delete could be found for the provided identifier.

405

Method not allowed

Error: Method not allowed. ...

A method other than DELETE was used.

500

Internal Server Error

Error: Deletion of absence failed. Please try again.

The absence could not be deleted.


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