🚀 Tanda API v2

Getting Started

Welcome to the Tanda API! This documentation steps you through authenticating to the API, as well as the various endpoints and methods supported.

Not sure where to start? Check out the quick start guide, or browse some code samples on GitHub.

There’s two ways to connect to the API. Use Authorization Code if you’re making an add-on for other Tanda users to use. Use Password if you’re building an integration just for your own account.

Authentication (Authorization Code)

Use Authorization Code authentication if you’re making an add-on for other Tanda customers to use. For example, if you are building an integration that connects your custom reporting platform to Tanda data, you’ll probably want to let lots of Tanda customers use it. This is the approach for you.

First, you should create a new account for your app. Do this by signing up for a new account from the Tanda homepage, then reach out to your Tanda account manager (or developers@tanda.co) and ask for the account to be set up as a developer account.

Once you have a dedicated account, you can get an application ID, secret, and redirect URI. You can get all of these from the applications page. With those details, follow these steps to authenticate a user using the Authorization Code authentication flow.

https://my.tanda.co/api/oauth/authorize?scope=SCOPE1+SCOPE2&client_id=YOUR_APPLICATION_ID&redirect_uri=YOUR_REDIRECT_URI&response_type=code

1. Redirect the user to the authorize endpoint

Allow users on your website to authenticate themselves with Tanda by redirecting them to the following URL. Where APPLICATION_ID and REDIRECT_URI are the values specific to your app, and the scope parameter is the relevant Tanda OAuth2 scopes your want access to (more information: Scopes).

2. Catch the request to your redirect URI

The Tanda server will then redirect the request back to your redirect URI, with a request code in the URL parameters. So if your redirect URI is https://mysite.com/callback then the request will be made to https://mysite.com/callback?code=AUTHORIZATION_CODE.

For local testing, as the browser gets redirected to the URI, it is possible to set it to a local address (i.e. http://localhost:3000/callback) to allow you to test your OAuth web app before deploying your code.

curl https://my.tanda.co/api/oauth/token -X POST -H "Cache-Control: no-cache" \
-F "client_id=YOUR_APPLICATION_ID" \
-F "client_secret=YOUR_SECRET" \
-F "code=AUTHORIZATION_CODE" \
-F "redirect_uri=YOUR_REDIRECT_URI" \
-F "grant_type=authorization_code"

3. Make a POST request to the token endpoint

Now that you’ve got your authorization code, you can finally make the POST request to get your access token (don’t worry, this is the last step).

From your server/application make a POST request to https://my.tanda.co/api/oauth/token.

The response should look something like this:

{
  "access_token": "6833b9ecaa84ce420da3cafaa43124d241cb28b5287b72d131f6b38bcb64cd91",
  "token_type": "bearer",
  "expires_in": 7200,
  "refresh_token": "ddeb6480f06247e3635826dd5e3875ece6f64a27044516731a914897431ab446",
  "scope": "me",
  "created_at": 1457304578
}

expires_in is in seconds, so your token will last 2 hours. To learn how to refresh your token, see Refreshing your Token.

Refreshing your Token

curl https://my.tanda.co/api/oauth/token -X POST -H "Cache-Control: no-cache" \
-F "client_id=YOUR_APPLICATION_ID" \
-F "client_secret=YOUR_SECRET" \
-F "refresh_token=REFRESH_TOKEN" \
-F "redirect_uri=YOUR_REDIRECT_URI" \
-F "grant_type=refresh_token"

If you got your token using the Authorization Code authentication flow, and it expires, then using the the refresh_token you got above, you are able to refresh it by making a POST request to https://my.tanda.co/api/oauth/token.

The response should look something like this:

{
  "access_token": "ddeb6480f06247e3635826dd5e3875ece6f64a27044516731a914897431ab446",
  "token_type": "bearer",
  "expires_in": 7200,
  "refresh_token": "d0692903972ff6559ec5f0e3165cabd5b87f47e3613431ad53805b5397268206",
  "scope": "me",
  "created_at": 1457311778
}

You can now go on using this new access token for another 2 hours.

If your application’s access is revoked by the user, then you will need to run through the authentication process again to obtain a new access token.

Although the tokens only last for 2 hours, you can refresh your token as many times as you want. The refresh token has no expiry but can only be used once.

Authentication (Password)

Use Password authentication if you’re building an integration just for your own account. For example, if you’re building an integration for a specific customer - either as an in-house developer or as a consultant - this is the the approach for you.

If you’re using the API for a single account, the Password authentication flow is an easier way to get set up. You can authenticate via the command line using your Tanda login details, or you can just set up an access token through the Tanda API management page.

Access tokens generated using Password authentication never expire, but can be revoked from the API management page.

1. Make a POST request to the token endpoint

curl https://my.tanda.co/api/oauth/token -X POST -H "Cache-Control: no-cache" \
-F "username=USER_EMAIL" \
-F "password=USER_PASSWORD" \
-F "scope=SCOPE1 SCOPE2" \
-F "grant_type=password"

From your server/application make a POST request to https://my.tanda.co/api/oauth/token with the user’s email and password.

The response should look something like this:

{
  "access_token": "6833b9ecaa84ce420da3cafaa43124d241cb28b5287b72d131f6b38bcb64cd91",
  "token_type": "bearer",
  "scope": "me",
  "created_at": 1457304578
}

Password authenticated tokens have no expiry. They can also be created and revoked from the access tokens page.

Making Requests

Once either of the above authentication methods have been completed, you’ll have an access token (in the case of Authorization Code authentication, the token will only last for 2 hours).

Your access token will look something like this: 6833b9ecaa84ce420da3cafaa43124d241cb28b5287b72d131f6b38bcb64cd91. From here on out all requests you make to the Tanda v2 API must include the token in the header like so:

curl --header "Authorization: bearer 6833b9ecaa84ce420da3cafaa43124d241cb28b5287b72d131f6b38bcb64cd91" \
https://my.tanda.co/api/v2/users/me
Authorization: bearer 6833b9ecaa84ce420da3cafaa43124d241cb28b5287b72d131f6b38bcb64cd91

See the right hand sidebar for an example of a request that gets information about the user that just authenticated.

Invalid Subscriptions

If you receive a 402 response status with this message:

Your account is locked out for billing purposes, and cannot use the API!

This indicates that the customer’s account does not have a valid credit card or other billing method set, and their free trial has ended. Therefore they will not be able to access some components of Tanda either through the website or the API.

You can query the current user endpoint to check if a user has a valid subscription.

Rate Limiting

If you reach the rate limit, you’ll get the following 429 response:

Headers

X-RateLimit-Limit:       100
X-RateLimit-RateLimited: true
X-RateLimit-Remaining:   0
X-RateLimit-Reset:       1461211225

Body

{
  "error": "API rate limit exceeded!"
}

Requests to the API are rate limited to 100 requests, per 1 minute for each requester.

A requester is defined through the following workflow:

  • Is the request using a Password Access Token?
    • Yes? Then the requester is the current user (meaning all requests made though any of my password tokens are counted together).
    • No? The the requester is the combination of the OAuth app and current user.

When making requests to the API, the following headers will be added to the response:

X-RateLimit-Limit:     100
X-RateLimit-Remaining: 52
X-RateLimit-Reset:     1461211225
  • X-RateLimit-Limit is the your rate limit

  • X-RateLimit-Remaining is the remaining number of requests you can make before you will be rate limited

  • X-RateLimit-Reset is when the rate limit will be reset

If have reached the rate limit, then an additional header will be present:

X-RateLimit-RateLimited: true

Here’s an example to make things a little clearer:

  • I have multiple Password Access Tokens with different scopes, token_1, token_2.

  • I have an OAuth app, which is used by user_1, user_2 and myself.

  • user_2 has also created an OAuth app which I am using.

This is the maximum number of requests that can be made in a single minute:

  • 99 requests with token_1

  • 1 request with token_2 (I have 100 requests/min for all my Password Access Tokens)

  • 100 requests on my behalf through user_2's OAuth app

  • 100 requests on my behalf through my OAuth app

  • 100 requests on user_1's behalf through my OAuth app

  • 100 requests on user_2's behalf through my OAuth app

In summary the distinct requesters in this example are:

  • Me through my Password Access Tokens

  • Me through user_2's OAuth app

  • Me through my OAuth app

  • user_1 through my OAuth app

  • user_2 through my OAuth app

Caching

curl --header "If-None-Match: 17f1542065ae37d0963a608fd632b4615a288ceb" --header "Authorization: bearer 6833b9ecaa84ce420da3cafaa43124d241cb28b5287b72d131f6b38bcb64cd91" \
https://my.tanda.co/api/v2/users/me

The Tanda API supports the If-None-Match HTTP header. All API responses will include an ETag response header. You can use the value of this header in future requests to the same endpoint by passing it to the If-None-Match request header. If the content the API would return has not changed, you will get back a 304 Not Modified response.

The right sidebar has an example of an ETag being included in a request. For more information about ETags and If-None-Match, see Mozilla’s guide.

Scopes

In both the Authorization Code and Password authentication methods, you are required to include a scope parameter. Here is a complete list of the scopes in the Tanda API, additionally, in this documentation each endpoint specifies which scope/s it requires.

Scope Endpoints Description
me Users, Shift Reminders Access information about the current user
roster Rosters, Schedules, Schedule Swap Plans, Custom Events Manage roster, schedule information, shift swaps and custom events
timesheet Timesheets, Shifts Manage timesheet and shift information
department Locations, Teams (Departments), Shift Details, Custom Events Manage location, department (team), and shift detail information
user Users, Award Tags, Clock Ins Manage personal information about your employees (without wages)
cost Users, Timesheets, Shifts, Rosters, Schedules Mange information about your employee’s wage, and see costs for timesheets and rosters
leave Leave Requests, Leave Balances Manage leave requests and balances
unavailability Unavailability Manage unavailability
datastream Data Streams, Data Stream Joins, Store Stats Manage your data streams and store stats
device Devices, Clock Ins Manage timeclock information, and read clock ins for devices
qualifications Qualifications Manage qualifications
settings Settings, Award Templates Manage account settings and award related configuration
organisation Organisations View & create client organisations
sms SMS Send SMS
personal Personal Details Manage your personal details (without Bank Details, TFN, etc)
financial Personal Details, Users Access financial data about your employees (Bank Details, TFN, etc)
platform Platform Get platform data

Not only will you need the relevant scopes to access the endpoints, but also the correct system permissions in Tanda. For more information see each endpoint group.

By selecting only the bare minimum scopes that your application needs, users will feel more comfortable authorizing your application.

For example: If you had all scopes selected but your application simply collects information about users (using the User endpoint, and user scope) people will question why your application needs to have access to timesheet data (timesheet scope) and will be less likely to approve it.

Dates and Times

All dates in the Tanda API are rendered in YYYY-MM-DD format. Any request you make must use YYYY-MM-DD format for all dates.

All times in the Tanda API are rendered as Unix time, this is to avoid confusion as there can be users with different timezones in the same organisation. A user’s timezone can be retrieved from the both the User endpoint and the Current User endpoint. Any request you make must use Unix time for all times.

Our user guide has more information on working with unix times through the API.

Update Timestamps

As well as the fields listed in the API examples below, every API response will also include an updated_at timestamp. This represents the last time that an object was updated. Like all other times returned by the API, it will be formatted as a Unix timestamp.

Many GET endpoints support an updated_after querystring parameter. Use this to filter results API-side by the updated_at field. Some endpoints also support a show_costs parameter, and return a last_costed_at field. If you pass both show_costs and updated_after, we will compare to both the updated_at and last_costed_at field when filtering.

An example may illustrate this better. Say you have a shift, and at 10am you change its start time. Then, at 11am, costing details for the shift’s employee are changed, which causes the cost of the shift to update. The shift’s updated_at will be 10am, while its last_costed_at will be 11am. If you make a call to the shift GET endpoint with updated_after of 10:30am, the shift will not be returned. But if you include the show_costs parameter when making the call, the shift will be returned since it was last costed after 10:30am.

Audit Trails

Every change made in Tanda through the API is logged and added to the in-Tanda audit trail. By default, changes will be marked as being made by “API v2”, with the user ID that corresponds to the authenticated user. If you’re building an integration that requires more fine tuned auditing (for example, a token is shared by multiple users, but you’re able to identify which user is responsible for a particular action), you can customise the user ID and audit trail name that are displayed. Please contact developers@tanda.co and we can help you set this up.

Code Samples

We have a repository of code samples available on GitHub. There’s also user guides and links to other helpful API information there. Please check it out, contributions are always welcome!

General

Current User

GET https://my.tanda.co/api/v2/users/me
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 123456,
  "name": "Lenny Leonard",
  "email": "lenny.leonard@springfieldpowerplant.com",
  "photo": "http://vignette1.wikia.nocookie.net/family-guyamerican-dadthe-simpsons-and-futurama/images/f/ff/250px-Lenny_Leonard.png",
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "organisation": "Moe's Tavern",
  "organisation_id": 126546,
  "locale": "en-US",
  "country": "United States",
  "permissions": [
    "employee",
    "manager"
  ],
  "valid_subscription": true,
  "user_ids": [
    1,
    2,
    123456
  ],
  "organisations": [
    {
      "name": "Moe's Tavern",
      "id": 1,
      "user_id": 1,
      "locale": "en-US",
      "country": "United States"
    },
    {
      "name": "Bob's Burgers",
      "id": 2,
      "user_id": 1,
      "locale": "en-US",
      "country": "United States"
    },
    {
      "name": "Dave's Doors",
      "id": 3,
      "user_id": 123456,
      "locale": "en-AU",
      "country": "Australia"
    }
  ],
  "updated_at": 1478650040
}

Get Current User
GET/api/v2/users/me

Gets information about the current user (i.e. the user that has been authenticated).

The following fields are returned:

  • id - the user’s unique ID.

  • name - the user’s name.

  • email - the user’s email.

  • photo - if present, a link to a photo of the user.

  • time_zone - the name of the time zone the user is in - uses zone names from the IANA Time Zone Database. See our user guide for more on using times with the Tanda API.

  • utc_offset - the UTC offset for the current user, this can be used as a compliment to the time zone name. See our user guide for more on using times with the Tanda API.

  • organisation - the name of the currently authenticated organisation. A user can belong to one or more organisations. Unless otherwise specified on the individual endpoint, only data from this organisation will be returned by any API calls using the current access token.

  • organisation_id - the ID of the currently authenticated organisation. A user can belong to one or more organisations. Unless otherwise specified on the individual endpoint, only data from this organisation will be returned by any API calls using the current access token.

  • locale - the locale of the user.

  • country - the country the user’s organisation is based in.

  • permissions - The user’s privilege levels in the system, from the set of ['organisation_admin', 'payroll_officer', 'roster_manager', 'manager', 'employee', 'partner'].

  • valid_subscription - If true, the user will be able to access other API endpoints.

  • user_ids - User IDs associated with this user. This array will contain more than one item if the user has multiple profiles. If you want to get all data relating to a person across all their workplaces, use these. If you need to restrict your API call to a specific user, you can use the X-User-Id header and one of these IDs.

  • organisations - Organisations at which this user has profiles, based on user_ids. If your application needs to deal with people who may work at more than one Tanda organisation, you should use this. If you need to restrict your API call to a specific organisation, you can use the X-Organisation-Id header and one of these IDs. Note that a user may have multiple profiles within the same organisation.

This method requires the me scope (see Scopes for more information).


Rosters

Rosters are the container for scheduled shifts, each roster runs for 1 week and contains Schedules. For actual times worked, please see Timesheets or Shifts.

Rosters are not created directly. Instead a roster will be created when creating through the Schedules endpoint.

No special Tanda permissions are required to use the roster endpoint.

Roster

GET https://my.tanda.co/api/v2/rosters/70074?show_costs=true
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 70074,
  "schedules": [
    {
      "date": "2016-03-02",
      "schedules": [
        {
          "id": 31337157,
          "roster_id": 70074,
          "user_id": 123456,
          "start": 1456902000,
          "finish": 1456916400,
          "breaks": [
            {
              "start": 1456909200,
              "finish": 1456911000
            }
          ],
          "automatic_break_length": 30,
          "department_id": 111,
          "shift_detail_id": 36,
          "cost": 20.19,
          "last_published_at": 1457002800,
          "acceptance_status: `not_accepted`": "Hello, world!",
          "record_id": 532432
        }
      ]
    }
  ],
  "start": "2016-02-29",
  "finish": "2016-03-07",
  "cost": 1200.2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "schedules": {
      "type": "array",
      "description": "The roster broken down by days"
    },
    "start": {
      "type": "string",
      "description": "The date of the first day of the roster"
    },
    "finish": {
      "type": "string",
      "description": "The date of the last day of the roster"
    },
    "cost": {
      "type": "number",
      "description": "The total cost of the roster, if `show_costs=true` parameter is set"
    }
  },
  "required": [
    "id",
    "schedules",
    "start",
    "finish"
  ]
}

Get Roster
GET/api/v2/rosters/{id}{?show_costs}

Get a roster by id.

This method requires the roster scope (see Scopes for more information).

If you are using show_costs=true, the cost scope is also required.

URI Parameters
HideShow
id
number (required) Example: 70074

The id of the roster

show_costs
boolean (optional) Example: true

Whether to show the costs for the roster (defaults to false)


Current Roster

GET https://my.tanda.co/api/v2/rosters/current?show_costs=true
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 70074,
  "schedules": [
    {
      "date": "2016-03-02",
      "schedules": [
        {
          "id": 31337157,
          "roster_id": 70074,
          "user_id": 123456,
          "start": 1456902000,
          "finish": 1456916400,
          "breaks": [
            {
              "start": 1456909200,
              "finish": 1456911000
            }
          ],
          "automatic_break_length": 30,
          "department_id": 111,
          "shift_detail_id": 36,
          "cost": 20.19,
          "last_published_at": 1457002800,
          "acceptance_status: `not_accepted`": "Hello, world!",
          "record_id": 532432
        }
      ]
    }
  ],
  "start": "2016-02-29",
  "finish": "2016-03-07",
  "cost": 1200.2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "schedules": {
      "type": "array",
      "description": "The roster broken down by days"
    },
    "start": {
      "type": "string",
      "description": "The date of the first day of the roster"
    },
    "finish": {
      "type": "string",
      "description": "The date of the last day of the roster"
    },
    "cost": {
      "type": "number",
      "description": "The total cost of the roster, if `show_costs=true` parameter is set"
    }
  },
  "required": [
    "id",
    "schedules",
    "start",
    "finish"
  ]
}

Get the Current Roster
GET/api/v2/rosters/current{?show_costs}

Get the current roster.

This method requires the roster scope (see Scopes for more information).

If you are using show_costs=true, the cost scope is also required.

URI Parameters
HideShow
show_costs
boolean (required) Example: true

Whether to show the costs for the roster (defaults to false)


Roster that Contains Date

GET https://my.tanda.co/api/v2/rosters/on/2016-03-02?show_costs=true
Responses200204
Headers
Content-Type: application/json
Body
{
  "id": 70074,
  "schedules": [
    {
      "date": "2016-03-02",
      "schedules": [
        {
          "id": 31337157,
          "roster_id": 70074,
          "user_id": 123456,
          "start": 1456902000,
          "finish": 1456916400,
          "breaks": [
            {
              "start": 1456909200,
              "finish": 1456911000
            }
          ],
          "automatic_break_length": 30,
          "department_id": 111,
          "shift_detail_id": 36,
          "cost": 20.19,
          "last_published_at": 1457002800,
          "acceptance_status: `not_accepted`": "Hello, world!",
          "record_id": 532432
        }
      ]
    }
  ],
  "start": "2016-02-29",
  "finish": "2016-03-07",
  "cost": 1200.2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "schedules": {
      "type": "array",
      "description": "The roster broken down by days"
    },
    "start": {
      "type": "string",
      "description": "The date of the first day of the roster"
    },
    "finish": {
      "type": "string",
      "description": "The date of the last day of the roster"
    },
    "cost": {
      "type": "number",
      "description": "The total cost of the roster, if `show_costs=true` parameter is set"
    }
  },
  "required": [
    "id",
    "schedules",
    "start",
    "finish"
  ]
}
Headers
Content-Type: application/json

Get Roster that Contains Date
GET/api/v2/rosters/on/{date}{?show_costs}

Get the roster that contains a date, will return a 204 response if there is no roster.

This method requires the roster scope (see Scopes for more information).

If you are using show_costs=true, the cost scope is also required.

URI Parameters
HideShow
date
string (required) Example: 2016-03-02

The date that’s contained in the roster you are looking for.

show_costs
boolean (optional) Example: true

Whether to show the costs for the roster (defaults to false)


Sales Targets

GET https://my.tanda.co/api/v2/rosters/sales_targets/type/2018-02-26
Responses200
Headers
Content-Type: application/json
Body
{
  "target": "1234.56",
  "created_at": 1519621685,
  "updated_at": 1519621685,
  "user_entered": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "target": {
      "type": "string",
      "description": "Value of the sales target. null if there is no roster for the given date."
    },
    "created_at": {
      "type": [
        "number",
        "null"
      ],
      "description": "When the user-entered sales target was first created, if there is one. Otherwise null."
    },
    "updated_at": {
      "type": [
        "number",
        "null"
      ],
      "description": "When the user-entered sales target was last updated, if there is one. Otherwise null."
    },
    "user_entered": {
      "type": "boolean",
      "description": "Whether or not the default projection was overridden with a user-entered value."
    }
  },
  "required": [
    "created_at",
    "updated_at",
    "user_entered"
  ]
}

Get Sales Target
GET/api/v2/rosters/sales_targets/{type}/{date}

Get the sales target for a given roster with no filter.

This method requires the roster scope (see Scopes for more information).

URI Parameters
HideShow
type
string (required) 

There are two possible values: day and week.

date
string (required) Example: 2018-02-26

A date within the roster you are looking for.


Sales Targets for Team (Department)

GET https://my.tanda.co/api/v2/rosters/sales_targets/type/2018-02-26?department_id=123
Responses200
Headers
Content-Type: application/json
Body
{
  "target": "1234.56",
  "created_at": 1519621685,
  "updated_at": 1519621685,
  "user_entered": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "target": {
      "type": "string",
      "description": "Value of the sales target. null if there is no roster for the given date."
    },
    "created_at": {
      "type": [
        "number",
        "null"
      ],
      "description": "When the user-entered sales target was first created, if there is one. Otherwise null."
    },
    "updated_at": {
      "type": [
        "number",
        "null"
      ],
      "description": "When the user-entered sales target was last updated, if there is one. Otherwise null."
    },
    "user_entered": {
      "type": "boolean",
      "description": "Whether or not the default projection was overridden with a user-entered value."
    }
  },
  "required": [
    "created_at",
    "updated_at",
    "user_entered"
  ]
}

Get Target for Team
GET/api/v2/rosters/sales_targets/{type}/{date}{?department_id}

Get the sales target for a given roster filtered to a team.

You must either be an Admin or General Manager, or have read access to the team you are requesting.

This method requires the roster scope (see Scopes for more information).

URI Parameters
HideShow
type
string (required) 

There are two possible values: day and week.

date
string (required) Example: 2018-02-26

A date within the roster you are looking for.

department_id
number (optional) Example: 123

The ID of a team to filter the roster to.


Sales Targets for Location

GET https://my.tanda.co/api/v2/rosters/sales_targets/type/2018-02-26?location_id=456
Responses200
Headers
Content-Type: application/json
Body
{
  "target": "1234.56",
  "created_at": 1519621685,
  "updated_at": 1519621685,
  "user_entered": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "target": {
      "type": "string",
      "description": "Value of the sales target. null if there is no roster for the given date."
    },
    "created_at": {
      "type": [
        "number",
        "null"
      ],
      "description": "When the user-entered sales target was first created, if there is one. Otherwise null."
    },
    "updated_at": {
      "type": [
        "number",
        "null"
      ],
      "description": "When the user-entered sales target was last updated, if there is one. Otherwise null."
    },
    "user_entered": {
      "type": "boolean",
      "description": "Whether or not the default projection was overridden with a user-entered value."
    }
  },
  "required": [
    "created_at",
    "updated_at",
    "user_entered"
  ]
}

Get Target for Location
GET/api/v2/rosters/sales_targets/{type}/{date}{?location_id}

Get the sales target for a given roster filtered to a location.

You must either be an Admin or General Manager, or have read access to the location you are requesting.

This method requires the roster scope (see Scopes for more information).

URI Parameters
HideShow
type
string (required) 

There are two possible values: day and week.

date
string (required) Example: 2018-02-26

A date within the roster you are looking for.

location_id
number (optional) Example: 456

The ID of a location to filter the roster to.


Schedules

Schedules represent planned shifts for a user and are contained in a Roster, for actual times worked please see Timesheets or Shifts.

No special Tanda permissions are required to view schedules, however only the schedules that would be visible through the UI are visible through the API.

To create or change schedules, the user must be a team manager, roster manager, or admin. In the case of the team manager, the shift must be for someone in the user’s managed teams.

Employees can only see published schedules. Specifying ids of unpublished schedules, or using the published_only flag will not change this.

Looking to just get the roster for an individual employee? Check out our user guide for a workflow.

Schedules

