Documentation · API reference
POST
/api/v1/sites/{site}/imports/checkWhat an import would do
This page as Markdown, or in an AI chatMore ways to read this page
What an import would do. The file is the request's body; nothing is written.
# What an import would do
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-sites-site-imports-check
`POST /api/v1/sites/{site}/imports/check`
What an import would do. The file is the request's body; nothing is written.
## Parameters
- `site` (in path, needed): The site's id or name
- `source` (in path, needed): `plausible`, `umami`, `goatcounter`, `matomo` or `tidekeeper`.
- `name` (in path, needed): The file's name, to show beside the import.
## The answer
200, `ImportPreview`: What an import would do, worked out without writing anything (IO-03).
- `bytes` (integer, needed)
- `counted_from` (string or null): The first day tidekeeper counted itself, if it has counted any.
- `days` (integer, needed)
- `file` (string, needed)
- `files` (integer, needed)
- `from` (string, needed): The first and last day in the file.
- `lines` (list of ImportLine, needed)
- `months` (list of ImportMonth, needed)
- `notes` (list of string, needed): What was found while reading: a day that appears twice, rows left out.
- `problems` (list of string, needed): Why it cannot be imported as it is. Empty when it can.
- `source` (string, needed)
- `source_label` (string, needed)
- `to` (string, needed)
- `views` (integer, needed)
- `visitors` (integer, needed)
- `will_days` (integer, needed)
- `will_from` (string or null): The stretch that would be imported: the file's days before tidekeeper's own begin, and before today. `null` when nothing is left.
- `will_to` (string or null)
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports/check \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN"
```
Parameters
- sitein the address
- neededThe site's id or name
- sourcein the address
- needed`plausible`, `umami`, `goatcounter`, `matomo` or `tidekeeper`.
- namein the address
- neededThe file's name, to show beside the import.
The answer
Status 200
ImportPreview What an import would do, worked out without writing anything (IO-03).
- bytes
- integerneeded
- counted_from
- string or nullThe first day tidekeeper counted itself, if it has counted any.
- days
- integerneeded
- file
- stringneeded
- files
- integerneeded
- from
- stringneededThe first and last day in the file.
- lines
- list of ImportLineneeded
- months
- list of ImportMonthneeded
- notes
- list of stringneededWhat was found while reading: a day that appears twice, rows left out.
- problems
- list of stringneededWhy it cannot be imported as it is. Empty when it can.
- source
- stringneeded
- source_label
- stringneeded
- to
- stringneeded
- views
- integerneeded
- visitors
- integerneeded
- will_days
- integerneeded
- will_from
- string or nullThe stretch that would be imported: the file's days before tidekeeper's own begin, and before today. `null` when nothing is left.
- will_to
- string or null
Asking
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports/check \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/imports/check", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());