# API: People

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/work/people` | Everyone who does the work. Rates and pay show only to people who may see them | `people:read` |
| POST | `/v1/work/people` | Add someone who does work. They aren't emailed; invite them when you want them to sign in | `people:write` |
| GET | `/v1/work/people/:id` | One person, with the history of their rates (only what you may see) | `people:read` |
| PATCH | `/v1/work/people/:id` | Correct someone's details or hours, or archive them (their time stays) | `people:write` |
| PUT | `/v1/work/people/:id/rates/:kind` | Set what someone's hour bills at, or costs, from a day on. Time already on an invoice never changes | `people:write` |
| DELETE | `/v1/work/people/:id/rates/:rate_id` | Remove a rate that was set by mistake | `people:write` |
| GET | `/v1/work/people/access` | Which person you are, and what you may see and do | `people:read` |
| DELETE | `/v1/work/people/chat` | Stop posting to the channel, and forget its address (web app only) | `people:write` |
| GET | `/v1/work/people/chat` | What your Slack or Google Chat channel hears about (web app only) | `people:read` |
| PUT | `/v1/work/people/chat` | Connect a Slack or Google Chat channel, or change what it hears. A new address gets one test message (web app only) | `people:write` |
| GET | `/v1/work/people/imports` | Records brought from other systems, the newest first | `people:write` |
| POST | `/v1/work/people/imports` | Start bringing records in, from files or from an old account with your own key to it. Nothing is added yet | `people:write` |
| DELETE | `/v1/work/people/imports/:id` | Forget what was found, before anything is brought in | `people:write` |
| GET | `/v1/work/people/imports/:id` | One import: where it's up to, what was found, and what's here now | `people:write` |
| POST | `/v1/work/people/imports/:id/bring` | Bring in what was found. Nobody is emailed, invited, reminded or invoiced | `people:write` |
| POST | `/v1/work/people/imports/:id/look` | Every row is sent: work out what was found. Nothing is added yet | `people:write` |
| POST | `/v1/work/people/imports/:id/rows` | Send some of a file's rows, up to 2 MB at a time | `people:write` |
| POST | `/v1/work/people/imports/:id/undo` | Take away everything an import brought. What's been invoiced here since stays | `people:write` |
| GET | `/v1/work/people/roles` | Roles of your own | `people:read` |
| POST | `/v1/work/people/roles` | Add a role of your own (owners only) (web app only) | `people:write` |
| DELETE | `/v1/work/people/roles/:id` | Remove a role of your own. People keep what it let them do (web app only) | `people:write` |
| PATCH | `/v1/work/people/roles/:id` | Change a role of your own. Everyone who has it changes with it (web app only) | `people:write` |
| DELETE | `/v1/work/people/sample` | Remove the made-up clients, projects, people and time | `people:write` |
| POST | `/v1/work/people/sample` | Add made-up clients, projects and time to try everything with (nothing is sent to anyone) | `people:write` |
| GET | `/v1/work/people/settings` | How your organization tracks time: time zone, currency, week, rounding and rules | `people:read` |
| PUT | `/v1/work/people/settings` | Change how your organization tracks time. New rounding applies to time that isn't on an invoice yet | `people:write` |
| GET | `/v1/work/people/setup` | Your first steps and which are done (the sample data never counts) | `people:read` |
| GET | `/v1/work/people/team` | Everyone who can sign in, and what each may do | `people:read` |
| PUT | `/v1/work/people/team/:user_id` | Set what someone may see and do: a role, or abilities one by one. Only an owner gives pay and settings | `people:write` |
| POST | `/v1/work/people/team/invite` | Invite someone by email with a role, which they get when they accept (owners only) (web app only) | `members:write` |

## Examples

### GET /v1/work/people

Everyone who does the work. Rates and pay show only to people who may see them

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

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

### POST /v1/work/people

Add someone who does work. They aren't emailed; invite them when you want them to sign in

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people`, {
  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();
```

### GET /v1/work/people/$ID

One person, with the history of their rates (only what you may see)

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

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

### PATCH /v1/work/people/$ID

Correct someone's details or hours, or archive them (their time stays)

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

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

### PUT /v1/work/people/$ID/rates/$KIND

Set what someone's hour bills at, or costs, from a day on. Time already on an invoice never changes

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/${id}/rates/${kind}`, {
  method: "PUT",
  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/people/$ID/rates/$RATE_ID

Remove a rate that was set by mistake

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

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

### GET /v1/work/people/access

Which person you are, and what you may see and do

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

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

### GET /v1/work/people/imports

Records brought from other systems, the newest first

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

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

### POST /v1/work/people/imports

Start bringing records in, from files or from an old account with your own key to it. Nothing is added yet

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

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

Forget what was found, before anything is brought in

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

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

### GET /v1/work/people/imports/$ID

One import: where it's up to, what was found, and what's here now

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

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

### POST /v1/work/people/imports/$ID/bring

Bring in what was found. Nobody is emailed, invited, reminded or invoiced

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/imports/${id}/bring`, {
  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();
```

### POST /v1/work/people/imports/$ID/look

Every row is sent: work out what was found. Nothing is added yet

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/imports/${id}/look`, {
  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();
```

### POST /v1/work/people/imports/$ID/rows

Send some of a file's rows, up to 2 MB at a time

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/imports/${id}/rows`, {
  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();
```

### POST /v1/work/people/imports/$ID/undo

Take away everything an import brought. What's been invoiced here since stays

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/imports/${id}/undo`, {
  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();
```

### GET /v1/work/people/roles

Roles of your own

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

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

### DELETE /v1/work/people/sample

Remove the made-up clients, projects, people and time

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

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

### POST /v1/work/people/sample

Add made-up clients, projects and time to try everything with (nothing is sent to anyone)

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/sample`, {
  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();
```

### GET /v1/work/people/settings

How your organization tracks time: time zone, currency, week, rounding and rules

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

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

### PUT /v1/work/people/settings

Change how your organization tracks time. New rounding applies to time that isn't on an invoice yet

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/settings`, {
  method: "PUT",
  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/people/setup

Your first steps and which are done (the sample data never counts)

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

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

### GET /v1/work/people/team

Everyone who can sign in, and what each may do

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

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

### PUT /v1/work/people/team/$USER_ID

Set what someone may see and do: a role, or abilities one by one. Only an owner gives pay and settings

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

```js
const res = await fetch(`https://api.hourfinch.com/v1/work/people/team/${user_id}`, {
  method: "PUT",
  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).