GET https://my.tanda.co/api/v2/schedules?ids=1,2,31337157&show_costs=true&include_names=false&include_colleagues=false&platform=false
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 31337157,
    "roster_id": 70074,
    "user_id": 123456,
    "start": 1456902000,
    "finish": 1456916400,
    "breaks": [
      {
        "start": 1456909200,
        "finish": 1456911000
      }
    ],
    "automatic_break_length": 30,
    "department_id": 111,
    "shift_detail_id": 36,
    "cost": 20.19,
    "last_published_at": 1457002800,
    "acceptance_status: `not_accepted`": "Hello, world!",
    "record_id": 532432
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Schedules
GET/api/v2/schedules{?ids,show_costs,include_names,include_colleagues,platform}

Get multiple schedules by id.

This method requires the roster scope (see Scopes for more information).

If you are using show_costs=true or show_award_interpretation=true, the cost scope is also required.

URI Parameters
HideShow
ids
string (required) Example: 1,2,31337157

Comma separated list of schedule ids

show_costs
boolean (optional) Example: true

Whether to show the costs for the schedule (defaults to false).

show_award_interpretation
boolean (optional) Example: true

Whether to show costs breakdown for the schedule (defaults to false).

include_names
boolean (optional) Example: false

If true, the department name and shift detail name (not just ID) will be included in the response. Defaults to false.

include_colleagues
boolean (optional) Example: false

If true, shifts for colleagues will be returned. If false, only shifts for the current user will be returned. Defaults to false.

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified schedules

published_only
boolean (optional) Example: false

Only retrieve schedules that have been published. Useful for managers to see only published schedules, where they would usually see any schedule. Defaults to false.


GET https://my.tanda.co/api/v2/schedules?user_ids=1,2,123456&from=2016-03-02&to=2016-03-02&show_costs=true&include_names=false
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 31337157,
    "roster_id": 70074,
    "user_id": 123456,
    "start": 1456902000,
    "finish": 1456916400,
    "breaks": [
      {
        "start": 1456909200,
        "finish": 1456911000
      }
    ],
    "automatic_break_length": 30,
    "department_id": 111,
    "shift_detail_id": 36,
    "cost": 20.19,
    "last_published_at": 1457002800,
    "acceptance_status: `not_accepted`": "Hello, world!",
    "record_id": 532432
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Schedules by User
GET/api/v2/schedules{?user_ids,from,to,show_costs,include_names}

Get multiple schedules by user IDs, from, and to date. From and to date are required, while user IDs are optional. If no user IDs are provided, all visible schedules (based on the current user’s permission levels) will be returned.

This method requires the roster scope (see Scopes for more information).

If you are using show_costs=true, the cost scope is also required, and you must have access to see wages for all user IDs provided.

URI Parameters
HideShow
user_ids
string (required) Example: 1,2,123456

Comma separated list of user ids. You can pass user IDs from multiple different organisations, for example if you want to get all schedules for a particular person across companies.

from
string (required) Example: 2016-03-02

From date to lookup schedules in. If provided, from and to can be at most 7 days apart.

to
string (required) Example: 2016-03-02

To date to lookup schedules in. If provided, from and to can be at most 7 days apart.

show_costs
boolean (optional) Example: true

Whether to show the costs for the schedule (defaults to false).

show_award_interpretation
boolean (optional) Example: true

Whether to show costs breakdown for the schedule (defaults to false).

include_names
boolean (optional) Example: false

If true, the department name and shift detail name (not just ID) will be included in the response. Defaults to false.

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified schedules


POST https://my.tanda.co/api/v2/schedules
RequestsCreate ScheduleCreate vacant Schedule
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "start": 1456903800,
  "finish": 1456911000,
  "department_id": 111,
  "automatic_break_length": 30
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 31337158,
  "roster_id": 70074,
  "user_id": 123456,
  "start": 1456903800,
  "finish": 1456911000,
  "breaks": [],
  "automatic_break_length": 30,
  "department_id": 111,
  "shift_detail_id": null,
  "last_published_at": null,
  "last_acknowledged_at": null
  "acceptance_status": "not_accepted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the schedule"
    },
    "roster_id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who is assigned the schedule"
    },
    "start": {
      "type": "number",
      "description": "The start of the schedule"
    },
    "finish": {
      "type": "number",
      "description": "The end of the schedule"
    },
    "breaks": {
      "type": "array",
      "description": "The breaks taken in the schedule"
    },
    "automatic_break_length": {
      "type": "number",
      "description": "Length of automatic break in minutes"
    },
    "department_id": {
      "type": "number",
      "description": "The department (team) id for the schedule"
    },
    "shift_detail_id": {
      "type": "number",
      "description": "The shift detail id for the schedule"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the schedule, if `show_costs=true` parameter is set"
    },
    "last_published_at": {
      "type": "number",
      "description": "When the schedule was last published to its given employee"
    },
    "acceptance_status: `not_accepted`": {
      "type": "string",
      "description": "The current status of the schedule"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "roster_id"
  ]
}
Headers
Content-Type: application/json
Body
{
  "start": 1456903800
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 31337158,
  "roster_id": 70074,
  "user_id": null,
  "start": 1456903800,
  "finish": null,
  "breaks": [],
  "automatic_break_length": null,
  "department_id": null,
  "shift_detail_id": null,
  "last_published_at": null,
  "last_acknowledged_at": null
  "acceptance_status": "not_accepted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the schedule"
    },
    "roster_id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who is assigned the schedule"
    },
    "start": {
      "type": "number",
      "description": "The start of the schedule"
    },
    "finish": {
      "type": "number",
      "description": "The end of the schedule"
    },
    "breaks": {
      "type": "array",
      "description": "The breaks taken in the schedule"
    },
    "automatic_break_length": {
      "type": "number",
      "description": "Length of automatic break in minutes"
    },
    "department_id": {
      "type": "number",
      "description": "The department (team) id for the schedule"
    },
    "shift_detail_id": {
      "type": "number",
      "description": "The shift detail id for the schedule"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the schedule, if `show_costs=true` parameter is set"
    },
    "last_published_at": {
      "type": "number",
      "description": "When the schedule was last published to its given employee"
    },
    "acceptance_status: `not_accepted`": {
      "type": "string",
      "description": "The current status of the schedule"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "roster_id"
  ]
}

Create Schedule
POST/api/v2/schedules

This will create a Roster for the given date, if it does not already exist.

Only one of breaks and automatic_break_length can be set to non-null values.

This method requires the roster scope (see Scopes for more information).


Schedule

GET https://my.tanda.co/api/v2/schedules/31337157?show_costs=true&include_names=false&platform=false
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 31337157,
  "roster_id": 70074,
  "user_id": 123456,
  "start": 1456902000,
  "finish": 1456916400,
  "breaks": [
    {
      "start": 1456909200,
      "finish": 1456911000
    }
  ],
  "automatic_break_length": 30,
  "department_id": 111,
  "shift_detail_id": 36,
  "cost": 20.19,
  "last_published_at": 1457002800,
  "acceptance_status: `not_accepted`": "Hello, world!",
  "record_id": 532432
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the schedule"
    },
    "roster_id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who is assigned the schedule"
    },
    "start": {
      "type": "number",
      "description": "The start of the schedule"
    },
    "finish": {
      "type": "number",
      "description": "The end of the schedule"
    },
    "breaks": {
      "type": "array",
      "description": "The breaks taken in the schedule"
    },
    "automatic_break_length": {
      "type": "number",
      "description": "Length of automatic break in minutes"
    },
    "department_id": {
      "type": "number",
      "description": "The department (team) id for the schedule"
    },
    "shift_detail_id": {
      "type": "number",
      "description": "The shift detail id for the schedule"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the schedule, if `show_costs=true` parameter is set"
    },
    "last_published_at": {
      "type": "number",
      "description": "When the schedule was last published to its given employee"
    },
    "acceptance_status: `not_accepted`": {
      "type": "string",
      "description": "The current status of the schedule"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "roster_id"
  ]
}

Get Schedule
GET/api/v2/schedules/{id}{?show_costs,include_names,platform}

Get a schedule by id.

If you are not able to see the schedule through the UI then you will not be able to see it through the API.

This method requires the roster scope (see Scopes for more information).

If you are using show_costs=true, the cost scope is also required.

URI Parameters
HideShow
id
number (required) Example: 31337157

The id of the schedule

show_costs
boolean (optional) Example: true

Whether to show the costs for the schedule (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show costs breakdown for the schedule (defaults to false).

include_names
boolean (optional) Example: false

If true, the department name and shift detail name (not just ID) will be included in the response. Defaults to false.

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


PUT https://my.tanda.co/api/v2/schedules/31337157
RequestsUpdate ScheduleMake Schedule vacantGive Schedule automatic break
Headers
Content-Type: application/json
Body
{
  "start": 1456898400,
  "breaks": [
    {
      "start": 1456903800,
      "finish": 1456905600
    },
    {
      "start": 1456909200,
      "finish": 1456911000
    }
  ],
  "automatic_break_length": null,
  "department_id": null
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 31337157,
  "roster_id": 70074,
  "user_id": 123456,
  "start": 1456898400,
  "finish": 1456916400,
  "breaks": [
    {
      "start": 1456903800,
      "finish": 1456905600
    },
    {
      "start": 1456909200,
      "finish": 1456911000
    }
  ],
  "automatic_break_length": null,
  "department_id": null,
  "shift_detail_id": null,
  "last_published_at": null,
  "last_acknowledged_at": null
  "acceptance_status": "not_accepted"
}
Headers
Content-Type: application/json
Body
{
  "user_id": nil
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 31337157,
  "roster_id": 70074,
  "user_id": null,
  "start": 1456902000,
  "finish": 1456916400,
  "breaks": [
    {
      "start": 1456909200,
      "finish": 1456911000
    }
  ],
  "department_id": 111,
  "shift_detail_id": null,
  "last_published_at": null,
  "last_acknowledged_at": null
  "acceptance_status": "not_accepted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the schedule"
    },
    "roster_id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who is assigned the schedule"
    },
    "start": {
      "type": "number",
      "description": "The start of the schedule"
    },
    "finish": {
      "type": "number",
      "description": "The end of the schedule"
    },
    "breaks": {
      "type": "array",
      "description": "The breaks taken in the schedule"
    },
    "automatic_break_length": {
      "type": "number",
      "description": "Length of automatic break in minutes"
    },
    "department_id": {
      "type": "number",
      "description": "The department (team) id for the schedule"
    },
    "shift_detail_id": {
      "type": "number",
      "description": "The shift detail id for the schedule"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the schedule, if `show_costs=true` parameter is set"
    },
    "last_published_at": {
      "type": "number",
      "description": "When the schedule was last published to its given employee"
    },
    "acceptance_status: `not_accepted`": {
      "type": "string",
      "description": "The current status of the schedule"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "roster_id"
  ]
}
Headers
Content-Type: application/json
Body
{
  "automatic_break_length": 25,
  "breaks": null
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 31337157,
  "roster_id": 70074,
  "user_id": 123456,
  "start": 1456902000,
  "finish": 1456916400,
  "breaks": [],
  "automatic_break_length": 25,
  "department_id": 111,
  "shift_detail_id": null,
  "last_published_at": null,
  "last_acknowledged_at": null
  "acceptance_status": "not_accepted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the schedule"
    },
    "roster_id": {
      "type": "number",
      "description": "The id of the roster"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who is assigned the schedule"
    },
    "start": {
      "type": "number",
      "description": "The start of the schedule"
    },
    "finish": {
      "type": "number",
      "description": "The end of the schedule"
    },
    "breaks": {
      "type": "array",
      "description": "The breaks taken in the schedule"
    },
    "automatic_break_length": {
      "type": "number",
      "description": "Length of automatic break in minutes"
    },
    "department_id": {
      "type": "number",
      "description": "The department (team) id for the schedule"
    },
    "shift_detail_id": {
      "type": "number",
      "description": "The shift detail id for the schedule"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the schedule, if `show_costs=true` parameter is set"
    },
    "last_published_at": {
      "type": "number",
      "description": "When the schedule was last published to its given employee"
    },
    "acceptance_status: `not_accepted`": {
      "type": "string",
      "description": "The current status of the schedule"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "roster_id"
  ]
}

Update Schedule
PUT/api/v2/schedules/{id}

Only one of breaks and automatic_break_length can be set to non-null values. If automatic_break_length or breaks is already set, you will not be able to change the other unless the set field is cleared (can be done in the same request by setting the currently set field to null).

This method requires the roster scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 31337157

The id of the schedule


DELETE https://my.tanda.co/api/v2/schedules/31337157
Responses200
Headers
Content-Type: application/json

Delete Schedule
DELETE/api/v2/schedules/{id}

This method requires the roster scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 31337157

The id of the schedule


Schedule Versions

GET https://my.tanda.co/api/v2/schedules/31337157/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"Schedule\"",
    "changes": [
      {
        "field": "start",
        "previous": 1456898400,
        "updated": 1456902000
      },
      {
        "field": "finish",
        "previous": 1456912800,
        "updated": 1456916400
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Schedule Versions
GET/api/v2/schedules/{id}/versions

If you are not able to see the schedule through the UI then you will not be able to see it through the API.

This method requires the roster scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 31337157

The id of the schedule

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified schedule versions


Timesheets

Timesheets are the container for actual shifts worked, a timesheet can be for a period of 1 or 2 weeks depending on how the organisation pays their staff. Each timesheet contains many Shifts. For rostered times, please see Rosters or Schedules.

Timesheets are not created directly. Instead a timesheet will be created when creating through the Shifts endpoint.

Regular employees can only see their own timesheets, roster managers and admins can see all timesheets, and department managers can only see timesheets for staff that they manage.

All methods require the timesheet scope (see Scopes for more information).

Exporting Timesheets

You can download a timesheet in an export format to be imported into a payroll system by providing the export_format URI parameter. This works with any of the timesheet endpoints.

For example, making a call to /api/v2/timesheets/7007?export_format=myob will return a MYOB-compatible export of the timesheet, and /api/v2/timesheets/on/2016-03-02?export_format=myob will return a MYOB-compatible export of all timesheets for that date range.

By default all timesheets will be returned. Provide the approved_only parameter to limit your export to approved timesheets (this is the default behaviour in the Tanda UI). For example, /api/v2/timesheets/7007?export_format=myob&approved_only=true.

The content-type of these responses will not be application/json as they are for other API calls - it will depend on the export format requested, but will generally be text/plain or text/csv.

Timesheets will have their status set to exported when accessed through this endpoint. If you don’t want this to happen, include the skip_status_update parameter - eg. /api/v2/timesheets/7007?export_format=myob&skip_status_update=true. Alternatively, use the update timesheeet endpoint to reset their status.

Current Timesheets

GET https://my.tanda.co/api/v2/timesheets/current?show_costs=true&show_award_interpretation=true
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 7007,
    "user_id": 123456,
    "start": "2016-02-29",
    "finish": "2016-03-14",
    "status": "approved",
    "shifts": [
      {
        "id": 1337,
        "timesheet_id": 7007,
        "user_id": 123456,
        "date": "2016-03-02",
        "start": 1456902118,
        "break_start": 1456908143,
        "break_finish": 1456909812,
        "break_length": 27,
        "breaks": [
          {
            "id": 42,
            "shift_id": 1337,
            "start": 1456908143,
            "finish": 1456909812,
            "length": 27,
            "paid": false
          }
        ],
        "finish": 1456916286,
        "status": "PENDING",
        "allowances": [
          {
            "id": 456789,
            "name": "Hazardous Environment Allowance",
            "value": 0.5,
            "cost": 1.75
          }
        ],
        "tag": "Head Technician",
        "tag_id": 65421,
        "sub_cost_centre": "0212",
        "cost": 20.1,
        "award_interpretation": [
          {
            "units": 6.45,
            "date": "2016-02-29",
            "export_name": "ORD 1x",
            "secondary_export_name": "LOAD",
            "ordinary_hours": true,
            "cost": 16.125,
            "from": 1456902000,
            "to": 1456916400
          }
        ],
        "department_id": 808,
        "metadata": "My special metadata",
        "leave_request_id": 333,
        "record_id": 532432,
        "approved_by": 123455,
        "approved_at": "1456988518",
        "notes": [
          {
            "body": "Goals were kicked this shift 💪",
            "author": "Mike Richards"
          }
        ]
      }
    ],
    "cost": 102.15,
    "award_interpretation": [
      {
        "units": 6.45,
        "date": "2016-02-29",
        "export_name": "ORD 1x",
        "secondary_export_name": "LOAD",
        "ordinary_hours": true,
        "cost": 16.125,
        "from": 1456902000,
        "to": 1456916400
      }
    ],
    "notes": [
      {
        "body": "Goals were kicked this shift 💪",
        "author": "Mike Richards"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Current Timesheets
GET/api/v2/timesheets/current{?show_costs,show_award_interpretation}

If you are using show_costs=true or show_award_interpretation=true, the cost scope is required.

URI Parameters
HideShow
show_costs
boolean (optional) Example: true

Whether to show the costs for the timesheet (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show award interpretation for the timesheet (defaults to false)

show_notes
boolean (optional) Example: true

Whether to show notes for the timesheet (defaults to false). Note that notes can exist at the timesheet level or the shift level, and these can be found through notes arrays on the respective objects.

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified timesheets

report_location_id
number (optional) Example: 111

The ID of a location for which to filter timesheets to. If provided, only returns timesheets if the timesheet’s user’s default team (report_department_id) is set, and it is a team within this location.

export_format
string (optional) Example: myob

The format in which timesheet data should be exported. See the Exporting Timesheets section above for more information.

skip_status_update
boolean (optional) Example: true

If true, timesheets will not have their status set to exported as part of the export. Default is false. Only used if export_format is provided.

approved_only
boolean (optional) Example: true

If true, only approved timesheets will be returned. Default is false.


Timesheets on Date

GET https://my.tanda.co/api/v2/timesheets/on/2016-03-02?show_costs=true&show_award_interpretation=true
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 7007,
    "user_id": 123456,
    "start": "2016-02-29",
    "finish": "2016-03-14",
    "status": "approved",
    "shifts": [
      {
        "id": 1337,
        "timesheet_id": 7007,
        "user_id": 123456,
        "date": "2016-03-02",
        "start": 1456902118,
        "break_start": 1456908143,
        "break_finish": 1456909812,
        "break_length": 27,
        "breaks": [
          {
            "id": 42,
            "shift_id": 1337,
            "start": 1456908143,
            "finish": 1456909812,
            "length": 27,
            "paid": false
          }
        ],
        "finish": 1456916286,
        "status": "PENDING",
        "allowances": [
          {
            "id": 456789,
            "name": "Hazardous Environment Allowance",
            "value": 0.5,
            "cost": 1.75
          }
        ],
        "tag": "Head Technician",
        "tag_id": 65421,
        "sub_cost_centre": "0212",
        "cost": 20.1,
        "award_interpretation": [
          {
            "units": 6.45,
            "date": "2016-02-29",
            "export_name": "ORD 1x",
            "secondary_export_name": "LOAD",
            "ordinary_hours": true,
            "cost": 16.125,
            "from": 1456902000,
            "to": 1456916400
          }
        ],
        "department_id": 808,
        "metadata": "My special metadata",
        "leave_request_id": 333,
        "record_id": 532432,
        "approved_by": 123455,
        "approved_at": "1456988518",
        "notes": [
          {
            "body": "Goals were kicked this shift 💪",
            "author": "Mike Richards"
          }
        ]
      }
    ],
    "cost": 102.15,
    "award_interpretation": [
      {
        "units": 6.45,
        "date": "2016-02-29",
        "export_name": "ORD 1x",
        "secondary_export_name": "LOAD",
        "ordinary_hours": true,
        "cost": 16.125,
        "from": 1456902000,
        "to": 1456916400
      }
    ],
    "notes": [
      {
        "body": "Goals were kicked this shift 💪",
        "author": "Mike Richards"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Timesheets on Date
GET/api/v2/timesheets/on/{date}{?show_costs,show_award_interpretation}

If you are using show_costs=true or show_award_interpretation=true, the cost scope is required.

URI Parameters
HideShow
date
date (required) Example: 2016-03-02

The date included in the timesheet to find

show_costs
boolean (optional) Example: true

Whether to show the costs for the timesheet (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show award interpretation for the timesheet (defaults to false)

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified timesheets

report_location_id
number (optional) Example: 111

The ID of a location for which to filter timesheets to. If provided, only returns timesheets if the timesheet’s user’s default team (report_department_id) is set, and it is a team within this location.

export_format
string (optional) Example: myob

The format in which timesheet data should be exported. See the Exporting Timesheets section above for more information.

skip_status_update
boolean (optional) Example: true

If true, timesheets will not have their status set to exported as part of the export. Default is false. Only used if export_format is provided.

approved_only
boolean (optional) Example: true

If true, only approved timesheets will be returned. Default is false.


Current Timesheet for User

GET https://my.tanda.co/api/v2/timesheets/for/123456/current?show_costs=true&show_award_interpretation=true
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 7007,
  "user_id": 123456,
  "start": "2016-02-29",
  "finish": "2016-03-14",
  "status": "approved",
  "shifts": [
    {
      "id": 1337,
      "timesheet_id": 7007,
      "user_id": 123456,
      "date": "2016-03-02",
      "start": 1456902118,
      "break_start": 1456908143,
      "break_finish": 1456909812,
      "break_length": 27,
      "breaks": [
        {
          "id": 42,
          "shift_id": 1337,
          "start": 1456908143,
          "finish": 1456909812,
          "length": 27,
          "paid": false
        }
      ],
      "finish": 1456916286,
      "status": "PENDING",
      "allowances": [
        {
          "id": 456789,
          "name": "Hazardous Environment Allowance",
          "value": 0.5,
          "cost": 1.75
        }
      ],
      "tag": "Head Technician",
      "tag_id": 65421,
      "sub_cost_centre": "0212",
      "cost": 20.1,
      "award_interpretation": [
        {
          "units": 6.45,
          "date": "2016-02-29",
          "export_name": "ORD 1x",
          "secondary_export_name": "LOAD",
          "ordinary_hours": true,
          "cost": 16.125,
          "from": 1456902000,
          "to": 1456916400
        }
      ],
      "department_id": 808,
      "metadata": "My special metadata",
      "leave_request_id": 333,
      "record_id": 532432,
      "approved_by": 123455,
      "approved_at": "1456988518",
      "notes": [
        {
          "body": "Goals were kicked this shift 💪",
          "author": "Mike Richards"
        }
      ]
    }
  ],
  "cost": 102.15,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the timesheet"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "start": {
      "type": "string",
      "description": "The start date of the timesheet"
    },
    "finish": {
      "type": "string",
      "description": "The end date of the timesheet"
    },
    "status": {
      "type": "string",
      "description": "One of `pending`, `approved`, `exported`"
    },
    "shifts": {
      "type": "array",
      "description": "The shifts on the timesheet"
    },
    "cost": {
      "type": "number",
      "description": "The total cost of the timesheet, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the timesheet"
    }
  },
  "required": [
    "id",
    "user_id",
    "start",
    "finish",
    "status",
    "shifts"
  ]
}

Get Current Timesheet for User
GET/api/v2/timesheets/for/{user_id}/current{?show_costs,show_award_interpretation}

If you are using show_costs=true or show_award_interpretation=true, the cost scope is required.

URI Parameters
HideShow
user_id
number (required) Example: 123456

The user’s id, me can also be used to reference the current user

show_costs
boolean (optional) Example: true

Whether to show the costs for the timesheet (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show award interpretation for the timesheet (defaults to false)

approved_only
boolean (optional) Example: true

If true, only approved timesheets will be returned. Default is false.


Timesheet for User on Date

GET https://my.tanda.co/api/v2/timesheets/for/123456/on/2016-03-02?show_costs=true&show_award_interpretation=true
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 7007,
  "user_id": 123456,
  "start": "2016-02-29",
  "finish": "2016-03-14",
  "status": "approved",
  "shifts": [
    {
      "id": 1337,
      "timesheet_id": 7007,
      "user_id": 123456,
      "date": "2016-03-02",
      "start": 1456902118,
      "break_start": 1456908143,
      "break_finish": 1456909812,
      "break_length": 27,
      "breaks": [
        {
          "id": 42,
          "shift_id": 1337,
          "start": 1456908143,
          "finish": 1456909812,
          "length": 27,
          "paid": false
        }
      ],
      "finish": 1456916286,
      "status": "PENDING",
      "allowances": [
        {
          "id": 456789,
          "name": "Hazardous Environment Allowance",
          "value": 0.5,
          "cost": 1.75
        }
      ],
      "tag": "Head Technician",
      "tag_id": 65421,
      "sub_cost_centre": "0212",
      "cost": 20.1,
      "award_interpretation": [
        {
          "units": 6.45,
          "date": "2016-02-29",
          "export_name": "ORD 1x",
          "secondary_export_name": "LOAD",
          "ordinary_hours": true,
          "cost": 16.125,
          "from": 1456902000,
          "to": 1456916400
        }
      ],
      "department_id": 808,
      "metadata": "My special metadata",
      "leave_request_id": 333,
      "record_id": 532432,
      "approved_by": 123455,
      "approved_at": "1456988518",
      "notes": [
        {
          "body": "Goals were kicked this shift 💪",
          "author": "Mike Richards"
        }
      ]
    }
  ],
  "cost": 102.15,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the timesheet"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "start": {
      "type": "string",
      "description": "The start date of the timesheet"
    },
    "finish": {
      "type": "string",
      "description": "The end date of the timesheet"
    },
    "status": {
      "type": "string",
      "description": "One of `pending`, `approved`, `exported`"
    },
    "shifts": {
      "type": "array",
      "description": "The shifts on the timesheet"
    },
    "cost": {
      "type": "number",
      "description": "The total cost of the timesheet, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the timesheet"
    }
  },
  "required": [
    "id",
    "user_id",
    "start",
    "finish",
    "status",
    "shifts"
  ]
}

Get Timesheet for User on Date
GET/api/v2/timesheets/for/{user_id}/on/{date}{?show_costs,show_award_interpretation}

If you are using show_costs=true or show_award_interpretation=true, the cost scope is required.

URI Parameters
HideShow
user_id
number (required) Example: 123456

The user’s id, me can also be used to reference the current user

date
date (required) Example: 2016-03-02

The date included in the timesheet to find

show_costs
boolean (optional) Example: true

Whether to show the costs for the timesheet (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show award interpretation for the timesheet (defaults to false)

approved_only
boolean (optional) Example: true

If true, only approved timesheets will be returned. Default is false.


Timesheet

GET https://my.tanda.co/api/v2/timesheets/7007?show_costs=true&show_award_interpretation=true
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 7007,
  "user_id": 123456,
  "start": "2016-02-29",
  "finish": "2016-03-14",
  "status": "approved",
  "shifts": [
    {
      "id": 1337,
      "timesheet_id": 7007,
      "user_id": 123456,
      "date": "2016-03-02",
      "start": 1456902118,
      "break_start": 1456908143,
      "break_finish": 1456909812,
      "break_length": 27,
      "breaks": [
        {
          "id": 42,
          "shift_id": 1337,
          "start": 1456908143,
          "finish": 1456909812,
          "length": 27,
          "paid": false
        }
      ],
      "finish": 1456916286,
      "status": "PENDING",
      "allowances": [
        {
          "id": 456789,
          "name": "Hazardous Environment Allowance",
          "value": 0.5,
          "cost": 1.75
        }
      ],
      "tag": "Head Technician",
      "tag_id": 65421,
      "sub_cost_centre": "0212",
      "cost": 20.1,
      "award_interpretation": [
        {
          "units": 6.45,
          "date": "2016-02-29",
          "export_name": "ORD 1x",
          "secondary_export_name": "LOAD",
          "ordinary_hours": true,
          "cost": 16.125,
          "from": 1456902000,
          "to": 1456916400
        }
      ],
      "department_id": 808,
      "metadata": "My special metadata",
      "leave_request_id": 333,
      "record_id": 532432,
      "approved_by": 123455,
      "approved_at": "1456988518",
      "notes": [
        {
          "body": "Goals were kicked this shift 💪",
          "author": "Mike Richards"
        }
      ]
    }
  ],
  "cost": 102.15,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the timesheet"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "start": {
      "type": "string",
      "description": "The start date of the timesheet"
    },
    "finish": {
      "type": "string",
      "description": "The end date of the timesheet"
    },
    "status": {
      "type": "string",
      "description": "One of `pending`, `approved`, `exported`"
    },
    "shifts": {
      "type": "array",
      "description": "The shifts on the timesheet"
    },
    "cost": {
      "type": "number",
      "description": "The total cost of the timesheet, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the timesheet"
    }
  },
  "required": [
    "id",
    "user_id",
    "start",
    "finish",
    "status",
    "shifts"
  ]
}

Get Timesheet
GET/api/v2/timesheets/{id}{?show_costs,show_award_interpretation}

If you are using show_costs=true or show_award_interpretation=true, the cost scope is required.

URI Parameters
HideShow
id
number (required) Example: 7007

The id of the timesheet

show_costs
boolean (optional) Example: true

Whether to show the costs for the timesheet (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show award interpretation for the timesheet (defaults to false)

show_notes
boolean (optional) Example: true

Whether to show notes for the timesheet (defaults to false)

approved_only
boolean (optional) Example: true

If true, only approved timesheets will be returned. Default is false.


PUT https://my.tanda.co/api/v2/timesheets/7007
RequestsUpdate Timesheet
Headers
Content-Type: application/json
Body
{
  "status": "pending"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 7007,
  "user_id": 123456,
  "start": "2016-02-29",
  "finish": "2016-03-14",
  "status": "exported",
  "shifts": [
    {
      "id": 1337,
      "timesheet_id": 7007,
      "user_id": 123456,
      "date": "2016-03-02",
      "start": 1456902118,
      "break_start": 1456908143,
      "break_finish": 1456909812,
      "break_length": 27,
      "breaks": [
        {
          "id": 42,
          "shift_id": 1337,
          "start": 1456908143,
          "finish": 1456909812,
          "length": 27,
          "paid": false
        }
      ],
      "finish": 1456916286,
      "status": "PENDING",
      "allowances": [
        {
          "id": 456789,
          "name": "Hazardous Environment Allowance",
          "value": 0.5,
          "cost": 1.75
        }
      ],
      "tag": "Head Technician",
      "tag_id": 65421,
      "sub_cost_centre": "0212",
      "cost": 20.1,
      "award_interpretation": [
        {
          "units": 6.45,
          "date": "2016-02-29",
          "export_name": "ORD 1x",
          "secondary_export_name": "LOAD",
          "ordinary_hours": true,
          "cost": 16.125,
          "from": 1456902000,
          "to": 1456916400
        }
      ],
      "department_id": 808,
      "metadata": "My special metadata",
      "leave_request_id": 333,
      "record_id": 532432,
      "approved_by": 123455,
      "approved_at": "1456988518",
      "notes": [
        {
          "body": "Goals were kicked this shift 💪",
          "author": "Mike Richards"
        }
      ]
    }
  ],
  "cost": 102.15,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the timesheet"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "start": {
      "type": "string",
      "description": "The start date of the timesheet"
    },
    "finish": {
      "type": "string",
      "description": "The end date of the timesheet"
    },
    "status": {
      "type": "string",
      "description": "One of `pending`, `approved`, `exported`"
    },
    "shifts": {
      "type": "array",
      "description": "The shifts on the timesheet"
    },
    "cost": {
      "type": "number",
      "description": "The total cost of the timesheet, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the timesheet"
    }
  },
  "required": [
    "id",
    "user_id",
    "start",
    "finish",
    "status",
    "shifts"
  ]
}

