Skip to the content

DoRoutes API · version 1

Availability

GET/v1/admin/bank-holidays

The business's bank holidays

Any signed-in staff member. From the GOV.UK list the business follows (its bank_holiday_region setting), from and to at most two years apart; working is set for those it works.

Parameters

  • fromstring (date), in the query, required
  • tostring (date), in the query, required

Response 200 · object

Done.

  • bank_holidaysarray of BankHoliday, required
    • datestring (date), required
    • titlestring, required
    • workingboolean, required
Example response 200
{
  "bank_holidays": [
    {
      "date": "date",
      "title": "string",
      "working": true
    }
  ]
}

Response 400 · Error

The request is not valid.

  • errorobject, required
    • codestring, required

      A short machine-readable name, such as not_found.

    • messagestring, required

      What went wrong, for people.

  • request_idstring, required

    Matches the X-Request-ID response header.

Example response 400
{
  "error": {
    "code": "string",
    "message": "string"
  },
  "request_id": "string"
}

Response 401 · Error

No tenant key, or no valid session.

Fields as in The business's bank holidays

Response 403 · Error

The session may not do this.

Fields as in The business's bank holidays

Response 500 · Error

Something failed on our side.

Fields as in The business's bank holidays

PUT/v1/admin/bank-holidays/{date}

Work a bank holiday, or not

Needs the settings.write permission. date is YYYY-MM-DD and must be one of the business's bank holidays.

Parameters

  • datestring, in the path, required

Request body · object

  • workingboolean, required
Example request
{
  "working": true
}

Response 200 · object

Done.

  • datestring, required
  • workingboolean, required
Example response 200
{
  "date": "string",
  "working": true
}

Response 400 · Error

The request is not valid.

Fields as in The business's bank holidays

Response 401 · Error

No tenant key, or no valid session.

Fields as in The business's bank holidays

Response 403 · Error

The session may not do this.

Fields as in The business's bank holidays

Response 404 · Error

Not found, or not yours.

Fields as in The business's bank holidays

Response 500 · Error

Something failed on our side.

Fields as in The business's bank holidays

GET/v1/admin/user/{user_id}/availability

A staff member's time away and days off

Any signed-in staff member.

Parameters

  • user_idstring, in the path, required

Response 200 · object

Done.

  • availabilityAvailability, required
    • absencesarray of Absence, required
      • idinteger (int64)
      • startsstring (date), required
      • endsstring (date), required

        The last day away.

      • kindstring, required

        One of: holiday day_off sick other

      • notestring
    • days_offarray of integer, required
Example response 200
{
  "availability": {
    "absences": [
      {
        "id": 0,
        "starts": "date",
        "ends": "date",
        "kind": "holiday",
        "note": "string"
      }
    ],
    "days_off": [
      0
    ]
  }
}

Response 400 · Error

The request is not valid.

Fields as in The business's bank holidays

Response 401 · Error

No tenant key, or no valid session.

Fields as in The business's bank holidays

Response 403 · Error

The session may not do this.

Fields as in The business's bank holidays

Response 404 · Error

Not found, or not yours.

Fields as in The business's bank holidays

Response 500 · Error

Something failed on our side.

Fields as in The business's bank holidays

POST/v1/admin/user/{user_id}/absences

Record a staff member's time away

Needs the staff.manage permission.

Parameters

  • user_idstring, in the path, required

Request body · Absence

  • idinteger (int64)
  • startsstring (date), required
  • endsstring (date), required

    The last day away.

  • kindstring, required

    One of: holiday day_off sick other

  • notestring
Example request
{
  "id": 0,
  "starts": "date",
  "ends": "date",
  "kind": "holiday",
  "note": "string"
}

Response 200 · object

Done.

  • availabilityAvailability, required
    • absencesarray of Absence, required
      • idinteger (int64)
      • startsstring (date), required
      • endsstring (date), required

        The last day away.

      • kindstring, required

        One of: holiday day_off sick other

      • notestring
    • days_offarray of integer, required
Example response 200
{
  "availability": {
    "absences": [
      {
        "id": 0,
        "starts": "date",
        "ends": "date",
        "kind": "holiday",
        "note": "string"
      }
    ],
    "days_off": [
      0
    ]
  }
}

Response 400 · Error

The request is not valid.

Fields as in The business's bank holidays

Response 401 · Error

No tenant key, or no valid session.

Fields as in The business's bank holidays

Response 403 · Error

The session may not do this.

Fields as in The business's bank holidays

Response 404 · Error

Not found, or not yours.

Fields as in The business's bank holidays

Response 500 · Error

Something failed on our side.

Fields as in The business's bank holidays

DELETE/v1/admin/user/{user_id}/absences/{id}

Remove a staff member's time away

Needs the staff.manage permission.

Parameters

  • user_idstring, in the path, required
  • idstring, in the path, required

Response 200 · object

Done.

  • availabilityAvailability, required
    • absencesarray of Absence, required
      • idinteger (int64)
      • startsstring (date), required
      • endsstring (date), required

        The last day away.

      • kindstring, required

        One of: holiday day_off sick other

      • notestring
    • days_offarray of integer, required
Example response 200
{
  "availability": {
    "absences": [
      {
        "id": 0,
        "starts": "date",
        "ends": "date",
        "kind": "holiday",
        "note": "string"
      }
    ],
    "days_off": [
      0
    ]
  }
}

Response 400 · Error

The request is not valid.

Fields as in The business's bank holidays

Response 401 · Error

No tenant key, or no valid session.

Fields as in The business's bank holidays

Response 403 · Error

The session may not do this.

Fields as in The business's bank holidays

Response 404 · Error

Not found, or not yours.

Fields as in The business's bank holidays

Response 500 · Error

Something failed on our side.

Fields as in The business's bank holidays

PUT/v1/admin/user/{user_id}/days-off

Set the weekdays a staff member never works

Needs the staff.manage permission. Replaces them; 1 is Monday.

Parameters

  • user_idstring, in the path, required

Request body · object

  • weekdaysarray of integer, required
Example request
{
  "weekdays": [
    0
  ]
}

Response 200 · object

Done.

  • availabilityAvailability, required
    • absencesarray of Absence, required
      • idinteger (int64)
      • startsstring (date), required
      • endsstring (date), required

        The last day away.

      • kindstring, required

        One of: holiday day_off sick other

      • notestring
    • days_offarray of integer, required
Example response 200
{
  "availability": {
    "absences": [
      {
        "id": 0,
        "starts": "date",
        "ends": "date",
        "kind": "holiday",
        "note": "string"
      }
    ],
    "days_off": [
      0
    ]
  }
}

Response 400 · Error

The request is not valid.

Fields as in The business's bank holidays

Response 401 · Error

No tenant key, or no valid session.

Fields as in The business's bank holidays

Response 403 · Error

The session may not do this.

Fields as in The business's bank holidays

Response 404 · Error

Not found, or not yours.

Fields as in The business's bank holidays

Response 500 · Error

Something failed on our side.

Fields as in The business's bank holidays