# API: Schedule

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/work/schedule` | Who's planned on what between two days, who's away, roles to fill, holidays and days things are due | `schedule:read` |
| DELETE | `/v1/work/schedule/calendar` | Stop your calendar address working | `schedule:write` |
| GET | `/v1/work/schedule/calendar` | Whether you have an address for a calendar app | `schedule:read` |
| POST | `/v1/work/schedule/calendar` | Make your own address for a calendar app. An old one stops working (web app only) | `schedule:write` |
| GET | `/v1/work/schedule/holidays` | Days everyone is off, and the countries whose public holidays can be added | `schedule:read` |
| POST | `/v1/work/schedule/holidays` | Add a day everyone is off, or a country's public holidays for a year. Nobody's time off counts on it | `schedule:write` |
| DELETE | `/v1/work/schedule/holidays/:id` | Make a holiday an ordinary day again | `schedule:write` |
| POST | `/v1/work/schedule/items` | Plan someone, or a role to fill, on a project between two days. They join its team. It can repeat every so many weeks | `schedule:write` |
| DELETE | `/v1/work/schedule/items/:id` | Take a plan off the schedule | `schedule:write` |
| PATCH | `/v1/work/schedule/items/:id` | Move or change a plan, or give it to someone else | `schedule:write` |
| GET | `/v1/work/schedule/milestones` | Days things are due on a project | `schedule:read` |
| POST | `/v1/work/schedule/milestones` | Add a day something is due on a project, with a part of its price if it's fixed. `months` makes one a month | `schedule:write` |
| DELETE | `/v1/work/schedule/milestones/:id` | Remove a day something is due | `schedule:write` |
| PATCH | `/v1/work/schedule/milestones/:id` | Change a day something is due | `schedule:write` |
| GET | `/v1/work/schedule/mine` | What you're planned to work on, day by day, with your hours, holidays and time off | `schedule:read` |
| GET | `/v1/work/schedule/off` | Time off asked for and taken: yours, and everyone's if you approve time | `schedule:read` |
| POST | `/v1/work/schedule/off` | Ask for time off, whole days or part of each. For someone else you need to approve time, and it's approved at once | `schedule:write` |
| PATCH | `/v1/work/schedule/off/:id` | Approve, decline or cancel time off. You can cancel your own until it has started | `schedule:write` |
| GET | `/v1/work/schedule/off/balances` | What's left of a year's time off: yours, or everyone's with `all`, in seconds | `schedule:read` |
| GET | `/v1/work/schedule/off/changes` | What was added to or taken from someone's time off in a year | `schedule:read` |
| POST | `/v1/work/schedule/off/changes` | Add to or take from what someone has left in a year: a start balance, or days paid out | `schedule:write` |
| DELETE | `/v1/work/schedule/off/changes/:id` | Take back a change to someone's time off | `schedule:write` |
| GET | `/v1/work/schedule/off/kinds` | Kinds of time off | `schedule:read` |
| POST | `/v1/work/schedule/off/kinds` | Add a kind of time off, with a year's allowance or no limit | `schedule:write` |
| PATCH | `/v1/work/schedule/off/kinds/:id` | Change a kind of time off, or archive it | `schedule:write` |
| POST | `/v1/work/schedule/roles` | Add a role someone will fill, to plan before you hire. No limit, and free | `schedule:write` |
| DELETE | `/v1/work/schedule/roles/:id` | Remove a role and its plans | `schedule:write` |
| PATCH | `/v1/work/schedule/roles/:id` | Rename a role, or give its plans to the person who fills it | `schedule:write` |

## Examples

### GET /v1/work/schedule

Who's planned on what between two days, who's away, roles to fill, holidays and days things are due

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### DELETE /v1/work/schedule/calendar

Stop your calendar address working

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/schedule/calendar" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/calendar`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/schedule/calendar

Whether you have an address for a calendar app

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/calendar" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/calendar`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/schedule/holidays