Update Timesheet
PUT/api/v2/timesheets/{id}

Use this endpoint to change a timesheet’s status. Three values are accepted: pending, approved, or exported.

If a timesheet is exported it cannot be edited and its costs are locked. If you are exporting data out of timesheets through the API to be costed externally, you should mark those timesheets as exported at that time.

URI Parameters
HideShow
id
number (required) Example: 7007

The id of the timesheet


Shifts

Shifts represent actual times worked for a user and are contained in a Timesheet. For rostered times, please see Rosters or Schedules.

A user can see all the shifts on each timesheet that they can see. Shifts can be created, updated and deleted by staff if they have the ability to see their own timesheets (a system setting). All shifts can be created, updated and deleted by roster managers and admins, and department managers can create, update and delete shifts for staff that they manage.

Shifts

GET https://my.tanda.co/api/v2/shifts?ids=1,2,1337&user_ids=1,2,123456&from=2016-03-02&to=2016-03-02&show_costs=true&show_award_interpretation=true&report_location_id=111&platform=false
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 1337,
    "timesheet_id": 7007,
    "user_id": 123456,
    "date": "2016-03-02",
    "start": 1456902118,
    "break_start": 1456908143,
    "break_finish": 1456909812,
    "break_length": 27,
    "breaks": [
      {
        "id": 42,
        "shift_id": 1337,
        "start": 1456908143,
        "finish": 1456909812,
        "length": 27,
        "paid": false
      }
    ],
    "finish": 1456916286,
    "status": "PENDING",
    "allowances": [
      {
        "id": 456789,
        "name": "Hazardous Environment Allowance",
        "value": 0.5,
        "cost": 1.75
      }
    ],
    "tag": "Head Technician",
    "tag_id": 65421,
    "sub_cost_centre": "0212",
    "cost": 20.1,
    "award_interpretation": [
      {
        "units": 6.45,
        "date": "2016-02-29",
        "export_name": "ORD 1x",
        "secondary_export_name": "LOAD",
        "ordinary_hours": true,
        "cost": 16.125,
        "from": 1456902000,
        "to": 1456916400
      }
    ],
    "department_id": 808,
    "metadata": "My special metadata",
    "leave_request_id": 333,
    "record_id": 532432,
    "approved_by": 123455,
    "approved_at": "1456988518",
    "notes": [
      {
        "body": "Goals were kicked this shift 💪",
        "author": "Mike Richards"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Shifts
GET/api/v2/shifts{?ids,user_ids,from,to,show_costs,show_award_interpretation,report_location_id,platform}

Get multiple shifts by IDs, user IDs, or from/to dates. You need to provide at least one of these parameters (ids, user_ids, or from + to). If you provide more than one, or any of the other parameters below, only shifts that meet all criteria will be returned.

This method requires the timesheet scope (see Scopes for more information).

If you are using show_costs=true or show_award_interpretation=true, the cost scope is also required.

URI Parameters
HideShow
ids
string (optional) Example: 1,2,1337

Comma separated list of shift IDs

user_ids
string (optional) Example: 1,2,123456

Comma separated list of user IDs

from
string (optional) Example: 2016-03-02

From date to lookup shifts in

to
string (optional) Example: 2016-03-02

To date to lookup shifts in

show_costs
boolean (optional) Example: true

Whether to show the costs for the shift (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show award interpretation for the shifts (defaults to false)

show_notes
boolean (optional) Example: true

Whether to show notes for the shifts (defaults to false)

report_location_id
number (optional) Example: 111

The ID of a location for which to filter shifts to. If provided, only returns shifts if the shifts’s user’s default team (report_department_id) is set, and it is a team within this location. Note that it is possible for a shift’s user’s default location to be different to the location at which a shift was worked. This parameter always filters based on the user. For example if a user can work at locations A and B, they default to A, but work at B, a call with report_location_id=A will return that user’s shifts worked at location B.

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified shifts


POST https://my.tanda.co/api/v2/shifts
RequestsCreate ShiftCreate Shift with breaksCreate approved ShiftCreate Shift with Allowances
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "date": "2016-03-12",
  "start": 1457741040,
  "finish": 1457762640,
  "department_id": 808,
  "metadata": "My special metadata"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 9665,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-12",
  "start": 1457741040,
  "break_start": null,
  "break_finish": null,
  "break_length": null,
  "finish": 1457762640,
  "status": "PENDING",
  "allowances": [],
  "tag": null,
  "tag_id": null,
  "sub_cost_centre": null,
  "department_id": 808,
  "department_export_name": "abc123",
  "metadata": "My special metadata",
  "leave_request_id": null
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_finish - break_start) / 60`, see Shifts section)"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift  (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "date": "2016-03-12",
  "start": 1457741040,
  "finish": 1457762640,
  "break_start": 1457751660,
  "break_finish": 1457753280,
  "metadata": "My special metadata"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 9665,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-12",
  "start": 1457741040,
  "break_start": 1457751660,
  "break_finish": 1457753280,
  "break_length": 27,
  "finish": 1457762640,
  "status": "PENDING",
  "allowances": [],
  "tag": "Head Technician",
  "tag_id": 65421,
  "sub_cost_centre": "0212",
  "department_id": 808,
  "record_id": 532432,
  "metadata": "My special metadata"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_finish - break_start) / 60`, see Shifts section)"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift  (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    },
    "metadata": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "date": "2016-03-12",
  "start": 1457741040,
  "finish": 1457762640,
  "status": "APPROVED",
  "tag": null,
  "sub_cost_centre": null
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 9665,
  "timesheet_id": 7007,
  "user_id": 123456,
  "start": 1457741040,
  "break_start": null,
  "break_finish": null,
  "break_length": null,
  "finish": 1457762640,
  "status": "APPROVED",
  "allowances": [],
  "tag": null,
  "tag_id": null,
  "sub_cost_centre": null,
  "metadata": null,
  "leave_request_id": null
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_finish - break_start) / 60`, see Shifts section)"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift  (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "date": "2016-03-12",
  "start": 1457741040,
  "finish": 1457762640,
  "allowances": [
    {
      "id": 987654,
      "value": 1
    }
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 9665,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-12",
  "start": 1457741040,
  "break_start": null,
  "break_finish": null,
  "break_length": null,
  "finish": 1457762640,
  "status": "PENDING",
  "allowances": [
    {
      "id": 987654,
      "value": 1
    }
  ],
  "tag": null,
  "tag_id": null,
  "sub_cost_centre": null,
  "metadata": null,
  "leave_request_id": null
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_finish - break_start) / 60`, see Shifts section)"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift  (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}

Create Shift
POST/api/v2/shifts

Create a shift for a user, with specified times, on a specified date.

This will create a timesheet for the user for the given pay period, if one doesn’t exist already. The shift object that is returned will have both an id (to use for Shift lookups) and a timesheet_id (for Timesheet lookups).

When a shift is created, the times provided for the start, finish, break_start, and break_finish keys will be rounded to the nearest minute. To avoid potentially confusing, you can round them before passing them to the API.

This method requires the timesheet scope (see Scopes for more information).


Shift

