Skip to content

Absence

Absence data

Attribute Value type Description
uuid str Absence UUID
absence_type object Absence type information with uuid and label
absentee object Member information for the person on absence
absence_note str Note/reason for the absence
start_date str Start date (YYYY-MM-DD format)
end_date str End date (YYYY-MM-DD format)
start_dt str Start datetime (for hourly-based absences)
end_dt str End datetime (for hourly-based absences)
status str Absence status: 'W' (Waiting), 'A' (Approved), 'D' (Denied), 'C' (Cancelled), 'DEL' (Deleted), 'A-AUTO' (Auto-approved)

Absence Type data

Attribute Value type Description
uuid str Absence type UUID
title str Absence type title
alive bool Is the absence type active (alive) or deleted

** Endpoint: absences/ **

GET https://api.smartplanapp.io/v2/accounts/UUID/absences/

Returns all absences for the specified account

Limited to 50 objects per page. In the response dataset; 'total_count' will be the total number of available objects. To fetch the next 'page' you can use the url in the 'next' param. Likewise you can use the url in the 'previous' for the previous 50 objects.

Available filters

Use simple GET params for the filters.

  • absence_type (str) Filter by absence type. Can be built-in types ('sick', 'vacation') or custom absence type UUIDs. Supports comma-separated values.
  • absentee (UUID) Filter by the UUID of the person on absence
  • status (str) Filter by absence status. Supports comma-separated values: 'W', 'A', 'D', 'C', 'DEL', 'A-AUTO'
  • date (YYYY-MM-DD) Filter absences that overlap with the specified date

Available ordering

Use the 'ordering' GET param to sort results:

  • absence_type - Sort by absence type
  • absentee - Sort by absentee
  • status - Sort by status
  • start_date - Sort by start date
  • end_date - Sort by end date

Add '-' prefix for descending order (e.g., '-start_date')

Example response:
response = {
  'total_count': 2, 
  'next': None, 
  'previous': None, 
  'results': [
    {
      'uuid': '1234-5678-9abc-def0',
      'absence_type': {
        'uuid': 'sick',
        'label': 'Sick leave'
      },
      'absentee': {
        'uuid': '1111-2222-3333-4444',
        'first_name': 'John',
        'last_name': 'Doe',
        'initials': 'JD',
        'is_admin': False,
        'user_type': 'Employee'
      },
      'absence_note': 'Flu symptoms',
      'start_date': '2024-01-15',
      'end_date': '2024-01-17',
      'start_dt': None,
      'end_dt': None,
      'status': 'A'
    },
    {
      'uuid': '5678-9abc-def0-1234',
      'absence_type': {
        'uuid': 'vacation',
        'label': 'Vacation'
      },
      'absentee': {
        'uuid': '2222-3333-4444-5555',
        'first_name': 'Jane',
        'last_name': 'Smith',
        'initials': 'JS',
        'is_admin': True,
        'user_type': 'Manager'
      },
      'absence_note': 'Summer vacation',
      'start_date': '2024-07-01',
      'end_date': '2024-07-14',
      'start_dt': None,
      'end_dt': None,
      'status': 'A'
    }
  ]
}

** Endpoint: absences/UUID/ **

GET https://api.smartplanapp.io/v2/accounts/UUID/absences/UUID/

Returns the data for the specified absence

Example response:
response = {
  'results': {
    'uuid': '1234-5678-9abc-def0',
    'absence_type': {
      'uuid': 'sick',
      'label': 'Sick leave'
    },
    'absentee': {
      'uuid': '1111-2222-3333-4444',
      'first_name': 'John',
      'last_name': 'Doe',
      'initials': 'JD',
      'is_admin': False,
      'user_type': 'Employee'
    },
    'absence_note': 'Flu symptoms',
    'start_date': '2024-01-15',
    'end_date': '2024-01-17',
    'start_dt': None,
    'end_dt': None,
    'status': 'A'
  }
}

** Endpoint: absences/types/ **

GET https://api.smartplanapp.io/v2/accounts/UUID/absences/types/

Returns all absence types for the specified account, including both built-in types ('sick', 'vacation') and custom absence types

Limited to 50 objects per page. In the response dataset; 'total_count' will be the total number of available objects. To fetch the next 'page' you can use the url in the 'next' param. Likewise you can use the url in the 'previous' for the previous 50 objects.

Available filters

Use simple GET params for the filters.

  • alive (True/False) Filter absence types by whether they are deleted or not. Built-in types are always alive.

Available ordering

Use the 'ordering' GET param to sort results:

  • title - Sort by title

Add '-' prefix for descending order (e.g., '-title')

Example response:
response = {
  'total_count': 5, 
  'next': None, 
  'previous': None, 
  'results': [
    {
      'uuid': 'sick',
      'title': 'Sick leave',
      'alive': True
    },
    {
      'uuid': 'vacation',
      'title': 'Vacation',
      'alive': True
    },
    {
      'uuid': 'aaaa-bbbb-cccc-dddd',
      'title': 'Maternity Leave',
      'alive': True
    },
    {
      'uuid': 'bbbb-cccc-dddd-eeee',
      'title': 'Training',
      'alive': True
    },
    {
      'uuid': 'cccc-dddd-eeee-ffff',
      'title': 'Conference',
      'alive': True
    }
  ]
}

** Endpoint: absences/types/UUID/ **

GET https://api.smartplanapp.io/v2/accounts/UUID/absences/types/UUID/

Returns the data for the specified custom absence type

Example response:
response = {
  'results': {
    'uuid': 'aaaa-bbbb-cccc-dddd',
    'title': 'Maternity Leave',
    'alive': True
  }
}

Built-in Absence Types

The system supports two built-in absence types that can be used in filters:

  • sick - Sick leave
  • vacation - Vacation/holiday

Custom absence types are defined per account and have their own UUIDs.

Status Codes

Absence status values and their meanings:

  • W - Waiting for approval
  • A - Approved
  • D - Denied
  • C - Cancelled
  • DEL - Deleted
  • A-AUTO - Auto-approved