# API: Reports

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/work/reports/entries` | Every entry, newest first | `reports:read` |
| GET | `/v1/work/reports/entries.csv` | Every entry as a spreadsheet, with the columns you choose | `reports:read` |
| GET | `/v1/work/reports/expenses` | Expenses by kind, client, project or person | `reports:read` |
| GET | `/v1/work/reports/numbers` | Numbers your organization works out its own way, and what they can be made from | `reports:read` |
| POST | `/v1/work/reports/numbers` | Add a number to a report: one column plus, less or divided by another | `reports:write` |
| DELETE | `/v1/work/reports/numbers/:id` | Take a number off its report | `reports:write` |
| GET | `/v1/work/reports/payroll` | Everyone's ordinary hours, overtime, time off by kind, and expenses to pay back | `reports:read` |
| GET | `/v1/work/reports/profit` | What came in, less what people cost and what was spent, by client, project, person or month | `reports:read` |
| GET | `/v1/work/reports/saved` | Reports you saved, and the ones shared with everyone | `reports:read` |
| POST | `/v1/work/reports/saved` | Save a report, for yourself or everyone. Each person sees only what they may | `reports:write` |
| DELETE | `/v1/work/reports/saved/:id` | Remove a saved report. The time in it stays | `reports:write` |
| PATCH | `/v1/work/reports/saved/:id` | Rename, change or share a saved report | `reports:write` |
| GET | `/v1/work/reports/table` | Any report as one table: time, expenses, profit, plans against what happened, invoiced and paid, or what clients owe | `reports:read` |
| GET | `/v1/work/reports/time` | Hours by client, project, task, person, day, week or month, with what they're worth if you may see it | `reports:read` |

## Examples

### GET /v1/work/reports/entries

Every entry, newest first

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

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

### GET /v1/work/reports/entries.csv

Every entry as a spreadsheet, with the columns you choose

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

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

### GET /v1/work/reports/expenses

Expenses by kind, client, project or person

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

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

### GET /v1/work/reports/numbers

Numbers your organization works out its own way, and what they can be made from

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

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

### POST /v1/work/reports/numbers

Add a number to a report: one column plus, less or divided by another

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/reports/numbers`, {
  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/reports/numbers/$ID

Take a number off its report

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

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

### GET /v1/work/reports/payroll

Everyone's ordinary hours, overtime, time off by kind, and expenses to pay back

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

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

### GET /v1/work/reports/profit

What came in, less what people cost and what was spent, by client, project, person or month

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

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

### GET /v1/work/reports/saved

Reports you saved, and the ones shared with everyone

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

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

### POST /v1/work/reports/saved

Save a report, for yourself or everyone. Each person sees only what they may

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/reports/saved`, {
  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/reports/saved/$ID

Remove a saved report. The time in it stays

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

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

### PATCH /v1/work/reports/saved/$ID

Rename, change or share a saved report

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/reports/saved/${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/reports/table

Any report as one table: time, expenses, profit, plans against what happened, invoiced and paid, or what clients owe

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

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

### GET /v1/work/reports/time

Hours by client, project, task, person, day, week or month, with what they're worth if you may see it

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/reports/time`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.TK_API_KEY}` },
});
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).