GET https://my.tanda.co/api/v2/shifts/1337?show_costs=true&show_award_interpretation=true&platform=false
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1337,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-02",
  "start": 1456902118,
  "break_start": 1456908143,
  "break_finish": 1456909812,
  "break_length": 27,
  "breaks": [
    {
      "id": 42,
      "shift_id": 1337,
      "start": 1456908143,
      "finish": 1456909812,
      "length": 27,
      "paid": false
    }
  ],
  "finish": 1456916286,
  "status": "PENDING",
  "allowances": [
    {
      "id": 456789,
      "name": "Hazardous Environment Allowance",
      "value": 0.5,
      "cost": 1.75
    }
  ],
  "tag": "Head Technician",
  "tag_id": 65421,
  "sub_cost_centre": "0212",
  "cost": 20.1,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "department_id": 808,
  "metadata": "My special metadata",
  "leave_request_id": 333,
  "record_id": 532432,
  "approved_by": 123455,
  "approved_at": "1456988518",
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "breaks": {
      "type": "array",
      "description": "The shift's breaks"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the shift, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "metadata": {
      "type": "string",
      "description": "Custom string field that holds up to 500 characters"
    },
    "leave_request_id": {
      "type": "number",
      "description": "The ID for the leave request, if leave was taken, otherwise null."
    },
    "record_id": {
      "type": "number",
      "description": "The record ID, for use with Platform endpoints"
    },
    "approved_by": {
      "type": "number",
      "description": "The ID of the user that approved the shift"
    },
    "approved_at": {
      "type": "string",
      "description": "The time the shift was approved"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the shift"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}

Get Shift
GET/api/v2/shifts/{id}{?show_costs,show_award_interpretation,platform}

Get a shift by id.

This method requires the timesheet scope (see Scopes for more information).

If you are using show_costs=true or show_award_interpretation=true, the cost scope is also required.

URI Parameters
HideShow
id
number (required) Example: 1337

The id of the shift

show_costs
boolean (optional) Example: true

Whether to show the costs for the shift (defaults to false)

show_award_interpretation
boolean (optional) Example: true

Whether to show award interpretation for the shift (defaults to false)

show_notes
boolean (optional) Example: true

Whether to show notes for the shift (defaults to false)

show_export_name
boolean (optional) Example: true

Whether to show the department’s export code that the employee worked on the shift (defaults to false)

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


PUT https://my.tanda.co/api/v2/shifts/1337
RequestsApprove ShiftUpdate Shift timesUpdate Shift times on new dateUpdate Shift allowances
Headers
Content-Type: application/json
Body
{
  "status": "APPROVED"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1337,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-02",
  "start": 1456902118,
  "break_start": 1456908143,
  "break_finish": 1456909812,
  "break_length": 27,
  "breaks": [
    {
      "id": 42,
      "shift_id": 1337,
      "start": 1456908143,
      "finish": 1456909812,
      "length": 27,
      "paid": false
    }
  ],
  "finish": 1456916286,
  "status": "APPROVED",
  "allowances": [
    {
      "id": 456789,
      "name": "Hazardous Environment Allowance",
      "value": 0.5,
      "cost": 1.75
    }
  ],
  "tag": "Head Technician",
  "tag_id": 65421,
  "sub_cost_centre": "0212",
  "cost": 20.1,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "department_id": 808,
  "metadata": "My special metadata",
  "leave_request_id": 333,
  "record_id": 532432,
  "approved_by": 123455,
  "approved_at": "1456988518",
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "breaks": {
      "type": "array",
      "description": "The shift's breaks"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the shift, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "metadata": {
      "type": "string",
      "description": "Custom string field that holds up to 500 characters"
    },
    "leave_request_id": {
      "type": "number",
      "description": "The ID for the leave request, if leave was taken, otherwise null."
    },
    "record_id": {
      "type": "number",
      "description": "The record ID, for use with Platform endpoints"
    },
    "approved_by": {
      "type": "number",
      "description": "The ID of the user that approved the shift"
    },
    "approved_at": {
      "type": "string",
      "description": "The time the shift was approved"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the shift"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}
Headers
Content-Type: application/json
Body
{
  "start": 1456901518,
  "finish": 1456916886
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1337,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-02",
  "start": 1456901518,
  "break_start": 1456908143,
  "break_finish": 1456909812,
  "break_length": 27,
  "breaks": [
    {
      "id": 42,
      "shift_id": 1337,
      "start": 1456908143,
      "finish": 1456909812,
      "length": 27,
      "paid": false
    }
  ],
  "finish": 1456916886,
  "status": "PENDING",
  "allowances": [
    {
      "id": 456789,
      "name": "Hazardous Environment Allowance",
      "value": 0.5,
      "cost": 1.75
    }
  ],
  "tag": "Head Technician",
  "tag_id": 65421,
  "sub_cost_centre": "0212",
  "cost": 20.1,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "department_id": 808,
  "metadata": "My special metadata",
  "leave_request_id": 333,
  "record_id": 532432,
  "approved_by": 123455,
  "approved_at": "1456988518",
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "breaks": {
      "type": "array",
      "description": "The shift's breaks"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the shift, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "metadata": {
      "type": "string",
      "description": "Custom string field that holds up to 500 characters"
    },
    "leave_request_id": {
      "type": "number",
      "description": "The ID for the leave request, if leave was taken, otherwise null."
    },
    "record_id": {
      "type": "number",
      "description": "The record ID, for use with Platform endpoints"
    },
    "approved_by": {
      "type": "number",
      "description": "The ID of the user that approved the shift"
    },
    "approved_at": {
      "type": "string",
      "description": "The time the shift was approved"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the shift"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}
Headers
Content-Type: application/json
Body
{
  "date": "2016-03-03",
  "start": 1456987918,
  "finish": 1457003286,
  "break_start": 1456994543,
  "break_finish": 1456996212
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1337,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-03",
  "start": 1456987918,
  "break_start": 1456994543,
  "break_finish": 1456996212,
  "break_length": 27,
  "breaks": [
    {
      "id": 42,
      "shift_id": 1337,
      "start": 1456908143,
      "finish": 1456909812,
      "length": 27,
      "paid": false
    }
  ],
  "finish": 1457003286,
  "status": "PENDING",
  "allowances": [
    {
      "id": 456789,
      "name": "Hazardous Environment Allowance",
      "value": 0.5,
      "cost": 1.75
    }
  ],
  "tag": "Head Technician",
  "tag_id": 65421,
  "sub_cost_centre": "0212",
  "cost": 20.1,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "department_id": 808,
  "metadata": "My special metadata",
  "leave_request_id": 333,
  "record_id": 532432,
  "approved_by": 123455,
  "approved_at": "1456988518",
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "breaks": {
      "type": "array",
      "description": "The shift's breaks"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the shift, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "metadata": {
      "type": "string",
      "description": "Custom string field that holds up to 500 characters"
    },
    "leave_request_id": {
      "type": "number",
      "description": "The ID for the leave request, if leave was taken, otherwise null."
    },
    "record_id": {
      "type": "number",
      "description": "The record ID, for use with Platform endpoints"
    },
    "approved_by": {
      "type": "number",
      "description": "The ID of the user that approved the shift"
    },
    "approved_at": {
      "type": "string",
      "description": "The time the shift was approved"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the shift"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}
Headers
Content-Type: application/json
Body
{
  "allowances": [
    {
      "id": 987654,
      "value": 1
    }
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1337,
  "timesheet_id": 7007,
  "user_id": 123456,
  "date": "2016-03-02",
  "start": 1456902118,
  "break_start": 1456908143,
  "break_finish": 1456909812,
  "break_length": 27,
  "breaks": [
    {
      "id": 42,
      "shift_id": 1337,
      "start": 1456908143,
      "finish": 1456909812,
      "length": 27,
      "paid": false
    }
  ],
  "finish": 1456916286,
  "status": "PENDING",
  "allowances": [
    {
      "id": 987654,
      "value": 1
    },
    {
      "id": 456789,
      "value": 0.5,
      "cost": 1.75
    }
  ],
  "tag": "Head Technician",
  "tag_id": 65421,
  "sub_cost_centre": "0212",
  "cost": 20.1,
  "award_interpretation": [
    {
      "units": 6.45,
      "date": "2016-02-29",
      "export_name": "ORD 1x",
      "secondary_export_name": "LOAD",
      "ordinary_hours": true,
      "cost": 16.125,
      "from": 1456902000,
      "to": 1456916400
    }
  ],
  "department_id": 808,
  "metadata": "My special metadata",
  "leave_request_id": 333,
  "record_id": 532432,
  "approved_by": 123455,
  "approved_at": "1456988518",
  "notes": [
    {
      "body": "Goals were kicked this shift 💪",
      "author": "Mike Richards"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift"
    },
    "timesheet_id": {
      "type": "number",
      "description": "The id of the timesheet that the shift belongs on"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who worked the shift"
    },
    "date": {
      "type": "string",
      "description": "The date the shift was worked"
    },
    "start": {
      "type": "number",
      "description": "The start of the shift"
    },
    "break_start": {
      "type": "number",
      "description": "The start of the break"
    },
    "break_finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "break_length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "breaks": {
      "type": "array",
      "description": "The shift's breaks"
    },
    "finish": {
      "type": "number",
      "description": "The end of the shift"
    },
    "status": {
      "type": "string",
      "description": "One of `PENDING`, `APPROVED`"
    },
    "allowances": {
      "type": "array",
      "description": "The allowances that apply to the shift"
    },
    "tag": {
      "type": "string",
      "description": "The name of the tag on the shift (can use `tag_id` instead)"
    },
    "tag_id": {
      "type": "number",
      "description": "The id of the tag on the shift (can use `tag` instead)"
    },
    "sub_cost_centre": {
      "type": "string",
      "description": "The sub cost centre of the shift"
    },
    "cost": {
      "type": "number",
      "description": "The cost of the shift, if `show_costs=true` parameter is set"
    },
    "award_interpretation": {
      "type": "array",
      "description": "Award interpretation output, if `show_award_interpretation=true` parameter is set"
    },
    "department_id": {
      "type": "number",
      "description": "The ID for the team this shift was worked in"
    },
    "metadata": {
      "type": "string",
      "description": "Custom string field that holds up to 500 characters"
    },
    "leave_request_id": {
      "type": "number",
      "description": "The ID for the leave request, if leave was taken, otherwise null."
    },
    "record_id": {
      "type": "number",
      "description": "The record ID, for use with Platform endpoints"
    },
    "approved_by": {
      "type": "number",
      "description": "The ID of the user that approved the shift"
    },
    "approved_at": {
      "type": "string",
      "description": "The time the shift was approved"
    },
    "notes": {
      "type": "array",
      "description": "Notes on the shift"
    }
  },
  "required": [
    "id",
    "timesheet_id",
    "user_id",
    "date",
    "status",
    "allowances"
  ]
}

Update Shift
PUT/api/v2/shifts/{id}

When a shift is updated, the times provided for the start and finish keys will be rounded to the nearest minute. To avoid potentially confusing, you can round them before passing them to the API.

After the parent timesheet to which a shift is attached has been exported, you can no longer update the shift.

This method requires the timesheet scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 1337

The id of the shift


DELETE https://my.tanda.co/api/v2/shifts/1337
Responses200
Headers
Content-Type: application/json

Delete Shift
DELETE/api/v2/shifts/{id}

This method requires the timesheet scope (see Scopes for more information).

Shifts can’t be deleted if their timesheet has already been exported.

URI Parameters
HideShow
id
number (required) Example: 1337

The id of the shift


Active Status

GET https://my.tanda.co/api/v2/shifts/active
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "user_id": 123456,
    "shift_id": 1337,
    "status": "clocked_in"
  },
  {
    "user_id": 123457,
    "shift_id": 1338,
    "status": "on_break"
  }
]

Get Active Shifts
GET/api/v2/shifts/active

Gets a list of shifts that are taking place now. For each shift, returns the user ID, the shift ID, and the shift’s current status, which could be either clocked_in or on_break. Shifts are returned if they have a start time and no finish time.

This method requires the timesheet scopes (see Scopes for more information).


Shift's Applicable Allowances

GET https://my.tanda.co/api/v2/shifts/1337/applicable_allowances
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 456789,
    "name": "Hazardous Environment Allowance",
    "export_name": "HE Allowance",
    "current_value": 0.5
  },
  {
    "id": 987654,
    "name": "Meal Allowance"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Shift's Applicable Allowances
GET/api/v2/shifts/{id}/applicable_allowances

Our user guide has more information on working with allowances through the API.

Get list of manually applied allowances that can apply to a shift, along with the current amount currently applied to the given shift.

The allowance IDs returned will be the same for all shifts within the organisation, but the values may differ from shift to shift.

Allowances that are configured to apply automatically will not be returned by this endpoint. They will update automatically every time a shift is saved.

This method requires the timesheet scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 1337

The id of the shift


Shift Versions

GET https://my.tanda.co/api/v2/shifts/1337/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"Shift\"",
    "changes": [
      {
        "field": "finish",
        "previous": 1456916286,
        "updated": 1456916300
      },
      {
        "field": "status",
        "previous": "PENDING",
        "updated": "APPROVED"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Shift Versions
GET/api/v2/shifts/{id}/versions

This method requires the timesheet scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 1337

The id of the shift

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified shift versions


Shift Breaks

Shift breaks represent a break in a Shift. A shift can have many breaks.

Shift breaks inherit access permissions from their parent shift.

All shift break actions require the timesheet scope (see Scopes for more information).

GET https://my.tanda.co/api/v2/shifts/1337/breaks
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 42,
    "shift_id": 1337,
    "start": 1456908143,
    "finish": 1456909812,
    "length": 27,
    "paid": false
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Shift's Breaks
GET/api/v2/shifts/{shift_id}/breaks

URI Parameters
HideShow
shift_id
number (required) Example: 1337

The id of the shift


POST https://my.tanda.co/api/v2/shifts/1337/breaks
RequestsCreate with timesCreate with lengthCreate with paid
Headers
Content-Type: application/json
Body
{
  "start": 1456908143,
  "finish": 1456909812,
}
Responses201
Headers
Content-Type: application/json
Body
{
  "id": 42,
  "shift_id": 1337,
  "start": 1456908143,
  "finish": 1456909812,
  "length": 27,
  "paid": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the break"
    },
    "shift_id": {
      "type": "number",
      "description": "The id of the break's shift"
    },
    "start": {
      "type": "number",
      "description": "The start of the break"
    },
    "finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "paid": {
      "type": "boolean",
      "description": "Whether the break is a paid break"
    }
  },
  "required": [
    "id",
    "shift_id"
  ]
}
Headers
Content-Type: application/json
Body
{
  "length": 45,
}
Responses201
Headers
Content-Type: application/json
Body
{
  "id": 42,
  "shift_id": 1337,
  "start": null,
  "finish": null,
  "length": 45,
  "paid": false,
}
Headers
Content-Type: application/json
Body
{
  "paid": true,
}
Responses201
Headers
Content-Type: application/json
Body
{
  "id": 42,
  "shift_id": 1337,
  "start": null,
  "finish": null,
  "length": 45,
  "paid": true,
}

Create Shift Break
POST/api/v2/shifts/{shift_id}/breaks

URI Parameters
HideShow
shift_id
number (required) Example: 1337

The id of the shift


Shift Break

Shift breaks represent a break in a Shift. A shift can have many breaks.

Shift breaks inherit access permissions from their parent shift.

All shift break actions require the timesheet scope (see Scopes for more information).

GET https://my.tanda.co/api/v2/shifts/1337/breaks/42
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 42,
  "shift_id": 1337,
  "start": 1456908143,
  "finish": 1456909812,
  "length": 27,
  "paid": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the break"
    },
    "shift_id": {
      "type": "number",
      "description": "The id of the break's shift"
    },
    "start": {
      "type": "number",
      "description": "The start of the break"
    },
    "finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "paid": {
      "type": "boolean",
      "description": "Whether the break is a paid break"
    }
  },
  "required": [
    "id",
    "shift_id"
  ]
}

Get Shift Break
GET/api/v2/shifts/{shift_id}/breaks/{break_id}

URI Parameters
HideShow
shift_id
number (required) Example: 1337

The id of the shift

break_id
number (required) Example: 42

The id of the break


PUT https://my.tanda.co/api/v2/shifts/1337/breaks/42
Requestsupdate shift break
Headers
Content-Type: application/json
Body
{
  "start": 1456908143
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 42,
  "shift_id": 1337,
  "start": 1456908143,
  "finish": 1456909812,
  "length": 27,
  "paid": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the break"
    },
    "shift_id": {
      "type": "number",
      "description": "The id of the break's shift"
    },
    "start": {
      "type": "number",
      "description": "The start of the break"
    },
    "finish": {
      "type": "number",
      "description": "The end of the break"
    },
    "length": {
      "type": "number",
      "description": "The length of the break in minutes (NOTE: this can be different to `(break_start - break_finish) / 60`, see Shifts section)"
    },
    "paid": {
      "type": "boolean",
      "description": "Whether the break is a paid break"
    }
  },
  "required": [
    "id",
    "shift_id"
  ]
}

Update Shift Break
PUT/api/v2/shifts/{shift_id}/breaks/{break_id}

When a break is updated, the times provided for the start and finish keys will be rounded to the nearest minute. To avoid potentially confusing, you can round them before passing them to the API.

URI Parameters
HideShow
shift_id
number (required) Example: 1337

The id of the shift

break_id
number (required) Example: 42

The id of the break


Shift Break Versions

GET https://my.tanda.co/api/v2/shifts/breaks/42/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"ShiftBreak\"",
    "changes": [
      {
        "field": "break_finish",
        "previous": 1456916286,
        "updated": 1456916300
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Shift Break Versions
GET/api/v2/shifts/breaks/{break_id}/versions

This method requires the timesheet scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 1337

The id of the shift

break_id
number (required) Example: 42

The id of the break

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified shift break versions


Shift Limits

GET https://my.tanda.co/api/v2/shifts/limits?user_ids=123456,987654
Responses200
Body
[
  {
    "id": 1337,
    "timesheet_id": 7007,
    "user_id": 123456,
    "date": "2016-03-02",
    "start": 1456902118,
    "break_start": 1456908143,
    "break_finish": 1456909812,
    "break_length": 27,
    "breaks": [
      {
        "id": 42,
        "shift_id": 1337,
        "start": 1456908143,
        "finish": 1456909812,
        "length": 27
      }
    ],
    "finish": 1456916286,
    "status": "PENDING",
    "allowances": [
      {
        "id": 456789,
        "name": "Hazardous Environment Allowance",
        "value": 0.5,
        "cost": 1.75
      }
    ],
    "tag": "Head Technician",
    "tag_id": 65421,
    "sub_cost_centre": "0212",
    "cost": 20.1,
    "award_interpretation": [
      {
        "units": 6.45,
        "date": "2016-02-29",
        "export_name": "ORD 1x",
        "secondary_export_name": "PEN10",
        "ordinary_hours": true,
        "cost": 16.125,
        "from": 1456902000,
        "to": 1456916400
      }
    ],
    "department_id": 808,
    "department_export_name": "abc123",
    "metadata": "My special metadata",
    "leave_request_id": 333
  },
  {
    "id": 9956,
    "timesheet_id": 14090,
    "user_id": 123456,
    "date": "2019-01-17",
    "start": 1547685971,
    "break_start": 1547695971,
    "break_finish": 1547697971,
    "break_length": 27,
    "breaks": [
      {
        "id": 42,
        "shift_id": 1337,
        "start": 1547695971,
        "finish": 1547697971,
        "length": 27
      }
    ],
    "finish": 1547697971,
    "status": "PENDING",
    "allowances": [
      {
        "id": 456789,
        "name": "Hazardous Environment Allowance",
        "value": 0.5,
        "cost": 1.75
      }
    ],
    "tag": "Head Technician",
    "tag_id": 65421,
    "sub_cost_centre": "0212",
    "cost": 20.1,
    "award_interpretation": [
      {
        "units": 6.45,
        "date": "2019-01-17",
        "export_name": "ORD 1x",
        "ordinary_hours": true,
        "cost": 16.125,
        "from": 1456902000,
        "to": 1456916400
      }
    ],
    "department_id": 808,
    "department_export_name": "abc123"
    "metadata": "My special metadata",
    "leave_request_id": 7889,
  }
]

Get Shift Limits
GET/api/v2/shifts/limits?user_ids=123456,987654

This method requires the timesheet scope (see Scopes for more information).

Gets the first and last shifts (based on start date/time) out of all shifts owned by the given users.

URI Parameters
HideShow
user_ids
string (required) Example: 123456,987654

Comma separated list of user IDs


Staff (Users)

There are no special system permissions to see information about the current user /users/me. However, to CRUD users in the organisation, the user will need to be a payroll officer, department manager, roster manager, or admin.

User List

GET https://my.tanda.co/api/v2/users?show_wages=true
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 123456,
    "name": "Lenny Leonard",
    "date_of_birth": "1955-05-12",
    "employment_start_date": "1989-12-17",
    "employee_id": "LL1",
    "passcode": "0456",
    "platform_role_ids": [
      18,
      19,
      22
    ],
    "department_ids": [
      111
    ],
    "preferred_hours": 20,
    "award": {
      "name": "Fast Food Industry",
      "identifier": "MA000003",
      "note": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
    },
    "award_template_id": 990,
    "award_tag_ids": [
      3816
    ],
    "report_department_id": 111,
    "managed_department_ids": [
      222
    ],
    "active": true,
    "email": "lenny.leonard@springfieldpowerplant.com",
    "photo": "http://vignette1.wikia.nocookie.net/family-guyamerican-dadthe-simpsons-and-futurama/images/f/ff/250px-Lenny_Leonard.png",
    "phone": "0404 123 123",
    "normalised_phone": "+61404123123",
    "salary": 1234.12,
    "hourly_rate": 32.47,
    "time_zone": "Australia/Brisbane",
    "utc_offset": 36000,
    "part_time_fixed_hours": 20,
    "expected_hours_in_pay_period": 38,
    "days_overtime_averaged_over": 7,
    "overtime_calculated_over_period_start": "2016-09-12",
    "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": "Hello, world!",
    "super_fund": {
      "id": 1234,
      "fund_name": "FUND NAME",
      "product_name": "FUND PRODUCT",
      "smsf": false,
      "abn": 123456789
    },
    "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": "Hello, world!",
    "qualifications": [
      {
        "id": 12345,
        "qualification_id": 1234,
        "enabled": true,
        "license_number": "ABC123",
        "expires": "2012-10-20",
        "in_training": false
      }
    ],
    "created_at": 1430715548,
    "record_id": 532432,
    "next_pay_group_id": 53242,
    "last_synced_mobile_app": 1430715548
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Users
GET/api/v2/users{?show_wages}

Gets information about all visible users.

This method requires the user scope (see Scopes for more information).

If you are using show_wages=true, the cost scope is also required.

If you want to see financial data, you’ll need the financial scope.

URI Parameters
HideShow
show_wages
boolean (optional) Example: true

Whether to show the user’s wage (defaults to false)

show_inactive
boolean (optional) Example: false

Include inactive staff in your response

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified users

report_location_id
number (optional) Example: 111

The ID of a location for which to filter users to. If provided, only returns users if the user’s default team (report_department_id) is set, and it is a team within this location.

employee_id
string (optional) Example: "CC123"

Employee ID to filter by.

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


POST https://my.tanda.co/api/v2/users
RequestsCreate UserMinimum fields required
Headers
Content-Type: application/json
Body
{
  "name": "Carlton Carlson Jr.",
  "employee_id": "CC123",
  "passcode": "6789",
  "phone": "+61408123654",
  "date_of_birth": "1956-09-25",
  "employment_start_date": "1986-09-24",
  "email": "carl.carlson@springfieldpowerplant.com",
  "report_department_id": 111,
  "preferred_hours": 22,
  "award_template_id": 990,
  "award_tag_ids": [
    3816
  ],
  "department_ids": [
    111
  ],
  "managed_department_ids": [
    111
  ],
  "platform_role_ids": [
    3816,
    3817
  ],
  "yearly_salary": 40000,
  "enable_login": true
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 12345678,
  "name": "Carlton Carlson Jr.",
  "date_of_birth": "1956-09-25",
  "employment_start_date": "1986-09-24",
  "employment_end_date": null,
  "employee_id": "CC123",
  "passcode": "6789",
  "platform_role_ids": [
    3816,
    3817
  ],
  "department_ids": [
    111
  ],
  "preferred_hours": 22,
  "award_template_id": 990,
  "award_tag_ids": [
    3816
  ],
  "report_department_id": 111,
  "managed_department_ids": [
    111
  ],
  "active": true,
  "enable_login": true,
  "email": "carl.carlson@springfieldpowerplant.com",
  "photo": null,
  "phone": "+61408123654",
  "normalised_phone": "+61408123654",
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "created_at": 1459476813,
  "part_time_fixed_hours": 0,
  "expected_hours_in_pay_period": null,
  "days_overtime_averaged_over": 7,
  "overtime_calculated_over_period_start": "2016-11-14",
  "employment_basis": null,
  "super_fund_membership": null,
  "super_fund": null,
  "bank_details": null,
  "tax_declaration": null,
  "onboarding_status": "not_applicable",
  "qualifications": [],
  "updated_at": 1562272900
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the user"
    },
    "name": {
      "type": "string",
      "description": "The user's name"
    },
    "date_of_birth": {
      "type": "string",
      "description": "The user's date of birth"
    },
    "employment_start_date": {
      "type": "string",
      "description": "The user's employment start date"
    },
    "employee_id": {
      "type": "string",
      "description": "The user's employee id, used for external systems"
    },
    "passcode": {
      "type": "string",
      "description": "The user's system passcode (used for clocking in and out)"
    },
    "platform_role_ids": {
      "type": "array",
      "description": "IDs of the user's roles (see Access & Roles)"
    },
    "department_ids": {
      "type": "array",
      "description": "The department (team) ids that the user is a member of"
    },
    "preferred_hours": {
      "type": "number",
      "description": "The preferred number of hours to be rostered each week"
    },
    "award": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the award"
        },
        "identifier": {
          "type": "string",
          "description": "The award's identifier (will be the award code for all modern awards)"
        },
        "note": {
          "type": "string",
          "description": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
        }
      },
      "required": [
        "name"
      ],
      "description": "Information about the user's award, null if user isn't on award"
    },
    "award_template_id": {
      "type": "number",
      "description": "The ID of the award template thte user is on"
    },
    "award_tag_ids": {
      "type": "array",
      "description": "The award tag ids that apply to the user"
    },
    "report_department_id": {
      "type": "number",
      "description": "The user's default team"
    },
    "managed_department_ids": {
      "type": "array",
      "description": "The department ids that this user manages"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the user is active in the system"
    },
    "email": {
      "type": "string",
      "description": "The user's email"
    },
    "photo": {
      "type": "string",
      "description": "An avatar for the user"
    },
    "phone": {
      "type": "string",
      "description": "Phone number for the user"
    },
    "normalised_phone": {
      "type": "string",
      "description": "Phone number for user with international dialing code"
    },
    "time_zone": {
      "type": "string",
      "description": "The user's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The user's time zone's UTC offset"
    },
    "oauth_provider": {
      "type": "string",
      "description": "If oAuth login enabled, login provider"
    },
    "oauth_uid": {
      "type": "string",
      "description": "If oAuth login enabled, login UID"
    },
    "part_time_fixed_hours": {
      "type": "number",
      "description": "readonly: for part time staff, can be used to configure when overtime starts to apply"
    },
    "expected_hours_in_pay_period": {
      "type": "number",
      "description": "readonly: for salaried staff, defines expected number of hours worked per pay period"
    },
    "days_overtime_averaged_over": {
      "type": "number",
      "description": "readonly: date range (weekly, fortnightly, or 4-weekly) over which overtime calculations should run"
    },
    "overtime_calculated_over_period_start": {
      "type": "string",
      "description": "readonly: date from which overtime averaging periods should commence"
    },
    "created_at": {
      "type": "number",
      "description": "When the user's Tanda profile was created"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "name",
    "passcode",
    "platform_role_ids",
    "department_ids",
    "preferred_hours",
    "award_tag_ids",
    "active",
    "utc_offset",
    "created_at"
  ]
}
Headers
Content-Type: application/json
Body
{
  "name": "Carlton Carlson Jr."
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 12345678,
  "name": "Carlton Carlson Jr.",
  "date_of_birth": null,
  "employment_start_date": null,
  "employment_end_date": null,
  "employee_id": null,
  "passcode": null,
  "platform_role_ids": [
    3816
  ],
  "department_ids": [],
  "preferred_hours": 22,
  "award_template_id": null,
  "award_tag_ids": [],
  "report_department_id": null,
  "managed_department_ids": [],
  "active": true,
  "enable_login": true,
  "email": null,
  "photo": null,
  "phone": null,
  "normalised_phone": null,
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "created_at": 1459476813,
  "part_time_fixed_hours": 0,
  "expected_hours_in_pay_period": null,
  "days_overtime_averaged_over": 7,
  "overtime_calculated_over_period_start": "2016-11-14",
  "employment_basis": null,
  "super_fund_membership": null,
  "super_fund": null,
  "bank_details": null,
  "tax_declaration": null,
  "onboarding_status": "not_applicable",
  "qualifications": [],
  "updated_at": 1562272900
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the user"
    },
    "name": {
      "type": "string",
      "description": "The user's name"
    },
    "date_of_birth": {
      "type": "string",
      "description": "The user's date of birth"
    },
    "employment_start_date": {
      "type": "string",
      "description": "The user's employment start date"
    },
    "employee_id": {
      "type": "string",
      "description": "The user's employee id, used for external systems"
    },
    "passcode": {
      "type": "string",
      "description": "The user's system passcode (used for clocking in and out)"
    },
    "platform_role_ids": {
      "type": "array",
      "description": "IDs of the user's roles (see Access & Roles)"
    },
    "department_ids": {
      "type": "array",
      "description": "The department (team) ids that the user is a member of"
    },
    "preferred_hours": {
      "type": "number",
      "description": "The preferred number of hours to be rostered each week"
    },
    "award": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the award"
        },
        "identifier": {
          "type": "string",
          "description": "The award's identifier (will be the award code for all modern awards)"
        },
        "note": {
          "type": "string",
          "description": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
        }
      },
      "required": [
        "name"
      ],
      "description": "Information about the user's award, null if user isn't on award"
    },
    "award_template_id": {
      "type": "number",
      "description": "The ID of the award template thte user is on"
    },
    "award_tag_ids": {
      "type": "array",
      "description": "The award tag ids that apply to the user"
    },
    "report_department_id": {
      "type": "number",
      "description": "The user's default team"
    },
    "managed_department_ids": {
      "type": "array",
      "description": "The department ids that this user manages"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the user is active in the system"
    },
    "email": {
      "type": "string",
      "description": "The user's email"
    },
    "photo": {
      "type": "string",
      "description": "An avatar for the user"
    },
    "phone": {
      "type": "string",
      "description": "Phone number for the user"
    },
    "normalised_phone": {
      "type": "string",
      "description": "Phone number for user with international dialing code"
    },
    "time_zone": {
      "type": "string",
      "description": "The user's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The user's time zone's UTC offset"
    },
    "oauth_provider": {
      "type": "string",
      "description": "If oAuth login enabled, login provider"
    },
    "oauth_uid": {
      "type": "string",
      "description": "If oAuth login enabled, login UID"
    },
    "part_time_fixed_hours": {
      "type": "number",
      "description": "readonly: for part time staff, can be used to configure when overtime starts to apply"
    },
    "expected_hours_in_pay_period": {
      "type": "number",
      "description": "readonly: for salaried staff, defines expected number of hours worked per pay period"
    },
    "days_overtime_averaged_over": {
      "type": "number",
      "description": "readonly: date range (weekly, fortnightly, or 4-weekly) over which overtime calculations should run"
    },
    "overtime_calculated_over_period_start": {
      "type": "string",
      "description": "readonly: date from which overtime averaging periods should commence"
    },
    "created_at": {
      "type": "number",
      "description": "When the user's Tanda profile was created"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "name",
    "passcode",
    "platform_role_ids",
    "department_ids",
    "preferred_hours",
    "award_tag_ids",
    "active",
    "utc_offset",
    "created_at"
  ]
}

Create User
POST/api/v2/users

Only the name field is required to create a user.

To create a manager, you should provide the IDs of Teams they manage in the managed_department_ids field.

The Tanda API currently requires email addresses to be unique within an organisation when creating a user. However, there is no guarantee that this restriction will exist in the future. If you are creating users via the API you should first GET a list of users and validate that the user you’re creating doesn’t already exist - do not depend on the API to validate this for you.

To skip email validation when creating a user, use skip_validation=true.

This method requires the user scope (see Scopes for more information).

If you plan to assign wage information you will need the cost scope. This includes the employee_id field.

To set financial information, you will need the financial scope.

URI Parameters
HideShow
skip_validation
boolean (optional) Example: true

Skip’s checking if an employee already exists with this email address (defaults to false)


Inactive User List

GET https://my.tanda.co/api/v2/users/inactive
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 1234567,
    "name": "Homer Simpson",
    "date_of_birth": null,
    "employment_start_date": null,
    "employment_end_date": "2019-06-01",
    "employee_id": "HS98",
    "passcode": "1230",
    "department_ids": [
      111
    ],
    "preferred_hours": 22,
    "award_template_id": 58,
    "award_tag_ids": [],
    "report_department_id": 111,
    "managed_department_ids": [],
    "active": false,
    "enable_login": true,
    "email": "homer.simpson@springfieldpowerplant.com",
    "photo": "http://vignette2.wikia.nocookie.net/simpsons/images/b/bd/Homer_Simpson.png",
    "phone": "+61404123456",
    "normalised_phone": "+61404123456",
    "time_zone": "Australia/Brisbane",
    "utc_offset": 36000,
    "created_at": 1430715549,
    "part_time_fixed_hours": 0,
    "expected_hours_in_pay_period": null,
    "days_overtime_averaged_over": 7,
    "overtime_calculated_over_period_start": "2016-11-14",
    "employment_basis": null,
    "super_fund_membership": null,
    "super_fund": null,
    "bank_details": null,
    "tax_declaration": null,
    "onboarding_status": "not_applicable",
    "qualifications": [],
    "updated_at": 1562272900
  }
]

Get Inactive Users
GET/api/v2/users/inactive

This method requires the user scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified users

report_location_id
number (optional) Example: 111

The ID of a location for which to filter users to. If provided, only returns users if the user’s default team (report_department_id) is set, and it is a team within this location.


User

