When I Work

App · 20 actions

Read employees, schedules, shifts, time entries and time off; manage positions and schedules.

Actions

ActionWhat it does
Create positionCreate Position.
Create scheduleCreate Schedule (Location).
Delete positionDelete Position.
Delete scheduleDelete Schedule (Location).
Get positionGet Position.
Get profileGet User Profile.
Get scheduleGet Schedule (Location).
Get shiftGet Shift.
Get siteGet Site.
Get time entryGet Time.
Get time off requestGet Time Off Request.
Get userGet User.
List positionsList Positions.
List schedulesList Schedules (Locations).
List shiftsList Shifts.
List sitesList Sites.
List time entriesList Times.
List time off requestsList Time Off Requests.
List usersList Users.
Update positionUpdate Position.

Create position

Create Position.

Inputs

NamenametextRequired
Name.
Colorcolortext
Color.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "position": {
      "account_id": 1,
      "color": "example",
      "created_at": "example",
      "id": 1,
      "name": "example",
      "sort": 1,
      "tips_tracking": false,
      "updated_at": "example"
    }
  }
}

Create schedule

Create Schedule (Location).

Inputs

NamenametextRequired
Name.
Addressaddresstext
Address.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "location": {
      "account_id": 1,
      "address": "example",
      "coordinates": [],
      "created_at": "example",
      "deleted_at": "example",
      "id": 1,
      "ip_address": "example",
      "is_default": false,
      "is_deleted": false,
      "latitude": 1.0,
      "longitude": 1.0,
      "max_hours": 1,
      "name": "example",
      "place": {
        "address": "example",
        "business_name": "example",
        "country": "example",
        "id": 1,
        "latitude": 1.0,
        "locality": "example",
        "longitude": 1.0,
        "place_id": "example",
        "place_type": [],
        "postal_code": "example",
        "region": "example",
        "street_name": "example",
        "street_number": "example",
        "sub_locality": "example",
        "updated_at": "example"
      },
      "place_confirmed": false,
      "place_id": "example",
      "radius": 1,
      "sort": 1,
      "updated_at": "example"
    }
  }
}

Delete position

Delete Position.

Inputs

IdidtextRequired
The ID of the position

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "success": false
  }
}

Delete schedule

Delete Schedule (Location).

Inputs

IdidtextRequired
The ID of the schedule

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "success": false
  }
}

Get position

Get Position.

Inputs

IdidtextRequired
The ID of the position

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "position": {
      "account_id": 1,
      "color": "example",
      "created_at": "example",
      "id": 1,
      "name": "example",
      "sort": 1,
      "tips_tracking": false,
      "updated_at": "example"
    }
  }
}

Get profile

Get User Profile.

Inputs

None.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "user": {
      "account_id": 1,
      "activated": false,
      "created_at": "example",
      "email": "example",
      "employee_code": "example",
      "employment_type": "hourly",
      "first_name": "example",
      "hourly_rate": 1.0,
      "hours_max": 1.0,
      "id": 1,
      "is_deleted": false,
      "is_hidden": false,
      "is_payroll": false,
      "is_private": false,
      "is_trusted": false,
      "last_login": "example",
      "last_name": "example",
      "locations": [],
      "login_id": 1,
      "middle_name": "example",
      "notes": "example",
      "phone_number": "example",
      "position_rates": {},
      "positions": [],
      "role": 1,
      "start_date": "example",
      "type": 1,
      "updated_at": "example"
    }
  }
}

Get schedule

Get Schedule (Location).

Inputs

IdidtextRequired
The ID of the schedule

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "location": {
      "account_id": 1,
      "address": "example",
      "coordinates": [],
      "created_at": "example",
      "deleted_at": "example",
      "id": 1,
      "ip_address": "example",
      "is_default": false,
      "is_deleted": false,
      "latitude": 1.0,
      "longitude": 1.0,
      "max_hours": 1,
      "name": "example",
      "place": {
        "address": "example",
        "business_name": "example",
        "country": "example",
        "id": 1,
        "latitude": 1.0,
        "locality": "example",
        "longitude": 1.0,
        "place_id": "example",
        "place_type": [],
        "postal_code": "example",
        "region": "example",
        "street_name": "example",
        "street_number": "example",
        "sub_locality": "example",
        "updated_at": "example"
      },
      "place_confirmed": false,
      "place_id": "example",
      "radius": 1,
      "sort": 1,
      "updated_at": "example"
    }
  }
}

