Client list
10 operations in the Tolvi API, version 1. Paths are relative to https://api.tolvi.co.uk. Every amount is integer pence.
List the fields of the client list
GET/api/v1/client-list/fields
- Scopes
clients:read
One group per module, with each field’s type and what it can be filtered by. Only modules for products you can use, and your credential has a scope for. Part of the hub product: the firm must have it and you must have access to it.
Responses
200 OK, application/json
Body: object (ClientFieldCatalogue).
| Field | Type | Description |
|---|---|---|
modulesrequired | array of ClientFieldModuleEntry | |
modules[].keyrequired | string | |
modules[].labelrequired | string | |
defaultColumnsrequired | array of string | |
fieldsrequired | array of ClientField | |
fields[].idrequired | string | The id to use in columns, filter and sort. example "ct.due" |
fields[].modulerequired | string | example "corporation_tax" |
fields[].labelrequired | string | |
fields[].typerequired | string (ClientFieldType) | One of: |
fields[].filterablerequired | boolean | |
fields[].sortablerequired | boolean | |
fields[].operatorsrequired | array of string | The operators a condition on this field can use. |
fields[].options | array of ClientFieldOption | |
fields[].options[].valuerequired | string | |
fields[].options[].labelrequired | string | |
fields[].description | string |
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 429 Too many requests, as problem details (application/problem+json).
List clients with chosen columns and filters
GET/api/v1/client-list
- Scopes
clients:read
Filtered, sorted and paged on the server, with data from every product you can use. Only fields in the catalogue can be named. Part of the hub product: the firm must have it and you must have access to it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | 1 to 200; default 50 |
page | query | integer | at least 1; default 1 |
q | query | string | Part of the client name or company number. up to 100 characters |
sort | query | string | A field id, with a leading - for descending. Blanks come last. Name, then id, break ties. up to 61 characters |
columns | query | string | Field ids, comma separated. Left out: the default columns. |
filter | query | string | JSON: up to 8000 characters |
Responses
200 OK, application/json
Body: object (ClientListPage).
| Field | Type | Description |
|---|---|---|
rowsrequired | array of ClientListRow | |
rows[].idrequired | string (uuid) | |
rows[].valuesrequired | object | By field id. Money is integer pence; dates are ISO; a person is their name. |
columnsrequired | array of string | The columns returned, in order. |
pagerequired | integer | |
pageSizerequired | integer | |
totalrequired | integer | |
hiddenFieldsrequired | array of ClientListHiddenField | Fields asked for from products you can’t use: left out of the columns, and conditions on them not applied. |
hiddenFields[].idrequired | string | |
hiddenFields[].labelrequired | string | |
hiddenFields[].modulerequired | string | |
hiddenFields[].moduleLabelrequired | string |
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 429 Too many requests, as problem details (application/problem+json).
Export the client list as CSV
GET/api/v1/client-list/export
- Scopes
clients:read
The same filter, sort and columns as the list, every matching row, up to 10,000. Money is in pounds, with credits in brackets. Refused when it’s more than that, or SA tax due is a column and more than 500 clients match. Part of the hub product: the firm must have it and you must have access to it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q | query | string | Part of the client name or company number. up to 100 characters |
sort | query | string | A field id, with a leading - for descending. Blanks come last. Name, then id, break ties. up to 61 characters |
columns | query | string | Field ids, comma separated. Left out: the default columns. |
filter | query | string | JSON: up to 8000 characters |
Responses
200 OK, text/csv
The CSV.
Body: string.
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 429 Too many requests, as problem details (application/problem+json).
List saved views
GET/api/v1/client-list/views
- Scopes
clients:read
Those shared with the practice, and your own private ones. Part of the hub product: the firm must have it and you must have access to it.
Responses
200 OK, application/json
Body: object (ClientListViews).
| Field | Type | Description |
|---|---|---|
viewsrequired | array of ClientListView | |
views[].idrequired | string (uuid) | |
views[].namerequired | string | |
views[].visibilityrequired | string (ClientViewVisibility) | One of: |
views[].columnsrequired | array of string | |
views[].filterrequired | object |
|
views[].sortrequired | object (ClientListSort)nullable | |
views[].sort.fieldrequired | string | |
views[].sort.dirrequired | string (ClientListSortDirection) | One of: |
views[].createdByrequired | string (uuid)nullable | |
views[].createdByNamerequired | stringnullable | |
views[].isDefaultrequired | boolean | The view you open the client list on. |
views[].canEditrequired | boolean | Whether you can change or delete it. |
views[].hiddenFieldsrequired | array of ClientListHiddenField | What this view uses from products you can’t use. |
views[].hiddenFields[].idrequired | string | |
views[].hiddenFields[].labelrequired | string | |
views[].hiddenFields[].modulerequired | string | |
views[].hiddenFields[].moduleLabelrequired | string | |
views[].updatedAtrequired | string (date-time) | |
defaultViewIdrequired | string (uuid)nullable |
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 429 Too many requests, as problem details (application/problem+json).
Save a view
POST/api/v1/client-list/views
- Scopes
clients:read- Retries
- Send an
Idempotency-Keyto make retries safe.
Anyone signed in can save one, private or shared with the practice. An API credential also needs clients:write. Part of the hub product: the firm must have it and you must have access to it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | A unique key (1-255 visible characters) to make retries safe. Replayed for 24 hours. 1 to 255 characters |
Request body
Required. application/json: object (CreateClientListViewRequest).
| Field | Type | Description |
|---|---|---|
namerequired | string | up to 80 characters |
visibility | string (ClientViewVisibility) | private (the default) or firm: everyone in the practice. One of: |
columnsrequired | array of string | |
filter | object |
|
sort | object (ClientListSort)nullable | |
sort.fieldrequired | string | |
sort.dirrequired | string (ClientListSortDirection) | One of: |
Responses
201 Created, application/json
Body: object (ClientListView).
| Field | Type | Description |
|---|---|---|
idrequired | string (uuid) | |
namerequired | string | |
visibilityrequired | string (ClientViewVisibility) | One of: |
columnsrequired | array of string | |
filterrequired | object |
|
sortrequired | object (ClientListSort)nullable | |
sort.fieldrequired | string | |
sort.dirrequired | string (ClientListSortDirection) | One of: |
createdByrequired | string (uuid)nullable | |
createdByNamerequired | stringnullable | |
isDefaultrequired | boolean | The view you open the client list on. |
canEditrequired | boolean | Whether you can change or delete it. |
hiddenFieldsrequired | array of ClientListHiddenField | What this view uses from products you can’t use. |
hiddenFields[].idrequired | string | |
hiddenFields[].labelrequired | string | |
hiddenFields[].modulerequired | string | |
hiddenFields[].moduleLabelrequired | string | |
updatedAtrequired | string (date-time) |
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 409 Conflict, 422 Unprocessable content, 429 Too many requests, as problem details (application/problem+json).
Change a saved view
PATCH/api/v1/client-list/views/{viewId}
- Scopes
clients:read
Its creator, or for a shared view a manager or above. Only its creator can change who sees it. Someone else’s private view is 404. Part of the hub product: the firm must have it and you must have access to it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
viewIdrequired | path | string (uuid) |
Request body
Required. application/json: object (UpdateClientListViewRequest).
| Field | Type | Description |
|---|---|---|
name | string | up to 80 characters |
visibility | string (ClientViewVisibility) | Only whoever made the view can change this. One of: |
columns | array of string | |
filter | object |
|
sort | object (ClientListSort)nullable | |
sort.fieldrequired | string | |
sort.dirrequired | string (ClientListSortDirection) | One of: |
Responses
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 404 Not found, 429 Too many requests, as problem details (application/problem+json).
Delete a saved view
DELETE/api/v1/client-list/views/{viewId}
- Scopes
clients:read
Its creator, or for a shared view a manager or above. Part of the hub product: the firm must have it and you must have access to it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
viewIdrequired | path | string (uuid) |
Responses
204 No content
Deleted.
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 404 Not found, 429 Too many requests, as problem details (application/problem+json).
Duplicate a saved view
POST/api/v1/client-list/views/{viewId}/duplicate
- Scopes
clients:read- Retries
- Send an
Idempotency-Keyto make retries safe.
The copy is yours, and private. Part of the hub product: the firm must have it and you must have access to it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
viewIdrequired | path | string (uuid) | |
Idempotency-Key | header | string | A unique key (1-255 visible characters) to make retries safe. Replayed for 24 hours. 1 to 255 characters |
Request body
Optional. application/json: object (DuplicateClientListViewRequest).
| Field | Type | Description |
|---|---|---|
name | string | up to 80 characters |
Responses
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 404 Not found, 409 Conflict, 422 Unprocessable content, 429 Too many requests, as problem details (application/problem+json).
Open the client list on this view
PUT/api/v1/client-list/views/{viewId}/default
- Scopes
clients:read
For you alone. Part of the hub product: the firm must have it and you must have access to it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
viewIdrequired | path | string (uuid) |
Responses
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 404 Not found, 429 Too many requests, as problem details (application/problem+json).
Stop opening the client list on a saved view
DELETE/api/v1/client-list/default-view
- Scopes
clients:read
Part of the hub product: the firm must have it and you must have access to it.
Responses
204 No content
Cleared.
Errors: 400 Bad request, 401 Unauthorised, 403 Forbidden, 429 Too many requests, as problem details (application/problem+json).