GET https://my.tanda.co/api/v2/users/123456?show_wages=true
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 123456,
  "name": "Lenny Leonard",
  "date_of_birth": "1955-05-12",
  "employment_start_date": "1989-12-17",
  "employee_id": "LL1",
  "passcode": "0456",
  "platform_role_ids": [
    18,
    19,
    22
  ],
  "department_ids": [
    111
  ],
  "preferred_hours": 20,
  "award": {
    "name": "Fast Food Industry",
    "identifier": "MA000003",
    "note": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
  },
  "award_template_id": 990,
  "award_tag_ids": [
    3816
  ],
  "report_department_id": 111,
  "managed_department_ids": [
    222
  ],
  "active": true,
  "email": "lenny.leonard@springfieldpowerplant.com",
  "photo": "http://vignette1.wikia.nocookie.net/family-guyamerican-dadthe-simpsons-and-futurama/images/f/ff/250px-Lenny_Leonard.png",
  "phone": "0404 123 123",
  "normalised_phone": "+61404123123",
  "salary": 1234.12,
  "hourly_rate": 32.47,
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "part_time_fixed_hours": 20,
  "expected_hours_in_pay_period": 38,
  "days_overtime_averaged_over": 7,
  "overtime_calculated_over_period_start": "2016-09-12",
  "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": "Hello, world!",
  "super_fund": {
    "id": 1234,
    "fund_name": "FUND NAME",
    "product_name": "FUND PRODUCT",
    "smsf": false,
    "abn": 123456789
  },
  "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": "Hello, world!",
  "qualifications": [
    {
      "id": 12345,
      "qualification_id": 1234,
      "enabled": true,
      "license_number": "ABC123",
      "expires": "2012-10-20",
      "in_training": false
    }
  ],
  "created_at": 1430715548,
  "record_id": 532432,
  "next_pay_group_id": 53242,
  "last_synced_mobile_app": 1430715548
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the user"
    },
    "name": {
      "type": "string",
      "description": "The user's name"
    },
    "date_of_birth": {
      "type": "string",
      "description": "The user's date of birth"
    },
    "employment_start_date": {
      "type": "string",
      "description": "The user's employment start date"
    },
    "employee_id": {
      "type": "string",
      "description": "The user's employee id, used for external systems"
    },
    "passcode": {
      "type": "string",
      "description": "The user's system passcode (used for clocking in and out)"
    },
    "platform_role_ids": {
      "type": "array",
      "description": "IDs of the user's roles (see Access & Roles)"
    },
    "department_ids": {
      "type": "array",
      "description": "The department (team) ids that the user is a member of"
    },
    "preferred_hours": {
      "type": "number",
      "description": "The preferred number of hours to be rostered each week"
    },
    "award": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the award"
        },
        "identifier": {
          "type": "string",
          "description": "The award's identifier (will be the award code for all modern awards)"
        },
        "note": {
          "type": "string",
          "description": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
        }
      },
      "required": [
        "name"
      ],
      "description": "Information about the user's award, null if user isn't on award"
    },
    "award_template_id": {
      "type": "number",
      "description": "The ID of the award template thte user is on"
    },
    "award_tag_ids": {
      "type": "array",
      "description": "The award tag ids that apply to the user"
    },
    "report_department_id": {
      "type": "number",
      "description": "The user's default team"
    },
    "managed_department_ids": {
      "type": "array",
      "description": "The department ids that this user manages"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the user is active in the system"
    },
    "email": {
      "type": "string",
      "description": "The user's email"
    },
    "photo": {
      "type": "string",
      "description": "An avatar for the user"
    },
    "phone": {
      "type": "string",
      "description": "Phone number for the user"
    },
    "normalised_phone": {
      "type": "string",
      "description": "Phone number for user with international dialing code"
    },
    "salary": {
      "type": "number",
      "description": "The weekly salary of the user, if `show_wages=true` parameter is set"
    },
    "hourly_rate": {
      "type": "number",
      "description": "The hourly rate of the user, if `show_wages=true` parameter is set, will not show if the salary exists"
    },
    "time_zone": {
      "type": "string",
      "description": "The user's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The user's time zone's UTC offset"
    },
    "part_time_fixed_hours": {
      "type": "number",
      "description": "For part time staff, can be used to configure when overtime starts to apply"
    },
    "expected_hours_in_pay_period": {
      "type": "number",
      "description": "readonly: for salaried staff, defines expected number of hours worked per pay period"
    },
    "days_overtime_averaged_over": {
      "type": "number",
      "description": "date range (weekly, fortnightly, or 4-weekly) over which overtime calculations should run"
    },
    "overtime_calculated_over_period_start": {
      "type": "string",
      "description": "date from which overtime averaging periods should commence"
    },
    "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": {
      "type": "string",
      "description": "the employment type the employee has specified on their TFN declaration"
    },
    "super_fund": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "the unique ID of the employees fund"
        },
        "fund_name": {
          "type": "string",
          "description": "the name of the fund"
        },
        "product_name": {
          "type": "string",
          "description": "the name of the fund product"
        },
        "smsf": {
          "type": "boolean",
          "description": "is the fund a self managed fund"
        },
        "abn": {
          "type": "number",
          "description": "the number of the fund"
        }
      },
      "description": "information about the employees super fund"
    },
    "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": {
      "type": "string",
      "description": "the status of the employee onboarding progress"
    },
    "qualifications": {
      "type": "array",
      "description": "Information about qualifications the user holds, if Qualifications are enabled"
    },
    "created_at": {
      "type": "number",
      "description": "When the user's Tanda profile was created"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    },
    "next_pay_group_id": {
      "type": "number",
      "description": "the ID for the pay group of the user's next timesheet"
    },
    "last_synced_mobile_app": {
      "type": "number",
      "description": "Read only: when the user last opened the mobile app."
    }
  },
  "required": [
    "id",
    "name",
    "passcode",
    "platform_role_ids",
    "department_ids",
    "preferred_hours",
    "award_tag_ids",
    "active",
    "utc_offset",
    "created_at"
  ]
}

Get User
GET/api/v2/users/{id}{?show_wages}

Gets information about a user.

This method requires the user scope (see Scopes for more information).

If you are using show_wages=true, the cost scope is also required.

URI Parameters
HideShow
id
number (required) Example: 123456

The id of the user

show_wages
boolean (optional) Example: true

Whether to show the user’s wage (defaults to false)

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


PUT https://my.tanda.co/api/v2/users/123456
RequestsUpdate UserDeactivate UserRemove Departments
Headers
Content-Type: application/json
Body
{
  "name": "Lenford Leonard",
  "employee_id": "Lenford",
  "passcode": "0123",
  "phone": "0404123122",
  "date_of_birth": "1990-12-12",
  "employment_start_date": "2016-03-01",
  "email": "some_email@test.com",
  "hourly_rate": 12.34,
  "enable_login": true
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 123456,
  "name": "Lenford Leonard",
  "date_of_birth": "1990-12-12",
  "employment_start_date": "2016-03-01",
  "employee_id": "Lenford",
  "passcode": "0123",
  "platform_role_ids": [
    18,
    19,
    22
  ],
  "department_ids": [
    111
  ],
  "preferred_hours": 20,
  "award": {
    "name": "Fast Food Industry",
    "identifier": "MA000003",
    "note": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
  },
  "award_template_id": 990,
  "award_tag_ids": [
    3816
  ],
  "report_department_id": 111,
  "managed_department_ids": [
    222
  ],
  "active": true,
  "email": "some_email@test.com",
  "photo": "http://vignette1.wikia.nocookie.net/family-guyamerican-dadthe-simpsons-and-futurama/images/f/ff/250px-Lenny_Leonard.png",
  "phone": "0404123122",
  "normalised_phone": "+61404123122",
  "salary": 1234.12,
  "hourly_rate": 12.34,
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "part_time_fixed_hours": 20,
  "expected_hours_in_pay_period": 38,
  "days_overtime_averaged_over": 7,
  "overtime_calculated_over_period_start": "2016-09-12",
  "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": "",
  "super_fund": {
    "id": 1234,
    "fund_name": "FUND NAME",
    "product_name": "FUND PRODUCT",
    "smsf": false,
    "abn": 123456789
  },
  "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": "",
  "qualifications": [
    {
      "id": 12345,
      "qualification_id": 1234,
      "enabled": true,
      "license_number": "ABC123",
      "expires": "2012-10-20",
      "in_training": false
    }
  ],
  "created_at": 1430715548,
  "record_id": 532432,
  "next_pay_group_id": 53242,
  "last_synced_mobile_app": 1430715548,
  "enable_login": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the user"
    },
    "name": {
      "type": "string",
      "description": "The user's name"
    },
    "date_of_birth": {
      "type": "string",
      "description": "The user's date of birth"
    },
    "employment_start_date": {
      "type": "string",
      "description": "The user's employment start date"
    },
    "employee_id": {
      "type": "string",
      "description": "The user's employee id, used for external systems"
    },
    "passcode": {
      "type": "string",
      "description": "The user's system passcode (used for clocking in and out)"
    },
    "platform_role_ids": {
      "type": "array",
      "description": "IDs of the user's roles (see Access & Roles)"
    },
    "department_ids": {
      "type": "array",
      "description": "The department (team) ids that the user is a member of"
    },
    "preferred_hours": {
      "type": "number",
      "description": "The preferred number of hours to be rostered each week"
    },
    "award": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the award"
        },
        "identifier": {
          "type": "string",
          "description": "The award's identifier (will be the award code for all modern awards)"
        },
        "note": {
          "type": "string",
          "description": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
        }
      },
      "required": [
        "name"
      ],
      "description": "Information about the user's award, null if user isn't on award"
    },
    "award_template_id": {
      "type": "number",
      "description": "The ID of the award template thte user is on"
    },
    "award_tag_ids": {
      "type": "array",
      "description": "The award tag ids that apply to the user"
    },
    "report_department_id": {
      "type": "number",
      "description": "The user's default team"
    },
    "managed_department_ids": {
      "type": "array",
      "description": "The department ids that this user manages"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the user is active in the system"
    },
    "email": {
      "type": "string",
      "description": "The user's email"
    },
    "photo": {
      "type": "string",
      "description": "An avatar for the user"
    },
    "phone": {
      "type": "string",
      "description": "Phone number for the user"
    },
    "normalised_phone": {
      "type": "string",
      "description": "Phone number for user with international dialing code"
    },
    "salary": {
      "type": "number",
      "description": "The weekly salary of the user, if `show_wages=true` parameter is set"
    },
    "hourly_rate": {
      "type": "number",
      "description": "The hourly rate of the user, if `show_wages=true` parameter is set, will not show if the salary exists"
    },
    "time_zone": {
      "type": "string",
      "description": "The user's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The user's time zone's UTC offset"
    },
    "part_time_fixed_hours": {
      "type": "number",
      "description": "For part time staff, can be used to configure when overtime starts to apply"
    },
    "expected_hours_in_pay_period": {
      "type": "number",
      "description": "readonly: for salaried staff, defines expected number of hours worked per pay period"
    },
    "days_overtime_averaged_over": {
      "type": "number",
      "description": "date range (weekly, fortnightly, or 4-weekly) over which overtime calculations should run"
    },
    "overtime_calculated_over_period_start": {
      "type": "string",
      "description": "date from which overtime averaging periods should commence"
    },
    "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": {
      "type": "string",
      "description": "the employment type the employee has specified on their TFN declaration"
    },
    "super_fund": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "the unique ID of the employees fund"
        },
        "fund_name": {
          "type": "string",
          "description": "the name of the fund"
        },
        "product_name": {
          "type": "string",
          "description": "the name of the fund product"
        },
        "smsf": {
          "type": "boolean",
          "description": "is the fund a self managed fund"
        },
        "abn": {
          "type": "number",
          "description": "the number of the fund"
        }
      },
      "description": "information about the employees super fund"
    },
    "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": {
      "type": "string",
      "description": "the status of the employee onboarding progress"
    },
    "qualifications": {
      "type": "array",
      "description": "Information about qualifications the user holds, if Qualifications are enabled"
    },
    "created_at": {
      "type": "number",
      "description": "When the user's Tanda profile was created"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    },
    "next_pay_group_id": {
      "type": "number",
      "description": "the ID for the pay group of the user's next timesheet"
    },
    "last_synced_mobile_app": {
      "type": "number",
      "description": "Read only: when the user last opened the mobile app."
    },
    "enable_login": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "name",
    "passcode",
    "platform_role_ids",
    "department_ids",
    "preferred_hours",
    "award_tag_ids",
    "active",
    "utc_offset",
    "created_at"
  ]
}
Headers
Content-Type: application/json
Body
{
  "active": false
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 123456,
  "name": "Lenny Leonard",
  "date_of_birth": "1955-05-12",
  "employment_start_date": "1989-12-17",
  "employee_id": "LL1",
  "passcode": "01234568975461",
  "platform_role_ids": [
    18,
    19,
    22
  ],
  "department_ids": [
    111
  ],
  "preferred_hours": 20,
  "award": {
    "name": "Fast Food Industry",
    "identifier": "MA000003",
    "note": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
  },
  "award_template_id": 990,
  "award_tag_ids": [
    3816
  ],
  "report_department_id": 111,
  "managed_department_ids": [
    222
  ],
  "active": false,
  "email": "lenny.leonard@springfieldpowerplant.com",
  "photo": "http://vignette1.wikia.nocookie.net/family-guyamerican-dadthe-simpsons-and-futurama/images/f/ff/250px-Lenny_Leonard.png",
  "phone": "0404 123 123",
  "normalised_phone": "+61404123123",
  "salary": 1234.12,
  "hourly_rate": 32.47,
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "part_time_fixed_hours": 20,
  "expected_hours_in_pay_period": 38,
  "days_overtime_averaged_over": 7,
  "overtime_calculated_over_period_start": "2016-09-12",
  "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": "",
  "super_fund": {
    "id": 1234,
    "fund_name": "FUND NAME",
    "product_name": "FUND PRODUCT",
    "smsf": false,
    "abn": 123456789
  },
  "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": "",
  "qualifications": [
    {
      "id": 12345,
      "qualification_id": 1234,
      "enabled": true,
      "license_number": "ABC123",
      "expires": "2012-10-20",
      "in_training": false
    }
  ],
  "created_at": 1430715548,
  "record_id": 532432,
  "next_pay_group_id": 53242,
  "last_synced_mobile_app": 1430715548
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the user"
    },
    "name": {
      "type": "string",
      "description": "The user's name"
    },
    "date_of_birth": {
      "type": "string",
      "description": "The user's date of birth"
    },
    "employment_start_date": {
      "type": "string",
      "description": "The user's employment start date"
    },
    "employee_id": {
      "type": "string",
      "description": "The user's employee id, used for external systems"
    },
    "passcode": {
      "type": "string",
      "description": "The user's system passcode (used for clocking in and out)"
    },
    "platform_role_ids": {
      "type": "array",
      "description": "IDs of the user's roles (see Access & Roles)"
    },
    "department_ids": {
      "type": "array",
      "description": "The department (team) ids that the user is a member of"
    },
    "preferred_hours": {
      "type": "number",
      "description": "The preferred number of hours to be rostered each week"
    },
    "award": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the award"
        },
        "identifier": {
          "type": "string",
          "description": "The award's identifier (will be the award code for all modern awards)"
        },
        "note": {
          "type": "string",
          "description": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
        }
      },
      "required": [
        "name"
      ],
      "description": "Information about the user's award, null if user isn't on award"
    },
    "award_template_id": {
      "type": "number",
      "description": "The ID of the award template thte user is on"
    },
    "award_tag_ids": {
      "type": "array",
      "description": "The award tag ids that apply to the user"
    },
    "report_department_id": {
      "type": "number",
      "description": "The user's default team"
    },
    "managed_department_ids": {
      "type": "array",
      "description": "The department ids that this user manages"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the user is active in the system"
    },
    "email": {
      "type": "string",
      "description": "The user's email"
    },
    "photo": {
      "type": "string",
      "description": "An avatar for the user"
    },
    "phone": {
      "type": "string",
      "description": "Phone number for the user"
    },
    "normalised_phone": {
      "type": "string",
      "description": "Phone number for user with international dialing code"
    },
    "salary": {
      "type": "number",
      "description": "The weekly salary of the user, if `show_wages=true` parameter is set"
    },
    "hourly_rate": {
      "type": "number",
      "description": "The hourly rate of the user, if `show_wages=true` parameter is set, will not show if the salary exists"
    },
    "time_zone": {
      "type": "string",
      "description": "The user's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The user's time zone's UTC offset"
    },
    "part_time_fixed_hours": {
      "type": "number",
      "description": "For part time staff, can be used to configure when overtime starts to apply"
    },
    "expected_hours_in_pay_period": {
      "type": "number",
      "description": "readonly: for salaried staff, defines expected number of hours worked per pay period"
    },
    "days_overtime_averaged_over": {
      "type": "number",
      "description": "date range (weekly, fortnightly, or 4-weekly) over which overtime calculations should run"
    },
    "overtime_calculated_over_period_start": {
      "type": "string",
      "description": "date from which overtime averaging periods should commence"
    },
    "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": {
      "type": "string",
      "description": "the employment type the employee has specified on their TFN declaration"
    },
    "super_fund": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "the unique ID of the employees fund"
        },
        "fund_name": {
          "type": "string",
          "description": "the name of the fund"
        },
        "product_name": {
          "type": "string",
          "description": "the name of the fund product"
        },
        "smsf": {
          "type": "boolean",
          "description": "is the fund a self managed fund"
        },
        "abn": {
          "type": "number",
          "description": "the number of the fund"
        }
      },
      "description": "information about the employees super fund"
    },
    "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": {
      "type": "string",
      "description": "the status of the employee onboarding progress"
    },
    "qualifications": {
      "type": "array",
      "description": "Information about qualifications the user holds, if Qualifications are enabled"
    },
    "created_at": {
      "type": "number",
      "description": "When the user's Tanda profile was created"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    },
    "next_pay_group_id": {
      "type": "number",
      "description": "the ID for the pay group of the user's next timesheet"
    },
    "last_synced_mobile_app": {
      "type": "number",
      "description": "Read only: when the user last opened the mobile app."
    }
  },
  "required": [
    "id",
    "name",
    "passcode",
    "platform_role_ids",
    "department_ids",
    "preferred_hours",
    "award_tag_ids",
    "active",
    "utc_offset",
    "created_at"
  ]
}
Headers
Content-Type: application/json
Body
{
  "department_ids": null
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 123456,
  "name": "Lenny Leonard",
  "date_of_birth": "1955-05-12",
  "employment_start_date": "1989-12-17",
  "employment_end_date": "2019-06-01",
  "employee_id": "LL1",
  "passcode": "0456",
  "department_ids": [],
  "preferred_hours": 20,
  "award_template_id": 990,
  "award_tag_ids": [
    3816
  ],
  "report_department_id": 111,
  "managed_department_ids": [
    222
  ],
  "active": true,
  "enable_login": true,
  "email": "lenny.leonard@springfieldpowerplant.com",
  "photo": "http://vignette1.wikia.nocookie.net/family-guyamerican-dadthe-simpsons-and-futurama/images/f/ff/250px-Lenny_Leonard.png",
  "phone": "0404 123 123",
  "normalised_phone": "+61404123123",
  "salary": 1234.12,
  "hourly_rate": 32.47,
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "created_at": 1430715548
  "part_time_fixed_hours": 20,
  "expected_hours_in_pay_period": 38,
  "days_overtime_averaged_over": 7,
  "overtime_calculated_over_period_start": "2016-09-12",
  "employment_basis": full_time,
  "super_fund_membership": null,
  "super_fund": null,
  "bank_details": null,
  "tax_declaration": null,
  "qualifications": [],
  "updated_at": 1562272900
}

Update User
PUT/api/v2/users/{id}

This method requires the user scope (see Scopes for more information).

If you plan to update wage information you will need the cost scope. This includes the employee_id field.

To set financial information, you will need the financial scope.

The Tanda API currently requires email addresses to be unique within an organisation. However, there is no guarantee that this restriction will exist in the future. If you are updating a user’s email via the API you should first GET a list of users and validate that the email you’re setting isn’t already in use - do not depend on the API to validate this for you.

To skip email validation when creating a user, use skip_validation=true.

If you are attempting to remove a user’s department_ids or managed_department_ids, you should pass null as part of your API call. There is an example in the sidebar.

It’s not possible to remove a user’s passcode. If you pass null as a value for it, the user’s passcode will be regenerated.

URI Parameters
HideShow
id
number (required) Example: 123456

The id of the user

skip_validation
boolean (optional) Example: true

Skip’s checking if an employee already exists with this email address


DELETE https://my.tanda.co/api/v2/users/654321
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 123456,
  "name": "Lenny Leonard",
  "date_of_birth": "1955-05-12",
  "employment_start_date": "1989-12-17",
  "employee_id": "LL1",
  "passcode": "01234568975461",
  "platform_role_ids": [
    18,
    19,
    22
  ],
  "department_ids": [
    111
  ],
  "preferred_hours": 20,
  "award": {
    "name": "Fast Food Industry",
    "identifier": "MA000003",
    "note": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
  },
  "award_template_id": 990,
  "award_tag_ids": [
    3816
  ],
  "report_department_id": 111,
  "managed_department_ids": [
    222
  ],
  "active": false,
  "email": "lenny.leonard@springfieldpowerplant.com",
  "photo": "http://vignette1.wikia.nocookie.net/family-guyamerican-dadthe-simpsons-and-futurama/images/f/ff/250px-Lenny_Leonard.png",
  "phone": "0404 123 123",
  "normalised_phone": "+61404123123",
  "salary": 1234.12,
  "hourly_rate": 32.47,
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "part_time_fixed_hours": 20,
  "expected_hours_in_pay_period": 38,
  "days_overtime_averaged_over": 7,
  "overtime_calculated_over_period_start": "2016-09-12",
  "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": "",
  "super_fund": {
    "id": 1234,
    "fund_name": "FUND NAME",
    "product_name": "FUND PRODUCT",
    "smsf": false,
    "abn": 123456789
  },
  "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": "",
  "qualifications": [
    {
      "id": 12345,
      "qualification_id": 1234,
      "enabled": true,
      "license_number": "ABC123",
      "expires": "2012-10-20",
      "in_training": false
    }
  ],
  "created_at": 1430715548,
  "record_id": 532432,
  "next_pay_group_id": 53242,
  "last_synced_mobile_app": 1430715548
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the user"
    },
    "name": {
      "type": "string",
      "description": "The user's name"
    },
    "date_of_birth": {
      "type": "string",
      "description": "The user's date of birth"
    },
    "employment_start_date": {
      "type": "string",
      "description": "The user's employment start date"
    },
    "employee_id": {
      "type": "string",
      "description": "The user's employee id, used for external systems"
    },
    "passcode": {
      "type": "string",
      "description": "The user's system passcode (used for clocking in and out)"
    },
    "platform_role_ids": {
      "type": "array",
      "description": "IDs of the user's roles (see Access & Roles)"
    },
    "department_ids": {
      "type": "array",
      "description": "The department (team) ids that the user is a member of"
    },
    "preferred_hours": {
      "type": "number",
      "description": "The preferred number of hours to be rostered each week"
    },
    "award": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the award"
        },
        "identifier": {
          "type": "string",
          "description": "The award's identifier (will be the award code for all modern awards)"
        },
        "note": {
          "type": "string",
          "description": "This field is deprecated, and may be removed in the future. Please rely on the `award_template_id` field instead."
        }
      },
      "required": [
        "name"
      ],
      "description": "Information about the user's award, null if user isn't on award"
    },
    "award_template_id": {
      "type": "number",
      "description": "The ID of the award template thte user is on"
    },
    "award_tag_ids": {
      "type": "array",
      "description": "The award tag ids that apply to the user"
    },
    "report_department_id": {
      "type": "number",
      "description": "The user's default team"
    },
    "managed_department_ids": {
      "type": "array",
      "description": "The department ids that this user manages"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the user is active in the system"
    },
    "email": {
      "type": "string",
      "description": "The user's email"
    },
    "photo": {
      "type": "string",
      "description": "An avatar for the user"
    },
    "phone": {
      "type": "string",
      "description": "Phone number for the user"
    },
    "normalised_phone": {
      "type": "string",
      "description": "Phone number for user with international dialing code"
    },
    "salary": {
      "type": "number",
      "description": "The weekly salary of the user, if `show_wages=true` parameter is set"
    },
    "hourly_rate": {
      "type": "number",
      "description": "The hourly rate of the user, if `show_wages=true` parameter is set, will not show if the salary exists"
    },
    "time_zone": {
      "type": "string",
      "description": "The user's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The user's time zone's UTC offset"
    },
    "part_time_fixed_hours": {
      "type": "number",
      "description": "For part time staff, can be used to configure when overtime starts to apply"
    },
    "expected_hours_in_pay_period": {
      "type": "number",
      "description": "readonly: for salaried staff, defines expected number of hours worked per pay period"
    },
    "days_overtime_averaged_over": {
      "type": "number",
      "description": "date range (weekly, fortnightly, or 4-weekly) over which overtime calculations should run"
    },
    "overtime_calculated_over_period_start": {
      "type": "string",
      "description": "date from which overtime averaging periods should commence"
    },
    "employment_basis: full_time, part_time, casual, labour_hire, super_or_annuity": {
      "type": "string",
      "description": "the employment type the employee has specified on their TFN declaration"
    },
    "super_fund": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "the unique ID of the employees fund"
        },
        "fund_name": {
          "type": "string",
          "description": "the name of the fund"
        },
        "product_name": {
          "type": "string",
          "description": "the name of the fund product"
        },
        "smsf": {
          "type": "boolean",
          "description": "is the fund a self managed fund"
        },
        "abn": {
          "type": "number",
          "description": "the number of the fund"
        }
      },
      "description": "information about the employees super fund"
    },
    "onboarding_status: not_applicable, pending, invited, in_progress, completed, invitation_failed": {
      "type": "string",
      "description": "the status of the employee onboarding progress"
    },
    "qualifications": {
      "type": "array",
      "description": "Information about qualifications the user holds, if Qualifications are enabled"
    },
    "created_at": {
      "type": "number",
      "description": "When the user's Tanda profile was created"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    },
    "next_pay_group_id": {
      "type": "number",
      "description": "the ID for the pay group of the user's next timesheet"
    },
    "last_synced_mobile_app": {
      "type": "number",
      "description": "Read only: when the user last opened the mobile app."
    }
  },
  "required": [
    "id",
    "name",
    "passcode",
    "platform_role_ids",
    "department_ids",
    "preferred_hours",
    "award_tag_ids",
    "active",
    "utc_offset",
    "created_at"
  ]
}

Delete User
DELETE/api/v2/users/{id}

This endpoint will just mark the user as inactive and return the user, this effectively does the same as the deactivate user request above.

This method requires the user scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 654321

The id of the user


Invite Users

POST https://my.tanda.co/api/v2/users/654321/invite
Responses201
Headers
Content-Type: application/json

Invite User
POST/api/v2/users/{id}/invite

This endpoint takes a user ID and sends that user an email invite to use Tanda.

This method requires the user scope (see Scopes for more information).

It also requires the following prerequisites to work

  • User must exist

  • You must be able to manage the User

  • The User must have an email and it must be valid

  • The User must not have already signed up

  • The User must not already have a valid invitation

Failure to meet these pre reqs will result in a returned 400, 403 or 404. Otherwise a 201 CREATED will be returned

URI Parameters
HideShow
id
number (required) Example: 654321

The id of the user


Invite Users for Onboarding

POST https://my.tanda.co/api/v2/users/onboarding
RequestsCreate User for Onboarding
Headers
Content-Type: application/json
Body
{
  "name": "Eddard Sheppard",
  "email": "carl.carlson@springfieldpowerplant.com",
  "phone": "+61408123654",
  "custom_message": "Welcome to the company!"
}
Responses201
Headers
Content-Type: application/json

Invite User for Onboarding
POST/api/v2/users/onboarding