Get shift

Get Shift.

Inputs

IdidtextRequired
The ID of the shift

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "repeating_shifts": [],
    "shift": {
      "account_id": 1,
      "acknowledged": false,
      "acknowledged_at": "example",
      "alerted": false,
      "break_time": 1.0,
      "breaks": [],
      "color": "example",
      "created_at": "example",
      "creator_id": 1,
      "end_time": "example",
      "id": 1,
      "instances": 1,
      "is_approved_without_time": false,
      "is_open": false,
      "is_shared": false,
      "is_trimmed": false,
      "linked_users": [],
      "location_id": 1,
      "notes": "example",
      "notified_at": "example",
      "openshift_approval_request_id": 1,
      "position_id": 1,
      "published": false,
      "published_date": "example",
      "requires_openshift_approval": false,
      "shiftchain_key": "example",
      "site_id": 1,
      "start_time": "example",
      "updated_at": "example",
      "user_id": 1
    },
    "shiftchains": []
  }
}

Get site

Get Site.

Inputs

IdidtextRequired
The ID of the site

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "site": {
      "account_id": 1,
      "address": "example",
      "color": "example",
      "coordinates": [],
      "created_at": "example",
      "deleted_at": "example",
      "description": "example",
      "id": 1,
      "is_deleted": false,
      "latitude": 1.0,
      "location_id": 1,
      "longitude": 1.0,
      "name": "example",
      "place": {
        "address": "example",
        "business_name": "example",
        "country": "example",
        "id": 1,
        "latitude": 1.0,
        "locality": "example",
        "longitude": 1.0,
        "place_id": "example",
        "place_type": [],
        "postal_code": "example",
        "region": "example",
        "street_name": "example",
        "street_number": "example",
        "sub_locality": "example",
        "updated_at": "example"
      },
      "place_id": "example",
      "updated_at": "example"
    }
  }
}

Get time entry

Get Time.

Inputs

IdidtextRequired
The ID of the time

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "time": {
      "account_id": 1,
      "alert_type": 1,
      "cash_tips": "example",
      "created_at": "example",
      "creator_id": 1,
      "end_time": "example",
      "hourly_rate": 1.0,
      "id": 1,
      "is_alerted": false,
      "is_approved": false,
      "length": 1.0,
      "location_id": 1,
      "modified_by": 1,
      "notes": "example",
      "paid_break_note": "example",
      "position_id": 1,
      "rounded_end_time": "example",
      "rounded_length": 1.0,
      "rounded_start_time": "example",
      "shift_id": 1,
      "site_id": 1,
      "split_time": "example",
      "start_time": "example",
      "sync_hash": "example",
      "sync_id": "example",
      "updated_at": "example",
      "user_id": 1
    }
  }
}

Get time off request

Get Time Off Request.

Inputs

Request IDrequest_idtextRequired
Request ID to return.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "messages": [],
    "request": {
      "account_id": 1,
      "can_edit": false,
      "created_at": "example",
      "creator_id": 1,
      "end_time": "example",
      "hours": 1.0,
      "id": 1,
      "paid": false,
      "start_time": "example",
      "status": 0,
      "type": 1,
      "type_id": 1,
      "type_label": "example",
      "updated_at": "example",
      "user_id": 1,
      "user_status": 0
    },
    "users": []
  }
}

Get user

Get User.

Inputs

