Documentation · API reference
GET
/api/v1/goals/{id}/versionsEvery version of a goal's definition, oldest first
This page as Markdown, or in an AI chatMore ways to read this page
Every version of a goal's definition, oldest first.
# Every version of a goal's definition, oldest first
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/get-goals-id-versions
`GET /api/v1/goals/{id}/versions`
Every version of a goal's definition, oldest first.
## The answer
200, `A list of GoalVersionView`
- `by` (string or null)
- `created_at` (string, needed)
- `lines` (list of DefinitionLine, needed): The definition as labelled lines, the form a diff is shown in.
- `note` (string, needed)
- `spec` (object, needed)
- `version` (integer, needed)
## Asking
```sh
curl https://tidekeeper.eu/api/v1/goals/{id}/versions \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN"
```
The answer
Status 200
A list of GoalVersionView
- by
- string or null
- created_at
- stringneeded
- lines
- list of DefinitionLineneededThe definition as labelled lines, the form a diff is shown in.
- note
- stringneeded
- spec
- objectneeded
- version
- integerneeded
Asking
curl https://tidekeeper.eu/api/v1/goals/{id}/versions \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN"
const answer = await fetch("https://tidekeeper.eu/api/v1/goals/{id}/versions", { headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, }, }).then((r) => r.json());