If you are using Tanda’s employee onboarding, you can use this endpoint to automatically invite new staff to be onboarded. It takes a name and email, and optionally a phone number and custom message, and sends the employee a link to a form where they can add their details.


Clocked In Users

GET https://my.tanda.co/api/v2/users/clocked_in
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "user_id": 123456,
    "shift_id": 1337
  }
]

Get Clocked In Users
GET/api/v2/users/clocked_in

This endpoint is deprecated. You should use /shifts/active instead.

Gets a list of staff who are currently at work. Essentially this looks for valid shifts that have a start time but no end time. The shift’s ID is also returned.

This method requires the user and timesheet scopes (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified users


User Versions

GET https://my.tanda.co/api/v2/users/123456/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"User\"",
    "changes": [
      {
        "field": "name",
        "previous": "Lenny L Leonard",
        "updated": "Lenny Leonard"
      },
      {
        "field": "preferred_hours",
        "previous": 28,
        "updated": 20
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get User Versions
GET/api/v2/users/{id}/versions

This method requires the user scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 123456

The id of the user

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified user versions


Locations

Admins and general managers can CRUD locations. Team managers can read locations which contain teams they manage.

Location List

GET https://my.tanda.co/api/v2/locations
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 111,
    "name": "Springfield",
    "short_name": "S",
    "latitude": -27.459687,
    "longitude": 153.032108,
    "address": "Springfield Powerplant Reactors",
    "time_zone": "Australia/Brisbane",
    "utc_offset": 36000,
    "public_holiday_regions": [
      "au",
      "au_qld"
    ],
    "specific_holiday_dates": [
      {
        "date": "2016-08-08",
        "from": 8,
        "to": 17
      }
    ],
    "business_day_cutoff": 5,
    "record_id": 532432
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Locations
GET/api/v2/locations

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified locations

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


POST https://my.tanda.co/api/v2/locations
RequestsCreate LocationCreate basic Location
Headers
Content-Type: application/json
Body
{
  "name": "Springfield",
  "short_name": "S",
  "latitude": -27.467004,
  "longitude": 153.025453,
  "address": "Springfield Powerplant Logistics Centre",
  "public_holiday_regions": [
    "au"
  ],
  "specific_holiday_dates": [
    {
      "date": "2016-03-14"
    },
    {
      "date": "2016-08-08",
      "from": 12,
      "to": 17
    }
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "name": "Springfield",
  "short_name": "S",
  "latitude": -27.467004,
  "longitude": 153.025453,
  "address": "Springfield Powerplant Logistics Centre",
  "time_zone": null,
  "organisation_id": 12,
  "public_holiday_regions": [
    "au"
  ],
  "specific_holiday_dates": [
    {
      "date": "2016-03-14"
    },
    {
      "date": "2016-08-08",
      "from": 12,
      "to": 17
    }
  ],
  "business_day_cutoff": 0
}
Headers
Content-Type: application/json
Body
{
  "name": "Springfield"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 801,
  "name": "Springfield",
  "short_name": null,
  "latitude": null,
  "longitude": null,
  "address": null,
  "time_zone": null,
  "organisation_id": 12,
  "public_holiday_regions": [],
  "specific_holiday_dates": [],
  "business_day_cutoff": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the location"
    },
    "name": {
      "type": "string",
      "description": "The name of the location"
    },
    "short_name": {
      "type": "string",
      "description": "The abbreviated form of the location's name"
    },
    "latitude": {
      "type": "number",
      "description": "The latitude of the location"
    },
    "longitude": {
      "type": "number",
      "description": "The longitude of the location"
    },
    "address": {
      "type": "string",
      "description": "Address of the location"
    },
    "time_zone": {
      "type": "string",
      "description": "The location's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The location's time zone's UTC offset"
    },
    "public_holiday_regions": {
      "type": "array",
      "description": "Public holiday regions (see Locations section for list of options)"
    },
    "specific_holiday_dates": {
      "type": "array",
      "description": "The dates and times of specific holidays for the location"
    },
    "business_day_cutoff": {
      "type": "number",
      "description": "The hour of the day before which data should be treated as being part of the previous day. eg 5 indicates that data from before 5am is part of the previous business day."
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "name",
    "time_zone",
    "utc_offset"
  ]
}

Create Location
POST/api/v2/locations

Use this endpoint to create a Location object. Location objects should have addresses, but the field is not mandatory - you can create a Location with just a name (though it will not be as useful).

If an address is provided, latitude and longitude are also required.

This method requires the department scope (see Scopes for more information).


Location

GET https://my.tanda.co/api/v2/locations/111
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "name": "Springfield",
  "short_name": "S",
  "latitude": -27.459687,
  "longitude": 153.032108,
  "address": "Springfield Powerplant Reactors",
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "public_holiday_regions": [
    "au",
    "au_qld"
  ],
  "specific_holiday_dates": [
    {
      "date": "2016-08-08",
      "from": 8,
      "to": 17
    }
  ],
  "business_day_cutoff": 5,
  "record_id": 532432
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the location"
    },
    "name": {
      "type": "string",
      "description": "The name of the location"
    },
    "short_name": {
      "type": "string",
      "description": "The abbreviated form of the location's name"
    },
    "latitude": {
      "type": "number",
      "description": "The latitude of the location"
    },
    "longitude": {
      "type": "number",
      "description": "The longitude of the location"
    },
    "address": {
      "type": "string",
      "description": "Address of the location"
    },
    "time_zone": {
      "type": "string",
      "description": "The location's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The location's time zone's UTC offset"
    },
    "public_holiday_regions": {
      "type": "array",
      "description": "Public holiday regions (see Locations section for list of options)"
    },
    "specific_holiday_dates": {
      "type": "array",
      "description": "The dates and times of specific holidays for the location"
    },
    "business_day_cutoff": {
      "type": "number",
      "description": "The hour of the day before which data should be treated as being part of the previous day. eg 5 indicates that data from before 5am is part of the previous business day."
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "name",
    "time_zone",
    "utc_offset"
  ]
}

Get Location
GET/api/v2/locations/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 111

The id of the location

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


PUT https://my.tanda.co/api/v2/locations/111
RequestsUpdate Location
Headers
Content-Type: application/json
Body
{
  "name": "Shelbyville"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 111,
  "name": "Shelbyville",
  "short_name": "S",
  "latitude": -27.459687,
  "longitude": 153.032108,
  "address": "Springfield Powerplant Reactors",
  "time_zone": "Australia/Brisbane",
  "utc_offset": 36000,
  "public_holiday_regions": [
    "au",
    "au_qld"
  ],
  "specific_holiday_dates": [
    {
      "date": "2016-08-08",
      "from": 8,
      "to": 17
    }
  ],
  "business_day_cutoff": 5,
  "record_id": 532432
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the location"
    },
    "name": {
      "type": "string",
      "description": "The name of the location"
    },
    "short_name": {
      "type": "string",
      "description": "The abbreviated form of the location's name"
    },
    "latitude": {
      "type": "number",
      "description": "The latitude of the location"
    },
    "longitude": {
      "type": "number",
      "description": "The longitude of the location"
    },
    "address": {
      "type": "string",
      "description": "Address of the location"
    },
    "time_zone": {
      "type": "string",
      "description": "The location's time zone"
    },
    "utc_offset": {
      "type": "number",
      "description": "The location's time zone's UTC offset"
    },
    "public_holiday_regions": {
      "type": "array",
      "description": "Public holiday regions (see Locations section for list of options)"
    },
    "specific_holiday_dates": {
      "type": "array",
      "description": "The dates and times of specific holidays for the location"
    },
    "business_day_cutoff": {
      "type": "number",
      "description": "The hour of the day before which data should be treated as being part of the previous day. eg 5 indicates that data from before 5am is part of the previous business day."
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "name",
    "time_zone",
    "utc_offset"
  ]
}

Update Location
PUT/api/v2/locations/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 111

The id of the location


DELETE https://my.tanda.co/api/v2/locations/111
Responses200
Headers
Content-Type: application/json

Delete Location
DELETE/api/v2/locations/{id}

This method requires the department scope (see Scopes for more information).

Locations cannot be deleted if they have any teams.

URI Parameters
HideShow
id
number (required) Example: 111

The id of the location


Location Versions

GET https://my.tanda.co/api/v2/locations/111/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"Location\"",
    "changes": [
      {
        "field": "name",
        "previous": "Spring field",
        "updated": "Springfield"
      },
      {
        "field": "longitude",
        "previous": 153.032108,
        "updated": 100.500169
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Location Versions
GET/api/v2/locations/{id}/versions

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 111

The id of the location

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified location versions


Teams (Departments)

Departments are often referred to as Teams inside Tanda. Teams belong to a Location.

Department managers can read and update information about the departments they manage. Admins can CRUD departments. Employees can read the departments that they belong to, with a subset of fields (see below)

The department group / team group Feature needs to be enabled before you can access this field.

Team List

GET https://my.tanda.co/api/v2/departments
RequestsAs a managerAs an employee
This response has no content.
Responses200
Body
[
  {
    "id": 808,
    "location_id": 111,
    "name": "Waiters",
    "export_name": "WGB",
    "colour": "#FBB829",
    "staff": [
      1,
      2,
      123456
    ],
    "managers": [
      4,
      5
    ],
    "record_id": 532432
  }
]
Schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "number",
        "description": "The id of the team"
      },
      "location_id": {
        "type": "number",
        "description": "The id of the team's location"
      },
      "name": {
        "type": "string",
        "description": "The name of the team"
      },
      "export_name": {
        "type": "string",
        "description": "30 (string) - The payroll export name of the team (if different to the name)"
      },
      "colour": {
        "type": "string",
        "description": "The team's colour"
      },
      "staff": {
        "type": "array",
        "items": {
          "type": "number"
        },
        "description": "The user ids of the staff in the team"
      },
      "managers": {
        "type": "array",
        "items": {
          "type": "number"
        },
        "description": "The user ids of the managers of the team"
      },
      "record_id": {
        "type": "number",
        "description": "the record ID, for use with Platform endpoints"
      }
    },
    "required": [
      "id",
      "location_id",
      "name"
    ]
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
This response has no content.
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 608,
    "name": "Waiters",
    "location_id": 111,
    "colour": "#FBB830"
  }
]

Get Teams
GET/api/v2/departments

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified teams

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


POST https://my.tanda.co/api/v2/departments
RequestsCreate TeamCreate Basic Team
Headers
Content-Type: application/json
Body
{
  "name": "Waiters",
  "location_id": 111,
  "export_name": "WGB-32",
  "colour": "#FBB830",
  "team_group": "Front of House"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 809,
  "location_id": "111",
  "name": "Waiters",
  "export_name": "WGB",
  "colour": "#FBB830",
  "staff": [],
  "managers": [],
  "record_id": 532432,
  "team_group": "Front of House"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the team"
    },
    "location_id": {
      "type": "string",
      "description": "The id of the team's location"
    },
    "name": {
      "type": "string",
      "description": "The name of the team"
    },
    "export_name": {
      "type": "string",
      "description": "32"
    },
    "colour": {
      "type": "string",
      "description": "The team's colour"
    },
    "staff": {
      "description": "The user ids of the staff in the team"
    },
    "managers": {
      "description": "The user ids of the managers of the team"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    },
    "team_group": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "location_id",
    "name"
  ]
}
Headers
Content-Type: application/json
Body
{
  "name": "Waiters",
  "location_id": "111",
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 809,
  "location_id": 111,
  "name": "Waiters",
  "export_name": null,
  "colour": null,
  "staff": [],
  "managers": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the team"
    },
    "location_id": {
      "type": "number",
      "description": "The id of the team's location"
    },
    "name": {
      "type": "string",
      "description": "The name of the team"
    },
    "export_name": {
      "type": "string",
      "description": "30 (string) - The payroll export name of the team (if different to the name)"
    },
    "colour": {
      "type": "string",
      "description": "The team's colour"
    },
    "staff": {
      "type": "array",
      "description": "The user ids of the staff in the team"
    },
    "managers": {
      "type": "array",
      "description": "The user ids of the managers of the team"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "location_id",
    "name"
  ]
}

Create Team
POST/api/v2/departments

This method requires the department scope (see Scopes for more information).


Team

GET https://my.tanda.co/api/v2/departments/111
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 808,
  "location_id": 111,
  "name": "Waiters",
  "export_name": "WGB",
  "colour": "#FBB829",
  "staff": [
    1,
    2,
    123456
  ],
  "managers": [
    4,
    5
  ],
  "record_id": 532432
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the team"
    },
    "location_id": {
      "type": "number",
      "description": "The id of the team's location"
    },
    "name": {
      "type": "string",
      "description": "The name of the team"
    },
    "export_name": {
      "type": "string",
      "description": "30 (string) - The payroll export name of the team (if different to the name)"
    },
    "colour": {
      "type": "string",
      "description": "The team's colour"
    },
    "staff": {
      "type": "array",
      "description": "The user ids of the staff in the team"
    },
    "managers": {
      "type": "array",
      "description": "The user ids of the managers of the team"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "location_id",
    "name"
  ]
}

Get Team
GET/api/v2/departments/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 111

The id of the team

platform
boolean (optional) Example: false

If true, Platform data will be returned (defaults to false).


PUT https://my.tanda.co/api/v2/departments/111
RequestsUpdate Team
Headers
Content-Type: application/json
Body
{
  "name": "Kitchen Staff"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 808,
  "location_id": 111,
  "name": "Kitchen Staff",
  "export_name": "WGB",
  "colour": "#FBB829",
  "staff": [
    1,
    2,
    123456
  ],
  "managers": [
    4,
    5
  ],
  "record_id": 532432
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the team"
    },
    "location_id": {
      "type": "number",
      "description": "The id of the team's location"
    },
    "name": {
      "type": "string",
      "description": "The name of the team"
    },
    "export_name": {
      "type": "string",
      "description": "30 (string) - The payroll export name of the team (if different to the name)"
    },
    "colour": {
      "type": "string",
      "description": "The team's colour"
    },
    "staff": {
      "type": "array",
      "description": "The user ids of the staff in the team"
    },
    "managers": {
      "type": "array",
      "description": "The user ids of the managers of the team"
    },
    "record_id": {
      "type": "number",
      "description": "the record ID, for use with Platform endpoints"
    }
  },
  "required": [
    "id",
    "location_id",
    "name"
  ]
}

Update Team
PUT/api/v2/departments/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 111

The id of the team


DELETE https://my.tanda.co/api/v2/departments/111
Responses200
Headers
Content-Type: application/json

Delete Team
DELETE/api/v2/departments/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 111

The id of the team


Team Versions

GET https://my.tanda.co/api/v2/departments/111/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"Department\"",
    "changes": [
      {
        "field": "name",
        "previous": "Wait staff",
        "updated": "Waiters"
      },
      {
        "field": "colour",
        "previous": "#3FAFD7",
        "updated": "#FBB829"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Team Versions
GET/api/v2/departments/{id}/versions

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 111

The id of the team

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified team versions


Shift Details

Shift details belong to a Team, and can be assigned on Schedules within that team.

Teams managers can read and update information about the shift details from the teams they manage. Admins can CRUD shift details.

Shift Detail List

GET https://my.tanda.co/api/v2/shift_details
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 36,
    "department_id": 808,
    "name": "Higher Duties"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Shift Details
GET/api/v2/shift_details

This method requires the department scope (see Scopes for more information).


POST https://my.tanda.co/api/v2/shift_details
RequestsCreate Shift Detail
Headers
Content-Type: application/json
Body
{
  "name": "Manager",
  "department_id": 808
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 532,
  "department_id": "808",
  "name": "Manager"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift detail"
    },
    "department_id": {
      "type": "string",
      "description": "The id of the shift detail's department"
    },
    "name": {
      "type": "string",
      "description": "The name of the shift detail"
    }
  },
  "required": [
    "id",
    "department_id",
    "name"
  ]
}

Create Shift Detail
POST/api/v2/shift_details

This method requires the department scope (see Scopes for more information).


Shift Detail

GET https://my.tanda.co/api/v2/shift_details/36
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 36,
  "department_id": 808,
  "name": "Higher Duties"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift detail"
    },
    "department_id": {
      "type": "number",
      "description": "The id of the shift detail's department"
    },
    "name": {
      "type": "string",
      "description": "The name of the shift detail"
    }
  },
  "required": [
    "id",
    "department_id",
    "name"
  ]
}

Get Shift Detail
GET/api/v2/shift_details/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 36

The id of the shift detail


PUT https://my.tanda.co/api/v2/shift_details/36
RequestsUpdate Shift Detail
Headers
Content-Type: application/json
Body
{
  "name": "Shift Runner"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 36,
  "department_id": 808,
  "name": "Shift Runner"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the shift detail"
    },
    "department_id": {
      "type": "number",
      "description": "The id of the shift detail's department"
    },
    "name": {
      "type": "string",
      "description": "The name of the shift detail"
    }
  },
  "required": [
    "id",
    "department_id",
    "name"
  ]
}

Update Shift Detail
PUT/api/v2/shift_details/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 36

The id of the shift detail


DELETE https://my.tanda.co/api/v2/shift_details/36
Responses200
Headers
Content-Type: application/json

Delete Shift Detail
DELETE/api/v2/shift_details/{id}

This method requires the department scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 36

The id of the shift detail


Access & Roles

By default only admin level users can access roles. But you can also define new roles that are able to access roles!

Platform Role List

GET https://my.tanda.co/api/v2/platform/roles
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 3816,
    "name": "Admin",
    "description": "access to all functions in Tanda",
    "type": "organisation_admin",
    "enabled": true,
    "native": true,
    "sort_order": 1
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Platform Roles
GET/api/v2/platform/roles

This method requires the platform scope (see Scopes for more information).


Award Tags

No special permissions are required to read award tags.

Award Tag List

GET https://my.tanda.co/api/v2/award_tags
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 3816,
    "name": "Casual"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Award Tags
GET/api/v2/award_tags

This method requires the user scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified award tags


Award Tag

GET https://my.tanda.co/api/v2/award_tags/3816
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 3816,
  "name": "Casual"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the award tag"
    },
    "name": {
      "type": "string",
      "description": "The name of the award tag"
    }
  },
  "required": [
    "id",
    "name"
  ]
}

Get Award Tag
GET/api/v2/award_tags/{id}

This method requires the user scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 3816

The id of the Award Tag


Leave Requests

Leave is time formally not worked by an employee, due to things like public holidays, sickness, or by accruing annual leave.

For specifying times when an employee requests not to be rostered, please see Unavailability.

Admins, payroll officers, and roster managers can create, read and update leave requests for all users, and department managers can create, read and update leave requests for users that they manage. Other users are able to create, read and update leave requests for themself. Note that the current user may not update status for their own leave requests unless they are an Admin, payroll officer or roster manager. Deletion of leave requests is not supported.

Leave List

GET https://my.tanda.co/api/v2/leave?ids=1,2,666&from=2016-03-15&to=2016-04-05&user_ids=1,2,123456
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 666,
    "department_id": 808,
    "user_id": 123456,
    "reason": "Terribly Sick",
    "leave_type": "Personal/Carer's Leave",
    "hours": 7.6,
    "start": "2016-04-01",
    "finish": "2016-04-01",
    "start_time": "2000-01-01T09:30:00+10:00",
    "finish_time": "2000-01-01T05:30:00+10:00",
    "status": "pending",
    "multitagging": "false",
    "all_day": true,
    "daily_breakdown": {
      "2016-04-01": {},
      "hours": 7.6,
      "all_day": true,
      "start_time": "2016-04-01T09:30:00+1000",
      "finish_time": "2016-04-01T17:30:00+1000"
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Leave List
GET/api/v2/leave{?ids,from,to,user_ids}

Lookup multiple leave requests in a single request.

Your URL parameters must include:

  • from and to, or

  • ids, or

  • all 3 of the above

You can also specify user_ids to further filter your request.

This method requires the leave scope (see Scopes for more information).

You will only be able to query up to 366 days when specifying from and to.

URI Parameters
HideShow
ids
string (optional) Example: 1,2,666

Comma separated list of leave ids to lookup

from
string (optional) Example: 2016-03-15

From date to lookup leave in

to
string (optional) Example: 2016-04-05

To date to lookup leave in

user_ids
string (optional) Example: 1,2,123456

Comma separated list of user ids to lookup leave for

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified leave requests


POST https://my.tanda.co/api/v2/leave
RequestsCreate Leave
Headers
Content-Type: application/json
Body
{
  "reason": "Sick Day",
  "department_id": 2,
  "user_id": 123456,
  "hours": 114.0,
  "start": "2016-03-07",
  "start_time": "2000-01-01 09:30:00",
  "finish": "2016-03-07",
  "finish_time": "2000-01-01 17:30:00",
  "leave_type": "Sick Leave",
  "fallback_leave_type": "Unpaid Leave",
  "status": "pending",
  "all_day": false,
  "file_id": "73fe3430-4f5d-3a0a-84a7-cffbeb5efeb2",
  "daily_breakdown": [
    {
      "date": "2016-03-07"
      "hours": 114.0,
      "all_day": true,
      "start_time": "2016-03-07T09:30:00+1000",
      "finish_time": "2016-03-07T17:30:00+1000"
    }
  ]
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 7250,
  "department_id": 808,
  "user_id": 123456,
  "reason": "Holiday in France",
  "leave_type": "Annual Leave",
  "hours": 114,
  "start": "2016-03-07",
  "finish": "2016-03-08",
  "start_time": "2000-01-01T09:30:00",
  "finish_time": "2000-01-01T17:30:00",
  "status": "pending",
  "multitagging": "false",
  "all_day": "false",
  "daily_breakdown": [],
  "fallback_leave_type": "Unpaid Leave",
  "verification": "http://springfieldfiles.com/albums/notes/0244.JPG"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the leave request"
    },
    "department_id": {
      "type": "number",
      "description": "The id of the team with which the leave request's shifts will be tagged"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who owns the leave request"
    },
    "reason": {
      "type": "string",
      "description": "The reason for the leave request - optional"
    },
    "leave_type": {
      "type": "string",
      "description": "The type of leave request"
    },
    "hours": {
      "type": "number",
      "description": "The number of workable hours the leave request spans"
    },
    "start": {
      "type": "string",
      "description": "The start date for the leave request"
    },
    "finish": {
      "type": "string",
      "description": "The end date for the leave request"
    },
    "start_time": {
      "type": "string",
      "description": "The start time for a leave request event"
    },
    "finish_time": {
      "type": "string",
      "description": "The end time for a leave request event"
    },
    "status": {
      "type": "string",
      "description": "The status for the leave request. One of ['pending', 'approved', 'rejected']"
    },
    "multitagging": {
      "type": "string",
      "description": "Determines whether shifts on the leave request can be tagged differently."
    },
    "all_day": {
      "type": "string",
      "description": "Useful for all day leave requests."
    },
    "daily_breakdown": {},
    "fallback_leave_type": {
      "type": "string"
    },
    "verification": {
      "type": "string"
    },
    "": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string"
        },
        "hours": {
          "type": "number"
        },
        "all_day": {
          "type": "boolean"
        },
        "start_time": {
          "type": "string"
        },
        "finish_time": {
          "type": "string"
        }
      },
      "required": [
        "date",
        "all_day",
        "start_time",
        "finish_time"
      ]
    }
  },
  "required": [
    "id",
    "user_id",
    "leave_type",
    "hours",
    "start",
    "finish",
    "status"
  ]
}

Create Leave Request
POST/api/v2/leave

Note that a status for a new Leave Request is required. Managers can create approved leave requests for their staff, and themselves if permitted by the organisation settings. Admins can create approved leave requests for all staff. Employees may only create pending leave requests. The server will respond with a 400 when a user creates a leave request violating the above requirements.

Leave request status must be one of: “pending”, “approved”, “rejected”.

When a leave request is created with status “approved”, a Shift will be created for each day the leave request spans, and will be attached to the leave request. If a department_id is passed, these shifts will be categorised with the team corresponding to the department_id. Passing a department_id will have no consequence if the leave request status is “pending” or “rejected”. Note that the department_id will not be returned by the API, since technically it is a property of the shift, not of the leave request.

If you are building a user interface for the creation of leave requests, you might like to use the default hours endpoint to get recommendations for the hours field as the user chooses their dates.

You can attach a file when creating a leave request using the file_id parameter. See the temporary files endpoint for more information. The file should be a JPEG, PNG, GIF, or PDF.

This method requires the leave scope (see Scopes for more information).

New: time fields, and all_day boolean added to leave. Time fields allow leave to apply to a portion of a day, instead of a whole day. The date part of the time fields is not to be used and when returned from the API will always use the ruby default date of 2000-01-01.


Leave Request

