# API reference

Every resource and operation of the TimeSubmit REST API, with the scope each one needs, linked to its reference page.

Every path below is relative to `https://www.timesubmit.com/api/v1`, and each operation needs the scope shown beside it. [Authentication](https://www.timesubmit.com/developers/authentication) explains keys and scopes.

## [Clients](https://www.timesubmit.com/developers/reference/clients)

The organisations your consultancy bills.

- [`GET /clients`](https://www.timesubmit.com/developers/reference/clients#listClients): List clients. Needs `clients:read`.
- [`GET /clients/{id}`](https://www.timesubmit.com/developers/reference/clients#getClient): Read a client. Needs `clients:read`.
- [`POST /clients`](https://www.timesubmit.com/developers/reference/clients#createClient): Create a client. Needs `clients:write`.
- [`PATCH /clients/{id}`](https://www.timesubmit.com/developers/reference/clients#updateClient): Update a client. Needs `clients:write`.
- [`POST /clients/{id}/archive`](https://www.timesubmit.com/developers/reference/clients#archiveClient): Archive a client. Needs `clients:write`.

## [Projects](https://www.timesubmit.com/developers/reference/projects)

Work for a client, with its rate and approval settings.

- [`GET /projects`](https://www.timesubmit.com/developers/reference/projects#listProjects): List projects. Needs `projects:read`.
- [`GET /projects/{id}`](https://www.timesubmit.com/developers/reference/projects#getProject): Read a project. Needs `projects:read`.
- [`POST /projects`](https://www.timesubmit.com/developers/reference/projects#createProject): Create a project. Needs `projects:write`.
- [`PATCH /projects/{id}`](https://www.timesubmit.com/developers/reference/projects#updateProject): Update a project. Needs `projects:write`.

## [Consultants](https://www.timesubmit.com/developers/reference/consultants)

The people who work on projects. Read only, and never their bank or tax details.

- [`GET /consultants`](https://www.timesubmit.com/developers/reference/consultants#listConsultants): List consultants. Needs `consultants:read`.
- [`GET /consultants/{id}`](https://www.timesubmit.com/developers/reference/consultants#getConsultant): Read a consultant. Needs `consultants:read`.

## [Assignments](https://www.timesubmit.com/developers/reference/assignments)

A consultant on a project, with the rate charged and the rate paid.

- [`GET /assignments`](https://www.timesubmit.com/developers/reference/assignments#listAssignments): List assignments. Needs `assignments:read`.
- [`GET /assignments/{id}`](https://www.timesubmit.com/developers/reference/assignments#getAssignment): Read an assignment. Needs `assignments:read`.
- [`POST /assignments`](https://www.timesubmit.com/developers/reference/assignments#createAssignment): Assign a consultant to a project. Needs `assignments:write`.
- [`PATCH /assignments/{id}`](https://www.timesubmit.com/developers/reference/assignments#updateAssignment): Update an assignment. Needs `assignments:write`.
- [`DELETE /assignments/{id}`](https://www.timesubmit.com/developers/reference/assignments#removeAssignment): Remove an assignment. Needs `assignments:write`.

## [Invoices](https://www.timesubmit.com/developers/reference/invoices)

Receivables to clients and payables from consultants. Read only.

- [`GET /invoices`](https://www.timesubmit.com/developers/reference/invoices#listInvoices): List invoices. Needs `invoices:read`.
- [`GET /invoices/{id}`](https://www.timesubmit.com/developers/reference/invoices#getInvoice): Read an invoice. Needs `invoices:read`.

## [Client purchase orders](https://www.timesubmit.com/developers/reference/client-purchase-orders)

A client's purchase order: the budget and dates your receivables bill against.

- [`GET /client-purchase-orders`](https://www.timesubmit.com/developers/reference/client-purchase-orders#listClientPurchaseOrders): List client purchase orders. Needs `purchase_orders:read`.
- [`GET /client-purchase-orders/{id}`](https://www.timesubmit.com/developers/reference/client-purchase-orders#getClientPurchaseOrder): Read a client purchase order. Needs `purchase_orders:read`.
- [`GET /client-purchase-orders/{id}/changes`](https://www.timesubmit.com/developers/reference/client-purchase-orders#listClientPurchaseOrderChanges): List a client purchase order's changes. Needs `purchase_orders:read`.
- [`POST /client-purchase-orders`](https://www.timesubmit.com/developers/reference/client-purchase-orders#createClientPurchaseOrder): Record a client purchase order. Needs `purchase_orders:write`.
- [`PATCH /client-purchase-orders/{id}`](https://www.timesubmit.com/developers/reference/client-purchase-orders#updateClientPurchaseOrder): Amend a client purchase order. Needs `purchase_orders:write`.
- [`POST /client-purchase-orders/{id}/close`](https://www.timesubmit.com/developers/reference/client-purchase-orders#closeClientPurchaseOrder): Close a client purchase order. Needs `purchase_orders:write`.
- [`DELETE /client-purchase-orders/{id}`](https://www.timesubmit.com/developers/reference/client-purchase-orders#deleteClientPurchaseOrder): Delete a client purchase order. Needs `purchase_orders:write`.

## [Consultant purchase orders](https://www.timesubmit.com/developers/reference/consultant-purchase-orders)

Your purchase order to a consultant: the budget and dates their payables bill against.

- [`GET /consultant-purchase-orders`](https://www.timesubmit.com/developers/reference/consultant-purchase-orders#listConsultantPurchaseOrders): List consultant purchase orders. Needs `purchase_orders:read`.
- [`GET /consultant-purchase-orders/{id}`](https://www.timesubmit.com/developers/reference/consultant-purchase-orders#getConsultantPurchaseOrder): Read a consultant purchase order. Needs `purchase_orders:read`.
- [`GET /consultant-purchase-orders/{id}/changes`](https://www.timesubmit.com/developers/reference/consultant-purchase-orders#listConsultantPurchaseOrderChanges): List a consultant purchase order's changes. Needs `purchase_orders:read`.
- [`POST /consultant-purchase-orders`](https://www.timesubmit.com/developers/reference/consultant-purchase-orders#createConsultantPurchaseOrder): Record a consultant purchase order. Needs `purchase_orders:write`.
- [`PATCH /consultant-purchase-orders/{id}`](https://www.timesubmit.com/developers/reference/consultant-purchase-orders#updateConsultantPurchaseOrder): Amend a consultant purchase order. Needs `purchase_orders:write`.
- [`POST /consultant-purchase-orders/{id}/close`](https://www.timesubmit.com/developers/reference/consultant-purchase-orders#closeConsultantPurchaseOrder): Close a consultant purchase order. Needs `purchase_orders:write`.
- [`DELETE /consultant-purchase-orders/{id}`](https://www.timesubmit.com/developers/reference/consultant-purchase-orders#deleteConsultantPurchaseOrder): Delete a consultant purchase order. Needs `purchase_orders:write`.

## [Events](https://www.timesubmit.com/developers/reference/events)

What happened to timesheets and invoices, for the last 30 days.

- [`GET /events`](https://www.timesubmit.com/developers/reference/events#listEvents): List events. Needs `events:read`.
