Documentation · API reference
PATCH
/api/v1/goals/{id}Change a goal
This page as Markdown, or in an AI chatMore ways to read this page
Rename, pause, or change the definition. A changed definition is a new version.
# Change a goal
> tidekeeper's API reference: https://tidekeeper.eu/docs/api/patch-goals-id
`PATCH /api/v1/goals/{id}`
Rename, pause, or change the definition. A changed definition is a new version.
## What to send
`GoalUpdate`: Change a goal. A new `spec` makes a new version; conversions already counted keep the version they were counted under.
- `name` (string or null)
- `note` (string or null): Why the definition changed, shown beside the version.
- `paused` (boolean or null)
- `spec` (object or null)
## The answer
200, `GoalView`
- `created_at` (string, needed)
- `id` (string, needed)
- `name` (string, needed)
- `paused` (boolean, needed)
- `site_id` (string, needed)
- `spec` (object, needed)
- `summary` (string, needed): `event install-copy`, `page /thanks*`.
- `version` (integer, needed): The version in force. Each conversion records the one it was counted under (EV-06).
## Asking
```sh
curl -X PATCH https://tidekeeper.eu/api/v1/goals/{id} \
-H "Authorization: Bearer $TIDEKEEPER_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'
```
What to send
GoalUpdate Change a goal. A new `spec` makes a new version; conversions already counted keep the version they were counted under.
- name
- string or null
- note
- string or nullWhy the definition changed, shown beside the version.
- paused
- boolean or null
- spec
- object or null
The answer
Status 200
GoalView
- created_at
- stringneeded
- id
- stringneeded
- name
- stringneeded
- paused
- booleanneeded
- site_id
- stringneeded
- spec
- objectneeded
- summary
- stringneeded`event install-copy`, `page /thanks*`.
- version
- integerneededThe version in force. Each conversion records the one it was counted under (EV-06).
Asking
curl -X PATCH https://tidekeeper.eu/api/v1/goals/{id} \ -H "Authorization: Bearer $TIDEKEEPER_TOKEN" \ -H "Content-Type: application/json" \ -d '{}'
const answer = await fetch("https://tidekeeper.eu/api/v1/goals/{id}", { method: "PATCH", headers: { Authorization: `Bearer ${process.env.TIDEKEEPER_TOKEN}`, "Content-Type": "application/json", }, body: JSON.stringify({}), }).then((r) => r.json());