GET https://my.tanda.co/api/v2/leave/666
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 666,
  "department_id": 808,
  "user_id": 123456,
  "reason": "Terribly Sick",
  "leave_type": "Personal/Carer's Leave",
  "hours": 7.6,
  "start": "2016-04-01",
  "finish": "2016-04-01",
  "start_time": "2000-01-01T09:30:00+10:00",
  "finish_time": "2000-01-01T05:30:00+10:00",
  "status": "pending",
  "multitagging": "false",
  "all_day": true,
  "daily_breakdown": {
    "2016-04-01": {},
    "hours": 7.6,
    "all_day": true,
    "start_time": "2016-04-01T09:30:00+1000",
    "finish_time": "2016-04-01T17:30:00+1000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the leave request"
    },
    "department_id": {
      "type": "number",
      "description": "The id of the team with which the leave request's shifts will be tagged"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who owns the leave request"
    },
    "reason": {
      "type": "string",
      "description": "The reason for the leave request - optional"
    },
    "leave_type": {
      "type": "string",
      "description": "The type of leave request"
    },
    "hours": {
      "type": "number",
      "description": "The number of workable hours the leave request spans"
    },
    "start": {
      "type": "string",
      "description": "The start date for the leave request"
    },
    "finish": {
      "type": "string",
      "description": "The end date for the leave request"
    },
    "start_time": {
      "type": "string",
      "description": "The start time for a leave request event"
    },
    "finish_time": {
      "type": "string",
      "description": "The end time for a leave request event"
    },
    "status": {
      "type": "string",
      "description": "The status for the leave request. One of ['pending', 'approved', 'rejected']"
    },
    "multitagging": {
      "type": "string",
      "description": "Determines whether shifts on the leave request can be tagged differently."
    },
    "all_day": {
      "type": "boolean",
      "description": "Useful for all day leave requests."
    },
    "daily_breakdown": {
      "type": "object",
      "properties": {
        "2016-04-01": {
          "type": "object",
          "properties": {}
        },
        "hours": {
          "type": "number"
        },
        "all_day": {
          "type": "boolean"
        },
        "start_time": {
          "type": "string"
        },
        "finish_time": {
          "type": "string"
        }
      },
      "required": [
        "all_day",
        "start_time",
        "finish_time"
      ]
    }
  },
  "required": [
    "id",
    "user_id",
    "leave_type",
    "hours",
    "start",
    "finish",
    "status"
  ]
}

Get Leave Request
GET/api/v2/leave/{id}

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 666

The id of the leave to lookup


PUT https://my.tanda.co/api/v2/leave/666
RequestsUpdate Leave
Headers
Content-Type: application/json
Body
{
  "reason": "Really Really Sick",
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 666,
  "department_id": 808,
  "user_id": 123456,
  "reason": "Really Really Sick",
  "leave_type": "Personal/Carer's Leave",
  "hours": 7.6,
  "start": "2016-04-01",
  "finish": "2016-04-01",
  "start_time": "2000-01-01T09:30:00+10:00",
  "finish_time": "2000-01-01T05:30:00+10:00",
  "status": "pending",
  "multitagging": "false",
  "all_day": true,
  "daily_breakdown": {
    "2016-04-01": {},
    "hours": 7.6,
    "all_day": true,
    "start_time": "2016-04-01T09:30:00+1000",
    "finish_time": "2016-04-01T17:30:00+1000"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the leave request"
    },
    "department_id": {
      "type": "number",
      "description": "The id of the team with which the leave request's shifts will be tagged"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who owns the leave request"
    },
    "reason": {
      "type": "string",
      "description": "The reason for the leave request - optional"
    },
    "leave_type": {
      "type": "string",
      "description": "The type of leave request"
    },
    "hours": {
      "type": "number",
      "description": "The number of workable hours the leave request spans"
    },
    "start": {
      "type": "string",
      "description": "The start date for the leave request"
    },
    "finish": {
      "type": "string",
      "description": "The end date for the leave request"
    },
    "start_time": {
      "type": "string",
      "description": "The start time for a leave request event"
    },
    "finish_time": {
      "type": "string",
      "description": "The end time for a leave request event"
    },
    "status": {
      "type": "string",
      "description": "The status for the leave request. One of ['pending', 'approved', 'rejected']"
    },
    "multitagging": {
      "type": "string",
      "description": "Determines whether shifts on the leave request can be tagged differently."
    },
    "all_day": {
      "type": "boolean",
      "description": "Useful for all day leave requests."
    },
    "daily_breakdown": {
      "type": "object",
      "properties": {
        "2016-04-01": {
          "type": "object",
          "properties": {}
        },
        "hours": {
          "type": "number"
        },
        "all_day": {
          "type": "boolean"
        },
        "start_time": {
          "type": "string"
        },
        "finish_time": {
          "type": "string"
        }
      },
      "required": [
        "all_day",
        "start_time",
        "finish_time"
      ]
    }
  },
  "required": [
    "id",
    "user_id",
    "leave_type",
    "hours",
    "start",
    "finish",
    "status"
  ]
}

Update Leave Request
PUT/api/v2/leave/{id}

This method requires the leave scope (see Scopes for more information).

Employees cannot update a leave request, with the exception of rejecting their own pending leave request.

URI Parameters
HideShow
id
number (required) Example: 666

The id of the leave to update


Leave Types

GET https://my.tanda.co/api/v2/leave/types_for/123456
Responses200
Headers
Content-Type: application/json
Body
[
  "Annual Leave",
  "Personal/Carer's Leave",
  "Public Holiday (Paid/Not Worked)"
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Leave Types for User
GET/api/v2/leave/types_for/{user_id}

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
user_id
number (required) Example: 123456

The id of the user to lookup leave types for


Leave Types With Details

GET https://my.tanda.co/api/v2/leave/types_with_details_for/123456
Responses200
Headers
Content-Type: application/json
Body
[
{
name: "Annual Leave",
prevent_negative: true,
default_fallback_leave_type_name: "Unpaid Leave"
},
{
name: "Unpaid Leave",
prevent_negative: false,
default_fallback_leave_type_name: nil
}
]

Get Leave Types with details for User
GET/api/v2/leave/types_with_details_for/{user_id}

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
user_id
number (required) Example: 123456

The id of the user to lookup leave types for


Leave Request Versions

GET https://my.tanda.co/api/v2/leave/666/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"Leave\"",
    "changes": [
      {
        "field": "status",
        "previous": "pending",
        "updated": "approved"
      },
      {
        "field": "reason",
        "previous": "Holiday",
        "updated": "Terribly Sick"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Leave Request Versions
GET/api/v2/leave/{id}/versions

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 666

The id of the leave request

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified leave request versions


Default Leave Hours

GET https://my.tanda.co/api/v2/leave/hours_between?user_id=123456&start=2016-03-15&finish=2016-03-17&leave_type=Annual Leave
Responses200
Headers
Content-Type: application/json
Body
{
  "hours": "22.8",
}

Get Default Hours for a Leave Request
GET/api/v2/leave/hours_between{?user_id,start,finish,leave_type}

Use this endpoint to get a recommendation for the number of hours of leave someone should take based on the given dates. This will take into account public holidays and weekends, and the default leave hours setting in an account. For example, if given a date range of 5 days, of which 1 is a weekend and 1 is a holiday, and with a default leave hours setting of 7.6, the endpoint will return 22.8 hours.

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
user_id
number (required) Example: 123456

The id of the user

start
string (required) Example: 2016-03-15

Start date of leave request

finish
string (required) Example: 2016-03-17

Finish date of leave request

leave_type
string (optional) Example: Annual Leave

The leave type


Leave Balances

Leave balances denote how much leave (of each type) someone has accrued.

Leave balance interactions require the same permissions as leave requests.

Leave Balance List

GET https://my.tanda.co/api/v2/leave_balances?user_ids=1,2,666
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 666,
    "user_id": 123456,
    "leave_type": "Annual Leave",
    "hours": 4,
    "should_accrue": false
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Leave Balances
GET/api/v2/leave_balances{?user_ids}

Lookup leave balances for one or more user_ids.

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
user_ids
string (optional) Example: 1,2,666

Comma separated list of user ids to lookup leave balances for

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified leave balances


POST https://my.tanda.co/api/v2/leave_balances
RequestsCreate Leave BalanceCreate multiple Leave Balances
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "leave_type": "Annual Leave",
  "hours": 18
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 666,
  "user_id": 123456,
  "leave_type": "Annual Leave",
  "hours": 18,
  "should_accrue": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the leave balance"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who owns the leave balance"
    },
    "leave_type": {
      "type": "string",
      "description": "The type of leave"
    },
    "hours": {
      "type": "number",
      "description": "The number of hours of leave accrued"
    },
    "should_accrue": {
      "type": "boolean",
      "description": "If true, this leave balance will accrue in Tanda automatically. If false, you should keep it up to date. Default is false."
    }
  },
  "required": [
    "id",
    "user_id",
    "leave_type",
    "hours"
  ]
}
Headers
Content-Type: application/json
Body
{
  "balances": [
    {
      "user_id": 123456,
      "leave_type": "Annual Leave",
      "hours": 18
    },
    {
      "user_id": 654321,
      "leave_type": "Sick Leave",
      "hours": 22
    }
  ]
}
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "user_id": 123456,
    "hours": 18,
    "leave_type": "Annual Leave"
  },
  {
    "user_id": 654321,
    "hours": 22,
    "leave_type": "Sick Leave"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Create Leave Balance
POST/api/v2/leave_balances

Use the Leave Types For User call to find accessible leave types for your user.

This method requires the leave scope (see Scopes for more information).


Leave Balance

GET https://my.tanda.co/api/v2/leave_balances/666
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 666,
  "user_id": 123456,
  "leave_type": "Annual Leave",
  "hours": 4,
  "should_accrue": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the leave balance"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who owns the leave balance"
    },
    "leave_type": {
      "type": "string",
      "description": "The type of leave"
    },
    "hours": {
      "type": "number",
      "description": "The number of hours of leave accrued"
    },
    "should_accrue": {
      "type": "boolean",
      "description": "If true, this leave balance will accrue in Tanda automatically. If false, you should keep it up to date. Default is false."
    }
  },
  "required": [
    "id",
    "user_id",
    "leave_type",
    "hours"
  ]
}

Get Leave Balance
GET/api/v2/leave_balances/{id}

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 666

The ID of the leave balance to lookup


PUT https://my.tanda.co/api/v2/leave_balances/666
RequestsUpdate Leave
Headers
Content-Type: application/json
Body
{
  "hours": 22.5
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 666,
  "user_id": 123456,
  "leave_type": "Annual Leave",
  "hours": 22.5,
  "should_accrue": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the leave balance"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who owns the leave balance"
    },
    "leave_type": {
      "type": "string",
      "description": "The type of leave"
    },
    "hours": {
      "type": "number",
      "description": "The number of hours of leave accrued"
    },
    "should_accrue": {
      "type": "boolean",
      "description": "If true, this leave balance will accrue in Tanda automatically. If false, you should keep it up to date. Default is false."
    }
  },
  "required": [
    "id",
    "user_id",
    "leave_type",
    "hours"
  ]
}

Update Leave Balance with ID
PUT/api/v2/leave_balances/{id}

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 666

The ID of the leave balance to update


Update Leave Balance with User ID

PUT https://my.tanda.co/api/v2/leave_balances/user/123456
RequestsUpdate Leave Balance with User IDCreate multiple Leave Balances with User ID
Headers
Content-Type: application/json
Body
{
  "leave_type": "Annual Leave",
  "hours": 18,
  "should_accrue": false
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 666,
  "user_id": 123456,
  "leave_type": "Annual Leave",
  "hours": 18,
  "should_accrue": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the leave balance"
    },
    "user_id": {
      "type": "number",
      "description": "The id of the user who owns the leave balance"
    },
    "leave_type": {
      "type": "string",
      "description": "The type of leave"
    },
    "hours": {
      "type": "number",
      "description": "The number of hours of leave accrued"
    },
    "should_accrue": {
      "type": "boolean",
      "description": "If true, this leave balance will accrue in Tanda automatically. If false, you should keep it up to date. Default is false."
    }
  },
  "required": [
    "id",
    "user_id",
    "leave_type",
    "hours"
  ]
}
Headers
Content-Type: application/json
Body
{
  "balances": [
    {
      "leave_type": "Annual Leave",
      "hours": 18
    },
    {
      "leave_type": "Sick Leave",
      "hours": 22
    }
  ]
}
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "hours": 18,
    "leave_type": "Annual Leave"
  },
  {
    "hours": 22,
    "leave_type": "Sick Leave"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Update Leave Balance with User ID
PUT/api/v2/leave_balances/user/{user_id}

This method requires the leave scope (see Scopes for more information).

URI Parameters
HideShow
user_id
number (required) Example: 123456

The ID of the user whose leave balance you want to update


Predict Leave Balances

POST https://my.tanda.co/api/v2/leave_balances/654321/predict
RequestsPredict Leave Balance
Headers
Content-Type: application/json
Body
{
  "date": "2019-12-24"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "prediction": 22.5
}

Predict Leave Balance
POST/api/v2/leave_balances/{id}/predict

This endpoint takes a leave balance ID and a date, and predicts what the leave balance will be on the given date. The date must be in the future.

This method requires the leave scope (see Scopes for more information).

You should make it clear when displaying the result that this is a prediction. There is no guarantee the user’s actual leave balance will match this when the date comes.

URI Parameters
HideShow
id
number (required) Example: 654321

The ID of the leave balance


Unavailability

Unavailability is an employee’s way to notify the person building the roster that they are not going to be available during a certain time period. Unavailability is most used by casual staff or employees with flexible hours.

For specifying times when an employee formally took time off, or to request time off (most often for part time and full time employees), please see Leave.

If the organisation has unavailability enabled, then all employees can CRUD unavailability about themselves. Roster managers, and admins can CRUD unavailability for everyone and department managers can CRUD unavailability for users they can manage.

Unavailability List

GET https://my.tanda.co/api/v2/unavailability?ids=1,2,42&from=2016-03-15&to=2016-04-05&user_ids=1,2,123456
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 42,
    "user_id": 123456,
    "title": "Doing errr... something",
    "start": 1459814400,
    "finish": 1459836000,
    "repeating": false,
    "repeating_info": null,
    "all_day": false
  }
]

Get Unavailabilities
GET/api/v2/unavailability{?ids,from,to,user_ids}

Lookup multiple leave requests in a single request.

You must specify either both from and to or ids (you can specify both if you want too). user_ids can be specified in any case.

This method requires the unavailability scope (see Scopes for more information).

You will only be able to query up to 366 days when specifying from and to.

URI Parameters
HideShow
ids
string (optional) Example: 1,2,42

Comma separated list of unavailability ids to lookup

from
string (optional) Example: 2016-03-15

From date to lookup unavailability in

to
string (optional) Example: 2016-04-05

To date to lookup unavailability in

user_ids
string (optional) Example: 1,2,123456

Comma separated list of user ids to lookup unavailability for

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified unavailability


POST https://my.tanda.co/api/v2/unavailability
RequestsCreate UnavailabilityCreate all day UnavailabilityCreate repeating Unavailability
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "title": "Buying a unicycle",
  "start": 1459375200,
  "finish": 1459382400,
  "repeating": false
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 106092,
  "user_id": 123456,
  "title": "Buying a unicycle",
  "start": 1459375200,
  "finish": 1459382400,
  "repeating": false,
  "repeating_info": null,
  "all_day": false
}
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "title": "Buying a unicycle",
  "date_from": "2017-05-15",
  "date_to": "2017-05-15",
  "repeating": false,
  "all_day": true
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 106092,
  "user_id": 123456,
  "title": "Buying a unicycle",
  "start": 1494770400,
  "finish": 1494856800,
  "repeating": false,
  "repeating_info": null,
  "all_day": true
}
Headers
Content-Type: application/json
Body
{
  "user_id": 123456,
  "title": "Learning to ride my unicycle",
  "start": 1459382400,
  "finish": 1459389600,
  "repeating": true,
  "repeating_info": {
    "interval": "day",
    "occurrences": 3
  }
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 106093,
  "user_id": 123456,
  "title": "Learning to ride my unicycle",
  "start": 1459382400,
  "finish": 1459389600,
  "repeating": true,
  "repeating_info": {
    "interval": "day",
    "occurrences": 3,
    "start": 1459382400,
    "ids": [
      106093,
      106094,
      106095
    ]
  },
  "all_day": false
}

Create Unavailability
POST/api/v2/unavailability

This method requires the unavailability scope (see Scopes for more information).

There’s two ways to create unavailabilities: using dates (for all_day events), or using times (for events that don’t go all day).

Regardless of which method you use, you should use the unavailability minimum date from the Settings endpoint to validate your your dates or times locally. If you pass a time that is earlier than the minimum date (in the given user’s time zone), the request will fail.

To create an event using dates, use these parameters. Note that date_from and date_to are inclusive. If you have an unavailability that only goes for one day, they should have the same value. If you have an unavailability that goes for two full days, they should be one day apart, etc.

  • all_day: true

  • user_id - integer

  • title - string

  • repeating - boolean

  • date_from - string, eg “2016-03-15”

  • date_to - string, eg “2016-03-16” - In this example, you will be unavailable on the 15th AND the 16th of March

To create an event using times, use these parameters:

  • all_day: false

  • user_id - integer

  • title - string

  • repeating - boolean

  • start - integer, eg 1459375200

  • finish - integer, eg 1459382400 - In this example, you will be unavailable from 2016-03-30 22:00:00 UTC to 2016-03-31 00:00:00 UTC

You can also use the repeating param to tell an event to repeat. For example:

  • all_day: false

  • user_id - integer

  • title - string

  • repeating - true

  • repeating_info: {"interval": "week","occurrences": 4}

  • start - integer, eg 1494838800

  • finish - integer, eg 1494867600 - In this example, you will be unavailable from 2017-05-15 09:00:00 UTC to 2017-05-15 17:00:00 UTC, and at the same times for the next 3 weeks after (4 weeks total).

There’s more examples in the sidebar. The examples are based on a user in the AEST+10 time zone.


Repeating Unavailability List

GET https://my.tanda.co/api/v2/unavailability/repeating_for/43
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 43,
    "user_id": 123456,
    "title": "Doing errr... something else",
    "start": 1459994400,
    "finish": 1460001600,
    "repeating": true,
    "repeating_info": {
      "interval": "week",
      "occurrences": 2,
      "start": 1459994400,
      "ids": [
        43,
        44
      ]
    }
  },
  {
    "id": 44,
    "user_id": 123456,
    "title": "Doing errr... something else",
    "start": 1460599200,
    "finish": 1460606400,
    "repeating": true,
    "repeating_info": {
      "interval": "week",
      "occurrences": 2,
      "start": 1459994400,
      "ids": [
        43,
        44
      ]
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Repeating Unavailabilities
GET/api/v2/unavailability/repeating_for/{id}

This method requires the unavailability scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 43

The id of the unavailability to get repeating information for


Unavailability

GET https://my.tanda.co/api/v2/unavailability/42
RequestsNon-repeating unavailabilityRepeating unavailability
This response has no content.
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 42,
  "user_id": 123456,
  "title": "Doing errr... something",
  "start": 1459814400,
  "finish": 1459836000,
  "repeating": false,
  "repeating_info": null,
  "all_day": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the unavailability"
    },
    "user_id": {
      "type": "number",
      "description": "The user that the unavailability applies for"
    },
    "title": {
      "type": "string",
      "description": "The reason for the unavailability"
    },
    "start": {
      "type": "number",
      "description": "The start time for the unavailability"
    },
    "finish": {
      "type": "number",
      "description": "The end time for the unavailability"
    },
    "repeating": {
      "type": "boolean",
      "description": "Whether this is part of a set of repeating unavailabilities"
    },
    "repeating_info": {
      "type": "object",
      "properties": {
        "interval": {
          "type": "string",
          "description": "The time between repeating events"
        },
        "occurrences": {
          "type": "number",
          "description": "The number of unavailabilities in the repeating set of unavailabilities"
        },
        "start": {
          "type": "number",
          "description": "The start of the first unavailability in the repeating set"
        },
        "ids": {
          "type": "array",
          "description": "The ids of the unavailabilities that are part of the this repeating set"
        }
      },
      "required": [
        "interval",
        "occurrences",
        "start",
        "ids"
      ],
      "description": "Info about the unavailabilities that are part of this repeating set of unavailabilities (if the unavailability is repeating)"
    }
  },
  "required": [
    "id",
    "user_id",
    "start",
    "finish",
    "repeating"
  ]
}
This response has no content.
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 43,
  "user_id": 123456,
  "title": "Doing errr... something else",
  "start": 1459994400,
  "finish": 1460001600,
  "repeating": true,
  "repeating_info": {
    "interval": "week",
    "occurrences": 2,
    "start": 1459994400,
    "ids": [
      43,
      44
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the unavailability"
    },
    "user_id": {
      "type": "number",
      "description": "The user that the unavailability applies for"
    },
    "title": {
      "type": "string",
      "description": "The reason for the unavailability"
    },
    "start": {
      "type": "number",
      "description": "The start time for the unavailability"
    },
    "finish": {
      "type": "number",
      "description": "The end time for the unavailability"
    },
    "repeating": {
      "type": "boolean",
      "description": "Whether this is part of a set of repeating unavailabilities"
    },
    "repeating_info": {
      "type": "object",
      "properties": {
        "interval": {
          "type": "string",
          "description": "The time between repeating events"
        },
        "occurrences": {
          "type": "number",
          "description": "The number of unavailabilities in the repeating set of unavailabilities"
        },
        "start": {
          "type": "number",
          "description": "The start of the first unavailability in the repeating set"
        },
        "ids": {
          "type": "array",
          "description": "The ids of the unavailabilities that are part of the this repeating set"
        }
      },
      "required": [
        "interval",
        "occurrences",
        "start",
        "ids"
      ],
      "description": "Info about the unavailabilities that are part of this repeating set of unavailabilities (if the unavailability is repeating)"
    }
  },
  "required": [
    "id",
    "user_id",
    "start",
    "finish",
    "repeating"
  ]
}

Get Unavailability
GET/api/v2/unavailability/{id}

This method requires the unavailability scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 42

The id of unavailability to lookup


PUT https://my.tanda.co/api/v2/unavailability/42
RequestsUpdate Unavailability
Headers
Content-Type: application/json
Body
{
  "title": "Helping Grandma"
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 42,
  "user_id": 123456,
  "title": "Helping Grandma",
  "start": 1459814400,
  "finish": 1459836000,
  "repeating": false,
  "repeating_info": null,
  "all_day": false
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the unavailability"
    },
    "user_id": {
      "type": "number",
      "description": "The user that the unavailability applies for"
    },
    "title": {
      "type": "string",
      "description": "The reason for the unavailability"
    },
    "start": {
      "type": "number",
      "description": "The start time for the unavailability"
    },
    "finish": {
      "type": "number",
      "description": "The end time for the unavailability"
    },
    "repeating": {
      "type": "boolean",
      "description": "Whether this is part of a set of repeating unavailabilities"
    },
    "repeating_info": {
      "type": "object",
      "properties": {
        "interval": {
          "type": "string",
          "description": "The time between repeating events"
        },
        "occurrences": {
          "type": "number",
          "description": "The number of unavailabilities in the repeating set of unavailabilities"
        },
        "start": {
          "type": "number",
          "description": "The start of the first unavailability in the repeating set"
        },
        "ids": {
          "type": "array",
          "description": "The ids of the unavailabilities that are part of the this repeating set"
        }
      },
      "required": [
        "interval",
        "occurrences",
        "start",
        "ids"
      ],
      "description": "Info about the unavailabilities that are part of this repeating set of unavailabilities (if the unavailability is repeating)"
    }
  },
  "required": [
    "id",
    "user_id",
    "start",
    "finish",
    "repeating"
  ]
}

Update Unavailability
PUT/api/v2/unavailability/{id}

Update the unavailability’s title (in the case of repeating unavailability, all of the event’s titles will be updated).

This method requires the unavailability scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 42

The id of unavailability to lookup


DELETE https://my.tanda.co/api/v2/unavailability/42
Responses200
Headers
Content-Type: application/json

Delete Unavailability
DELETE/api/v2/unavailability/{id}

This method requires the unavailability scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 42

The id of the leave to delete


Data Streams

Our user guide has more information on working with data streams through the API.

A data stream is a container for many Store Stats. The data stream specifies the origin of the data, an identifier for the origin (if any), and the interval of the data. All store stats added to a data stream should be totaled data for a time period equal to the data_interval.

Data streams themselves are nice for holding data, but they are made useful by joining them to other objects. See Data Stream Joins for more on how this works. The Data Streams endpoint provides some functionality for quickly creating joins, but you should use the Data Stream Joins endpoint if you need more control over their structure or additional attributes.

Team managers can read data streams that are joined to their team. General managers and payroll officers can read all data streams, and admins can create read and update all data streams.

Data Stream List

GET https://my.tanda.co/api/v2/datastreams
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 24,
    "name": "Reactor Revenue",
    "source": "generic",
    "data_interval": 900,
    "print_mode": "hidden",
    "roster_display_mode": "values"
  },
  {
    "id": 25,
    "name": "User Entered: Springfield Powerplant",
    "source": "user_entered",
    "data_interval": 86400,
    "print_mode": "hidden",
    "roster_display_mode": "values"
  },
  {
    "id": 26,
    "name": "Reactor Revenue (Retail Express)",
    "source": "retail_express",
    "section_identifier": "11223344",
    "data_interval": 900,
    "print_mode": "hidden",
    "roster_display_mode": "values"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Data Streams
GET/api/v2/datastreams

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified data streams


POST https://my.tanda.co/api/v2/datastreams
RequestsCreate Data Stream
Headers
Content-Type: application/json
Body
{
  "name": "My Special Data",
  "data_interval": 900
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1069,
  "name": "My Special Data",
  "source": "api",
  "data_interval": 900,
  "print_mode": "hidden",
  "roster_display_mode": "values"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the data stream"
    },
    "name": {
      "type": "string",
      "description": "The name of the data stream"
    },
    "source": {
      "type": "string",
      "description": "The data stream's source"
    },
    "data_interval": {
      "type": "number",
      "description": "The time between the data stream's store stats in seconds"
    },
    "print_mode": {
      "type": "string",
      "description": "Should the data stream be printed when printing a roster? Options: hidden, values, cumulative_sum"
    },
    "roster_display_mode": {
      "type": "string",
      "description": "Should the data stream be displayed on rosters? Options: hidden, values, cumulative_sum"
    }
  },
  "required": [
    "id",
    "name",
    "data_interval"
  ]
}