IdidtextRequired
The ID of the user

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "user": {
      "account_id": 1,
      "activated": false,
      "created_at": "example",
      "email": "example",
      "employee_code": "example",
      "employment_type": "hourly",
      "first_name": "example",
      "hourly_rate": 1.0,
      "hours_max": 1.0,
      "id": 1,
      "is_deleted": false,
      "is_hidden": false,
      "is_payroll": false,
      "is_private": false,
      "is_trusted": false,
      "last_login": "example",
      "last_name": "example",
      "locations": [],
      "login_id": 1,
      "middle_name": "example",
      "notes": "example",
      "phone_number": "example",
      "position_rates": {},
      "positions": [],
      "role": 1,
      "start_date": "example",
      "type": 1,
      "updated_at": "example"
    }
  }
}

List positions

List Positions.

Inputs

Show deletedshow_deletedtrue/false
Whether to show positions that have been deleted

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "positions": []
  }
}

List schedules

List Schedules (Locations).

Inputs

Only unconfirmedonly_unconfirmedtrue/false
Include only unconfirmed schedules/locations

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "locations": []
  }
}

List shifts

List Shifts.

Inputs

Employeeemployee_idtext
The user id to filter by
Startstartdate and time
The start of the filter range.
Endenddate and time
The end of the filter range.
Locationlocation_idlist
Schedules to include.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "repeating_shifts": [],
    "shiftchains": [],
    "shifts": []
  }
}

List sites

List Sites.

Inputs

Include deletedinclude_deletedtrue/false
Include deleted sites

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "sites": []
  }
}

List time entries

List Times.

Inputs

Startstartdate and time
The start of the filter range.
Endenddate and time
The end of the filter range.
Employeeemployee_idlist
Employees to include.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "times": []
  }
}

List time off requests

List Time Off Requests.

Inputs

EndenddateRequired
yyyy-mm-dd formatted end date for the request time-frame.
Include deleted usersinclude_deleted_userstrue/false
Return all requests including those made by deleted users.
Limitlimitnumber
Number of requests to load per page.From 1 to 200.
Locationlocation_idtext
Location ID to show requests for.
Max IDmax_idtext
Return all requests created before the request with the given ID.
Pagepagenumber
Page of results to load.At least 0.
Since IDsince_idtext
Return all requests created since the request with given ID.
Sortbysortbytext
Field to sort by. Can either be 'created' and sort by the created_at date in descending order, or anything else and sort by status in ascending order, then by the updated_at date in descending order.One of: created, status.
StartstartdateRequired
yyyy-mm-dd formatted start date for the request time-frame.
Statusstatusnumber
Only return requests with the given status.One of: 0 (Pending), 1 (Canceled), 2 (Accepted), 3 (Expired).
Typetypenumber
Type of request to filter by.One of: 0 (Unpaid time off), 1 (Paid time off), 2 (Sick), 3 (Holiday).
Employeeemployee_idlist
Employees to include.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "messages": [],
    "more": false,
    "page": 1,
    "requests": [],
    "total": 1,
    "users": []
  }
}

List users

List Users.

Inputs

Locationlocation_idlist
Location ID.
Show pendingshow_pendingtrue/false
Include pending users in results. Defaults to true.
Only pendingonly_pendingtrue/false
Include ONLY pending users in results. Defaults to false.
Show deletedshow_deletedtrue/false
Include deleted users in results. Defaults to false. Requires administrator, manager, or supervisor access (enforced via can_supervise()); otherwise the request returns 403.
Only deletedonly_deletedtrue/false
Only include deleted/archived users in results. Defaults to false. Requires administrator, manager, or supervisor access (enforced via can_supervise()); otherwise the request returns 403.
Searchsearchtext
Optional string to search by in users first name, last name, or email.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "users": []
  }
}

Update position

Update Position.

Inputs

IdidtextRequired
The ID of the position
Namenametext
Name.
Colorcolortext
Color.

Outputs

dataobject
When I Work response data.
Example output
{
  "data": {
    "position": {
      "account_id": 1,
      "color": "example",
      "created_at": "example",
      "id": 1,
      "name": "example",
      "sort": 1,
      "tips_tracking": false,
      "updated_at": "example"
    }
  }
}

On this page