openapi: 3.2.0 info: title: Assignar Public Timesheets API version: Version 2 description: The Assignar Public API provides the ability for customers to extend the capability of the Assignar platform. servers: - description: Australia/New Zealand url: https://api.assignar.com.au/v2 - description: North America/Europe url: https://api.assignar.com/v2 security: - OAuth2: - target-entity:b816a5d3-40c3-477f-a551-1d066d7211cc:api_access tags: - name: Timesheets paths: /timesheets-expanded: get: summary: List all timesheets with expanded details description: 'Retrieves a list of timesheets with full expanded details including activity entries, asset entries, leave request entries, dockets, allowances, and site diary information. This endpoint provides a comprehensive view of timesheet data in a single response.' tags: - Timesheets operationId: getTimesheetsExpanded responses: '200': description: Success content: application/json: schema: type: object properties: status: type: integer description: The response status data: $ref: '#/components/schemas/TimesheetsExpandedList' /timesheets-expanded/{id}: get: summary: Retrieve a single timesheet with expanded details description: 'Retrieves a single timesheet with full expanded details including activity entries, asset entries, leave request entries, dockets, allowances, and site diary information. This endpoint provides a comprehensive view of all timesheet-related data in a single response.' tags: - Timesheets operationId: getTimesheetExpanded parameters: - in: path name: id required: true schema: type: integer description: The unique identifier of the timesheet responses: '200': description: Success content: application/json: schema: type: object properties: status: type: integer description: The response status data: $ref: '#/components/schemas/TimesheetExpanded' '404': description: Timesheet not found /timesheets/coded-worker-times: get: summary: Retrieve the coded timesheets for workers tags: - Timesheets operationId: getCodedWorkerTimes responses: '200': description: Success content: application/json: schema: type: object properties: status: type: integer description: The response status data: $ref: '#/components/schemas/CodedWorkerTimes' /timesheets/coded-worker-times/week-status: get: summary: Retrieve the weekly status for coded timesheets tags: - Timesheets operationId: getCodedTimesheetWeeklyStatus parameters: - name: start_date description: The start date should be the first working day of the week required: true in: query schema: type: string - name: timezone required: false in: query schema: type: string default: UTC responses: '200': description: Success content: application/json: schema: type: object properties: status: type: integer description: The response status data: $ref: '#/components/schemas/CodedTimesheetWeeklyStatus' /timesheets/{timesheetId}/process: put: summary: Sets a timesheet's status to processed description: In order to mark a timesheet as processed, the timesheet must be completed/submitted and not already processed. tags: - Timesheets operationId: processTimesheet parameters: - in: path name: timesheetId required: true schema: type: integer responses: '200': description: Success '400': description: 'Bad Request - Timesheet must be completed before processing - Timesheet already processed ' '404': description: Timesheet not found components: schemas: CodedWorkerTimes: type: object properties: full_name: type: string user_id: type: integer username: type: string first_name: type: string last_name: type: string employee_id: type: string timesheets: type: array items: $ref: '#/components/schemas/CodedTimesheet' TimesheetExpanded: type: object properties: id: type: integer example: 12345 client_id: type: integer example: 100 user_id: type: integer example: 500 project_id: type: integer example: 200 task_id: type: integer example: 300 location: type: - string - 'null' example: 123 Main Street, Sydney NSW 2000 order_id: type: - integer - 'null' example: 400 supplier_id: type: - integer - 'null' example: 50 job_number: type: - string - 'null' example: JOB-2024-001 start_time: type: string example: 08:00 start_datetime: type: - string - 'null' format: date-time example: '2024-01-15T08:00:00.000Z' end_time: type: string example: '17:00' end_datetime: type: - string - 'null' format: date-time example: '2024-01-15T17:00:00.000Z' total_time: type: string example: 08:00 comments: type: string example: Completed site preparation and foundation work office_use: type: - string - 'null' example: Additional notes for office use submitted_date: type: string format: date example: '2024-01-15' date_of_creation: type: string format: date-time example: '2024-01-15T06:30:00.000Z' created_by_id: type: integer example: 501 modified_time: type: string format: date-time example: '2024-01-15T18:00:00.000Z' modified_by: type: string example: admin submitted_by: type: - string - 'null' example: worker123 latitude: type: number format: float example: -33.8688 longitude: type: number format: float example: 151.2093 latitude2: type: - number - 'null' format: float example: -33.869 longitude2: type: - number - 'null' format: float example: 151.2095 signature_name: type: - string - 'null' example: John Smith signature_url: $ref: '#/components/schemas/UrlAttachment' client_signature_name: type: - string - 'null' example: Jane Doe client_signature_url: $ref: '#/components/schemas/UrlAttachment' document_url: $ref: '#/components/schemas/UrlAttachment' description: 'Signed URL for the auto-generated timesheet PDF. Refreshed every time the timesheet is created, updated, approved, processed, or its site diary is signed. Null for timesheets that have not been mutated since the feature was introduced. ' completed_at: type: - string - 'null' format: date-time example: '2024-01-15T17:30:00.000Z' completed_by_id: type: - integer - 'null' example: 501 processed_by_id: type: - integer - 'null' example: 502 processed_at: type: - string - 'null' format: date-time example: '2024-01-16T09:00:00.000Z' deleted_time: type: - string - 'null' format: date-time integration_id: type: - string - 'null' example: EXT-TS-12345 status: type: string example: APPROVED_WITH_PAY_AND_CHARGE_RATES client: type: - object - 'null' properties: name: type: string example: Acme Construction external_id: type: string example: CLIENT-001 project: type: - object - 'null' properties: name: type: string example: Sydney Office Building external_id: type: string example: PROJ-2024-001 task: type: - object - 'null' properties: name: type: string example: Foundation Work external_id: type: string example: TASK-FOUNDATION-001 user: type: - object - 'null' properties: user_id: type: integer example: 500 username: type: string example: jsmith full_name: type: string example: John Smith first_name: type: string example: John last_name: type: string example: Smith employee_id: type: string example: EMP-500 employment_type_id: type: integer example: 1 email: type: string example: john.smith@example.com supplier: type: - object - 'null' properties: name: type: string example: ABC Supplies Ltd external_id: type: string example: SUPPLIER-001 order: type: - object - 'null' properties: id: type: integer example: 400 job_number: type: string example: JOB-2024-001 job_description: type: string example: Office building construction project digitaldocket: type: - object - 'null' activity_entries: type: array items: $ref: '#/components/schemas/ActivityEntry' asset_entries: type: array items: $ref: '#/components/schemas/AssetEntry' leave_request_entries: type: array items: $ref: '#/components/schemas/LeaveRequestEntry' docket: type: - object - 'null' properties: id: type: integer example: 7001 docket_id: type: integer example: 8001 timesheet_id: type: integer example: 12345 docket: type: object properties: id: type: integer example: 8001 number: type: string example: DOCKET-2024-001 image: type: string example: /dockets/docket_8001.jpg allowances: type: array items: $ref: '#/components/schemas/TimesheetExpandedAllowance' site_diary: type: - object - 'null' properties: id: type: integer example: 10001 client_signature_name: type: - string - 'null' example: Jane Doe supervisor_signature_name: type: - string - 'null' example: John Smith client_signature_url: $ref: '#/components/schemas/UrlAttachment' supervisor_signature_url: $ref: '#/components/schemas/UrlAttachment' UserCreateUpdate: type: object properties: full_name: type: string user_id: type: integer username: type: string first_name: type: string last_name: type: string employee_id: type: string CodedTime: type: object properties: id: type: integer readOnly: true timesheet_id: type: integer timesheet_time_id: type: integer user_id: type: integer timesheet_date: type: string start_at: type: string end_at: type: string time_code_group_pay_code_id: type: integer time_code_group_version_id: type: integer time_code_rule_id: type: integer coded_by_id: type: integer coded_at: type: string override_pay_code_id: type: integer overriden_at: type: string overriden_by_id: type: integer created_at: type: string created_by_id: type: integer default_pay_code: $ref: '#/components/schemas/TimeCodeGroupPayCode' time_code_rule: $ref: '#/components/schemas/TimeCodeRule' created_by: $ref: '#/components/schemas/UserCreateUpdate' coded_by: $ref: '#/components/schemas/UserCreateUpdate' override_pay_code: type: object properties: id: type: integer readOnly: true code: type: string label: type: string override_pay_code_time_code: $ref: '#/components/schemas/TimeCode' overriden_by: $ref: '#/components/schemas/UserCreateUpdate' time_code_group_version: $ref: '#/components/schemas/TimeCodeGroupVersion' AssetClass: type: object properties: id: type: integer example: 5 name: type: string example: Heavy Machinery description: type: - string - 'null' example: Large construction equipment code: type: - string - 'null' example: HEAVY-MACH UserReference: type: object properties: user_id: type: integer example: 500 username: type: string example: jsmith first_name: type: string example: John last_name: type: string example: Smith TimeCodeRule: type: object properties: id: type: integer readOnly: true time_code_id: type: integer description: type: string is_active: type: boolean LeaveRequestEntry: type: object properties: id: type: integer example: 4001 start_at: type: - string - 'null' format: date-time start_at_tz: type: - string - 'null' end_at: type: - string - 'null' format: date-time end_at_tz: type: - string - 'null' start_at_naive: type: - string - 'null' example: '2024-01-15T09:00:00' end_at_naive: type: - string - 'null' example: '2024-01-15T10:00:00' is_naive_datetime: type: boolean example: true created_at: type: string format: date-time example: '2024-01-15T08:50:00.000Z' modified_at: type: string format: date-time example: '2024-01-15T10:10:00.000Z' duration: type: integer description: Duration in minutes example: 60 leave_type: type: object properties: id: type: integer example: 1 type: type: string example: SICK label: type: string example: Sick Leave code: type: string example: SICK-LEAVE created_by: $ref: '#/components/schemas/UserReference' modified_by: $ref: '#/components/schemas/UserReference' RelatedAssetEntry: type: object properties: id: type: integer example: 2001 asset_entry_id: type: integer example: 3001 activity_asset_usage_minutes: type: integer example: 180 created_at: type: string format: date-time example: '2024-01-15T08:10:00.000Z' modified_at: type: string format: date-time example: '2024-01-15T11:50:00.000Z' asset: type: object properties: id: type: integer example: 6001 name: type: string example: Excavator Model X external_id: type: string example: ASSET-EXC-001 assetClass: $ref: '#/components/schemas/AssetClass' created_by: $ref: '#/components/schemas/UserReference' modified_by: $ref: '#/components/schemas/UserReference' TimeCodeGroupVersion: type: object properties: id: type: integer readOnly: true time_code_group_id: type: integer version: type: integer time_code_group: $ref: '#/components/schemas/TimeCodeGroup' AssetEntry: type: object properties: id: type: integer example: 3001 start_at: type: - string - 'null' format: date-time example: '2024-01-15T08:00:00.000Z' start_at_tz: type: - string - 'null' example: Australia/Sydney end_at: type: - string - 'null' format: date-time example: '2024-01-15T17:00:00.000Z' end_at_tz: type: - string - 'null' example: Australia/Sydney start_at_naive: type: - string - 'null' example: '2024-01-15T08:00:00' end_at_naive: type: - string - 'null' example: '2024-01-15T17:00:00' is_naive_datetime: type: boolean example: false created_at: type: string format: date-time example: '2024-01-15T08:00:00.000Z' modified_at: type: string format: date-time example: '2024-01-15T17:00:00.000Z' duration: type: integer description: Duration in minutes example: 540 uses_whole_shift: type: boolean example: false asset: type: object properties: id: type: integer example: 6001 name: type: string example: Excavator Model X external_id: type: string example: ASSET-EXC-001 description: type: string example: Large hydraulic excavator for earthmoving make: type: string example: Caterpillar model: type: string example: 320D year: type: string example: '2020' assetClass: $ref: '#/components/schemas/AssetClass' created_by: $ref: '#/components/schemas/UserReference' modified_by: $ref: '#/components/schemas/UserReference' TimeCodeGroup: type: object properties: id: type: integer readOnly: true name: type: string description: type: string is_default: type: boolean CodedTimesheet: allOf: - $ref: '#/components/schemas/Timesheet' - type: object properties: timesheet_times: type: array items: $ref: '#/components/schemas/TimesheetTime' UrlAttachment: type: object readOnly: true properties: url: type: string format: url description: Download URL for the file. expiry: type: integer description: Expiry date of the download url in timestamp. example: url: https://url-to-attachment expiry: 1742575641898 PayCode: type: object required: - code properties: id: type: integer readOnly: true code: type: string label: type: string time_code_id: type: - integer - 'null' created_at: type: string format: date-time readOnly: true created_by_id: type: integer readOnly: true modified_at: type: string format: date-time readOnly: true modified_by_id: type: integer readOnly: true deleted_at: type: - string - 'null' format: date-time readOnly: true deleted_by_id: type: - integer - 'null' readOnly: true Timesheet: type: object required: - client_id - user_id - task_id - start_time - end_time - break_time - travel_time_to - travel_time_from - total_time - comments - submitted_date - date_of_creation - checked - locked properties: id: type: integer readOnly: true client_id: type: integer user_id: type: integer project_id: type: integer task_id: type: integer location: type: string order_id: type: integer supplier_id: type: integer job_number: type: string start_time: type: string start_datetime: type: string end_time: type: string end_datetime: type: string break_time: type: string travel_time_to: type: string travel_time_from: type: string total_time: type: string comments: type: string office_use: type: string submitted_date: type: string date_of_creation: type: string created_by_id: type: string modified_time: type: string modified_by: type: string submitted_by: type: string checked: type: boolean locked: type: boolean latitude: type: number longitude: type: number latitude2: type: number longitude2: type: number signature_name: type: string signature: type: string client_signature_name: type: string completed_by_id: type: integer completed_at: type: string is_processed: type: boolean processed_by_id: type: integer processed_at: type: string deleted_time: type: string integration_id: type: - string - 'null' client: type: object properties: name: type: string external_id: type: string project: type: object properties: name: type: string external_id: type: string task: type: object properties: name: type: string external_id: type: string user: type: object properties: full_name: type: string username: type: string first_name: type: string last_name: type: string employee_id: type: string digitaldocket: type: object properties: digital_docket_id: type: integer supplier: type: object properties: name: type: string external_id: type: string assets: type: array items: type: object properties: asset_id: type: integer allowances: type: array items: type: object properties: allowance_id: type: integer quantity: type: number format: decimal example: 1.0 default: 1.0 description: Decimal value with precision (10,2) allowance: type: object properties: id: type: integer name: type: string active: type: boolean code: type: string docket: type: object properties: id: type: integer number: type: string image: type: string asset_times: type: array items: type: object properties: id: type: integer asset_uses_timesheet_duration: type: boolean example: false description: indicates whether asset was used for the duration of the timesheet; explicit start and end times not captured start_at: type: string example: '2023-05-06T01:00:00.000Z' description: start time in UTC start_at_tz: type: string example: Australia/Sydney description: start timezone - used to convert `start_at` to local timezone end_at: type: string example: '2023-05-06T02:00:00.000Z' description: end time in UTC end_at_tz: type: string example: Australia/Sydney description: end timezone - used to convert `end_at` to local timezone asset_id: type: integer asset: type: object properties: id: type: integer name: type: string external_id: type: string client_signature_url: $ref: '#/components/schemas/UrlAttachment' signature_url: $ref: '#/components/schemas/UrlAttachment' site_diary: type: object properties: id: type: integer client_signature_name: type: string client_signature_url: $ref: '#/components/schemas/UrlAttachment' supervisor_signature_name: type: string supervisor_signature_url: $ref: '#/components/schemas/UrlAttachment' TimeCode: type: object properties: id: type: integer readOnly: true code: type: string name: type: string description: type: string is_default: type: boolean TimeCodeGroupPayCode: type: object properties: id: type: integer readOnly: true time_code_id: type: integer pay_code_id: type: integer time_code: $ref: '#/components/schemas/TimeCode' pay_code: $ref: '#/components/schemas/PayCode' CodedTimesheetWeeklyStatus: type: object properties: id: type: integer readOnly: true start_date: type: string end_date: type: string is_default_time_code_group_configured: type: boolean is_week_in_progress: type: boolean all_timesheets_approved: type: boolean has_processed_timesheets: type: boolean has_coded_timesheets: type: boolean has_manual_overrides: type: boolean has_uncoded_time: type: boolean ActivityEntry: type: object properties: id: type: integer example: 1001 start_at: type: - string - 'null' format: date-time example: '2024-01-15T08:00:00.000Z' start_at_tz: type: - string - 'null' example: Australia/Sydney end_at: type: - string - 'null' format: date-time example: '2024-01-15T12:00:00.000Z' end_at_tz: type: - string - 'null' example: Australia/Sydney start_at_naive: type: - string - 'null' example: '2024-01-15T08:00:00' end_at_naive: type: - string - 'null' example: '2024-01-15T12:00:00' is_naive_datetime: type: boolean example: false created_at: type: string format: date-time example: '2024-01-15T08:05:00.000Z' modified_at: type: string format: date-time example: '2024-01-15T12:05:00.000Z' duration: type: integer description: Duration in minutes example: 240 activity: type: object properties: id: type: integer example: 10 name: type: string example: Excavation external_id: type: string example: ACT-EXCAV-001 is_payable: type: boolean example: true created_by: $ref: '#/components/schemas/UserReference' modified_by: $ref: '#/components/schemas/UserReference' related_asset_entries: type: array items: $ref: '#/components/schemas/RelatedAssetEntry' TimesheetExpandedAllowance: type: object properties: id: type: integer example: 9001 timesheet_id: type: integer example: 12345 allowance_id: type: integer example: 20 quantity: type: number format: float example: 2.5 allowance: type: object properties: id: type: integer example: 20 name: type: string example: Meal Allowance active: type: boolean example: true code: type: string example: MEAL-ALLOW TimesheetTime: type: object properties: asset_uses_timesheet_duration: type: boolean id: type: integer readOnly: true timesheet_id: type: integer activity_id: type: integer minutes: type: integer is_naive_datetime: type: boolean start_at: type: string start_at_tz: type: string end_at: type: string end_at_tz: type: string start_at_naive: type: string end_at_naive: type: string created_at: type: string created_by: type: integer modified_at: type: string modified_by: type: integer asset_id: type: integer activity: type: object properties: id: type: integer readOnly: true name: type: string external_id: type: string asset: type: object properties: id: type: integer readOnly: true name: type: string external_id: type: string coded_times: type: array items: $ref: '#/components/schemas/CodedTime' TimesheetsExpandedList: type: object properties: count: type: integer description: Total number of timesheets returned rows: type: array items: $ref: '#/components/schemas/TimesheetExpanded' securitySchemes: OAuth2: type: oauth2 flows: clientCredentials: tokenUrl: https://login.assignar.com/oauth2/token scopes: target-entity:b816a5d3-40c3-477f-a551-1d066d7211cc:api_access: Access to API description: 'The client credentials flow is a server-to-server flow. There is no user authentication involved in the process. Instead, the client acts on behalf of itself. The client can request an access token using only its client credentials (or other supported means of authentication) when the client is requesting access to the protected resources under its control. The client credentials are passed in the Authorization header as a Basic Auth (base64 encoded "client_id:client_secret"). The token endpoint of the Authorization server where the client can obtain the token is https://login.assignar.com/oauth2/token. The scope ''target-entity:b816a5d3-40c3-477f-a551-1d066d7211cc:api_access'' is required to access the API. ' x-provenance: method: harvested publisher: Assignar source: https://apidocs.assignar.com/api-docs/swagger.yaml note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json); stamped by stamp-openapi-provenance.py (roadmap#793)