### Get All Users Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a list of all users, with optional filtering parameters. ```APIDOC ## GET /api/users ### Description Retrieves a list of users. Supports filtering by department and inclusion of archived users. ### Method GET ### Endpoint https://app.timetastic.co.uk/api/users ### Parameters #### Query Parameters - **departmentId** (integer) - Optional - An optional department to filter the users. Defaults to 0. - **includeArchivedUsers** (boolean) - Optional - Whether to include archived users in the search results. Defaults to false. - **onlyShowArchivedUsers** (boolean) - Optional - If archived users are included, should we ONLY show those. Defaults to false. ### Response #### Success Response (200) OK ##### Response Schema: Array of user objects. - **id** (integer) - The unique Id for this user. - **firstname** (string or null) - The user's first name. - **surname** (string or null) - The user's surname. - **email** (string or null) - The user's email. - **admin** (boolean) - Whether this user is an admin. - **director** (boolean) - Whether this user is set as a Director. - **accountOwner** (boolean) - Whether this user is an Account Owner. - **organisationId** (integer) - The organisation Id of this user. - **departmentId** (integer) - The department Id of this user. - **allowanceUnit** (string) - Enum: "Days" "Hours" - The allowance unit for the user - Days or Hours. - **managerOfDepartments** (Array of integers or null) - A comma-separated list of department ids that this user is a manager of. - **bossOfDepartments** (Array of integers or null) - Deprecated. - **endDate** (string or null) - If set, the date that the user was archived. - **departmentName** (string or null) - The name of the department this user belongs to. - **gravatar** (string or null) - The URL of the avatar/gravatar resource for this user. - **allowanceRemaining** (number) - The allowance remaining for this user, for the current year. - **hasLoggedOn** (boolean) - Whether this user has logged on. - **isArchived** (boolean) - Whether this user is archived. - **approverId** (integer) - If the user has a specific approver set, this is the Id of that user. - **isApprover** (boolean). - **deptManagerId** (integer) - The Id of the user who is the manager of the department this user belongs to. - **deptBossId** (integer) - Deprecated. We no longer use the word Boss - this parameter may be removed in future, use deptManagerId. - **birthday** (string or null) - The birthday of this user. - **startDate** (string or null) - The start date for this user. - **hasPublicHolidays** (boolean) - If this user has public holidays. - **userInitials** (string or null) - The user initials. - **countryCode** (string or null) - The country code this user has public holidays for (ZZ if custom location). - **currentYearAllowance** (number) - The allowance for this user, for the current leave year. - **nextYearAllowance** (number) - The allowance for this user, for the next leave year. - **userLinkedWithGoogle** (boolean). - **userManagedExternally** (boolean). - **mfaEnabled** (boolean). - **inviteSentTimeUtc** (string or null). - **inviteSentTimeHumanised** (string or null). - **yearStart** (integer) - The month that the user's leave year starts (1 being January to 12 being December). - **accrualSystem** (boolean). - **isEmailConfirmed** (boolean). ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json [ { "id": 0, "firstname": "string", "surname": "string", "email": "string", "admin": true, "director": true, "accountOwner": true, "organisationId": 0, "departmentId": 0, "allowanceUnit": "Days", "managerOfDepartments": [ 0 ], "bossOfDepartments": [ 0 ], "endDate": "2019-08-24T14:15:22Z", "departmentName": "string", "gravatar": "string", "allowanceRemaining": 0, "hasLoggedOn": true, "isArchived": true, "approverId": 0, "isApprover": true, "deptManagerId": 0, "deptBossId": 0, "birthday": "2019-08-24T14:15:22Z", "startDate": "2019-08-24T14:15:22Z", "hasPublicHolidays": true, "userInitials": "string", "countryCode": "string", "currentYearAllowance": 0, "nextYearAllowance": 0, "userLinkedWithGoogle": true, "userManagedExternally": true, "mfaEnabled": true, "inviteSentTimeUtc": "2019-08-24T14:15:22Z", "inviteSentTimeHumanised": "string", "yearStart": 0, "accrualSystem": true, "isEmailConfirmed": true } ] ``` ``` -------------------------------- ### Get a List of All Countries Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a list of all available countries for public holiday filtering. ```APIDOC ## GET /api/publicholidays/countries ### Description Retrieves a list of all countries for which public holidays are available. ### Method GET ### Endpoint /api/publicholidays/countries ### Responses #### Success Response (200) OK ``` -------------------------------- ### Get Leave Type Response Sample Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample JSON response when retrieving a specific leave type. It includes all details of the leave type. ```json { "id": 0, "name": "string", "organisationId": 0, "deducted": true, "requiresApproval": true, "includeMaxOff": true, "isPrivate": true, "active": true, "isInUse": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "color": "string", "icon": "string", "calendarVisibility": "Busy", "limitHours": 0, "limitDays": 0 } ``` -------------------------------- ### Get a Collection of Users Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a collection of users for an organization, with an option to filter by department. ```APIDOC ## GET /api/users ### Description Get a collection of users for your organization, optionally filtered by a department. ### Method GET ### Endpoint /api/users ``` -------------------------------- ### Add User Payload Source: https://app.timetastic.co.uk/api-docs/index.html Use this JSON payload to add a new user. 'firstName', 'lastName', 'allowance', and 'departmentId' are required. 'leaveYearStart' can be set to specify the start of the leave year. ```json { "firstName": "string", "lastName": "string", "emailAddress": "string or null", "leaveYearStart": "integer or null", "allowance": "number", "startDate": "string or null", "departmentId": "integer", "sendWelcomeEmail": "boolean" } ``` -------------------------------- ### Get a User by ID Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a specific user's details using their unique ID. ```APIDOC ## Get a User ### Description Gets a user using the ID passed. ##### path Parameters - **id** (integer) - Required - The ID of the user. ### Method GET ### Endpoint /api/users/{id} ### Response #### Success Response (200) OK ##### Response Schema: User object details. - **id** (integer) - The unique Id for this user. - **firstname** (string or null) - The user's first name. - **surname** (string or null) - The user's surname. - **email** (string or null) - The user's email. - **admin** (boolean) - Whether this user is an admin. - **director** (boolean) - Whether this user is set as a Director. - **accountOwner** (boolean) - Whether this user is an Account Owner. - **organisationId** (integer) - The organisation Id of this user. - **departmentId** (integer) - The department Id of this user. - **allowanceUnit** (string) - Enum: "Days" "Hours" - The allowance unit for the user - Days or Hours. - **managerOfDepartments** (Array of integers or null) - A comma-separated list of department ids that this user is a manager of. - **bossOfDepartments** (Array of integers or null) - Deprecated. - **endDate** (string or null) - If set, the date that the user was archived. - **departmentName** (string or null) - The name of the department this user belongs to. - **gravatar** (string or null) - The URL of the avatar/gravatar resource for this user. - **allowanceRemaining** (number) - The allowance remaining for this user, for the current year. - **hasLoggedOn** (boolean) - Whether this user has logged on. - **isArchived** (boolean) - Whether this user is archived. - **approverId** (integer) - If the user has a specific approver set, this is the Id of that user. - **isApprover** (boolean). - **deptManagerId** (integer) - The Id of the user who is the manager of the department this user belongs to. - **deptBossId** (integer) - Deprecated. We no longer use the word Boss - this parameter may be removed in future, use deptManagerId. - **birthday** (string or null) - The birthday of this user. - **startDate** (string or null) - The start date for this user. - **hasPublicHolidays** (boolean) - If this user has public holidays. - **userInitials** (string or null) - The user initials. - **countryCode** (string or null) - The country code this user has public holidays for (ZZ if custom location). - **currentYearAllowance** (number) - The allowance for this user, for the current leave year. - **nextYearAllowance** (number) - The allowance for this user, for the next leave year. - **userLinkedWithGoogle** (boolean). - **userManagedExternally** (boolean). - **mfaEnabled** (boolean). - **inviteSentTimeUtc** (string or null). - **inviteSentTimeHumanised** (string or null). - **yearStart** (integer) - The month that the user's leave year starts (1 being January to 12 being December). - **accrualSystem** (boolean). - **isEmailConfirmed** (boolean). ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "id": 0, "firstname": "string", "surname": "string", "email": "string", "admin": true, "director": true, "accountOwner": true, "organisationId": 0, "departmentId": 0, "allowanceUnit": "Days", "managerOfDepartments": [ 0 ], "bossOfDepartments": [ 0 ], "endDate": "2019-08-24T14:15:22Z", "departmentName": "string", "gravatar": "string", "allowanceRemaining": 0, "hasLoggedOn": true, "isArchived": true, "approverId": 0, "isApprover": true, "deptManagerId": 0, "deptBossId": 0, "birthday": "2019-08-24T14:15:22Z", "startDate": "2019-08-24T14:15:22Z", "hasPublicHolidays": true, "userInitials": "string", "countryCode": "string", "currentYearAllowance": 0, "nextYearAllowance": 0, "userLinkedWithGoogle": true, "userManagedExternally": true, "mfaEnabled": true, "inviteSentTimeUtc": "2019-08-24T14:15:22Z", "inviteSentTimeHumanised": "string", "yearStart": 0, "accrualSystem": true, "isEmailConfirmed": true } ``` ``` -------------------------------- ### Webhook Payload Sample Source: https://app.timetastic.co.uk/api-docs/index.html This is an example of the payload received when Timetastic makes a webhook request to your server. Non-2xx responses are treated as failures. ```json { "eventId": 0, "eventType": "TestEvent", "url": "string", "recordId": 0, "timestamp": "2019-08-24T14:15:22Z", "performingUser": { "id": 0, "firstname": "string", "surname": "string", "fullname": "string" }, "recordData": { "id": 0, "dateRangeString": "string", "startDateString": "string", "endDateString": "string", "startDate": "2019-08-24T14:15:22Z", "startType": "Morning", "endDate": "2019-08-24T14:15:22Z", "endType": "Morning", "userId": 0, "userName": "string", "requestedById": 0, "leaveTypeId": 0, "duration": 0, "deduction": 0, "actionerId": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "reason": "string", "declineReason": "string", "status": "Pending", "autoApproved": true, "bookingUnit": "Days", "leaveType": "string" } } ``` -------------------------------- ### Get All Users API Response Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample JSON response for retrieving a list of users. It includes various user attributes such as ID, name, email, role, department information, and allowance details. The response schema defines the structure and data types for each user object. ```json [ { "id": 0, "firstname": "string", "surname": "string", "email": "string", "admin": true, "director": true, "accountOwner": true, "organisationId": 0, "departmentId": 0, "allowanceUnit": "Days", "managerOfDepartments": [ 0 ], "bossOfDepartments": [ 0 ], "endDate": "2019-08-24T14:15:22Z", "departmentName": "string", "gravatar": "string", "allowanceRemaining": 0, "hasLoggedOn": true, "isArchived": true, "approverId": 0, "isApprover": true, "deptManagerId": 0, "deptBossId": 0, "birthday": "2019-08-24T14:15:22Z", "startDate": "2019-08-24T14:15:22Z", "hasPublicHolidays": true, "userInitials": "string", "countryCode": "string", "currentYearAllowance": 0, "nextYearAllowance": 0, "userLinkedWithGoogle": true, "userManagedExternally": true, "mfaEnabled": true, "inviteSentTimeUtc": "2019-08-24T14:15:22Z", "inviteSentTimeHumanised": "string", "yearStart": 0, "accrualSystem": true, "isEmailConfirmed": true } ] ``` -------------------------------- ### Get Available Leave Type Icons Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a list of valid icon names that can be used for leave types. An empty string can be used to indicate no icon. ```APIDOC ## Get Available Leave Type Icons ### Description Returns a list of valid icon names that can be used when creating or updating leave types. An empty string can also be used for no icon. ### Method GET ### Endpoint /api/leavetypes/icons ### Responses #### Success Response (200) - **value** (string or null) - The name of the icon. ### Response Example ```json [ { "value": "icon-name" } ] ``` ``` -------------------------------- ### Get Specific Department Response Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample JSON response when retrieving a single department by its ID. It contains detailed information about the specified department. ```json { "id": 0, "organisationId": 0, "name": "string", "managerId": 0, "bossId": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "archived": true, "userCount": 0, "maxOff": 0 } ``` -------------------------------- ### Get User by ID Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves detailed information about a specific user by their unique ID. This includes personal details, role information, department associations, and allowance data. ```APIDOC ## GET /api/users/{id} ### Description Retrieves detailed information about a specific user by their unique ID. ### Method GET ### Endpoint /api/users/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the user. ### Response #### Success Response (200) - **id** (integer) - The unique Id for this user - **firstname** (string or null) - The user's first name - **surname** (string or null) - The user's surname - **email** (string or null) - The user's email - **admin** (boolean) - Whether this user is an admin - **director** (boolean) - Whether this user is set as a Director - **accountOwner** (boolean) - Whether this user is an Account Owner - **organisationId** (integer) - The organisation Id of this user - **departmentId** (integer) - The department Id of this user - **allowanceUnit** (string) - Enum: "Days" "Hours" The allowance unit for the user - Days or Hours - **managerOfDepartments** (Array of integers or null) - A comma-separated list of department ids that this user is a manager of - **bossOfDepartments** (Array of integers or null) - Deprecated - **endDate** (string or null) - If set, the date that the user was archived - **departmentName** (string or null) - The name of the department this user belongs to - **gravatar** (string or null) - The URL of the avatar/gravatar resource for this user - **allowanceRemaining** (number) - The allowance remaining for this user, for the current year - **hasLoggedOn** (boolean) - Whether this user has logged on - **isArchived** (boolean) - Whether this user is archived - **approverId** (integer) - If the user has a specific approver set, this is the Id of that user - **isApprover** (boolean) - **deptManagerId** (integer) - The Id of the user who is the manager of the department this user belongs to - **deptBossId** (integer) - Deprecated. We no longer use the word Boss - this parameter may be removed in future, use deptManagerId - **birthday** (string or null) - The birthday of this user - **startDate** (string or null) - The start date for this user - **hasPublicHolidays** (boolean) - If this user has public holidays - **userInitials** (string or null) - The user initials - **countryCode** (string or null) - The country code this user has public holidays for (ZZ if custom location) - **currentYearAllowance** (number) - The allowance for this user, for the current leave year - **nextYearAllowance** (number) - The allowance for this user, for the next leave year - **userLinkedWithGoogle** (boolean) - **userManagedExternally** (boolean) - **mfaEnabled** (boolean) - **inviteSentTimeUtc** (string or null) - **inviteSentTimeHumanised** (string or null) - **yearStart** (integer) - The month that the user's leave year starts (1 being January to 12 being December) - **accrualSystem** (boolean) - **isEmailConfirmed** (boolean) - **workingDays** (Array of objects or null) - This is maintained for backwards compatibility, and now lists the working days for the current schedule. - **workSchedules** (Array of objects or null) - **allowances** (Array of objects or null) ### Response Example ```json { "id": 0, "firstname": "string", "surname": "string", "email": "string", "admin": true, "director": true, "accountOwner": true, "organisationId": 0, "departmentId": 0, "allowanceUnit": "Days", "managerOfDepartments": [ 0 ], "bossOfDepartments": [ 0 ], "endDate": "2019-08-24T14:15:22Z", "departmentName": "string", "gravatar": "string", "allowanceRemaining": 0, "hasLoggedOn": true, "isArchived": true, "approverId": 0, "isApprover": true, "deptManagerId": 0, "deptBossId": 0, "birthday": "2019-08-24T14:15:22Z", "startDate": "2019-08-24T14:15:22Z", "hasPublicHolidays": true, "userInitials": "string", "countryCode": "string", "currentYearAllowance": 0, "nextYearAllowance": 0, "userLinkedWithGoogle": true, "userManagedExternally": true, "mfaEnabled": true, "inviteSentTimeUtc": "2019-08-24T14:15:22Z", "inviteSentTimeHumanised": "string", "yearStart": 0, "accrualSystem": true, "isEmailConfirmed": true, "workingDays": [ { "dayOfWeek": "Sunday", "fromTimeAm": 0, "toTimeAm": 0, "fromTimePm": 0, "toTimePm": 0, "workingAm": true, "workingPm": true } ], "workSchedules": [ { "start": "2019-08-24T14:15:22Z", "days": [ { "dayOfWeek": "Sunday", "fromTimeAm": 0, "toTimeAm": 0, "fromTimePm": 0, "toTimePm": 0, "workingAm": true, "workingPm": true } ] } ], "allowances": [ { "year": 0, "allowance": 0, "remaining": 0, "used": 0 } ] } ``` ``` -------------------------------- ### Get a List of Holidays Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a list of holidays for an organization with various optional filtering capabilities. Results are limited to 100 per request. ```APIDOC ## Get a List of Holidays ### Description Retrieves a list of holidays for an organization with various optional filtering capabilities. Results are limited to 100 per request. ### Method GET ### Endpoint /api/holidays ### Parameters #### Query Parameters - **DepartmentId** (integer) - Optional - Filter holidays by a department. - **LeaveTypeId** (integer) - Optional - Filter holidays by a leave type. - **DepartmentManagersOnly** (boolean) - Optional - Filter for holidays of department managers only. - **MyTeamOnly** (integer) - Optional - Filter holidays for users in the specified user ID's team. - **MyFavouritesOnly** (integer) - Optional - Filter holidays for users marked as favorites by the specified user ID. - **UserIds** (string) - Optional - Filter holidays to include only the specified user(s). - **ExclusionUserIds** (string) - Optional - Filter holidays to exclude the specified user(s). - **NonArchivedUsersOnly** (boolean) - Optional - Only return holidays for users who are not archived. - **Start** (string) - Optional - Filter all holidays on or after this date (ISO 8601 format). - **TransactionYear** (integer) - Optional - Filter all holidays in this transaction year. - **End** (string) - Optional - Filter all holidays before and including this date (ISO 8601 format). - **Status** (string) - Optional - Enum: "PendingOrApproved", "Pending", "Approved", "Cancelled", "Declined", "Any" - Filter holidays by status. Bitwise enum: Pending=1, Approved=2, Cancelled=4, Declined=8. Defaults to PendingOrApproved. - **ApproverId** (integer) - Optional - Filter holidays by the approver's ID. - **PageNumber** (integer) - Optional - The current page number for pagination. Defaults to 1. ### Response #### Success Response (200) - **holidays** (Array of objects) - A list of holiday objects. - **id** (integer) - The holiday ID. - **dateRangeString** (string) - The date range as a string. - **startDateString** (string) - The start date as a string. - **endDateString** (string) - The end date as a string. - **startDate** (string) - The start date in ISO 8601 format. - **startType** (string) - The start type (e.g., "Morning"). - **endDate** (string) - The end date in ISO 8601 format. - **endType** (string) - The end type (e.g., "Morning"). - **userId** (integer) - The ID of the user. - **userName** (string) - The name of the user. - **requestedById** (integer) - The ID of the user who requested the holiday. - **leaveTypeId** (integer) - The ID of the leave type. - **duration** (integer) - The duration of the holiday. - **deduction** (integer) - The deduction amount. - **actionerId** (integer) - The ID of the user who actioned the holiday. - **createdAt** (string) - The creation timestamp. - **updatedAt** (string) - The update timestamp. - **reason** (string) - The reason for the holiday request. - **declineReason** (string) - The reason for declining the holiday. - **status** (string) - The status of the holiday (e.g., "Pending", "Approved"). - **autoApproved** (boolean) - Indicates if the holiday was auto-approved. - **bookingUnit** (string) - The unit of booking (e.g., "Days"). - **leaveType** (string) - The name of the leave type. - **totalRecords** (integer) - The total number of records available. - **pageNumber** (integer) - The current page number. - **nextPageLink** (string or null) - A link to the next page of results. - **previousPageLink** (string or null) - A link to the previous page of results. #### Response Example Content type: application/json ```json { "holidays": [ { "id": 0, "dateRangeString": "string", "startDateString": "string", "endDateString": "string", "startDate": "2019-08-24T14:15:22Z", "startType": "Morning", "endDate": "2019-08-24T14:15:22Z", "endType": "Morning", "userId": 0, "userName": "string", "requestedById": 0, "leaveTypeId": 0, "duration": 0, "deduction": 0, "actionerId": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "reason": "string", "declineReason": "string", "status": "Pending", "autoApproved": true, "bookingUnit": "Days", "leaveType": "string" } ], "totalRecords": 0, "pageNumber": 0, "nextPageLink": "string", "previousPageLink": "string" } ``` ``` -------------------------------- ### Get a List of Holidays Source: https://app.timetastic.co.uk/api-docs/index.html Retrieve a list of holidays for your organization. Supports filtering by department, leave type, user, status, dates, and more. Results are paginated with a default limit of 100 per request. ```json { "holidays": [ { "id": 0, "dateRangeString": "string", "startDateString": "string", "endDateString": "string", "startDate": "2019-08-24T14:15:22Z", "startType": "Morning", "endDate": "2019-08-24T14:15:22Z", "endType": "Morning", "userId": 0, "userName": "string", "requestedById": 0, "leaveTypeId": 0, "duration": 0, "deduction": 0, "actionerId": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "reason": "string", "declineReason": "string", "status": "Pending", "autoApproved": true, "bookingUnit": "Days", "leaveType": "string" } ], "totalRecords": 0, "pageNumber": 0, "nextPageLink": "string", "previousPageLink": "string" } ``` -------------------------------- ### Get User Contact Details Response Schema Source: https://app.timetastic.co.uk/api-docs/index.html This details the structure of the JSON response when retrieving a user's contact details. Note the various fields including personal information, administrative roles, and contact details. ```json { "id": 0, "firstname": "string", "surname": "string", "email": "string", "admin": true, "director": true, "accountOwner": true, "organisationId": 0, "departmentId": 0, "allowanceUnit": "Days", "managerOfDepartments": [ 0 ], "bossOfDepartments": [ 0 ], "endDate": "2019-08-24T14:15:22Z", "departmentName": "string", "gravatar": "string", "allowanceRemaining": 0.0, "hasLoggedOn": true, "isArchived": true, "approverId": 0, "isApprover": true, "deptManagerId": 0, "deptBossId": 0, "birthday": "2019-08-24T14:15:22Z", "startDate": "2019-08-24T14:15:22Z", "hasPublicHolidays": true, "userInitials": "string", "countryCode": "string", "currentYearAllowance": 0.0, "nextYearAllowance": 0.0, "userLinkedWithGoogle": true, "userManagedExternally": true, "mfaEnabled": true, "inviteSentTimeUtc": "2019-08-24T14:15:22Z", "inviteSentTimeHumanised": "string", "yearStart": 0, "accrualSystem": true, "isEmailConfirmed": true, "workingDays": [ { "day": "Monday", "isWorkingDay": true } ], "workSchedules": [ { "scheduleId": 0, "scheduleName": "string", "monday": "09:00", "tuesday": "09:00", "wednesday": "09:00", "thursday": "09:00", "friday": "09:00", "saturday": "09:00", "sunday": "09:00" } ], "allowances": [ { "id": 0, "name": "string", "unit": "Days", "amount": 0.0, "yearStartMonth": 0 } ], "jobTitle": "string", "payrollId": "string", "address1": "string", "address2": "string", "city": "string", "postCode": "string", "telephone1": "string", "telephone2": "string", "country": "string", "emergencyContactName": "string", "emergencyContactPhone": "string" } ``` -------------------------------- ### Get a List of Public Holidays Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a collection of public holidays for an organization, with options to filter by country code, year, user ID, bank holiday set ID, or use the organization's leave year. ```APIDOC ## GET /api/publicholidays ### Description Retrieves a collection of public holidays for your organization. This endpoint supports filtering by country code, year, user ID, and bank holiday set ID, and can also return holidays based on the user's leave year. ### Method GET ### Endpoint /api/publicholidays ### Parameters #### Query Parameters - **countryCode** (string) - Optional - An optional country code to filter the public holidays to. - **year** (integer) - Optional - An optional year to filter the public holidays to. - **userId** (integer) - Optional - An optional user ID to filter the public holidays to. - **bankHolidaySetId** (integer) - Optional - An optional bank holiday set to filter the public holidays to. - **useOrgLeaveYear** (boolean) - Optional - An optional parameter to specify if we want public holidays for the user's leave year. ### Responses #### Success Response (200) OK ##### Response Schema: Array of public holiday objects, each containing: - **id** (integer) - The unique ID for this public holiday. - **name** (string or null) - The name of the holiday. - **date** (string) - The public holiday date (date-time format). - **formattedDate** (string or null) - A formatted string representation of the public holiday date. - **createdAt** (string) - When the public holiday was created (date-time format). - **updatedAt** (string) - When the public holiday was last updated (date-time format). - **countryCode** (string or null) - The country code associated with this public holiday. - **bankHolidaySetId** (integer) - The "set" (group of public holidays) that this public holiday belongs to. - **bankHolidaySetName** (string or null) - The name of the country and region for this bank holiday set, or the name of a custom set. #### Response Example (200) ```json [ { "id": 0, "name": "string", "date": "2019-08-24T14:15:22Z", "formattedDate": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "countryCode": "string", "bankHolidaySetId": 0, "bankHolidaySetName": "string" } ] ``` ``` -------------------------------- ### User Data Response Sample Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample JSON response for user data, illustrating the structure and types of fields returned. ```json { "id": 0, "firstname": "string", "surname": "string", "email": "string", "admin": true, "director": true, "accountOwner": true, "organisationId": 0, "departmentId": 0, "allowanceUnit": "Days", "managerOfDepartments": [ 0 ], "bossOfDepartments": [ 0 ], "endDate": "2019-08-24T14:15:22Z", "departmentName": "string", "gravatar": "string", "allowanceRemaining": 0, "hasLoggedOn": true, "isArchived": true, "approverId": 0, "isApprover": true, "deptManagerId": 0, "deptBossId": 0, "birthday": "2019-08-24T14:15:22Z", "startDate": "2019-08-24T14:15:22Z", "hasPublicHolidays": true, "userInitials": "string", "countryCode": "string", "currentYearAllowance": 0, "nextYearAllowance": 0, "userLinkedWithGoogle": true, "userManagedExternally": true, "mfaEnabled": true, "inviteSentTimeUtc": "2019-08-24T14:15:22Z", "inviteSentTimeHumanised": "string", "yearStart": 0, "accrualSystem": true, "isEmailConfirmed": true, "workingDays": [ { "dayOfWeek": "Sunday", "fromTimeAm": 0, "toTimeAm": 0, "fromTimePm": 0, "toTimePm": 0, "workingAm": true, "workingPm": true } ], "workSchedules": [ { "start": "2019-08-24T14:15:22Z", "days": [ { "dayOfWeek": "Sunday", "fromTimeAm": 0, "toTimeAm": 0, "fromTimePm": 0, "toTimePm": 0, "workingAm": true, "workingPm": true } ] } ], "allowances": [ { "year": 0, "allowance": 0, "remaining": 0, "used": 0 } ], "jobTitle": "string", "payrollId": "string", "address1": "string", "address2": "string", "city": "string", "postCode": "string", "telephone1": "string", "telephone2": "string", "country": "string", "emergencyContactName": "string", "emergencyContactPhone": "string" } ``` -------------------------------- ### Get a Public Holiday Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a specific public holiday by its ID. ```APIDOC ## GET /api/publicholidays/{id} ### Description Gets a specific public holiday using its unique ID. ### Method GET ### Endpoint /api/publicholidays/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the public holiday. ### Responses #### Success Response (200) OK ##### Response Schema: - **id** (integer) - The unique ID for this public holiday. - **name** (string or null) - The name of the holiday. - **date** (string) - The public holiday date (date-time format). - **formattedDate** (string or null) - A formatted string representation of the public holiday date. - **createdAt** (string) - When the public holiday was created (date-time format). - **updatedAt** (string) - When the public holiday was last updated (date-time format). - **countryCode** (string or null) - The country code associated with this public holiday. - **bankHolidaySetId** (integer) - The "set" (group of public holidays) that this public holiday belongs to. - **bankHolidaySetName** (string or null) - The name of the country and region for this bank holiday set, or the name of a custom set. #### Response Example (200) ```json { "id": 0, "name": "string", "date": "2019-08-24T14:15:22Z", "formattedDate": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "countryCode": "string", "bankHolidaySetId": 0, "bankHolidaySetName": "string" } ``` ``` -------------------------------- ### List Webhooks Response Sample Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample JSON response when listing available webhooks. It shows the structure of a single webhook event object. ```json [ { "id": 0, "organisationId": 0, "recordId": 0, "userId": 0, "retryCount": 0, "eventType": "TestEvent", "expiresAt": "2019-08-24T14:15:22Z", "timestamp": "2019-08-24T14:15:22Z", "isProcessed": true, "lastProcessedAt": "2019-08-24T14:15:22Z", "lastResponseCode": 0, "lastResponseDetail": "string", "nextAttempt": "2019-08-24T14:15:22Z", "url": "string", "type": "Timetastic" } ] ``` -------------------------------- ### Get a specific Holiday Source: https://app.timetastic.co.uk/api-docs/index.html Retrieves a specific holiday booking using its unique ID. ```APIDOC ## GET /api/holidays/{id} ### Description Gets a holiday using the ID passed. ### Method GET ### Endpoint `/api/holidays/{id}` ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the holiday. #### Query Parameters - **filter** (string) - Optional - Default: "" - Filter criteria for the holiday. ### Response #### Success Response (200) OK ``` -------------------------------- ### Create Leave Type Response Sample (Success) Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample response when a leave type is successfully created. It returns the ID of the new leave type. ```json 0 ``` -------------------------------- ### List All Departments Response Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample JSON response when retrieving a list of all departments. It includes details for each department. ```json [ { "id": 0, "organisationId": 0, "name": "string", "managerId": 0, "bossId": 0, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "archived": true, "userCount": 0, "maxOff": 0 } ] ``` -------------------------------- ### Add Department Success Response Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample success response when a department is added. It returns the ID of the newly created department. ```json { "id": 0 } ``` -------------------------------- ### List Leave Types Response Sample Source: https://app.timetastic.co.uk/api-docs/index.html This is a sample JSON response when listing all leave types. It includes details for a single leave type object. ```json [ { "id": 0, "name": "string", "organisationId": 0, "deducted": true, "requiresApproval": true, "includeMaxOff": true, "isPrivate": true, "active": true, "isInUse": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "color": "string", "icon": "string", "calendarVisibility": "Busy", "limitHours": 0, "limitDays": 0 } ] ```