Days everyone is off, and the countries whose public holidays can be added

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/holidays" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/holidays`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/schedule/holidays

Add a day everyone is off, or a country's public holidays for a year. Nobody's time off counts on it

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/schedule/holidays" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/holidays`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/schedule/holidays/$ID

Make a holiday an ordinary day again

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/schedule/holidays/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/holidays/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/schedule/items

Plan someone, or a role to fill, on a project between two days. They join its team. It can repeat every so many weeks

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/schedule/items" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/items`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/schedule/items/$ID

Take a plan off the schedule

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/schedule/items/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/items/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### PATCH /v1/work/schedule/items/$ID

Move or change a plan, or give it to someone else

```bash
curl -s -X PATCH "https://api.hourfinch.com/v1/work/schedule/items/$ID" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/items/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/schedule/milestones

Days things are due on a project

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/milestones" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/milestones`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/schedule/milestones

Add a day something is due on a project, with a part of its price if it's fixed. `months` makes one a month

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/schedule/milestones" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/milestones`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/schedule/milestones/$ID

Remove a day something is due

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/schedule/milestones/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/milestones/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### PATCH /v1/work/schedule/milestones/$ID

Change a day something is due

```bash
curl -s -X PATCH "https://api.hourfinch.com/v1/work/schedule/milestones/$ID" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/milestones/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/schedule/mine

What you're planned to work on, day by day, with your hours, holidays and time off

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/mine" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/mine`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/schedule/off

Time off asked for and taken: yours, and everyone's if you approve time

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/off" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/schedule/off

Ask for time off, whole days or part of each. For someone else you need to approve time, and it's approved at once

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/schedule/off" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### PATCH /v1/work/schedule/off/$ID

Approve, decline or cancel time off. You can cancel your own until it has started

```bash
curl -s -X PATCH "https://api.hourfinch.com/v1/work/schedule/off/$ID" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/work/schedule/off/balances

What's left of a year's time off: yours, or everyone's with `all`, in seconds

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/off/balances" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/balances`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/schedule/off/changes

What was added to or taken from someone's time off in a year

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/off/changes" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/changes`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/schedule/off/changes

Add to or take from what someone has left in a year: a start balance, or days paid out

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/schedule/off/changes" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/changes`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/schedule/off/changes/$ID

Take back a change to someone's time off

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/schedule/off/changes/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/changes/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/work/schedule/off/kinds

Kinds of time off

```bash
curl -s "https://api.hourfinch.com/v1/work/schedule/off/kinds" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/kinds`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/work/schedule/off/kinds

Add a kind of time off, with a year's allowance or no limit

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/schedule/off/kinds" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/kinds`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### PATCH /v1/work/schedule/off/kinds/$ID

Change a kind of time off, or archive it

```bash
curl -s -X PATCH "https://api.hourfinch.com/v1/work/schedule/off/kinds/$ID" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/off/kinds/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/work/schedule/roles

Add a role someone will fill, to plan before you hire. No limit, and free

```bash
curl -s -X POST "https://api.hourfinch.com/v1/work/schedule/roles" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/roles`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### DELETE /v1/work/schedule/roles/$ID

Remove a role and its plans

```bash
curl -s -X DELETE "https://api.hourfinch.com/v1/work/schedule/roles/$ID" \
  -H "Authorization: Bearer $TK_API_KEY"
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/roles/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
const data = await res.json();
```

### PATCH /v1/work/schedule/roles/$ID

Rename a role, or give its plans to the person who fills it

```bash
curl -s -X PATCH "https://api.hourfinch.com/v1/work/schedule/roles/$ID" \
  -H "Authorization: Bearer $TK_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/schedule/roles/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

Request and response schemas: [https://www.hourfinch.com/openapi.json](https://www.hourfinch.com/openapi.json). All resources: [API reference](https://www.hourfinch.com/docs/api).
