Documentation · API reference
POST
/api/v1/sites/{site}/importsImport a file
This page as Markdown, or in an AI chatMore ways to read this page
Import a file. It is read again, exactly as the check read it.
# Import a file
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/post-sites-site-imports
`POST /api/v1/sites/{site}/imports`
Import a file. It is read again, exactly as the check read it.
## 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
201, `ImportView`
- `by` (string, needed)
- `days` (integer, needed)
- `dims` (list of string, needed): The dimensions it filled, by name.
- `file` (string, needed)
- `from` (string, needed)
- `id` (string, needed)
- `imported` (integer, needed)
- `notes` (list of string, needed)
- `removable` (boolean, needed): Whether it can still be taken out with one click.
- `removed` (integer or null)
- `source` (string, needed)
- `source_label` (string, needed)
- `to` (string, needed)
- `views` (integer, needed)
- `visitors` (integer, needed)
## Asking
```sh
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports \
-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 201
ImportView
- by
- stringneeded
- days
- integerneeded
- dims
- list of stringneededThe dimensions it filled, by name.
- file
- stringneeded
- from
- stringneeded
- id
- stringneeded
- imported
- integerneeded
- notes
- list of stringneeded
- removable
- booleanneededWhether it can still be taken out with one click.
- removed
- integer or null
- source
- stringneeded
- source_label
- stringneeded
- to
- stringneeded
- views
- integerneeded
- visitors
- integerneeded
Asking
curl -X POST https://tidekeeper.eu/api/v1/sites/example.org/imports \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
const answer = await fetch("https://tidekeeper.eu/api/v1/sites/example.org/imports", { method: "POST", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());