Create Data Stream
POST/api/v2/datastreams

You cannot create more than one data stream via the API with the same name. If you try to create a data stream with a name that already exists, that data stream will instead be updated and returned (effectively this will function as a PUT request).

The data interval must be either 86400, 3600, 1800, or 900. This corresponds to 1 day, 1 hour, 30 minutes, or 15 minutes.

This method requires the datastream scope (see Scopes for more information).


Data Stream

GET https://my.tanda.co/api/v2/datastreams/26
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 26,
  "name": "Reactor Revenue (Retail Express)",
  "source": "retail_express",
  "section_identifier": "11223344",
  "data_interval": 900,
  "print_mode": "hidden",
  "roster_display_mode": "values"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the data stream"
    },
    "name": {
      "type": "string",
      "description": "The name of the data stream"
    },
    "source": {
      "type": "string",
      "description": "The data stream's source"
    },
    "section_identifier": {
      "type": "string",
      "description": "A way to map to the external data provider"
    },
    "data_interval": {
      "type": "number",
      "description": "The time between the data stream's store stats in seconds"
    },
    "print_mode": {
      "type": "string",
      "description": "Should the data stream be printed when printing a roster? Options: hidden, values, cumulative_sum"
    },
    "roster_display_mode": {
      "type": "string",
      "description": "Should the data stream be displayed on rosters? Options: hidden, values, cumulative_sum"
    }
  },
  "required": [
    "id",
    "name",
    "source",
    "data_interval"
  ]
}

Get Data Stream
GET/api/v2/datastreams/{id}

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 26

The id of the data stream to lookup


PUT https://my.tanda.co/api/v2/datastreams/26
RequestsUpdate Data Stream
Headers
Content-Type: application/json
Body
{
  "name": "Foot Traffic!",
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1069,
  "name": "Foot Traffic!",
  "source": "api",
  "data_interval": 900,
  "print_mode": "hidden",
  "roster_display_mode": "values"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the data stream"
    },
    "name": {
      "type": "string",
      "description": "The name of the data stream"
    },
    "source": {
      "type": "string",
      "description": "The data stream's source"
    },
    "data_interval": {
      "type": "number",
      "description": "The time between the data stream's store stats in seconds"
    },
    "print_mode": {
      "type": "string",
      "description": "Should the data stream be printed when printing a roster? Options: hidden, values, cumulative_sum"
    },
    "roster_display_mode": {
      "type": "string",
      "description": "Should the data stream be displayed on rosters? Options: hidden, values, cumulative_sum"
    }
  },
  "required": [
    "id",
    "name",
    "data_interval"
  ]
}

Update Data Stream
PUT/api/v2/datastreams/{id}

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 26

The id of the data stream to update


DELETE https://my.tanda.co/api/v2/datastreams/26
Responses202
Headers
Content-Type: application/json

Delete Data Stream
DELETE/api/v2/datastreams/{id}

Only data streams created via the API can be deleted via the API. This also deletes all associated Data Stream Joins and Store Stats, and cannot be reversed.

The data stream will be scheduled for deletion, but may not be removed immediately. You can GET the data stream to check if it’s been deleted.

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 26

The id of the data stream


Data Stream Versions

GET https://my.tanda.co/api/v2/datastreams/26/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name": "API v2"
    },
    "item_id": 1235435,
    "item_type": "\"Datastream\"",
    "changes": [
      {
        "field": "data_interval",
        "previous": 900,
        "updated": 1800
      },
      {
        "field": "name",
        "previous": "Employee Superfund",
        "updated": "Reactor Revenue"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Data Stream Versions
GET/api/v2/datastreams/{id}/versions

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 26

The id of the data stream

updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified data stream versions


Data Stream Joins

Our user guide has more information on working with data streams through the API.

Data Stream Joins connect Data Streams to the object which owns the stream’s data. For example, data from a stream may be relate to a Team, Location, or to the Organisation itself.

If a data stream is joined to the organisation, it will show its store stats in the context of the whole organisation. Similarly, if it is joined to one or many teams, it will show its store stats when looking at stats for each of those teams. Data streams that are joined to a team, but not the organisation, will show their store stats in the context of the teams, but will not show when looking at the organisation as a whole (this is often useful for team specific stats).

Data Stream Joins also connect a single ‘stat_type’ from a data stream. You should specify which stat_type you want to join from the data stream to the Organisation, Location, or Department. For example, your data stream might have both ‘sales’ data and ‘transaction’ data in it. If you want to attach sales data to a team, then you must specify the stat_type_id for sales in the payload.

If you do not specify a stat_type, one will be inferred by what kind of data your datastream has. Eg if your data stream only has sales data in it, the join will automatically be given the sales stat type.

Only admins can manage data stream joins.

As well as managing this relationship, a Data Stream Join can also be given a rostering ratio, which is used to calculate how many staff should be rostered into the join’s object (the “streamable”) based on stream data. For example, a data stream might have a total value of 30 (values themselves are provided using Store Stats) for a half hour period, and the data stream’s join to a team might have a rostering ratio of 8. In this case Tanda would recommend that 4 staff be rostered for that half hour period.

Data Stream Join List

GET https://my.tanda.co/api/v2/datastreamjoins
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 162,
    "data_stream_id": 24,
    "data_streamable_id": 111,
    "data_streamable_type": "Department",
    "rostering_ratio": 1.175,
    "head_count_map": "\"1,2.5,5\""
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Data Stream Joins
GET/api/v2/datastreamjoins

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified data stream joins


POST https://my.tanda.co/api/v2/datastreamjoins
RequestsCreate Joined to TeamCreate Joined to Organisation
Headers
Content-Type: application/json
Body
{
  "data_stream_id": 24,
  "data_streamable_id": 111,
  "data_streamable_type": "Department",
  "rostering_ratio": 2.5,
  "stat_type_id": 123
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 162,
  "data_stream_id": 24,
  "data_streamable_id": 111,
  "data_streamable_type": "Department",
  "rostering_ratio": 2.5,
  "head_count_map": "\"1,2.5,5\"",
  "stat_type_id": 123
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the data stream join"
    },
    "data_stream_id": {
      "type": "number",
      "description": "The id of the data stream join's data stream"
    },
    "data_streamable_id": {
      "type": "number",
      "description": "The id of the data stream join's data streamable (location or team)"
    },
    "data_streamable_type": {
      "type": "string",
      "description": "The type of the data stream join's data streamable (\"Location\", \"Department\", or \"Organisation\")"
    },
    "rostering_ratio": {
      "type": "number",
      "description": "The ratio of units to staff required when rostering to this data stream"
    },
    "head_count_map": {
      "type": "string",
      "description": "The exact amounts of demand each team size can handle. This can be used to describe an 'economies of scale'"
    },
    "stat_type_id": {
      "type": "number"
    }
  },
  "required": [
    "id",
    "data_stream_id",
    "data_streamable_id",
    "data_streamable_type"
  ]
}
Headers
Content-Type: application/json
Body
{
  "data_stream_id": 24,
  "data_streamable_type": "Organisation",
  "stat_type_id": 123
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 162,
  "data_stream_id": 24,
  "data_streamable_id": null,
  "data_streamable_type": "Organisation",
  "rostering_ratio": 1.175,
  "stat_type_id": 123
}

Create Data Stream Join
POST/api/v2/datastreamjoins

This method requires the datastream scope (see Scopes for more information).


Data Stream Join

GET https://my.tanda.co/api/v2/datastreamjoins/162
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 162,
  "data_stream_id": 24,
  "data_streamable_id": 111,
  "data_streamable_type": "Department",
  "rostering_ratio": 1.175,
  "head_count_map": "\"1,2.5,5\""
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the data stream join"
    },
    "data_stream_id": {
      "type": "number",
      "description": "The id of the data stream join's data stream"
    },
    "data_streamable_id": {
      "type": "number",
      "description": "The id of the data stream join's data streamable (location or team)"
    },
    "data_streamable_type": {
      "type": "string",
      "description": "The type of the data stream join's data streamable (\"Location\", \"Department\", or \"Organisation\")"
    },
    "rostering_ratio": {
      "type": "number",
      "description": "The ratio of units to staff required when rostering to this data stream"
    },
    "head_count_map": {
      "type": "string",
      "description": "The exact amounts of demand each team size can handle. This can be used to describe an 'economies of scale'"
    }
  },
  "required": [
    "id",
    "data_stream_id",
    "data_streamable_id",
    "data_streamable_type"
  ]
}

Get Data Stream Join
GET/api/v2/datastreamjoins/{id}

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 162

The id of the data stream join to lookup


PUT https://my.tanda.co/api/v2/datastreamjoins/162
RequestsUpdate Data Stream Join
Headers
Content-Type: application/json
Body
{
  "rostering_ratio": 1.5
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 162,
  "data_stream_id": 24,
  "data_streamable_id": 111,
  "data_streamable_type": "Department",
  "rostering_ratio": 1.5,
  "head_count_map": "\"1,2.5,5\""
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the data stream join"
    },
    "data_stream_id": {
      "type": "number",
      "description": "The id of the data stream join's data stream"
    },
    "data_streamable_id": {
      "type": "number",
      "description": "The id of the data stream join's data streamable (location or team)"
    },
    "data_streamable_type": {
      "type": "string",
      "description": "The type of the data stream join's data streamable (\"Location\", \"Department\", or \"Organisation\")"
    },
    "rostering_ratio": {
      "type": "number",
      "description": "The ratio of units to staff required when rostering to this data stream"
    },
    "head_count_map": {
      "type": "string",
      "description": "The exact amounts of demand each team size can handle. This can be used to describe an 'economies of scale'"
    }
  },
  "required": [
    "id",
    "data_stream_id",
    "data_streamable_id",
    "data_streamable_type"
  ]
}

Update Data Stream Join
PUT/api/v2/datastreamjoins/{id}

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 162

The id of the data stream join to update


DELETE https://my.tanda.co/api/v2/datastreamjoins/162
Responses200
Headers
Content-Type: application/json

Delete Data Stream Join
DELETE/api/v2/datastreamjoins/{id}

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 162

The id of the data stream join to delete


Store Stats

Our user guide has more information on working with data streams through the API.

Store stats are the individual statistics that belong to a Data Stream. All store stats for a data stream should be totaled data for a time period equal to the data stream’s data_interval, starting at the store stat’s time.

Only store stats where the type parameter is equal to “sales” will be displayed on the weekly planner on the dashboard. You’re able to store a wide variety of stats in Tanda, and differentiate them using the type parameter, but be aware of this special case.

Store stats can be read by a user, if that user is able to read the data stream that the store stat belongs to.

Only admins can create store stats. They are able to do this for any data stream.

Store Stats for Datastream

GET https://my.tanda.co/api/v2/storestats/for_datastream/26/?from=2016-03-01&to=2016-03-20&type=sales
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 3518,
    "time": 1459295100,
    "stat": 3.5,
    "type": "sales"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Store Stats for Datastream
GET/api/v2/storestats/for_datastream/{datastream_id}/{?from,to,type}

This method requires the datastream scope (see Scopes for more information).

You will only be able to query up to 31 days using the from and to parameters.

URI Parameters
HideShow
datastream_id
number (required) Example: 26

The id of the data stream to lookup store stats for

from
string (required) Example: 2016-03-01

The start date of the range to lookup store stats in

to
string (required) Example: 2016-03-20

The id of the data stream to lookup store stats for

type
string (optional) Example: sales

The type of store stats to lookup (if not specified, all stats are returned)


Create Store Stats for Datastream

POST https://my.tanda.co/api/v2/storestats/for_datastream/27
RequestsCreate single Store StatCreate multiple Store Stats
Headers
Content-Type: application/json
Body
{
  "time": 1459296900,
  "stat": 3.5,
  "type": "sales"
}
Responses201
Headers
Content-Type: application/json
Body
{
  "id": 12231,
  "time": 1459296900,
  "stat": 3.5,
  "type": "sales"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the stat"
    },
    "time": {
      "type": "number",
      "description": "The time of the stat"
    },
    "stat": {
      "type": "number",
      "description": "The value of the stat"
    },
    "type": {
      "type": "string",
      "description": "The type of the stat"
    }
  },
  "required": [
    "id",
    "time",
    "stat",
    "type"
  ]
}
Headers
Content-Type: application/json
Body
{
  "stats": [
    {
      "time": 1459296900,
      "stat": 3.5,
      "type": "sales"
    },
    {
      "time": 1459296900,
      "stat": 1,
      "type": "transactions"
    },
    {
      "time": 1459297800,
      "stat": 20.1,
      "type": "sales"
    }
  ]
}
Responses201
Headers
Content-Type: application/json
Body
[
  {
    "id": 12231,
    "time": 1459296900,
    "stat": 3.5,
    "type": "sales"
  },
  {
    "id": 12232,
    "time": 1459296900,
    "stat": 1,
    "type": "transactions"
  },
  {
    "id": 12233,
    "time": 1459297800,
    "stat": 20.1,
    "type": "sales"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Create Store Stats for Datastream
POST/api/v2/storestats/for_datastream/{datastream_id}

Store stats can either be posted one at a time, or in bulk. When posting store stats in bulk, all the store stats must be for the same data stream.

To post store stats in bulk, simply represent them all in an array, under the stats key. Note that each combination of time and type must be unique - you must not send duplicate data.

{
  "stats": [
    {
      "time": 1459296900,
      "stat": 3.5,
      "type": "sales"
    },
    {
      "time": 1459297800,
      "stat": 1,
      "type": "transactions"
    }
  ]
}

Store stats will only be able to be created on data streams that were created using the API.

All existing store stats on the data stream within the newly posted store stats’ parameter range will be replaced with the newly posted store stats.

Please see the general Store Stat information above for an example.

This method requires the datastream scope (see Scopes for more information).

URI Parameters
HideShow
datastream_id
number (required) Example: 27

The id of the data stream to create store stats on


Deleting Store Stats

POST https://my.tanda.co/api/v2/storestats/for_datastream

Deleting Store Stats
POST/api/v2/storestats/for_datastream

To remove store stats generated through the API for a time period, you will need to make a POST, and provide store stats with a 0 as the stat for the start and end of that period.

For example, if you wanted to remove sales and transactions store stats for the period of 1459296900 to 1459383300 then posting the following data to the Create Store Stats endpoint would “delete” that data. This is becuase each post actually overrides existing store stat data for the period.

{
  "stats": [
    {
      "time": 1459296900,
      "stat": 0,
      "type": "sales"
    },
    {
      "time": 1459296900,
      "stat": 0,
      "type": "transactions"
    },
    {
      "time": 1459383300,
      "stat": 0,
      "type": "sales"
    },
    {
      "time": 1459383300,
      "stat": 0,
      "type": "transactions"
    }
  ]
}

Create Store Stats for multiple Datastreams

POST https://my.tanda.co/api/v2/storestats/for_datastream
RequestsCreate single Store StatCreate multiple Store Stats
Headers
Content-Type: application/json
Body
{
  "datastream_id": 123457,
  "time": 1459296900,
  "stat": 3.5,
  "type": "sales"
}
Responses201
Headers
Content-Type: application/json
Body
{
  "id": 12231,
  "time": 1459296900,
  "stat": 3.5,
  "type": "sales",
  "datastream_id": 123457
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the stat"
    },
    "time": {
      "type": "number",
      "description": "The time of the stat"
    },
    "stat": {
      "type": "number",
      "description": "The value of the stat"
    },
    "type": {
      "type": "string",
      "description": "The type of the stat"
    },
    "datastream_id": {
      "type": "number"
    }
  },
  "required": [
    "id",
    "time",
    "stat",
    "type"
  ]
}
Headers
Content-Type: application/json
Body
{
      "stats": [
        {
          "datastream_id": 123456,
          "time": 1459296900,
          "stat": 7.5,
          "type": "sales"
        },
        {
          "datastream_id": 123456,
          "time": 1459296900,
          "stat": 3,
          "type": "transactions"
        },
        {
          "datastream_id": 123457,
          "time": 1459297800,
          "stat": 3.5,
          "type": "sales"
        },
        {
          "datastream_id": 123457,
          "time": 1459297800,
          "stat": 1,
          "type": "transactions"
        }
        }
      ]
    }
Responses201
Headers
Content-Type: application/json
Body
[
  {
    "id": 12231,
    "datastream_id": 123456,
    "time": 1459296900,
    "stat": 7.5,
    "type": "sales"
  },
  {
    "id": 12232,
    "datastream_id": 123456,
    "time": 1459296900,
    "stat": 3,
    "type": "transactions"
  },
  {
    "id": 12233,
    "datastream_id": 123457,
    "time": 1459297800,
    "stat": 3.5,
    "type": "sales"
  },
  {
    "id": 12234,
    "datastream_id": 123457,
    "time": 1459297800,
    "stat": 1,
    "type": "transactions"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Create Store Stats for Multiple Datastreams
POST/api/v2/storestats/for_datastream

Store stats can either be posted one at a time, or in bulk. When posting store stats in bulk, all the store stats must be for the same data stream.

To post store stats in bulk, simply represent them all in an array, with the datastream_id included for each stat. Note that each combination of datastream_id, time and type must be unique - you must not send duplicate data.

{
  "stats": [
    {
      "datastream_id": 123456,
      "time": 1459296900,
      "stat": 7.5,
      "type": "sales"
    },
    {
      "datastream_id": 123456,
      "time": 1459297800,
      "stat": 3,
      "type": "transactions"
    }
    {
      "datastream_id": 123457,
      "time": 1459296900,
      "stat": 3.5,
      "type": "sales"
    },
    {
      "datastream_id": 123457,
      "time": 1459297800,
      "stat": 1,
      "type": "transactions"
    }
  ]
}

Store stats will only be able to be created on data streams that were created using the API.

All existing store stats on the data stream within the newly posted store stats’ parameter range will be replaced with the newly posted store stats.

Please see the general Store Stat information above for an example.


Devices

Devices are physical time clocks that are used by employees for clocking in and out, a device has many Clock Ins.

Admins and department managers can read devices, and admins can and update all devices.

Device List

GET https://my.tanda.co/api/v2/devices
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 1234,
    "location_id": 111,
    "nickname": "Reactor Timeclock",
    "returned": false,
    "last_heard_from": 1459296900,
    "dispatch_date": "2016-01-02"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Devices
GET/api/v2/devices

This method requires the device scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified devices


POST https://my.tanda.co/api/v2/devices
RequestsCreate new timeclock
Headers
Content-Type: application/json
Body
{
  "nickname": "Old Reactor Timeclock",
  "location_id": 111
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1234,
  "location_id": 111,
  "nickname": "Old Reactor Timeclock",
  "returned": false,
  "last_heard_from": 1459296900,
  "dispatch_date": "2016-01-02"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the device"
    },
    "location_id": {
      "type": "number",
      "description": "The ID of the time clock's [location](#locations)."
    },
    "nickname": {
      "type": "string",
      "description": "The nickname of the device. If not provided, the location's name is used."
    },
    "returned": {
      "type": "boolean",
      "description": "Whether the device has been returned"
    },
    "last_heard_from": {
      "type": "number",
      "description": "The time that the device last communicated with the Tanda server"
    },
    "dispatch_date": {
      "type": "string",
      "description": "The date that the device was sent out"
    }
  },
  "required": [
    "id",
    "nickname",
    "returned"
  ]
}

Create Device
POST/api/v2/devices

This method requires the device scope (see Scopes for more information).

Provide one or both of location_id and nickname when registering a time clock. If a location_id is provided, but a nickname isn’t, the location’s name is used as a nickname.

You can use the following attributes to store hardware information about the device: data_provider, mobile_number, sim_number, serial_number, imei, model.


Returned Device List

GET https://my.tanda.co/api/v2/devices/returned
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "id": 8403,
    "location_id": 111,
    "nickname": "Meltdown Reactor Timeclock",
    "returned": true,
    "return_date": "2016-03-02",
    "last_heard_from": 1456877652,
    "dispatch_date": "2015-10-12"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Get Returned Devices
GET/api/v2/devices/returned

This method requires the device scope (see Scopes for more information).

URI Parameters
HideShow
updated_after
number (optional) Example: 1451570400

Time filter to find recently created or modified returned devices


Device

GET https://my.tanda.co/api/v2/devices/1234
RequestsActive deviceReturned device
This response has no content.
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1234,
  "location_id": 111,
  "nickname": "Reactor Timeclock",
  "returned": false,
  "last_heard_from": 1459296900,
  "dispatch_date": "2016-01-02"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the device"
    },
    "location_id": {
      "type": "number",
      "description": "The ID of the time clock's [location](#locations)."
    },
    "nickname": {
      "type": "string",
      "description": "The nickname of the device. If not provided, the location's name is used."
    },
    "returned": {
      "type": "boolean",
      "description": "Whether the device has been returned"
    },
    "last_heard_from": {
      "type": "number",
      "description": "The time that the device last communicated with the Tanda server"
    },
    "dispatch_date": {
      "type": "string",
      "description": "The date that the device was sent out"
    }
  },
  "required": [
    "id",
    "nickname",
    "returned"
  ]
}
This response has no content.
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 8403,
  "location_id": 111,
  "nickname": "Meltdown Reactor Timeclock",
  "returned": true,
  "return_date": "2016-03-02",
  "last_heard_from": 1456877652,
  "dispatch_date": "2015-10-12"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the device"
    },
    "location_id": {
      "type": "number",
      "description": "The ID of the time clock's [location](#locations)."
    },
    "nickname": {
      "type": "string",
      "description": "The nickname of the device. If not provided, the location's name is used."
    },
    "returned": {
      "type": "boolean",
      "description": "Whether the device has been returned"
    },
    "return_date": {
      "type": "string",
      "description": "The date the device was returned"
    },
    "last_heard_from": {
      "type": "number",
      "description": "The time that the device last communicated with the Tanda server"
    },
    "dispatch_date": {
      "type": "string",
      "description": "The date that the device was sent out"
    }
  },
  "required": [
    "id",
    "nickname",
    "returned",
    "return_date"
  ]
}

Get Device
GET/api/v2/devices/{id}

This method requires the device scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 1234

The id of the device to lookup


PUT https://my.tanda.co/api/v2/devices/1234
RequestsUpdate device information
Headers
Content-Type: application/json
Body
{
  "nickname": "Old Reactor Timeclock",
  "location_id": 111
}
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1234,
  "location_id": 111,
  "nickname": "Old Reactor Timeclock",
  "returned": false,
  "last_heard_from": 1459296900,
  "dispatch_date": "2016-01-02"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the device"
    },
    "location_id": {
      "type": "number",
      "description": "The ID of the time clock's [location](#locations)."
    },
    "nickname": {
      "type": "string",
      "description": "The nickname of the device. If not provided, the location's name is used."
    },
    "returned": {
      "type": "boolean",
      "description": "Whether the device has been returned"
    },
    "last_heard_from": {
      "type": "number",
      "description": "The time that the device last communicated with the Tanda server"
    },
    "dispatch_date": {
      "type": "string",
      "description": "The date that the device was sent out"
    }
  },
  "required": [
    "id",
    "nickname",
    "returned"
  ]
}

Update Device
PUT/api/v2/devices/{id}

This method requires the device scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 1234

The id of the device to edit


Return Device

POST https://my.tanda.co/api/v2/devices/1234/return
Responses200
Headers
Content-Type: application/json
Body
{
  "id": 1234,
  "location_id": 111,
  "nickname": "Reactor Timeclock",
  "returned": "true",
  "last_heard_from": 1459296900,
  "dispatch_date": "2016-01-02",
  "return_date": "2016-04-01"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "The id of the device"
    },
    "location_id": {
      "type": "number",
      "description": "The ID of the time clock's [location](#locations)."
    },
    "nickname": {
      "type": "string",
      "description": "The nickname of the device. If not provided, the location's name is used."
    },
    "returned": {
      "type": "string",
      "description": "Whether the device has been returned"
    },
    "last_heard_from": {
      "type": "number",
      "description": "The time that the device last communicated with the Tanda server"
    },
    "dispatch_date": {
      "type": "string",
      "description": "The date that the device was sent out"
    },
    "return_date": {
      "type": "string",
      "description": "The date the device was returned"
    }
  },
  "required": [
    "id",
    "nickname",
    "returned"
  ]
}

Return Device
POST/api/v2/devices/{id}/return

This method requires the device scope (see Scopes for more information).

URI Parameters
HideShow
id
number (required) Example: 1234

The id of the device to return


Device Versions

GET https://my.tanda.co/api/v2/devices/1234/versions
Responses200
Headers
Content-Type: application/json
Body
[
  {
    "version_id": 123456,
    "time": 1459209907,
    "event": "update",
    "author": {
      "id": 123456,
      "name":