Attendance
Usage
Fetch shifts, worked time, and overtime requests:
import asyncio
import factorialhr
async def main():
auth = factorialhr.AccessTokenAuth("your_access_token")
async with factorialhr.ApiClient(auth=auth) as api:
# List attendance shifts for a period
shifts = factorialhr.ShiftsEndpoint(api)
response = await shifts.get(params={"page": 1, "limit": 20})
for shift in response.data():
print(shift.employee_id, shift.starts_at, shift.ends_at)
# Get worked time entries (e.g. for payroll or reports)
worked = factorialhr.WorkedTimesEndpoint(api)
all_worked = await worked.all()
for w in all_worked.data():
print(w.employee_id, w.date, w.seconds)
asyncio.run(main())
Enums
Models and endpoints
- class factorialhr.AttendanceShift(*, id: int, employee_id: int, date: date, reference_date: date, clock_in: time | None = None, clock_out: time | None = None, in_source: str | None = None, out_source: str | None = None, observations: str | None = None, location_type: LocationType | None = None, half_day: HalfDay | None = None, in_location_latitude: float | None = None, in_location_longitude: float | None = None, in_location_accuracy: float | None = None, out_location_latitude: float | None = None, out_location_longitude: float | None = None, out_location_accuracy: float | None = None, workable: bool | None = None, created_at: datetime, workplace_id: int | None = None, time_settings_break_configuration_id: int | None = None, company_id: int, updated_at: datetime, minutes: int, clock_in_with_seconds: time | None = None)[source]
Model for attendance_shift.
- clock_in: time | None
Time when the employee clocked in
- clock_in_with_seconds: time | None
Clock in time with seconds
- clock_out: time | None
Time when the employee clocked out
- company_id: int
Identifier for the company
- created_at: datetime
Timestamp when the shift record was created
- date: date
Date of the shift
- employee_id: int
Identifier for the employee assigned to the shift
- half_day: HalfDay | None
Indicates which worked part of the day
- id: int
Unique identifier for the shift
- in_location_accuracy: float | None
Accuracy of the clock-in location
- in_location_latitude: float | None
Latitude of the clock-in location
- in_location_longitude: float | None
Longitude of the clock-in location
- in_source: str | None
Source of the clock-in time
- location_type: LocationType | None
Type of location for the shift
- minutes: int
Number in minutes of the shift
- observations: str | None
Additional observations about the shift
- out_location_accuracy: float | None
Accuracy of the clock-out location
- out_location_latitude: float | None
Latitude of the clock-out location
- out_location_longitude: float | None
Longitude of the clock-out location
- out_source: str | None
Source of the clock-out time
- reference_date: date
Reference date for the shift
- time_settings_break_configuration_id: int | None
Identifier for the break configuration
- updated_at: datetime
Timestamp when the shift record was updated
- workable: bool | None
Indicates if the shift is workable
- workplace_id: int | None
Identifier for the location
- class factorialhr.BreakConfigurationsEndpoint(api: ApiClient)[source]
Endpoint for break configurations operations.
- async all(**kwargs) ListApiResponse[BreakConfiguration][source]
Get all break configurations records.
Official documentation: attendance/break_configurations
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) BreakConfiguration[source]
Create a new break configuration.
Official documentation: attendance/break_configurations
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async get(**kwargs) MetaApiResponse[BreakConfiguration][source]
Get break configurations with pagination metadata.
Official documentation: attendance/break_configurations
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(break_configuration_id: int | str, **kwargs) BreakConfiguration[source]
Get a specific break configuration by ID.
Official documentation: attendance/break_configurations
- Parameters:
break_configuration_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(break_configuration_id: int | str, data: Mapping[str, Any], **kwargs) BreakConfiguration[source]
Update a break configuration.
Official documentation: attendance/break_configurations
- Parameters:
break_configuration_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.EditTimesheetRequest(*, id: int, approved: bool | None = None, request_type: RequestType, employee_id: int, workable: bool | None = None, clock_in: time | None = None, clock_out: time | None = None, location_type: LocationType | None = None, reason: str | None = None, attendance_shift_id: int | None = None, time_settings_break_configuration_id: int | None = None, observations: str | None = None, date: date | None = None, reference_date: date | None = None)[source]
Model for attendance_edit_timesheet_request.
- approved: bool | None
Status of the edit timesheet request
- attendance_shift_id: int | None
Id of the shift for the request
- clock_in: time | None
Clock in of the shift
- clock_out: time | None
Clock out of the shift
- date: date | None
Date of the shift
- employee_id: int
Id of the shift’s employee
- id: int
Unique identifier for the edit timesheet request
- location_type: LocationType | None
Location of the shift
- observations: str | None
Additional observations for the shift
- reason: str | None
Approve or reject reason
- reference_date: date | None
Reference date for the shift
- request_type: RequestType
Type of the request
- time_settings_break_configuration_id: int | None
Id of the type of break for the request
- workable: bool | None
Indicates if the shift is workable or a break
- class factorialhr.EditTimesheetRequestsEndpoint(api: ApiClient)[source]
Endpoint for edit timesheet requests operations.
- async all(**kwargs) ListApiResponse[EditTimesheetRequest][source]
Get all edit timesheet requests records.
Official documentation: attendance/edit_timesheet_requests
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) EditTimesheetRequest[source]
Create a new edit timesheet request.
Official documentation: attendance/edit_timesheet_requests
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(edit_timesheet_request_id: int | str, **kwargs) EditTimesheetRequest[source]
Delete an edit timesheet request.
Official documentation: attendance/edit_timesheet_requests
- Parameters:
edit_timesheet_request_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[EditTimesheetRequest][source]
Get edit timesheet requests with pagination metadata.
Official documentation: attendance/edit_timesheet_requests
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(edit_timesheet_request_id: int | str, **kwargs) EditTimesheetRequest[source]
Get a specific edit timesheet request by ID.
Official documentation: attendance/edit_timesheet_requests
- Parameters:
edit_timesheet_request_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async update(edit_timesheet_request_id: int | str, data: Mapping[str, Any], **kwargs) EditTimesheetRequest[source]
Update an edit timesheet request.
Official documentation: attendance/edit_timesheet_requests
- Parameters:
edit_timesheet_request_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.EstimatedTime(*, date: date, company_id: int, employee_id: int, expected_minutes: float, regular_minutes: float, overtime_minutes: float, breaks: Sequence[Any], time_unit: TimeUnit, estimated_half_days: int, shifts: Sequence[Any], source: str, id: str, minutes: float)[source]
Model for attendance_estimated_time.
- breaks: Sequence[Any]
List of breaks
- company_id: int
Company identifier
- date: date
Date of the estimated time
- employee_id: int
Employee identifier
- estimated_half_days: int
Number of estimated half days
- expected_minutes: float
Amount of minutes the employee has to work without taking into consideration time off leaves and bank holidays
- id: str
ID to specify the estimation time it includes the employee_id and date
- minutes: float
Amount of minutes the employee has to work
- overtime_minutes: float
Amount of overtime minutes the employee has to work (only available with Shift Management)
- regular_minutes: float
Amount of regular minutes the employee has to work
- shifts: Sequence[Any]
List of shifts
- source: str
Source of the estimated time. Could be employee’s contract, work schedule or shift management
- class factorialhr.EstimatedTimesEndpoint(api: ApiClient)[source]
Endpoint for estimated times operations.
- async all(**kwargs) ListApiResponse[EstimatedTime][source]
Get all estimated times records.
Official documentation: attendance/estimated_times
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async get(**kwargs) MetaApiResponse[EstimatedTime][source]
Get estimated times with pagination metadata.
Official documentation: attendance/estimated_times
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- class factorialhr.OpenShift(*, id: int, employee_id: int, date: date, reference_date: date, clock_in: datetime, clock_out: datetime | None = None, status: OpenShiftStatus, workable: bool, automatic_clock_in: bool, location_type: LocationType | None = None, workplace_id: int | None = None, time_settings_break_configuration_id: int | None = None)[source]
Model for attendance_open_shift.
- automatic_clock_in: bool
Indicates if the shift is automatic or not
- clock_in: datetime
Clock in time from the shift. Ignore the date part
- clock_out: datetime | None
For open shifts, this field is null
- date: date
Date of the open shift
- employee_id: int
Employee identifier from the open shift
- id: int
Open Shift identifier
- location_type: LocationType | None
String representing the location type of the shift. Examples work_from_home, office, etc
- reference_date: date
Reference date for the shift
- status: OpenShiftStatus
Status of the shift
- time_settings_break_configuration_id: int | None
If the shift is a break, this field will have the break configuration id
- workable: bool
Indicates if the shift is a break or a workable shift
- workplace_id: int | None
Identifier for the workplace assigned to the shift
- class factorialhr.OpenShiftsEndpoint(api: ApiClient)[source]
Endpoint for open shifts operations.
- async all(**kwargs) ListApiResponse[OpenShift][source]
Get all open shifts records.
Official documentation: attendance/open_shifts
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async get(**kwargs) MetaApiResponse[OpenShift][source]
Get open shifts with pagination metadata.
Official documentation: attendance/open_shifts
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- class factorialhr.OvertimeRequest(*, id: int, employee_id: int, approver_id: int | None = None, author_id: int, status: OvertimeStatus, description: str | None = None, reason: str | None = None, date: date, hours_amount_in_cents: int, created_at: datetime | None = None, approver: bool, approver_full_name: str | None = None, is_editable: bool)[source]
Model for attendance_overtime_request.
- approver: bool
Whether the request has an approver
- approver_full_name: str | None
Full name of the approver
- approver_id: int | None
Approver identifier
- author_id: int
Author identifier
- created_at: datetime | None
Creation date of the overtime request
- date: date
Date of the overtime request
- description: str | None
Description of the overtime request
- employee_id: int
Employee identifier
- hours_amount_in_cents: int
Hours amount in cents
- id: int
Overtime request identifier
- is_editable: bool
Defines if the overtime request can be edited
- reason: str | None
Reason for the overtime request
- status: OvertimeStatus
Status of the overtime request
- class factorialhr.OvertimeRequestsEndpoint(api: ApiClient)[source]
Endpoint for overtime requests operations.
- async all(**kwargs) ListApiResponse[OvertimeRequest][source]
Get all overtime requests records.
Official documentation: attendance/overtime_requests
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async approve(data: Mapping[str, Any], **kwargs) OvertimeRequest[source]
Approve an overtime request.
Official documentation: attendance/overtime_requests
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) OvertimeRequest[source]
Create a new overtime request.
Official documentation: attendance/overtime_requests
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(overtime_request_id: int | str, **kwargs) OvertimeRequest[source]
Delete an overtime request.
Official documentation: attendance/overtime_requests
- Parameters:
overtime_request_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[OvertimeRequest][source]
Get overtime requests with pagination metadata.
Official documentation: attendance/overtime_requests
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(overtime_request_id: int | str, **kwargs) OvertimeRequest[source]
Get a specific overtime request by ID.
Official documentation: attendance/overtime_requests
- Parameters:
overtime_request_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async reject(data: Mapping[str, Any], **kwargs) OvertimeRequest[source]
Reject an overtime request.
Official documentation: attendance/overtime_requests
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async update(overtime_request_id: int | str, data: Mapping[str, Any], **kwargs) OvertimeRequest[source]
Update an overtime request.
Official documentation: attendance/overtime_requests
- Parameters:
overtime_request_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.Review(*, id: int, employee_id: int, date: date, approved: bool, created_at: datetime, updated_at: datetime)[source]
Model for attendance_review.
- approved: bool
Whether the review is approved
- created_at: datetime
Creation date
- date: date
Review date
- employee_id: int
Employee identifier
- id: int
Review identifier
- updated_at: datetime
Last update date
- class factorialhr.ReviewsEndpoint(api: ApiClient)[source]
Endpoint for attendance reviews operations.
- async all(**kwargs) ListApiResponse[Review][source]
Get all reviews records.
Official documentation: attendance/reviews
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async bulk_create(data: Mapping[str, Any], **kwargs) Sequence[Review][source]
Bulk create reviews.
Official documentation: attendance/reviews
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
Sequence[Review]
- async bulk_destroy(data: Mapping[str, Any], **kwargs) Sequence[Review][source]
Bulk destroy reviews.
Official documentation: attendance/reviews
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
Sequence[Review]
- async get(**kwargs) MetaApiResponse[Review][source]
Get reviews with pagination metadata.
Official documentation: attendance/reviews
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(review_id: int | str, **kwargs) Review[source]
Get a specific review by ID.
Official documentation: attendance/reviews
- Parameters:
review_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- class factorialhr.ShiftsEndpoint(api: ApiClient)[source]
Endpoint for shifts operations.
- async all(**kwargs) ListApiResponse[AttendanceShift][source]
Get all shifts records.
Official documentation: attendance/shifts
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async autofill(data: Mapping[str, Any], **kwargs) Sequence[AttendanceShift][source]
Autofill shifts.
Official documentation: attendance/shifts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
Sequence[AttendanceShift]
- async break_end(data: Mapping[str, Any], **kwargs) AttendanceShift[source]
End a break in a shift.
Official documentation: attendance/shifts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async break_start(data: Mapping[str, Any], **kwargs) AttendanceShift[source]
Start a break in a shift.
Official documentation: attendance/shifts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async clock_in(data: Mapping[str, Any], **kwargs) AttendanceShift[source]
Clock in a shift.
Official documentation: attendance/shifts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async clock_out(data: Mapping[str, Any], **kwargs) AttendanceShift[source]
Clock out a shift.
Official documentation: attendance/shifts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async create(data: Mapping[str, Any], **kwargs) AttendanceShift[source]
Create a new shift.
Official documentation: attendance/shifts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The created record.
- Return type:
- async delete(shift_id: int | str, **kwargs) AttendanceShift[source]
Delete a shift.
Official documentation: attendance/shifts
- Parameters:
shift_id (int | str) – The unique identifier of the record to delete.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The deleted record.
- Return type:
- async get(**kwargs) MetaApiResponse[AttendanceShift][source]
Get shifts with pagination metadata.
Official documentation: attendance/shifts
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type:
- async get_by_id(shift_id: int | str, **kwargs) AttendanceShift[source]
Get a specific shift by ID.
Official documentation: attendance/shifts
- Parameters:
shift_id (int | str) – The unique identifier.
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The record.
- Return type:
- async toggle_clock(data: Mapping[str, Any], **kwargs) AttendanceShift[source]
Toggle clock (clock in/out) a shift.
Official documentation: attendance/shifts
- Parameters:
data (Mapping[str, Any]) – Payload for the new record (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Result.
- Return type:
- async update(shift_id: int | str, data: Mapping[str, Any], **kwargs) AttendanceShift[source]
Update a shift.
Official documentation: attendance/shifts
- Parameters:
shift_id (int | str) – The unique identifier of the record to update.
data (Mapping[str, Any]) – Payload with fields to update (key-value mapping).
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.
- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
The updated record.
- Return type:
- class factorialhr.WorkedTime(*, employee_id: int, date: date, company_id: int, tracked_minutes: int, multiplied_minutes: int, pending_minutes: int, minutes: int, time_unit: TimeUnit, worked_time_blocks: Sequence[Any], day_type: DayType, id: str)[source]
Model for attendance_worked_time.
- company_id: int
Company identifier
- date: date
Date of the worked time
- day_type: DayType
Type of day
- employee_id: int
Employee identifier
- id: str
ID to specify the worked time it includes the employee_id and date
- minutes: int
Total number of minutes
- multiplied_minutes: int
Number of multiplied minutes
- pending_minutes: int
Number of pending minutes
- tracked_minutes: int
Number of tracked minutes
- worked_time_blocks: Sequence[Any]
List of worked time blocks
- class factorialhr.WorkedTimesEndpoint(api: ApiClient)[source]
Endpoint for worked times operations.
- async all(**kwargs) ListApiResponse[WorkedTime][source]
Get all worked times records.
Official documentation: attendance/worked_times
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing the list of records.
- Return type:
- async get(**kwargs) MetaApiResponse[WorkedTime][source]
Get worked times with pagination metadata.
Official documentation: attendance/worked_times
- Parameters:
kwargs (optional) – Optional keyword arguments (e.g.
paramsfor query string) forwarded to the HTTP request.- Raises:
httpx.HTTPStatusError – When the API returns an error status code.
- Returns:
Response containing records and pagination metadata.
- Return type: